QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#211547#3491. Meow Factor 2nowhkWA 9ms4832kbC++141.7kb2023-10-12 18:11:422023-10-12 18:11:42

Judging History

你现在查看的是最新测评结果

  • [2023-10-12 18:11:42]
  • 评测
  • 测评结果:WA
  • 用时:9ms
  • 内存:4832kb
  • [2023-10-12 18:11:42]
  • 提交

answer

#include<bits/stdc++.h>
namespace ifzw{
#define ll long long 
#define dd double 
#define ull unsigned ll
#define LL __int128
#define siz(A) ((int)A.size())
using namespace std;
char gc(){static char buf[1<<16],*s,*t;if(s==t){t=(s=buf)+fread(buf,1,1<<16,stdin);if(s==t)return EOF;}return *s++;}
#define getchar gc
ll read()
{
	char c;
	ll w=1;
	while((c=getchar())>'9'||c<'0')if(c=='-')w=-1;
	ll ans=c-'0';
	while((c=getchar())>='0'&&c<='9')ans=(ans<<1)+(ans<<3)+c-'0';
	return ans*w;
}
void pc(char c,int op)
{
	static char buf[1<<16],*s=buf,*t=(buf+(1<<16));
	(op||((*s++=c)&&(s==t)))&&(fwrite(buf,1,s-buf,stdout),s=buf);
}
void wt(int x)
{
	if(x>9)wt(x/10);
	pc('0'+x%10,0);
}
void wts(int x,char op)
{
	if(x<0)pc('-',0),x=-x;
	wt(x),pc(op,0);
}
char ST;
const int xx=1e6+5;
int n;
char s[xx];
vector<string>v[4]=
{
{"noip"},
{"noi","oip","nop","nip","niop","no?ip","no?p","n?ip"},
{"no","oi","ip","n?i","np","n?p","n??p","op","o?p"},
{"n","o","i","p"}
};
char cg(char A)
{
	if(A=='?')return A;
	if(A=='n')return 'm';
	if(A=='o')return 'e';
	if(A=='i')return 'o';
	if(A=='p')return 'w';
	return 'a';
}
bool cp(char A,char B){return A==B||A=='?'||B=='?';}
char ED;
int main(){
	cerr<<abs(&ST-&ED)/1024.0/1024<<"\n";
//	freopen("noip.in","r",stdin);
//	freopen("noip.out","w",stdout);
	scanf("%s",s+1);
	n=strlen(s+1);
	for(int j=0;j<4;j++)
	{
		for(auto it:v[j])
		{
			int len=siz(it);
			for(int i=1;i<=n-len+1;i++)
			{
				int cr=1;
				for(int k=0;k<len;k++)
					if(!cp(cg(it[k]),s[i+k]))cr=0;
				if(cr)cout<<j<<"\n",exit(0);
			}
		}
	}
	cout<<4<<"\n";
	pc('1',1);
	return 0;
}


}signed main(){return ifzw::main();}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3896kb

input:

pastimeofwhimsy

output:

1

result:

ok single line: '1'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3828kb

input:

yarn

output:

4

result:

ok single line: '4'

Test #3:

score: 0
Accepted
time: 1ms
memory: 3820kb

input:

meow

output:

0

result:

ok single line: '0'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

z

output:

4

result:

ok single line: '4'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3900kb

input:

o

output:

3

result:

ok single line: '3'

Test #6:

score: 0
Accepted
time: 9ms
memory: 4832kb

input:

meomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeomeo...

output:

0

result:

ok single line: '0'

Test #7:

score: 0
Accepted
time: 0ms
memory: 3884kb

input:

wtmeowmomeomm

output:

0

result:

ok single line: '0'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

ofmfwemfemmfwfeow

output:

1

result:

ok single line: '1'

Test #9:

score: 0
Accepted
time: 0ms
memory: 3792kb

input:

eeememeemoweeezwwm

output:

1

result:

ok single line: '1'

Test #10:

score: 0
Accepted
time: 0ms
memory: 3892kb

input:

jwmoowwjwemeeejjew

output:

1

result:

ok single line: '1'

Test #11:

score: 0
Accepted
time: 0ms
memory: 3816kb

input:

eeoeoleelomewm

output:

1

result:

ok single line: '1'

Test #12:

score: 0
Accepted
time: 0ms
memory: 3908kb

input:

meqowoqqmw

output:

1

result:

ok single line: '1'

Test #13:

score: 0
Accepted
time: 0ms
memory: 3892kb

input:

wmooggememwggewwm

output:

1

result:

ok single line: '1'

Test #14:

score: 0
Accepted
time: 0ms
memory: 3904kb

input:

omemuuuemoewmuumom

output:

1

result:

ok single line: '1'

Test #15:

score: 0
Accepted
time: 0ms
memory: 3864kb

input:

ooecoeoeecwomeoome

output:

1

result:

ok single line: '1'

Test #16:

score: 0
Accepted
time: 0ms
memory: 4052kb

input:

oegemggowomgg

output:

2

result:

ok single line: '2'

Test #17:

score: 0
Accepted
time: 0ms
memory: 3860kb

input:

mmvevvomvvmmmmvvoewv

output:

2

result:

ok single line: '2'

Test #18:

score: 0
Accepted
time: 0ms
memory: 3824kb

input:

ececwceemcmccccc

output:

2

result:

ok single line: '2'

Test #19:

score: 0
Accepted
time: 0ms
memory: 4052kb

input:

eoiiiiemii

output:

2

result:

ok single line: '2'

Test #20:

score: 0
Accepted
time: 0ms
memory: 3832kb

input:

omlllollmwlo

output:

2

result:

ok single line: '2'

Test #21:

score: 0
Accepted
time: 0ms
memory: 3904kb

input:

eeemmmlmleeemlwlmll

output:

2

result:

ok single line: '2'

Test #22:

score: -100
Wrong Answer
time: 0ms
memory: 3908kb

input:

tetooomoettmteemt

output:

3

result:

wrong answer 1st lines differ - expected: '2', found: '3'