QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#763294#9741. CCPCtianxiawoyou#WA 1ms4148kbC++14389b2024-11-19 19:26:282024-11-19 19:26:29

Judging History

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

  • [2024-11-19 19:26:29]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:4148kb
  • [2024-11-19 19:26:28]
  • 提交

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

详细

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'