結果

問題 No.2768 Password Crack
ユーザー ShirotsumeShirotsume
提出日時 2024-05-31 22:02:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 247 ms / 2,000 ms
コード長 844 bytes
コンパイル時間 201 ms
コンパイル使用メモリ 82,732 KB
実行使用メモリ 95,832 KB
平均クエリ数 1785.17
最終ジャッジ日時 2024-05-31 22:02:50
合計ジャッジ時間 7,689 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
82,360 KB
testcase_01 AC 82 ms
83,764 KB
testcase_02 AC 221 ms
95,604 KB
testcase_03 AC 221 ms
95,016 KB
testcase_04 AC 222 ms
95,688 KB
testcase_05 AC 99 ms
85,456 KB
testcase_06 AC 220 ms
95,436 KB
testcase_07 AC 214 ms
95,472 KB
testcase_08 AC 121 ms
88,608 KB
testcase_09 AC 247 ms
95,052 KB
testcase_10 AC 215 ms
95,320 KB
testcase_11 AC 216 ms
95,528 KB
testcase_12 AC 216 ms
95,176 KB
testcase_13 AC 219 ms
95,416 KB
testcase_14 AC 242 ms
95,192 KB
testcase_15 AC 223 ms
95,576 KB
testcase_16 AC 218 ms
95,284 KB
testcase_17 AC 216 ms
95,448 KB
testcase_18 AC 219 ms
95,600 KB
testcase_19 AC 168 ms
95,040 KB
testcase_20 AC 169 ms
95,412 KB
testcase_21 AC 218 ms
95,192 KB
testcase_22 AC 194 ms
95,552 KB
testcase_23 AC 108 ms
85,336 KB
testcase_24 AC 160 ms
91,352 KB
testcase_25 AC 215 ms
95,700 KB
testcase_26 AC 147 ms
91,352 KB
testcase_27 AC 196 ms
95,832 KB
testcase_28 AC 110 ms
86,104 KB
testcase_29 AC 123 ms
87,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, time, random
from collections import deque, Counter, defaultdict
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 61 - 1
mod = 998244353
import string

n = ii()

def ask(T):
    print("?", T)
    sys.stdout.flush()
    return ii()
def ans(T):
    print("!", T)
    sys.stdout.flush()
    exit()
X = []
for i in range(n):
    S = [0] * 25
    s = ['a'] * n
    for j in range(25):
        s[i] = string.ascii_lowercase[j]
        
        S[j] = ask(''.join(s))
    if min(S) == max(S):
        X.append('z')
    else:
        if S.count(min(S)) == 1:
            X.append(string.ascii_lowercase[S.index(min(S))])
        elif S.count(max(S)) == 1:
            X.append(string.ascii_lowercase[S.index(max(S))])

ans(''.join(X))
        
0