結果
| 問題 | No.2768 Password Crack |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-16 22:48:28 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 592 bytes |
| 記録 | |
| コンパイル時間 | 1,138 ms |
| コンパイル使用メモリ | 186,204 KB |
| 実行使用メモリ | 38,080 KB |
| 平均クエリ数 | 4.03 |
| 最終ジャッジ日時 | 2026-03-31 12:27:27 |
| 合計ジャッジ時間 | 5,715 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 3 TLE * 1 -- * 25 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
int main() {
int N;
cin >> N;
vector<int> a(26, 0);
vector<char> s;
rep(i, 26) {
string T = "";
rep(j, N)
T += 'a' + i;
cout << "? " << T << endl;
int n;
cin >> n;
rep(j, n)
s.push_back('a' + i);
}
do {
string S = "";
rep(i, N)
S += s[i];
cout << "? " << S << endl;
int n;
cin >> n;
if (n == N) {
cout << "! " << S << endl;
break;
}
} while (next_permutation(s.begin(), s.end()));
return 0;
}