AtCoder Beginner Contest 013

Submission #7471579

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

del pp

def sigma(sw,se):
  return [se[sw[i]] for i in range(n)]

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ソースコード長 572 Byte
File nameファイル名
Exec time実行時間 495 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 231 ms 23536 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 141 ms 16428 KB
01_random06.txt AC 211 ms 20768 KB
01_random07.txt AC 236 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 20 ms 3572 KB
02_random04.txt AC 19 ms 3316 KB
02_random05.txt AC 29 ms 4980 KB
02_random06.txt AC 65 ms 12772 KB
02_random07.txt AC 118 ms 22636 KB
02_random08.txt AC 120 ms 22628 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 20 ms 3316 KB
03_i.txt AC 17 ms 3064 KB
03_random01.txt AC 24 ms 3444 KB
03_random02.txt AC 94 ms 6388 KB
03_random03.txt AC 97 ms 5888 KB
03_random04.txt AC 79 ms 5892 KB
03_random05.txt AC 30 ms 3768 KB
03_random06.txt AC 29 ms 3600 KB
03_random07.txt AC 35 ms 3816 KB
03_random08.txt AC 18 ms 3064 KB
03_random09.txt AC 41 ms 4104 KB
03_random10.txt AC 67 ms 4900 KB
03_random11.txt AC 96 ms 6284 KB
03_random12.txt AC 100 ms 6404 KB
03_random13.txt AC 85 ms 5692 KB
03_random14.txt AC 73 ms 5280 KB
03_random15.txt AC 36 ms 3820 KB
04_i.txt AC 482 ms 23536 KB
04_p1.txt AC 440 ms 19240 KB
04_p2.txt AC 360 ms 15936 KB
04_random01.txt AC 266 ms 13988 KB
04_random02.txt AC 235 ms 10100 KB
04_random03.txt AC 110 ms 13828 KB
04_random04.txt AC 147 ms 23512 KB
04_random05.txt AC 148 ms 19420 KB
04_random06.txt AC 296 ms 13556 KB
04_random07.txt AC 243 ms 24892 KB
04_random08.txt AC 208 ms 20964 KB
04_random09.txt AC 183 ms 23484 KB
04_random10.txt AC 281 ms 12736 KB
04_random11.txt AC 468 ms 23536 KB
04_random12.txt AC 495 ms 23536 KB
04_random13.txt AC 456 ms 23536 KB
04_rp01.txt AC 439 ms 18792 KB
04_rp02.txt AC 421 ms 18792 KB
04_rp03.txt AC 425 ms 18788 KB
04_rp04.txt AC 404 ms 18792 KB
04_rp05.txt AC 407 ms 19364 KB
04_rp06.txt AC 434 ms 19236 KB
04_rp07.txt AC 412 ms 19364 KB
04_rp08.txt AC 445 ms 19364 KB
04_rp09.txt AC 428 ms 19364 KB
04_rp10.txt AC 463 ms 18792 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