結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,228 KB
testcase_01 AC 15 ms
8,272 KB
testcase_02 AC 17 ms
8,312 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, i1 in product(range(97, 123), repeat=3):
        s1 = chr(i1)
        s2 = chr(i2)
        s3 = chr(i3)
        s4 = chr(i1 + 1) if i1 < 122 else 'a'
        s = s1 + s2 + s3 + s4
        if cnt < N - 1:
            print(s)
            cnt += 1
        else:
            print(s + 'n')
            break

main()
0