結果
| 問題 | 
                            No.2768 Password Crack
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2024-05-31 22:02:42 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 250 ms / 2,000 ms | 
| コード長 | 844 bytes | 
| コンパイル時間 | 386 ms | 
| コンパイル使用メモリ | 82,404 KB | 
| 実行使用メモリ | 96,192 KB | 
| 平均クエリ数 | 1785.17 | 
| 最終ジャッジ日時 | 2024-12-20 23:29:11 | 
| 合計ジャッジ時間 | 8,944 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 29 | 
ソースコード
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))