QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#777396#9741. CCPCERin_cy#WA 0ms3540kbC++14464b2024-11-24 01:57:522024-11-24 01:57:52

Judging History

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

  • [2024-11-24 01:57:52]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3540kb
  • [2024-11-24 01:57:52]
  • 提交

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: 0
Wrong Answer
time: 0ms
memory: 3540kb

input:

ABCDCPCPC

output:

0

result:

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