結果

問題 No.701 ひとりしりとり
ユーザー GrayCoderGrayCoder
提出日時 2018-06-16 20:24:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 433 bytes
コンパイル時間 73 ms
コンパイル使用メモリ 10,712 KB
実行使用メモリ 8,320 KB
最終ジャッジ日時 2023-09-13 06:15:31
合計ジャッジ時間 1,263 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,136 KB
testcase_01 AC 18 ms
8,160 KB
testcase_02 AC 16 ms
8,224 KB
testcase_03 AC 16 ms
8,148 KB
testcase_04 AC 16 ms
8,072 KB
testcase_05 AC 16 ms
8,216 KB
testcase_06 AC 16 ms
8,096 KB
testcase_07 AC 16 ms
8,068 KB
testcase_08 AC 16 ms
8,212 KB
testcase_09 AC 16 ms
8,308 KB
testcase_10 AC 21 ms
8,320 KB
testcase_11 AC 65 ms
8,172 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product
from sys import stdin, stdout
input = lambda: stdin.readline().rstrip()
println = stdout.write

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

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

main()
0