結果
| 問題 | No.2925 2-Letter Shiritori | 
| コンテスト | |
| ユーザー |  Ayuna | 
| 提出日時 | 2024-10-19 15:46:18 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 100 ms / 2,000 ms | 
| コード長 | 576 bytes | 
| コンパイル時間 | 1,013 ms | 
| コンパイル使用メモリ | 81,712 KB | 
| 最終ジャッジ日時 | 2025-02-24 21:34:49 | 
| ジャッジサーバーID (参考情報) | judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 10 | 
ソースコード
#include <iostream>
#include <vector>
#include <set>
#include <string>
using namespace std;
using ll = long long;
int main(){
  string a;
  cin >> a;
  set<string> st;
  for (char c = 'a'; c <= 'z'; c++){
    st.insert(c + a);
  }
  cout << "? " << a << a << endl;
  st.erase(st.find(a + a));
  while (true){
    char j;
    string e;
    cin >> j >> e;
    if (e == "LOSE" || e == "WIN") return 0;
    if (st.find(e) != st.end())
      st.erase(st.find(e));
    string f = e;
    f[0] = e[1];
    f[1] = e[0];
    cout << "? " << f << endl;
    st.erase(st.find(f));
  }
}
            
            
            
        