結果
| 問題 |
No.2768 Password Crack
|
| コンテスト | |
| ユーザー |
hitonanode
|
| 提出日時 | 2024-06-21 00:44:04 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 490 bytes |
| コンパイル時間 | 450 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 85,976 KB |
| 平均クエリ数 | 1.00 |
| 最終ジャッジ日時 | 2024-06-21 00:44:31 |
| 合計ジャッジ時間 | 26,483 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | RE * 29 |
ソースコード
import numpy as np
np.random.seed(1635715637795631)
def query(s: list[str]) -> int:
print('?', ''.join(s))
return int(input())
N = int(input())
ret = ['a'] * N
v = query(['a'] * N)
for idx in range(N):
qs = list(range(1, 26))
np.random.shuffle(qs)
for d in qs:
tmp = ['a'] * N
tmp[idx] = chr(ord('a') + d)
if query(tmp) > v:
ret[idx] = chr(ord('a') + d)
elif query(tmp) < v:
break
print('!', ''.join(ret))
hitonanode