QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#776782 | #9741. CCPC | jdyt11 | WA | 0ms | 3576kb | C++23 | 740b | 2024-11-23 20:58:07 | 2024-11-23 20:58:11 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
#define ll long long
#define inf 0x3f3f3f3f
#define ull unsigned long long
#define pll pair<ll,ll>
#define ls d*2
#define rs d*2+1
#define mid (l+r)/2
#define lowbit(x) (x&(-x))
//#define endl "\n"
#define all(x) x.begin(),x.end()
#define int long long
//mt19937 seed;
//uniform_int_distribution<int>num(0,2e9);
const int N=1e6+10;
const int M=33;
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
int _=1;//cin>>_;
while(_--){
string s;
cin>>s;
int cnt1=0,cnt2=0;
int n=s.length();
for(int i=0;i<n;i++)cnt1+=(s[i]=='C'),cnt2+=(s[i]=='P');
cout<<min(cnt1/3,cnt2)<<endl;
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3540kb
input:
ABCDCPCPC
output:
1
result:
ok single line: '1'
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3576kb
input:
CAAACPBCDEFGCHIJCKLPM
output:
1
result:
wrong answer 1st lines differ - expected: '2', found: '1'