結果

問題 No.2925 2-Letter Shiritori
ユーザー achapi
提出日時 2024-10-12 15:23:21
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 388 bytes
コンパイル時間 2,155 ms
コンパイル使用メモリ 198,580 KB
最終ジャッジ日時 2025-02-24 18:02:24
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
	char c;
	cin >> c;
	set<string> st;
	while (true){
		for (int i = 0; i < 26; i++){
			string S;
			S += c;
			S += ('a' + i);
			if (st.count(S) == 0){
				cout << '?' << ' ' << S << endl;
				st.insert(S);
				break;
			}
		}
		cin >> c;
		if (c == '!'){
			return 0;
		}
		string T;
		cin >> T;
		st.insert(T);
		c = T[1];
	}
}
0