QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#749640#9741. CCPCZhangYGWA 0ms3700kbC++14308b2024-11-15 08:24:522024-11-15 08:24:53

Judging History

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

  • [2024-11-15 08:24:53]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3700kb
  • [2024-11-15 08:24:52]
  • 提交

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++;
	}
	c = c / 3;
//	cout << c << p;
	int ans = min(c,p);
	cout << ans;
	return 0;	
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

ABCDCPCPC

output:

1

result:

ok single line: '1'

Test #2:

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

input:

CAAACPBCDEFGCHIJCKLPM

output:

1

result:

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