标签:space 结构体 memset for namespace cpp 循环 std print
#include <iostream>
#include <stdio.h>
#include <string.h>
#define maxn 100005
using namespace std;
int main() {
int players[maxn], n, school, score;
cin >> n;
memset(players, 0, sizeof(players));
for (int i = 0; i < n; i++) {
cin >> school >> score;
players[school] += score;
}
int ans =0, sum =0;
for (int i = 0; i <=n; i++) {
if(players[i] > sum) {
ans = i;
sum = players[i];
}
}
printf("%d %d\n", ans, sum);
return 0;
}
错误点:
标签:space 结构体 memset for namespace cpp 循环 std print
原文地址:https://www.cnblogs.com/huangming-zzz/p/11632036.html