結果
| 問題 | No.2768 Password Crack |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-31 22:24:26 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,208 bytes |
| 記録 | |
| コンパイル時間 | 6,328 ms |
| コンパイル使用メモリ | 335,808 KB |
| 実行使用メモリ | 40,276 KB |
| 平均クエリ数 | 177.47 |
| 最終ジャッジ日時 | 2024-12-21 00:01:58 |
| 合計ジャッジ時間 | 60,237 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 12 TLE * 17 |
ソースコード
#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,26){
string s="";
rep(j,n)s.push_back(char('a'+i));
cout<<"? "<<s<<endl;
int x;
cin>>x;
rep(j,x)ans.push_back(char('a'+i));
}
cout<<"? "<<ans<<endl;
int x;
cin>>x;
int now=x;
while(x!=n){
rep(i,n-1){
if(ok[i])continue;
for(int j=i+1;j<n;j++){
string t=ans;
swap(t[i],t[j]);
cout<<"? "<<t<<endl;
cin>>now;
if(x<now){
if(now-x==2){
ok[i]=1;
ok[j]=1;
}else{
ok[i]=1;
}
ans=t;
x=now;
}
if(x==n)break;
}
}
if(x==n)break;
}
cout<<"! "<<ans<<endl;
return 0;
}