結果
問題 |
No.701 ひとりしりとり
|
ユーザー |
![]() |
提出日時 | 2018-06-15 22:39:01 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 429 bytes |
コンパイル時間 | 205 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 19,360 KB |
最終ジャッジ日時 | 2024-06-30 15:08:30 |
合計ジャッジ時間 | 5,392 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 TLE * 1 |
ソースコード
import random import string n = int(input()) a = [] def gen(x): while True: s = ''.join([ random.choice(string.ascii_lowercase) for _ in range(random.randint(1, 18)) ]) s = x + s if s[-1] != 'n' and s not in a: a.append(s) break return s x = 'a' for i in range(n - 1): s = gen(x) x = s[-1] print(s) s = gen(x) print(s + 'n')