結果

問題 No.2925 2-Letter Shiritori
ユーザー Hydrogen332
提出日時 2024-10-29 00:09:56
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 456 bytes
コンパイル時間 2,337 ms
コンパイル使用メモリ 194,204 KB
最終ジャッジ日時 2025-02-25 01:13:05
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, s, e) for (int i = (int)s; i < (int)e; ++i)
#define all(a) (a).begin(), (a).end()

int main() {
    char a;
    cin >> a;
    
    char prev = a;
    
    while (true) {
        cout << "? " << prev << a << endl;
        
        string type, S;
        cin >> type >> S;
        
        if (type == "!") return 0;
        else {
            prev = S[1];
        }
    }
}
0