結果
| 問題 |
No.380 悪の台本
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-16 20:07:21 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 2,319 bytes |
| コンパイル時間 | 1,793 ms |
| コンパイル使用メモリ | 176,428 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-17 15:14:24 |
| 合計ジャッジ時間 | 2,400 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 1 WA * 5 RE * 2 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
string str;
while(getline(cin, str)){
stringstream ss(str);
vector<string> a;
while(ss >> str){
for(auto &&c : str) if(isupper(c)) c ^= 32;
a.emplace_back(str);
}
bool ans = false;
int siz = a.back().size();
if(a[0] == "digi"){
ans |= a.back().substr(max(0, siz - 3), 3) == "nyo";
if(!a.back().empty() && !isalpha(a.back().back())) a.back().pop_back(), siz--;
ans |= a.back().substr(max(0, siz - 3), 3) == "nyo";
if(!a.back().empty() && !isalpha(a.back().back())) a.back().pop_back(), siz--;
ans |= a.back().substr(max(0, siz - 3), 3) == "nyo";
}else if(a[0] == "petit"){
ans |= a.back().substr(max(0, siz - 3), 3) == "nyu";
if(!a.back().empty() && !isalpha(a.back().back())) a.back().pop_back(), siz--;
ans |= a.back().substr(max(0, siz - 3), 3) == "nyu";
if(!a.back().empty() && !isalpha(a.back().back())) a.back().pop_back(), siz--;
ans |= a.back().substr(max(0, siz - 3), 3) == "nyu";
}else if(a[0] == "rabi"){
for(int i = 1; i < a.size(); i++){
for(auto &&c : a[i]){
if(isalpha(c)) ans |= true;
}
}
}else if(a[0] == "gema"){
ans |= a.back().substr(max(0, siz - 4), 4) == "gema";
if(!a.back().empty() && !isalpha(a.back().back())) a.back().pop_back(), siz--;
ans |= a.back().substr(max(0, siz - 4), 4) == "gema";
if(!a.back().empty() && !isalpha(a.back().back())) a.back().pop_back(), siz--;
ans |= a.back().substr(max(0, siz - 4), 4) == "gema";
}else{
ans |= a.back().substr(max(0, siz - 3), 3) == "pyo";
if(!a.back().empty() && !isalpha(a.back().back())) a.back().pop_back(), siz--;
ans |= a.back().substr(max(0, siz - 3), 3) == "pyo";
if(!a.back().empty() && !isalpha(a.back().back())) a.back().pop_back(), siz--;
ans |= a.back().substr(max(0, siz - 3), 3) == "pyo";
}
cout << (ans ? "CORRECT (maybe)" : "WRONG!") << '\n';
}
}