結果

問題 No.701 ひとりしりとり
ユーザー GrayCoder
提出日時 2018-06-15 23:51:17
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 412 bytes
コンパイル時間 247 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-06-30 15:37:51
合計ジャッジ時間 2,523 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product

def main():
    N = int(input())

    cnt = 0
    for i2, i3, i4, i1 in product(range(97, 123), repeat=4):
        s1, s2, s3, s4 = chr(i1), chr(i2), chr(i3), chr(i4)
        s5 = chr(i1 + 1) if i1 < 122 else 'a'
        s = s1 + s2 + s3 + s4 + s5
        if cnt < N - 1:
            print(s)
            cnt += 1
        else:
            print(s + 'n')
            break

main()
0