AtCoder Beginner Contest 013

Submission #7471557

Source codeソースコード

import sys

stdin = sys.stdin

ni = lambda: int(ns())
nl = lambda: list(map(int, stdin.readline().split()))
nm = lambda: map(int, stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n,m,d = nm()
a = nl()
pp = [i for i in range(n)]
f = [i for i in range(n)]
for x in a:
  pp[x-1],pp[x] = pp[x],pp[x-1]

p = [0]*n
for i in range(n):
  p[pp[i]] = i
  
def sigma(sw,se):
  ret = [se[sw[i]] for i in range(n)]
  return ret

for _ in range(d.bit_length()):
  if d&1:
    f = sigma(p,f)
  d >>= 1
  p = sigma(p,p)
for x in f:
  print(x+1)

Submission

Task問題 D - 阿弥陀
User nameユーザ名 しゃけ
Created time投稿日時
Language言語 Python3 (3.4.3)
Status状態 AC
Score得点 100
Source lengthソースコード長 577 Byte
File nameファイル名
Exec time実行時間 512 ms
Memory usageメモリ使用量 25664 KB

Test case

Set

Set name Score得点 / Max score Cases
Subtask1 10 / 10 sample_1.txt,01_i.txt,01_random01.txt,01_random02.txt,01_random03.txt,01_random04.txt,01_random05.txt,01_random06.txt,01_random07.txt
Subtask2 20 / 20 sample_1.txt,sample_2.txt,sample_3.txt,02_i.txt,02_p.txt,02_random01.txt,02_random02.txt,02_random03.txt,02_random04.txt,02_random05.txt,02_random06.txt,02_random07.txt,02_random08.txt,02_rp01.txt,02_rp02.txt,02_rp03.txt,02_rp04.txt,02_rp05.txt
Subtask3 20 / 20 sample_1.txt,sample_2.txt,03_i.txt,03_random01.txt,03_random02.txt,03_random03.txt,03_random04.txt,03_random05.txt,03_random06.txt,03_random07.txt,03_random08.txt,03_random09.txt,03_random10.txt,03_random11.txt,03_random12.txt,03_random13.txt,03_random14.txt,03_random15.txt
Subtask4 50 / 50 sample_1.txt,sample_2.txt,sample_3.txt,04_i.txt,04_p1.txt,04_p2.txt,04_random01.txt,04_random02.txt,04_random03.txt,04_random04.txt,04_random05.txt,04_random06.txt,04_random07.txt,04_random08.txt,04_random09.txt,04_random10.txt,04_random11.txt,04_random12.txt,04_random13.txt,04_rp01.txt,04_rp02.txt,04_rp03.txt,04_rp04.txt,04_rp05.txt,04_rp06.txt,04_rp07.txt,04_rp08.txt,04_rp09.txt,04_rp10.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
01_i.txt AC 247 ms 25664 KB
01_random01.txt AC 17 ms 3064 KB
01_random02.txt AC 17 ms 3064 KB
01_random03.txt AC 17 ms 3064 KB
01_random04.txt AC 26 ms 4468 KB
01_random05.txt AC 143 ms 17196 KB
01_random06.txt AC 219 ms 22288 KB
01_random07.txt AC 227 ms 25664 KB
02_i.txt AC 20 ms 3316 KB
02_p.txt AC 20 ms 3316 KB
02_random01.txt AC 17 ms 3064 KB
02_random02.txt AC 17 ms 3064 KB
02_random03.txt AC 21 ms 3572 KB
02_random04.txt AC 19 ms 3316 KB
02_random05.txt AC 29 ms 4980 KB
02_random06.txt AC 73 ms 12772 KB
02_random07.txt AC 118 ms 22764 KB
02_random08.txt AC 124 ms 23856 KB
02_rp01.txt AC 20 ms 3316 KB
02_rp02.txt AC 20 ms 3316 KB
02_rp03.txt AC 19 ms 3316 KB
02_rp04.txt AC 19 ms 3316 KB
02_rp05.txt AC 19 ms 3316 KB
03_i.txt AC 17 ms 3064 KB
03_random01.txt AC 24 ms 3444 KB
03_random02.txt AC 99 ms 6392 KB
03_random03.txt AC 85 ms 5892 KB
03_random04.txt AC 79 ms 5892 KB
03_random05.txt AC 29 ms 3720 KB
03_random06.txt AC 29 ms 3600 KB
03_random07.txt AC 36 ms 3820 KB
03_random08.txt AC 19 ms 3064 KB
03_random09.txt AC 40 ms 4100 KB
03_random10.txt AC 60 ms 4900 KB
03_random11.txt AC 90 ms 6304 KB
03_random12.txt AC 91 ms 6404 KB
03_random13.txt AC 82 ms 5692 KB
03_random14.txt AC 63 ms 5132 KB
03_random15.txt AC 36 ms 3816 KB
04_i.txt AC 512 ms 25044 KB
04_p1.txt AC 431 ms 20968 KB
04_p2.txt AC 359 ms 17728 KB
04_random01.txt AC 267 ms 15092 KB
04_random02.txt AC 228 ms 10744 KB
04_random03.txt AC 108 ms 13824 KB
04_random04.txt AC 144 ms 23512 KB
04_random05.txt AC 148 ms 19420 KB
04_random06.txt AC 288 ms 14964 KB
04_random07.txt AC 246 ms 23024 KB
04_random08.txt AC 208 ms 20964 KB
04_random09.txt AC 177 ms 24500 KB
04_random10.txt AC 296 ms 13832 KB
04_random11.txt AC 486 ms 25044 KB
04_random12.txt AC 483 ms 25048 KB
04_random13.txt AC 452 ms 25664 KB
04_rp01.txt AC 464 ms 20968 KB
04_rp02.txt AC 419 ms 20964 KB
04_rp03.txt AC 417 ms 20964 KB
04_rp04.txt AC 404 ms 20964 KB
04_rp05.txt AC 409 ms 21532 KB
04_rp06.txt AC 452 ms 21536 KB
04_rp07.txt AC 416 ms 21088 KB
04_rp08.txt AC 441 ms 21536 KB
04_rp09.txt AC 437 ms 20964 KB
04_rp10.txt AC 466 ms 20960 KB
sample_1.txt AC 17 ms 3064 KB
sample_2.txt AC 17 ms 3064 KB
sample_3.txt AC 17 ms 3064 KB