結果
問題 |
No.2925 2-Letter Shiritori
|
ユーザー |
|
提出日時 | 2025-05-29 00:48:18 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,486 bytes |
コンパイル時間 | 1,325 ms |
コンパイル使用メモリ | 113,800 KB |
実行使用メモリ | 26,228 KB |
平均クエリ数 | 2.00 |
最終ジャッジ日時 | 2025-05-29 00:48:22 |
合計ジャッジ時間 | 3,297 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | WA * 10 |
ソースコード
#define _USE_MATH_DEFINES #include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> #include <string> #include<math.h> #include<iomanip> #include<stdio.h> #include <stdlib.h> #include<stdio.h> #include <queue> #include<map> #include <fstream> #include <sstream> #include<set> #include<stack> #include<time.h> #include <sys/types.h> #include <tuple> #include <numeric> #include <iterator> typedef long long int ll; //#include<bits/stdc++.h> using namespace std; ll gcd(ll a, ll b) { if (a < b)swap(a, b); if (b == 0)return a; return gcd(b, a % b); } int lcm(int a, int b) { return a * b / gcd(a, b); } int main() { int Q; Q = 1; //cin >> Q; while (Q--) { char c; cin >> c; cout << "? "<<c<<c<<endl; set<string>s; string cc; cc.push_back(c); cc.push_back(c); s.insert(cc); while (1) { char p; cin >> p; string x; cin >> x; if (p == '!') { return 0; } if (s.count(x)) { cout << "! LOSE" << endl; return 0; } s.insert(x); string t = "! "; t.push_back(x[1]); t.push_back(c); string tt; tt.push_back(x[1]); tt.push_back(c); s.insert(tt); cout << tt << endl; } } return 0; }