結果
問題 |
No.701 ひとりしりとり
|
ユーザー |
![]() |
提出日時 | 2018-10-29 21:47:05 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 551 bytes |
コンパイル時間 | 92 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 23,424 KB |
最終ジャッジ日時 | 2024-11-19 08:20:13 |
合計ジャッジ時間 | 5,493 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 TLE * 1 |
ソースコード
import random n = int(input()) used_words = [] for i in range(n): while True: if used_words: word = used_words[-1][-1] + ''.join([chr(97 + x) for x in random.choices(range(26), k=5)]) else: word = ''.join([chr(97 + x) for x in random.choices(range(26), k=5)]) if word[-1] == 'n' or word in used_words or ((i == n-1) and (len(word) == 20)): continue if i == n-1: word += 'n' used_words.append(word) break for i in used_words: print(i)