QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#751534#9741. CCPCxdz_#AC ✓2ms4300kbC++20511b2024-11-15 19:16:522024-11-15 19:16:57

Judging History

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

  • [2024-11-15 19:16:57]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:4300kb
  • [2024-11-15 19:16:52]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

#define int long long
#define fi first
#define se second
#define endl '\n'

typedef pair<int,int> PII;

void solve(){
	string s;
	cin >>s;
	map<char,int> mp;
	for(int i = 0;i < s.size();i ++){
		mp[s[i]] ++;
	}
	if(mp['C'] >= 3){
		int x = (mp['C'] - 3) / 2 + 1;
		cout<<min(x,mp['P']);
	}
	else cout<<"0"<<'\n';
}

signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int T;
	T = 1;
	while(T --){
		solve();
	}
}

这程序好像有点Bug,我给组数据试试?

詳細信息

Test #1:

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

input:

ABCDCPCPC

output:

1

result:

ok single line: '1'

Test #2:

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

input:

CAAACPBCDEFGCHIJCKLPM

output:

2

result:

ok single line: '2'

Test #3:

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

input:

CCPPPPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

0

result:

ok single line: '0'

Test #4:

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

input:

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC...

output:

193517

result:

ok single line: '193517'

Test #5:

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

input:

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC...

output:

82881

result:

ok single line: '82881'

Test #6:

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

input:

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC...

output:

60591

result:

ok single line: '60591'

Test #7:

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

input:

C

output:

0

result:

ok single line: '0'

Test #8:

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

input:

P

output:

0

result:

ok single line: '0'

Extra Test:

score: 0
Extra Test Passed