結果

問題 No.380 悪の台本
ユーザー tntantntan
提出日時 2016-07-12 13:33:13
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,241 bytes
コンパイル時間 1,361 ms
コンパイル使用メモリ 160,860 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 14:42:18
合計ジャッジ時間 1,840 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
#define pb push_back
#define mp make_pair
#define fi first
#define se second

int main()
{
	string s,t;
	while(cin>>s)
	{
		getline(cin,t);
		if(!cin)break;
		if(t=="\n")break;
		int len=t.length();
		for(int i=0;i<t.length();i++)t[i]=tolower(t[i]);
		bool flag=false;
		if(s=="digi")
		{
			if(len<3)flag=false;
			else
			{
				for(int i=max(0,len-6);i<=len-3;i++)
				{
					if(t.substr(i,3)=="nyo")flag=true;
				}
			}
		}
		else if(s=="petit")
		{
			if(len<3)flag=false;
			else
			{
				for(int i=max(0,len-6);i<=len-3;i++)
				{
					if(t.substr(i,3)=="nyu")flag=true;
				}
			}
		}
		else if(s=="rabi")
		{
			for(int i=0;i<len-1;i++)
			{
				if(isalpha(t[i])||isdigit(t[i]))flag=true;
			}
		}
		else if(s=="gema")
		{
			if(len<4)flag=false;
			else
			{
				for(int i=max(0,len-7);i<=len-4;i++)
				{
					if(t.substr(i,3)=="gema")flag=true;
				}
			}
		}
		else if(s=="piyo")
		{
			if(len<3)flag=false;
			else
			{
				for(int i=max(0,len-6);i<=len-3;i++)
				{
					if(t.substr(i,3)=="pyo")flag=true;
				}
			}
		}
		if(flag)cout<<"CORRECT(maybe)"<<endl;
		else cout<<"WRONG!"<<endl;
	}
	return 0;
}
0