結果

問題 No.2768 Password Crack
ユーザー kaede2020kaede2020
提出日時 2024-05-31 23:32:14
言語 C++23(gcc13)
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 853 bytes
コンパイル時間 6,835 ms
コンパイル使用メモリ 337,068 KB
実行使用メモリ 25,604 KB
平均クエリ数 73.37
最終ジャッジ日時 2024-05-31 23:32:29
合計ジャッジ時間 13,027 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 28 ms
25,220 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
//using mint = modint998244353;
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};

int n;
int ok[111];
int main(){
    cin>>n;
    string ans="";
    rep(i,n)ans.push_back('a');
    cout<<"? "<<ans<<endl;
    int x;
    cin>>x;
    int now=x;
    rep(j,25){
        rep(i,n){    
            if(ok[i])continue;
            string t=ans;
            t[i]=(char)('a'+j);
            cout<<"? "<<t<<endl;
            int x;
            cin>>x;
            if(x-now==1){
                ok[i]=1;
                now=x;
                ans=t;
            }
        }
        if(now==x)break;
    }
    if(now!=x)rep(i,n)if(ok[i]==0)ans[i]='z';
    cout<<"! "<<ans<<endl;
    return 0;
}
0