結果
| 問題 |
No.2768 Password Crack
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-01 00:03:55 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 107 ms / 2,000 ms |
| コード長 | 528 bytes |
| コンパイル時間 | 3,960 ms |
| コンパイル使用メモリ | 273,468 KB |
| 実行使用メモリ | 25,476 KB |
| 平均クエリ数 | 1785.17 |
| 最終ジャッジ日時 | 2024-12-21 01:53:16 |
| 合計ジャッジ時間 | 8,681 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 29 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
const int INF = 1e9;
int main() {
int N;
cin >> N;
string ans = string(N, 'a');
for (int i = 0; i < N; i++) {
int MAX = 0, MIN = INF;
char c = 'a';
for (int j = 0; j < 25; j++) {
ans[i] = 'a' + j;
cout << "? " << ans << endl;
int n;
cin >> n;
if (n > MAX) {
MAX = n;
c = ans[i];
}
MIN = min(MIN, n);
}
if (MIN == MAX) {
c = 'z';
}
ans[i] = c;
}
cout << "! " << ans << endl;
}