QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#749647#9741. CCPCZhangYGWA 8ms4252kbC++14309b2024-11-15 08:39:292024-11-15 08:39:29

Judging History

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

  • [2024-11-15 08:39:29]
  • 评测
  • 测评结果:WA
  • 用时:8ms
  • 内存:4252kb
  • [2024-11-15 08:39:29]
  • 提交

answer

#include<bits/stdc++.h>

using namespace std;
string str;
int len,c,p;


int main()
{
	cin >> str;
	len = str.length();
	for(int i = 0 ; i < len ; i++)
	{
		if(str[i] == 'C') c++;
		if(str[i] == 'P') p++;
	}
	if(c / 2 == p && c % 2 == 1) cout << c/2;
	else cout << c / 2 - 1;
	return 0;	
} 

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

ABCDCPCPC

output:

1

result:

ok single line: '1'

Test #2:

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

input:

CAAACPBCDEFGCHIJCKLPM

output:

2

result:

ok single line: '2'

Test #3:

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

input:

CCPPPPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

0

result:

ok single line: '0'

Test #4:

score: -100
Wrong Answer
time: 8ms
memory: 4252kb

input:

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC...

output:

193516

result:

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