結果

問題 No.2768 Password Crack
ユーザー hiro1729hiro1729
提出日時 2024-05-31 22:07:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 208 ms / 2,000 ms
コード長 455 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 94,460 KB
平均クエリ数 983.57
最終ジャッジ日時 2024-05-31 22:07:16
合計ジャッジ時間 6,358 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
70,600 KB
testcase_01 AC 61 ms
70,488 KB
testcase_02 AC 189 ms
93,464 KB
testcase_03 AC 179 ms
93,656 KB
testcase_04 AC 178 ms
93,400 KB
testcase_05 AC 81 ms
72,024 KB
testcase_06 AC 173 ms
93,656 KB
testcase_07 AC 205 ms
93,744 KB
testcase_08 AC 98 ms
79,320 KB
testcase_09 AC 174 ms
93,564 KB
testcase_10 AC 183 ms
94,024 KB
testcase_11 AC 208 ms
94,460 KB
testcase_12 AC 168 ms
94,156 KB
testcase_13 AC 171 ms
94,424 KB
testcase_14 AC 174 ms
94,040 KB
testcase_15 AC 176 ms
94,140 KB
testcase_16 AC 158 ms
93,720 KB
testcase_17 AC 180 ms
94,040 KB
testcase_18 AC 177 ms
94,040 KB
testcase_19 AC 118 ms
87,384 KB
testcase_20 AC 111 ms
83,672 KB
testcase_21 AC 181 ms
93,916 KB
testcase_22 AC 135 ms
91,736 KB
testcase_23 AC 72 ms
74,648 KB
testcase_24 AC 92 ms
80,216 KB
testcase_25 AC 155 ms
94,144 KB
testcase_26 AC 125 ms
83,944 KB
testcase_27 AC 154 ms
90,328 KB
testcase_28 AC 78 ms
73,040 KB
testcase_29 AC 85 ms
78,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from random import shuffle
N = int(input())
l = list("abcdefghijklmnopqrstuvwxyz")
S = ""
for i in range(N):
	shuffle(l)
	cnts = []
	c1 = set()
	for c in l:
		print('?', S + c + 'a' * (N - 1 - i))
		x = int(input())
		cnts.append((x, c))
		c1.add(x)
		if len(cnts) >= 3 and len(c1) == 2:
			cnts.sort()
			c = 0
			for i, _ in cnts:
				if i == cnts[0][0]:
					c += 1
			if c == 1:
				S += cnts[0][1]
			else:
				S += cnts[-1][1]
			break
print('!', S)
0