1032. 挖掘机技术哪家强(20)
2017-11-12 21:57
232 查看
原题: https://www.patest.cn/contests/pat-b-practise/1032
思路: 开个100K+的数组, 轻松搞定.
完整实现:
#include <stdio.h> int main (void) { int n; int stu[100001] = {0}; int no; int score; int maxNo; int maxScore = 0; int i; scanf("%d", &n); for (i=1; i<=n; i++) { scanf("%d %d", &no, &score); stu[no] += score; if (stu[no] > maxScore) { maxScore = stu[no]; maxNo = no; } } printf("%d %d\n", maxNo, maxScore); return 0; }
相关文章推荐
- PAT 1032 挖掘机技术哪家强(20)
- PATB1032. 挖掘机技术哪家强(20)
- 1032. 挖掘机技术哪家强(20)
- 1032. 挖掘机技术哪家强(20)
- PAT乙题1032. 挖掘机技术哪家强(20)
- PAT乙级—1032. 挖掘机技术哪家强(20)-native
- PAT 1032. 挖掘机技术哪家强(20)
- 1032. 挖掘机技术哪家强(20)
- 1032. 挖掘机技术哪家强(20)
- 1032. 挖掘机技术哪家强(20)
- PAT-乙级-1032. 挖掘机技术哪家强(20)
- 1032. 挖掘机技术哪家强(20)
- PAT Basic 1032. 挖掘机技术哪家强(20)(C语言实现)
- 1032. 挖掘机技术哪家强(20)
- PAT 乙级 1032. 挖掘机技术哪家强(20)
- PAT (Basic Level) Practise (中文) 1032. 挖掘机技术哪家强(20)
- pat 乙级 1032. 挖掘机技术哪家强(20)
- 1032. 挖掘机技术哪家强(20)
- 1032. 挖掘机技术哪家强(20)
- 1032. 挖掘机技术哪家强(20)