結果
問題 |
No.2768 Password Crack
|
ユーザー |
|
提出日時 | 2024-05-31 22:01:47 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 846 bytes |
コンパイル時間 | 365 ms |
コンパイル使用メモリ | 82,420 KB |
実行使用メモリ | 86,748 KB |
平均クエリ数 | 1.83 |
最終ジャッジ日時 | 2024-12-20 23:26:12 |
合計ジャッジ時間 | 9,086 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 1 |
other | AC * 1 RE * 28 |
ソースコード
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))