結果
| 問題 |
No.2925 2-Letter Shiritori
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-14 12:49:50 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,199 bytes |
| コンパイル時間 | 3,513 ms |
| コンパイル使用メモリ | 121,568 KB |
| 実行使用メモリ | 25,452 KB |
| 平均クエリ数 | 26.00 |
| 最終ジャッジ日時 | 2024-10-14 12:49:57 |
| 合計ジャッジ時間 | 6,944 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 2 |
| other | RE * 10 |
ソースコード
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#ifdef local
#include <C++/core/io/debug_print.hpp>
#else
#define dump(...) void(0);
#endif
#include <iostream>
#include <ranges>
#include <cassert>
#include <unordered_set>
namespace man {
}
int main() {
std::cin.tie(nullptr) -> sync_with_stdio(false);
using namespace std::views;
char a;
std::cin >> a;
std::unordered_set<std::string> t;
while(true) {
std::string s;
bool filled = true;
s += std::to_string(a);
for(const auto c: iota('a', 'z' + 1)) {
s += std::to_string(c);
if(t.contains(s)) {
s.pop_back();
} else {
std::cout << '?' << s << std::endl;
filled = false;
}
}
if(filled) {
std::cout << "! LOSE" << std::endl;
}
char dummy;
std::cin >> dummy >> s;
assert(std::ssize(s) == 2);
if(t.contains(s)) {
break;
}
t.emplace(s);
a = s.back();
}
std::cout << "! WIN" << std::endl;
}