QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#757565#9741. CCPCJumping#WA 2ms4512kbC++14422b2024-11-17 10:40:002024-11-17 10:40:01

Judging History

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

  • [2024-11-17 10:40:01]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:4512kb
  • [2024-11-17 10:40:00]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
char s[N];
int cnt1,cnt2,n;
signed main()
{
	scanf("%s",s + 1);
	n = strlen(s + 1);
	for(int i = 1;i <= n;i++)
	{
		if(s[i] == 'C') cnt1++;
		else if(s[i] == 'P') cnt2++;
	}
	if(cnt1 <= 3 || cnt2 <= 1)
	{
		puts("0");
		return 0;
	}
	cnt1 -= 3;
	cnt2--;
	int x = 1 + min(cnt1 / 2,cnt2);
	printf("%d",x); 
	return 0;
}
//ABCDCPCPC

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

ABCDCPCPC

output:

1

result:

ok single line: '1'

Test #2:

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

input:

CAAACPBCDEFGCHIJCKLPM

output:

2

result:

ok single line: '2'

Test #3:

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

input:

CCPPPPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

0

result:

ok single line: '0'

Test #4:

score: 0
Accepted
time: 2ms
memory: 4512kb

input:

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC...

output:

193517

result:

ok single line: '193517'

Test #5:

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

input:

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC...

output:

82881

result:

ok single line: '82881'

Test #6:

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

input:

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC...

output:

60591

result:

ok single line: '60591'

Test #7:

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

input:

C

output:

0

result:

ok single line: '0'

Test #8:

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

input:

P

output:

0

result:

ok single line: '0'

Extra Test:

score: -3
Extra Test Failed : Wrong Answer on 2
time: 0ms
memory: 3784kb

input:

CCPC

output:

0

result:

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