HDU6023-Automatic Judge-简单模拟

本文详细解析了HDU在线评测系统的竞赛评分逻辑,包括如何计算参赛者的总解决题目数量及总罚时。文章通过具体示例介绍了如何根据提交状态(如AC或错误)来更新每个参赛者的得分和罚时。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

//传送门:http://acm.hdu.edu.cn/viewcode.php?rid=101&cid=772
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <vector>
using namespace std;
#define LL long long
#define N 100005
#define M 2005
#define INF 0x3f3f3f3f
const double eps = 1e-10;
/*
注意:没AC的题不算罚时
*/
bool has[25];
int cot[25];
int main()
{
    int t;
    scanf("%d",&t);
    while(t--){
        memset(has,0,sizeof(has));
        memset(cot,0,sizeof(cot));
        int tol = 0;
        int n,m;
        scanf("%d%d",&n,&m);
        int ans = 0;
        while(m--){
            int a,b,c;
            string s;
            scanf("%d %02d:%02d",&a,&b,&c);
            cin>>s;
            a-=1000;
            if(has[a]) continue;
            if(s=="AC"){
                tol++;
                has[a] = 1;
                ans += cot[a]*20 + b*60 + c;
            }else{
               cot[a]++;
            }
        }
        cout<<tol<<" "<<ans<<endl;
    }
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值