結果

問題 No.701 ひとりしりとり
ユーザー GrayCoderGrayCoder
提出日時 2018-06-15 23:51:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 412 bytes
コンパイル時間 201 ms
コンパイル使用メモリ 10,688 KB
実行使用メモリ 8,312 KB
最終ジャッジ日時 2023-09-13 05:28:11
合計ジャッジ時間 2,751 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,200 KB
testcase_01 AC 16 ms
8,112 KB
testcase_02 AC 16 ms
8,116 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

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