2017CCPC女生赛 Automatic Judge

xiaoxiao2021-02-28  72

http://acm.hdu.edu.cn/showproblem.php?pid=6023

这道题唯一的坑点在于,罚时是在过了题后才加上去的,我就说这还能怎么做。

代码如下:

#include<bits/stdc++.h> using namespace std; int main() { int T, n, m; bool pro[1020]; int cnt[1020]; char str[10]; int tmp, a, b; cin >> T; while(T--) { int key = 0; int ans = 0; memset(pro, 0, sizeof(pro)); memset(cnt, 0, sizeof(cnt)); scanf("%d%d", &n, &m); while(m--) { scanf("%d %d:%d %s", &tmp, &a, &b, &str); if(pro[tmp]) continue; if(!strcmp(str, "AC")) { key++; ans += (a * 60 + b) + cnt[tmp]; pro[tmp] = 1; } else cnt[tmp] += 20; } cout << key << " " << ans << endl; } return 0; }

转载请注明原文地址: https://www.6miu.com/read-80753.html

最新回复(0)