結果

問題 No.1764 Square
ユーザー DrDrpilot
提出日時 2022-01-21 18:07:05
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 693 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-11-25 17:54:16
合計ジャッジ時間 999 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
q0=deque()
q0.append('A')
q0.append('E')
q1=deque()
q1.append('B')
q2=deque()
q2.append('C')
q3=deque()
q3.append('D')
k=int(input())
for i in range(k):
    if i%4==0:
        out=q0.popleft()
        q1.append(out)
    elif i%4==1:
        out=q1.popleft()
        q2.append(out)
    elif i%4==2:
        out=q2.popleft()
        q3.append(out)
    else:
        out=q3.popleft()
        q0.append(out)
ans0=''
while q0:
    out=q0.popleft()
    ans0+=out
print(ans0)
ans1=''
while q1:
    out=q1.popleft()
    ans1+=out
print(ans1)
ans2=''
while q2:
    out=q2.popleft()
    ans2+=out
print(ans2)
ans3=''
while q3:
    out=q3.popleft()
    ans3+=out
print(ans3)
0