結果

問題 No.380 悪の台本
ユーザー vjudge1
提出日時 2025-04-18 16:21:49
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 4,206 bytes
コンパイル時間 2,104 ms
コンパイル使用メモリ 195,604 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-04-18 16:21:52
合計ジャッジ時間 2,573 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other AC * 1 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

/*
??????
??????
??????
??????
D P ????
??????
??????
??????
??????
??? l l?
??????
??????
?? OI ??
??????
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
//#define eps 1e-9
//#define ENF 1e13
const int N=5e6;
const int mod=1e9+7;
inline int read() {
	int x=0,f=1;
	char ch=getchar();
	while (ch<'0'||ch>'9') {
		if (ch=='-') f=-1;
		ch=getchar();
	}
	while (ch>='0'&&ch<='9') {
		x=(x<<3)+(x<<1)+ch-48;
		ch=getchar();
	}
	return x*f;
}
void write(int x) {
	if(x<0)putchar('-'),x=-x;
	if(x<10)putchar(x+'0');
	else write(x/10),putchar(x%10+'0');
}
char c;
char cc[N];
int top;
char ans1[40]= {' ','o','y','n','+'};
char ans2[40]= {' ','u','y','n','+'};
char ans4[50]= {' ','a','m','e','g','+'};
char ans5[40]= {' ','o','y','p','+'};
signed main() {
//	freopen("dialogue.in","r",stdin);
//	freopen("dialogue.out","w",stdout);
	while(scanf("%c",&c)!=EOF) {
		bool fl=0;
		if(c=='\n') {
			string s;
			if(top<=4||(cc[5]!=' '&&cc[6]!=' ')){
				cout<<"WRONG!\n";
				top=0;
				continue;
			}
			if(cc[5]==' ')s+=cc[1],s+=cc[2],s+=cc[3],s+=cc[4];
			if(cc[6]==' ')s+=cc[1],s+=cc[2],s+=cc[3],s+=cc[4],s+=cc[5];
			cout<<s<<"\n";
			if(s=="digi") {
				int ttop=1;
				int sum=0;
				bool fg=0;
				for(int j=top; j>=6; j--) {
					if(!((cc[j]>='a'&&cc[j]<='z')||(cc[j]>='A'&&cc[j]<='Z')||(cc[j]>='0'&&cc[j]<='9'))) {
					if(fg) {
							cout<<"WRONG!\n";
							break;
						} 
						else sum++;
					} else {
						if(cc[j]<='Z'&&cc[j]>='A')cc[j]+='a'-'A';
						fg=1;
						if(cc[j]!=ans1[ttop]) {
							cout<<"WRONG!\n";
							break;
						}
						ttop++;
						if(ttop==4){
							cout<<"CORRECT (maybe)\n";
							break;
						}
					}
					if(sum>3) {
						cout<<"WRONG!\n";
						break;
					}
				}
			} else if(s=="petit") {
				int ttop=1;
				int sum=0;
				bool fg=0;
				for(int j=top; j>=7; j--) {
					if(!((cc[j]>='a'&&cc[j]<='z')||(cc[j]>='A'&&cc[j]<='Z')||(cc[j]>='0'&&cc[j]<='9'))) {
						if(fg) {
							cout<<"WRONG!\n";
							break;
						} else sum++;
					} else {
						if(cc[j]<='Z'&&cc[j]>='A')cc[j]+='a'-'A';
						fg=1;
						if(cc[j]!=ans2[ttop]) {
							cout<<"WRONG!\n";
							break;
						}
						ttop++;
						if(ttop==4){
							cout<<"CORRECT (maybe)\n";
							break;
						}
					}
					if(sum>3) {
						cout<<"WRONG!\n";
						break;
					}
				}
			} else if(s=="rabi") {
				bool fg=0;
				for(int j=6; j<=top; j++)
				if((cc[j]>='a'&&cc[j]<='z')||(cc[j]>='A'&&cc[j]<='Z')||(cc[j]>='0'&&cc[j]<='9')) {
						fg=1;
						cout<<"CORRECT (maybe)\n";
						break;
					}
				if(!fg)cout<<"WRONG!\n";
			} else if(s=="gema") {
						int ttop=1;
				int sum=0;
				bool fg=0;
				for(int j=top; j>=6; j--) {
					if(!((cc[j]>='a'&&cc[j]<='z')||(cc[j]>='A'&&cc[j]<='Z')||(cc[j]>='0'&&cc[j]<='9'))) {
						if(fg) {
							cout<<"WRONG!\n";
							break;
						} else sum++;
					} else {
						if(cc[j]<='Z'&&cc[j]>='A')cc[j]+='a'-'A';
						fg=1;
						if(cc[j]!=ans4[ttop]) {
							cout<<"WRONG!\n";
							break;
						}
						ttop++;
						if(ttop==5){
							cout<<"CORRECT (maybe)\n";
							break;
						}
					}
					if(sum>3) {
						cout<<"WRONG!\n";
						break;
					}
				}
			} else if(s=="piyo") {
						int ttop=1;
				int sum=0;
				bool fg=0;
				for(int j=top; j>=6; j--) {
					if(!((cc[j]>='a'&&cc[j]<='z')||(cc[j]>='A'&&cc[j]<='Z')||(cc[j]>='0'&&cc[j]<='9'))) {
						if(fg) {
							cout<<"WRONG!\n";
							break;
						}
						else sum++;
					} else {
						if(cc[j]<='Z'&&cc[j]>='A')cc[j]+='a'-'A';
						fg=1;
						if(cc[j]!=ans5[ttop]) {
							cout<<"WRONG!\n";
							break;
						}
						ttop++;
							if(ttop==4){
							cout<<"CORRECT (maybe)\n";
							break;
						}
					}
					if(sum>3) {
						cout<<"WRONG!\n";
						break;
					}
				}
			} else cout<<"WRONG!\n";
			top=0;
			continue;
		}
		cc[++top]=char(c+(c>='A'&&c<='B'?'a'-'A':0));
		
	}
	return 0;

}
// ?????????????AC????
// ?????????????????????????
// ??????????????????
// ????????????????????????????????????
// ???????????????????????????????
// ????????????
// ????????????
// ????????????
// ????????????????????
// ????????????????????
// ????????????????????????????????
// ???????????????????????
// ???????????
// ?????????????
0