結果
| 問題 |
No.2768 Password Crack
|
| コンテスト | |
| ユーザー |
hitonanode
|
| 提出日時 | 2024-06-21 00:44:39 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 480 bytes |
| コンパイル時間 | 251 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 61,556 KB |
| 平均クエリ数 | 1967.83 |
| 最終ジャッジ日時 | 2024-06-21 00:45:05 |
| 合計ジャッジ時間 | 24,309 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 11 RE * 18 |
ソースコード
import numpy as np
np.random.seed(998998)
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