QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#763294 | #9741. CCPC | tianxiawoyou# | WA | 1ms | 4148kb | C++14 | 389b | 2024-11-19 19:26:28 | 2024-11-19 19:26:29 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
string s;
int h[30];
signed main(){
// freopen("1.in","r",stdin);
cin.tie(0),cout.tie(0),ios::sync_with_stdio(0);
cin>>s;
int n=s.length();
for(int i=0;i<n;++i)h[s[i]-'A']++;
int a=h['P'-'A'],b=h['C'-'A'],c;
if(b<3)c=0;
else if(b%3==2)c=b/3+1;
else c=b/3;
cout<<min(a,c);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3596kb
input:
ABCDCPCPC
output:
1
result:
ok single line: '1'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
CAAACPBCDEFGCHIJCKLPM
output:
2
result:
ok single line: '2'
Test #3:
score: 0
Accepted
time: 1ms
memory: 3676kb
input:
CCPPPPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
0
result:
ok single line: '0'
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 4148kb
input:
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC...
output:
129012
result:
wrong answer 1st lines differ - expected: '193517', found: '129012'