結果

問題 No.701 ひとりしりとり
ユーザー 👑 KazunKazun
提出日時 2020-08-31 15:14:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 69 ms / 2,000 ms
コード長 378 bytes
コンパイル時間 120 ms
コンパイル使用メモリ 81,868 KB
実行使用メモリ 75,904 KB
最終ジャッジ日時 2024-04-27 19:10:43
合計ジャッジ時間 1,446 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
66,432 KB
testcase_01 AC 56 ms
66,176 KB
testcase_02 AC 54 ms
66,304 KB
testcase_03 AC 53 ms
66,176 KB
testcase_04 AC 53 ms
66,048 KB
testcase_05 AC 53 ms
66,176 KB
testcase_06 AC 54 ms
66,176 KB
testcase_07 AC 55 ms
66,688 KB
testcase_08 AC 53 ms
66,384 KB
testcase_09 AC 56 ms
66,688 KB
testcase_10 AC 61 ms
69,504 KB
testcase_11 AC 69 ms
75,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from string import ascii_lowercase
from itertools import product

R=ascii_lowercase
n=R.index("n")
Y=R[:n]+R[n+1:]+R[0]

N=int(input())

Z=list(product(R,repeat=3))

X=[""]*N
for i in range(N):
    q=i//25
    r=i%25

    if (i-1)//25!=q:
        W=""
        for b in Z[q]:
            W+=b

    X[i]=Y[r]+W+Y[r+1]

    if i==N-1:
        X[i]=X[i][:-1]+"n"
print("\n".join(X))
0