QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#777406 | #9741. CCPC | ERin_cy# | WA | 1ms | 3604kb | C++20 | 464b | 2024-11-24 02:01:21 | 2024-11-24 02:01:21 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve(){
string str;
cin >> str;
int a = 0;
int b = 0;
for(int i = 0;i<str.size();i++){
if(str[i] =='C') a++;
else if(str[i] =='P') b++;
}
cout << min(a/3,b) << endl;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t;
t = 1;
while(t--){
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3600kb
input:
ABCDCPCPC
output:
1
result:
ok single line: '1'
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3604kb
input:
CAAACPBCDEFGCHIJCKLPM
output:
1
result:
wrong answer 1st lines differ - expected: '2', found: '1'