QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#777400#9741. CCPCERin_cy#WA 1ms3596kbC++14464b2024-11-24 01:58:172024-11-24 01:58:20

Judging History

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

  • [2024-11-24 01:58:20]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3596kb
  • [2024-11-24 01:58:17]
  • 提交

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;
}

詳細信息

Test #1:

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

input:

ABCDCPCPC

output:

1

result:

ok single line: '1'

Test #2:

score: -100
Wrong Answer
time: 1ms
memory: 3592kb

input:

CAAACPBCDEFGCHIJCKLPM

output:

1

result:

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