結果
| 問題 |
No.2768 Password Crack
|
| コンテスト | |
| ユーザー |
hitonanode
|
| 提出日時 | 2024-06-21 00:46:09 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 666 ms / 2,000 ms |
| コード長 | 506 bytes |
| コンパイル時間 | 154 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 61,640 KB |
| 平均クエリ数 | 812.03 |
| 最終ジャッジ日時 | 2024-06-21 00:46:32 |
| 合計ジャッジ時間 | 21,214 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 29 |
ソースコード
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
ff = 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)
q = query(tmp)
if q > ff:
ret[idx] = chr(ord('a') + d)
break
elif q < ff:
break
print('!', ''.join(ret))
hitonanode