結果

問題 No.2768 Password Crack
ユーザー srjywrdnprkt
提出日時 2024-02-29 18:41:57
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 680 bytes
コンパイル時間 2,009 ms
コンパイル使用メモリ 192,260 KB
最終ジャッジ日時 2025-02-19 22:00:30
ジャッジサーバーID
(参考情報)
judge2 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 14 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

void query(string &S){
    cout << "? " << S << endl;
}
void answer(string &T){
    cout << "! " << T << endl;
}

int main(){

    int N, M;
    cin >> N;
    string S=string(N, 'a');
    for (int i=0; i<N; i++){
        int mi=1e9, mx=0;
        char c='.';
        for (int j=0; j<25; j++){
            S[i] = char('a'+j);
            query(S);
            cin >> M;
            if (M > mx){
                mx = M;
                c = char('a'+j);
            }
            mi = min(mi, M);
        }
        if (mi == mx) c = 'z';
        S[i] = c;
    }
    
    query(S);

    answer(S);

    return 0;
}
0