結果

問題 No.2768 Password Crack
ユーザー kaede2020kaede2020
提出日時 2024-06-01 18:38:09
言語 C++23(gcc13)
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 70 ms / 2,000 ms
コード長 849 bytes
コンパイル時間 6,684 ms
コンパイル使用メモリ 335,332 KB
実行使用メモリ 25,220 KB
平均クエリ数 864.50
最終ジャッジ日時 2024-06-01 18:38:21
合計ジャッジ時間 9,371 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
25,196 KB
testcase_01 AC 22 ms
24,836 KB
testcase_02 AC 22 ms
25,184 KB
testcase_03 AC 25 ms
24,964 KB
testcase_04 AC 66 ms
24,836 KB
testcase_05 AC 30 ms
24,836 KB
testcase_06 AC 66 ms
25,208 KB
testcase_07 AC 31 ms
24,580 KB
testcase_08 AC 36 ms
24,580 KB
testcase_09 AC 65 ms
25,220 KB
testcase_10 AC 70 ms
24,836 KB
testcase_11 AC 65 ms
24,836 KB
testcase_12 AC 68 ms
25,208 KB
testcase_13 AC 70 ms
25,220 KB
testcase_14 AC 64 ms
24,836 KB
testcase_15 AC 59 ms
24,452 KB
testcase_16 AC 62 ms
25,220 KB
testcase_17 AC 63 ms
24,580 KB
testcase_18 AC 63 ms
24,580 KB
testcase_19 AC 45 ms
24,580 KB
testcase_20 AC 41 ms
24,836 KB
testcase_21 AC 62 ms
25,220 KB
testcase_22 AC 56 ms
25,220 KB
testcase_23 AC 31 ms
24,836 KB
testcase_24 AC 41 ms
25,220 KB
testcase_25 AC 62 ms
24,964 KB
testcase_26 AC 41 ms
24,836 KB
testcase_27 AC 56 ms
24,580 KB
testcase_28 AC 33 ms
24,808 KB
testcase_29 AC 35 ms
24,452 KB
権限があれば一括ダウンロードができます

ソースコード

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('z');
    cout<<"? "<<ans<<endl;
    int x;
    cin>>x;
    if(x==n){
        cout<<"! "<<ans<<endl;
        return 0;
    }
    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;
            }
        }
    }
    cout<<"! "<<ans<<endl;
    return 0;
}
0