結果
| 問題 |
No.2768 Password Crack
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-31 21:40:48 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 706 bytes |
| コンパイル時間 | 2,187 ms |
| コンパイル使用メモリ | 193,900 KB |
| 最終ジャッジ日時 | 2025-02-21 17:38:26 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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){
answer += 'a'; break;
}
if(now == S+1){
answer += c; break;
}
}
if(add == false) answer += 'z';
s.at(i) = 'a';
}
cout << "! " << answer << endl;
}