結果
問題 | No.2768 Password Crack |
ユーザー |
|
提出日時 | 2024-05-31 22:07:30 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 223 ms / 2,000 ms |
コード長 | 506 bytes |
コンパイル時間 | 443 ms |
コンパイル使用メモリ | 82,280 KB |
実行使用メモリ | 94,656 KB |
平均クエリ数 | 663.87 |
最終ジャッジ日時 | 2024-12-20 23:38:39 |
合計ジャッジ時間 | 6,494 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 29 |
ソースコード
from collections import defaultdictN=int(input())ans=["a"]*Nd=defaultdict(int)for i in range(26):t=chr(97+i)*Nprint("?",t,flush=1)n=int(input())d[chr(97+i)]=nfor i in range(N):x=0tmp=0flag=0for j in range(26):if d[chr(97+j)]==0:continueans[i]=chr(97+j)t="".join(ans)print("?",t,flush=1)n=int(input())if n>x:x=ntmp=jif flag:breakflag=1ans[i]=chr(97+tmp)d[chr(97+tmp)]-=1print("!","".join(ans))