您当前的位置: 首页 >  ar

MangataTS

暂无认证

  • 0浏览

    0关注

    423博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

AtCoder Beginner Contest 173 B - Judge Status Summary

MangataTS 发布时间:2020-07-12 20:58:00 ,浏览量:0

B - Judge Status Summary

Time Limit: 2 sec / Memory Limit: 1024 MB

Score : 200200 points

Problem Statement

Takahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.

The problem has NN test cases.

For each test case ii (1≤i≤N1≤i≤N), you are given a string SiSi representing the verdict for that test case. Find the numbers of test cases for which the verdict is ACWATLE, and RE, respectively.

See the Output section for the output format.

Constraints
  • 1≤N≤1051≤N≤105
  • SiSi is ACWATLE, or RE.
Input

Input is given from Standard Input in the following format:

NN
S1S1
⋮⋮
SNSN

Output

Let C0, C1, C2C2, and C3 be the numbers of test cases for which the verdict is ACWATLE, and RE, respectively. Print the following:

AC x C0
WA x C1
TLE x C2
RE x C3

Sample Input 1 Copy
Copy
6
AC
TLE
AC
AC
WA
TLE

Sample Output 1 Copy
Copy
AC x 3
WA x 1
TLE x 2
RE x 0

We have 33, 11, 22, and 00 test case(s) for which the verdict is ACWATLE, and RE, respectively.

解题思路:小学计数问题,不过多解释,看题目就能懂

解法1,利用字符串模拟:

#include
#include
using namespace std;
int main(void)
{
    int n;
    int a[4];
    char ch[10];
    char str[4][10]={{"AC"},{"WA"},{"TLE"},{"RE"}};
    while(~scanf("%d",&n))
    {
        memset(a,0,sizeof(a));
        getchar();
        for(int i=0;ich,mp[ch]++;
        printf("AC x %d\n",mp["AC"]);
        printf("WA x %d\n",mp["WA"]);
        printf("TLE x %d\n",mp["TLE"]);    
        printf("RE x %d\n",mp["RE"]);
    }
    return 0;
}
关注
打赏
1665836431
查看更多评论
立即登录/注册

微信扫码登录

0.0377s