結果
| 問題 | No.380 悪の台本 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-31 02:38:08 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 71 ms / 1,000 ms |
| コード長 | 1,220 bytes |
| 記録 | |
| コンパイル時間 | 1,323 ms |
| コンパイル使用メモリ | 214,236 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-10 10:43:43 |
| 合計ジャッジ時間 | 2,252 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
int main(){
while(1){
string s; getline(cin,s);
if(cin.eof()) break;
int idx=s.find(' ');
if(idx==string::npos){
puts("WRONG!");
continue;
}
string name=s.substr(0,idx);
s=s.substr(idx+1);
for(char& c:s) c=tolower(c);
if(name=="digi"){
rep(i,3) if(!s.empty() && !isalnum(s.back())) s.pop_back();
int m=s.length();
puts(m>=3&&s.substr(m-3)=="nyo"?"CORRECT (maybe)":"WRONG!");
}
else if(name=="petit"){
rep(i,3) if(!s.empty() && !isalnum(s.back())) s.pop_back();
int m=s.length();
puts(m>=3&&s.substr(m-3)=="nyu"?"CORRECT (maybe)":"WRONG!");
}
else if(name=="rabi"){
while(!s.empty() && !isalnum(s.back())) s.pop_back();
puts(!s.empty()?"CORRECT (maybe)":"WRONG!");
}
else if(name=="gema"){
rep(i,3) if(!s.empty() && !isalnum(s.back())) s.pop_back();
int m=s.length();
puts(m>=4&&s.substr(m-4)=="gema"?"CORRECT (maybe)":"WRONG!");
}
else if(name=="piyo"){
rep(i,3) if(!s.empty() && !isalnum(s.back())) s.pop_back();
int m=s.length();
puts(m>=3&&s.substr(m-3)=="pyo"?"CORRECT (maybe)":"WRONG!");
}
else{
puts("WRONG!");
}
}
return 0;
}