結果
| 問題 |
No.701 ひとりしりとり
|
| コンテスト | |
| ユーザー |
sekihankamibanz
|
| 提出日時 | 2018-10-29 21:45:05 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 609 bytes |
| コンパイル時間 | 153 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 19,108 KB |
| 最終ジャッジ日時 | 2024-11-19 08:16:22 |
| 合計ジャッジ時間 | 5,614 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 RE * 1 TLE * 1 |
ソースコード
import random
n = int(input())
used_words = []
for i in range(n):
while True:
word_length = random.choice(range(20))
if used_words:
word = used_words[-1][-1] + ''.join([chr(97 + x) for x in random.choices(range(26), k=word_length)])
else:
word = ''.join([chr(97 + x) for x in random.choices(range(26), k=word_length)])
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)
sekihankamibanz