/ @@18khV /

记录详情

Accepted

foo.cc: In function 'int main()':
foo.cc:16:17: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   16 |                 if(sum > maxx) maxn = name, maxx = sum; sum = 0;
      |                 ^~
foo.cc:16:57: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   16 |                 if(sum > maxx) maxn = name, maxx = sum; sum = 0;
      |                                                         ^~~
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Accepted 4ms 412.0 KiB
#2 Accepted 4ms 328.0 KiB
#3 Accepted 4ms 412.0 KiB
#4 Accepted 4ms 356.0 KiB
#5 Accepted 4ms 412.0 KiB
#6 Accepted 3ms 412.0 KiB
#7 Accepted 4ms 336.0 KiB
#8 Accepted 4ms 412.0 KiB
#9 Accepted 3ms 412.0 KiB
#10 Accepted 4ms 328.0 KiB

代码

#include<bits/stdc++.h>
using namespace std;
int main() {
	int n, s1, s2, sum = 0, maxx = 0, tots = 0, x;
	char a, b;
	string name, maxn;
	scanf("%d", &n);
	for(int i = 1; i <= n; i++) {
		cin >> name >> s1 >> s2 >> a >> b >> x;
		if(s1 > 80 && x > 0) sum += 8000;
		if(s1 > 85 && s2 > 80) sum += 4000;
		if(s1 > 90) sum += 2000;
		if(s1 > 85 && b == 'Y') sum += 1000;
		if(s2 > 80 && a == 'Y') sum += 850;
		tots += sum;
		if(sum > maxx) maxn = name, maxx = sum; sum = 0;
	}
	printf("%s\n%d\n%d\n", maxn.c_str(), maxx, tots);
	return 0;
}

信息

递交者
类型
递交
题目
P1000 谁拿了最多奖学金
题目数据
下载
语言
C++
递交时间
2020-11-06 20:22:17
评测时间
2023-09-05 13:30:22
评测机
分数
100
总耗时
43ms
峰值内存
412.0 KiB