結果
問題 | No.701 ひとりしりとり |
ユーザー | はむ吉🐹 |
提出日時 | 2018-06-15 22:38:06 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 180 ms / 2,000 ms |
コード長 | 500 bytes |
コンパイル時間 | 257 ms |
コンパイル使用メモリ | 87,024 KB |
実行使用メモリ | 82,724 KB |
最終ジャッジ日時 | 2023-09-13 04:55:50 |
合計ジャッジ時間 | 3,102 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 143 ms
80,056 KB |
testcase_01 | AC | 145 ms
80,064 KB |
testcase_02 | AC | 143 ms
80,452 KB |
testcase_03 | AC | 144 ms
80,380 KB |
testcase_04 | AC | 146 ms
80,288 KB |
testcase_05 | AC | 141 ms
80,144 KB |
testcase_06 | AC | 141 ms
80,360 KB |
testcase_07 | AC | 142 ms
80,188 KB |
testcase_08 | AC | 142 ms
80,344 KB |
testcase_09 | AC | 149 ms
81,268 KB |
testcase_10 | AC | 157 ms
81,916 KB |
testcase_11 | AC | 180 ms
82,724 KB |
ソースコード
#!/usr/bin/env pypy3 import itertools import string def generate_words(edge_char="a"): for mid_len in range(19): for chars in itertools.product(string.ascii_lowercase, repeat=mid_len): yield edge_char + "".join(chars) + edge_char def main(): n = int(input()) for i, word in enumerate(generate_words(), start=1): if i < n: print(word) else: print(word[:-1] + "n") return if __name__ == '__main__': main()