結果
問題 |
No.380 悪の台本
|
ユーザー |
![]() |
提出日時 | 2025-04-26 17:47:43 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,133 bytes |
コンパイル時間 | 2,344 ms |
コンパイル使用メモリ | 199,928 KB |
実行使用メモリ | 7,848 KB |
最終ジャッジ日時 | 2025-04-26 17:47:47 |
合計ジャッジ時間 | 3,415 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 2 WA * 6 |
ソースコード
#include <bits/stdc++.h> #include <cctype> #define int long long const int N = 1e5 + 5; const int Mod = 1e9 + 7; using namespace std; string S; void solve() { string name = ""; int i = 0; while (i < S.size() && S[i] != ' ') { name += S[i]; i++; } i++; if (i < S.size()) { S = S.substr(i, S.size()); } if (name == "rabi") { for (char i : S) { if (!isalnum(i)) { cout << "WRONG!" << endl; return; } } cout << "CORRECT (maybe)" << endl; return; } i = S.size() - 1; while (i >= 0 && !isalnum(S[i])) { if (S.size() - i > 3) { cout << "WRONG!" << endl; return; } i--; } S = S.substr(0, i + 1); if (name == "digi" || name == "petit" || name == "piyo") { if (S.size() < 3) { cout << "WRONG!" << endl; return; } string tmp; for (int i = S.size() - 3; i <= S.size() - 1; i++) { tmp += tolower(S[i]); } if (name == "digi" && tmp == "nyo") { cout << "CORRECT (maybe)" << endl; return; } if (name == "petit" && tmp == "nyu") { cout << "CORRECT (maybe)" << endl; return; } if (name == "piyo" && tmp == "pyo") { cout << "CORRECT (maybe)" << endl; return; } } if (name == "gema") { if (S.size() < 4) { cout << "WRONG!" << endl; return; } string tmp; for (int i = S.size() - 4; i <= S.size() - 1; i++) { tmp += tolower(S[i]); } if (tmp == "gema") { cout << "CORRECT (maybe)" << endl; return; } } cout << "WRONG!" << endl; } signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); while (getline(cin, S)) { solve(); } return 0; }