結果
| 問題 |
No.380 悪の台本
|
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2025-04-20 21:39:57 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,493 bytes |
| コンパイル時間 | 1,735 ms |
| コンパイル使用メモリ | 166,608 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-04-20 21:40:00 |
| 合計ジャッジ時間 | 2,663 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 4 WA * 4 |
ソースコード
#include <bits/stdc++.h>
#define int long long
//#define USE_FREOPEN
//#define MUL_TEST
#define FILENAME "dialogue"
using namespace std;
void solve() {
string s;
while (getline(cin,s)) {
int n = s.length();
s = ' ' + s;
string name = "";
for (int i = 1; s[i] != ' '; i++) name += s[i];
if (name == "rabi") {
bool flag = 0;
for (int i = 6; i <= n; i++)
if (isdigit(s[i]) || isalpha(s[i])) {
flag = 1;
break;
}
cout << (flag ? "CORRECT (maybe)\n" : "WRONG!\n");
} else {
int pos = n,cnt = 0;
while (!isdigit(s[pos]) && !isalpha(s[pos]) && cnt <= 3) {
cnt++;
pos--;
}
if (cnt > 3) {
cout << "WRONG!\n";
continue;
}
string ed = "";
for (int i = pos; i >= pos - 2; i--)
ed = (char)tolower(s[i]) + ed;
if (name == "digi") {
cout << (ed == "nyo" ? "CORRECT (maybe)\n" : "WRONG!\n");
} else if (name == "petit") {
cout << (ed == "nyu" ? "CORRECT (maybe)\n" : "WRONG!\n");
} else if (name == "piyo") {
cout << (ed == "pyo" ? "CORRECT (maybe)\n" : "WRONG!\n");
} else if (name == "gema") {
ed = (char)tolower(s[pos - 3]) + ed;
cout << (ed == "gema" ? "CORRECT (maybe)\n" : "WRONG!\n");
}
}
}
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
#ifdef USE_FREOPEN
freopen(FILENAME ".in","r",stdin);
freopen(FILENAME ".out","w",stdout);
#endif
int _ = 1;
#ifdef MUL_TEST
cin >> _;
#endif
while (_--)
solve();
_^=_;
return 0^_^0;
}
vjudge1