結果
| 問題 |
No.2925 2-Letter Shiritori
|
| コンテスト | |
| ユーザー |
yel_ow
|
| 提出日時 | 2024-11-24 05:03:57 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,164 bytes |
| コンパイル時間 | 2,895 ms |
| コンパイル使用メモリ | 259,788 KB |
| 実行使用メモリ | 43,792 KB |
| 最終ジャッジ日時 | 2024-11-24 05:04:40 |
| 合計ジャッジ時間 | 42,734 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | TLE * 2 |
| other | TLE * 10 |
ソースコード
//#include <monsterenergy>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int MAX = 1e9;
const int MIN = -1*1e9;
const ll MAXLL = 1e18;
const ll MINLL = -1*1e18;
int main()
{
char C; cin >> C;
set<pair<char,char>> Ans;
vector<pair<int,char>> Count(200);
for(int i = 0; i < 200; i++) Count[i] = {MAX,'?'};
for(char i = 'a'; i <= 'z'; i++) Count[i] = {26,i};
cout << "?" << " " << C << C << endl;
Ans.insert({C,C});
Count[C].first--;
while(true)
{
string S,S2; cin >> S2 >> S;
if(S2 == "!") return 0;
Ans.insert({S[0],S[1]});
Count[S[0]].first--;
sort(all(Count));
bool f = false;
for(int i = 0; i < 100; i++)
{
char A = S[1];
char B = Count[i].second;
if(Ans.count({A,B}))
{
cout << "?" << " " << A << B << endl;
}
else continue;
f = true;
Count[A].first--;
Ans.insert({A,B});
break;
}
}
return 0;
}
yel_ow