結果
| 問題 | No.2768 Password Crack |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-31 21:41:04 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 762 bytes |
| 記録 | |
| コンパイル時間 | 1,345 ms |
| コンパイル使用メモリ | 211,860 KB |
| 実行使用メモリ | 30,020 KB |
| 平均クエリ数 | 1676.67 |
| 最終ジャッジ日時 | 2026-07-04 19:43:06 |
| 合計ジャッジ時間 | 7,425 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 13 RE * 16 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int N; cin >> N;
string s('a',N);
int S;
cout << "? " << s << endl;
cin >> S;
string answer = "";
for(int i=0; i<N; i++){
bool add = false;
for(char c='b'; c<='y'; c++){
s.at(i) = c;
cout << "? " << s << endl;
int now; cin >> now;
if(S == now+1){
add = true;
answer += 'a'; break;
}
if(now == S+1){
add = true;
answer += c; break;
}
}
if(add == false) answer += 'z';
s.at(i) = 'a';
}
cout << "! " << answer << endl;
}