結果

問題 No.2768 Password Crack
ユーザー もぐらもぐら
提出日時 2024-05-31 23:16:20
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,106 bytes
コンパイル時間 3,741 ms
コンパイル使用メモリ 229,920 KB
実行使用メモリ 25,220 KB
平均クエリ数 962.60
最終ジャッジ日時 2024-05-31 23:16:28
合計ジャッジ時間 7,246 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
24,812 KB
testcase_01 AC 22 ms
24,580 KB
testcase_02 WA -
testcase_03 AC 28 ms
24,836 KB
testcase_04 AC 61 ms
25,220 KB
testcase_05 AC 27 ms
24,580 KB
testcase_06 AC 61 ms
25,220 KB
testcase_07 AC 30 ms
24,836 KB
testcase_08 AC 32 ms
25,220 KB
testcase_09 AC 58 ms
24,964 KB
testcase_10 AC 71 ms
24,836 KB
testcase_11 AC 70 ms
24,836 KB
testcase_12 AC 70 ms
24,964 KB
testcase_13 AC 72 ms
24,580 KB
testcase_14 AC 67 ms
24,836 KB
testcase_15 AC 56 ms
24,836 KB
testcase_16 AC 56 ms
24,836 KB
testcase_17 AC 59 ms
25,076 KB
testcase_18 AC 60 ms
24,964 KB
testcase_19 AC 42 ms
24,580 KB
testcase_20 AC 41 ms
25,220 KB
testcase_21 AC 64 ms
24,964 KB
testcase_22 AC 54 ms
24,580 KB
testcase_23 AC 30 ms
25,220 KB
testcase_24 AC 42 ms
24,964 KB
testcase_25 AC 61 ms
24,964 KB
testcase_26 AC 40 ms
24,580 KB
testcase_27 AC 52 ms
24,964 KB
testcase_28 AC 34 ms
24,580 KB
testcase_29 AC 34 ms
24,964 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:38:39: warning: 'f' may be used uninitialized [-Wmaybe-uninitialized]
   38 |                         else if(res==f-1){
      |                                      ~^~
main.cpp:27:12: note: 'f' was declared here
   27 |         ll f;
      |            ^

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
#define rep(i,n) for(int i = 0; i <n; i++)
#define all(a) a.begin(),a.end()
#define SORT(a) sort(all(a));
#define MIN(a) *min_element(all(a))
#define MAX(a) *max_element(all(a))
#define SUM(a) accumulate(all(a),0LL)
using ll=long long;
using ld=long double;
using ull=unsigned long;
ll MOD=998244353;
const int dx[]={0,1,0,-1,1,-1,1,-1};const int dy[]={1,0,-1,0,1,1,-1,-1};
const string ALPHA="ABCDEFGHIJKLMNOPQRSTUVWXYZ";const string alpha="abcdefghijklmnopqrstuvwxyz";
using Graph = vector<vector<int>>;
int main(){
  cin.tie(nullptr);
  cout.tie(nullptr);
  ios::sync_with_stdio(false);
  ll N;cin>>N;
  ll cnt=0;
  string ans="";
  rep(i,N){ans+='a';}
  while(cnt!=N){
  	ll now=0;
  	ll f;
  	while(now<=25){
  		ans[cnt]=alpha[now];
  		cout<<'?'<<" "<<ans<<endl;
  		ll res;cin>>res;
  		if(now==0){f=res;now++;continue;}
  		else if(now==25){break;}
  		else{
  			if(res==f+1){
  				break;
  			}
  			else if(res==f-1){
  				ans[cnt]='a';
  				break;
  			}
  		}
  		now++;
  	}
  	cnt++;
  }
  cout<<'!'<<" "<<ans<<endl;
}
0