結果
| 問題 | 
                            No.2768 Password Crack
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2024-06-01 12:49:29 | 
| 言語 | C++23  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 786 bytes | 
| コンパイル時間 | 3,854 ms | 
| コンパイル使用メモリ | 265,708 KB | 
| 実行使用メモリ | 25,836 KB | 
| 平均クエリ数 | 726.70 | 
| 最終ジャッジ日時 | 2024-12-21 19:48:04 | 
| 合計ジャッジ時間 | 10,516 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | WA * 1 | 
| other | WA * 29 | 
ソースコード
#pragma GCC optimize "O3,omit-frame-pointer,inline"
#pragma GCC push_options
#pragma GCC optimize ("unroll-loops")
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main () {
  std::ios::sync_with_stdio(false); std::cin.tie(0);
  int n;
  cin >> n;
  string ans;
  for (int u = 0; u < n; u++) {
    bool found = false;
    for (char c = 'a'; c < 'z'; c++) {
      string t;
      for (int v = 0; v < n; v++) {
        if (v == u) {
          t += c;
        } else {
          t += c + 1;
        }
      }
      cout << "? " << t << endl;
      int res;
      cin >> res;
      if (res == 1) {
        ans += c;
        found = true;
        break;
      }
    }
    if (!found) {
      ans += 'z';
    }
  }
  cout << ans << endl;
  return 0;  
}