結果

問題 No.1764 Square
ユーザー playerplayer
提出日時 2024-01-05 01:35:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 583 bytes
コンパイル時間 398 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 55,608 KB
最終ジャッジ日時 2024-01-05 01:35:03
合計ジャッジ時間 2,244 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
53,460 KB
testcase_01 AC 40 ms
53,460 KB
testcase_02 AC 40 ms
55,608 KB
testcase_03 AC 39 ms
55,608 KB
testcase_04 AC 39 ms
55,608 KB
testcase_05 AC 39 ms
55,608 KB
testcase_06 AC 40 ms
55,608 KB
testcase_07 AC 40 ms
55,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
k = int(input())

q0,q1,q2,q3 = deque(),deque(),deque(),deque()

q0.append("A")
q0.append("E")
q1.append("B")
q2.append("C")
q3.append("D")

for i in range(k):
    if i%4 == 0:
        now = q0.popleft()
        q1.append(now)
    elif i%4 == 1:
        now = q1.popleft()
        q2.append(now)
    elif i%4 == 2:
        now = q2.popleft()
        q3.append(now)
    else:
        now = q3.popleft()
        q0.append(now)
        
ans1 = "".join(q0)
ans2 = "".join(q1)
ans3 = "".join(q2)
ans4 = "".join(q3)
print(ans1)
print(ans2)
print(ans3)
print(ans4)
0