結果

問題 No.2768 Password Crack
ユーザー miho-4miho-4
提出日時 2024-05-31 22:07:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 179 ms / 2,000 ms
コード長 506 bytes
コンパイル時間 337 ms
コンパイル使用メモリ 82,380 KB
実行使用メモリ 94,192 KB
平均クエリ数 663.87
最終ジャッジ日時 2024-05-31 22:07:42
合計ジャッジ時間 5,906 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,264 KB
testcase_01 AC 69 ms
70,548 KB
testcase_02 AC 81 ms
80,164 KB
testcase_03 AC 83 ms
83,820 KB
testcase_04 AC 152 ms
90,164 KB
testcase_05 AC 70 ms
72,168 KB
testcase_06 AC 86 ms
78,860 KB
testcase_07 AC 89 ms
79,340 KB
testcase_08 AC 83 ms
72,328 KB
testcase_09 AC 169 ms
93,636 KB
testcase_10 AC 154 ms
90,500 KB
testcase_11 AC 167 ms
93,156 KB
testcase_12 AC 154 ms
89,752 KB
testcase_13 AC 179 ms
94,164 KB
testcase_14 AC 151 ms
90,360 KB
testcase_15 AC 155 ms
90,296 KB
testcase_16 AC 164 ms
93,828 KB
testcase_17 AC 169 ms
93,832 KB
testcase_18 AC 153 ms
90,800 KB
testcase_19 AC 101 ms
79,484 KB
testcase_20 AC 93 ms
80,208 KB
testcase_21 AC 138 ms
89,372 KB
testcase_22 AC 144 ms
94,192 KB
testcase_23 AC 74 ms
71,360 KB
testcase_24 AC 90 ms
78,964 KB
testcase_25 AC 160 ms
93,376 KB
testcase_26 AC 97 ms
79,988 KB
testcase_27 AC 133 ms
87,824 KB
testcase_28 AC 71 ms
72,188 KB
testcase_29 AC 77 ms
71,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

N=int(input())
ans=["a"]*N
d=defaultdict(int)

for i in range(26):
  t=chr(97+i)*N
  print("?",t,flush=1)
  n=int(input())
  d[chr(97+i)]=n

for i in range(N):
  x=0
  tmp=0
  flag=0
  for j in range(26):
    if d[chr(97+j)]==0:
      continue
    ans[i]=chr(97+j)
    t="".join(ans)
    print("?",t,flush=1)
    n=int(input())
    if n>x:
      x=n
      tmp=j
      if flag:
        break
      flag=1
  ans[i]=chr(97+tmp)
  d[chr(97+tmp)]-=1

print("!","".join(ans))
0