Kattis-ACM Contest Scoring

题目所述基本内容

Our new contest submission system keeps a chronological log of all submissions made by each team during the contest. With each entry, it records the number of minutes into the competition at which the submission was received, the letter that identifies the relevant contest problem, and the result of testing the submission (designated for the sake of this problem simply as right or wrong). As an example, the following is a hypothetical log for a particular team:

3 E right
10 A wrong
30 C wrong
50 B wrong
100 A wrong
200 A right
250 C wrong
300 D right

The rank of a team relative to others is determined by a primary and secondary scoring measure calculated from the submission data. The primary measure is the number of problems that were solved. The secondary measure is based on a combination of time and penalties. Specifically, a team’s time score is equal to the sum of those submission times that resulted in right answers, plus a 20-minute penalty for each wrong submission of a problem that is ultimately solved. If no problems are solved, the time measure is 0.

In the above example, we see that this team successfully completed three problems: E on their first attempt (3 minutes into the contest); A on their third attempt at that problem (200 minutes into the contest); and D on their first attempt at that problem (300 minutes into the contest). This team’s time score (including penalties) is 543. This is computed to include 3 minutes for solving E, 200 minutes for solving A with an additional 40 penalty minutes for two earlier mistakes on that problem, and finally 300 minutes for solving D. Note that the team also attempted problems B and C, but were never successful in solving those problems, and thus received no penalties for those attempts.

According to contest rules, after a team solves a particular problem, any further submissions of the same problem are ignored (and thus omitted from the log). Because times are discretized to whole minutes, there may be more than one submission showing the same number of minutes. In particular there could be more than one submission of the same problem in the same minute, but they are chronological, so only the last entry could possibly be correct. As a second example, consider the following submission log:

7 H right
15 B wrong
30 E wrong
35 E right
80 B wrong
80 B right
100 D wrong
100 C wrong
300 C right
300 D wrong

This team solved 4 problems, and their total time score (including penalties) is 502, with 7 minutes for H, 35+20 for E, 80+40 for B, and 300+20 for C.

输入输出样例

Input

The input contains n lines for 0≤n≤100, with each line describing a particular log entry. A log entry has three parts: an integer m, with 1≤m≤300, designating the number of minutes at which a submission was received, an uppercase letter designating the problem, and either the word right or wrong. The integers will be in nondecreasing order and may contain repeats. After all the log entries is a line containing just the number −1.

Output

Output two integers on a single line: the number of problems solved and the total time measure (including penalties).

 

代码

#include<iostream>
#include<map>
#include<string>
using namespace std;

int main() {
	int s = 0;
	int count = 0;
	map<char, int>a;
	int n;
	char b;
	string p;
	while (cin >> n) {
		if (n == -1) {
			break;
		}
		else {
			cin >> b >> p;
			a[b]++;
			if (p == "right") {
				count++;
				s = s + n+(a[b]-1)*20;
			}
		}
	}
	cout << count << " " << s << endl;
}

结束语

好兄弟好兄弟,留下你的关注和点赞,666走一波!!!!!

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
### 回答1: CDC-ACM驱动是一种USB设备驱动程序,用于安装和连接支持CDC ACM规范的通信设备。在Windows 7操作系统中,CDC-ACM驱动程序已经预装,但如果您的USB设备无法正常工作,您可以尝试手动更新或重新安装驱动程序。 首先,在Windows 7操作系统中,您可以通过设备管理器找到CDC-ACM驱动程序。打开设备管理器,找到您的USB设备,右键单击并选择“属性”,然后切换到“驱动程序”选项卡。如果您看到“当前驱动程序”一栏中没有CDC-ACM驱动程序,您可以在此处选择“更新驱动程序”选择CDC-ACM驱动程序并安装。 如果您的USB设备无法连接到计算机,您可以尝试重新安装CDC-ACM驱动程序。首先,您可以从设备制造商的网站下载最新版本的CDC-ACM驱动程序,或者从Windows更新程序中查找更新。然后,您可以将USB设备插入电脑,然后双击CDC-ACM驱动程序进行安装。按照安装向导的指示进行操作,完成驱动程序的安装后,您可以重新连接您的USB设备并测试其是否能够正常工作。 总之,CDC-ACM驱动程序是Windows 7预装的USB设备驱动程序之一。如果您的USB设备无法正常工作,您可以通过更新或重新安装驱动程序来解决问题。如果您有任何疑问或困难,建议您查看设备制造商的帮助文档或寻求专业的技术支持。 ### 回答2: CDC-ACM驱动是一种用于连接设备的万能串行总线设备驱动程序,可用于Windows 7操作系统。常见的CDC-ACM设备包括USB调制解调器、串行数字摄像头、商用POS终端等。 安装CDC-ACM驱动前,需要确认系统已经启用了自动驱动程序安装功能。打开设备管理器,在“通用串行总线控制器”下看到“CDC-ACM设备”或其他相关设备,说明驱动已经被正确识别。如果未自动识别,可以手动安装驱动。 手动安装驱动的步骤是,首先下载安装程序,解压缩后通过设备管理器找到对应设备,右键选择“更新驱动程序软件”,选择“浏览计算机以查找驱动程序软件”,选择解压文件夹中的.inf文件并进行安装。安装完成后,重新插拔设备即可。 总之,CDC-ACM驱动是连接设备的重要工具,对于无法识别的设备或需要手动更新驱动程序的情况,可以采取手动安装驱动的方式进行操作。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

做一个AC梦

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值