結果

問題 No.701 ひとりしりとり
ユーザー GrayCoderGrayCoder
提出日時 2018-06-15 23:57:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 112 ms / 2,000 ms
コード長 373 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 10,704 KB
実行使用メモリ 8,376 KB
最終ジャッジ日時 2023-09-13 05:29:38
合計ジャッジ時間 1,339 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,096 KB
testcase_01 AC 16 ms
8,104 KB
testcase_02 AC 16 ms
8,124 KB
testcase_03 AC 17 ms
8,176 KB
testcase_04 AC 16 ms
8,288 KB
testcase_05 AC 15 ms
8,128 KB
testcase_06 AC 16 ms
8,244 KB
testcase_07 AC 16 ms
8,092 KB
testcase_08 AC 15 ms
8,260 KB
testcase_09 AC 17 ms
8,360 KB
testcase_10 AC 26 ms
8,284 KB
testcase_11 AC 112 ms
8,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product

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

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

main()
0