結果
| 問題 |
No.701 ひとりしりとり
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-16 13:24:23 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 798 ms / 2,000 ms |
| コード長 | 419 bytes |
| コンパイル時間 | 97 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 21,124 KB |
| 最終ジャッジ日時 | 2024-06-22 03:09:18 |
| 合計ジャッジ時間 | 2,222 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 |
ソースコード
from collections import defaultdict
import random
n = int(input())
al = [chr(i) for i in range(97, 97+26)]
d = defaultdict(bool)
for i in range(n-1):
ok = False
while not ok:
ans = ""
for g in range(6):
rnd = random.randint(0, len(al)-1)
ans += al[rnd]
if not d[ans]:
print("a"+ ans +"a")
d[ans] = True
ok = True
print("an")