http://codeforces.com/contest/2/problem/A
Ideal: Give you some people's results
Seeking the name of the people who have the greatest achievement
If there are many outputs, the first to be up> = RET && End> = RET
ACcode:
#include<bits/stdc++.h>
using namespace std;
string name[1000100];
int score[1000100];
int main()
{
int n;
scanf("%d", &n);
map<string, int>m;
m.clear();
int ret = -1e9;
for(int i = 1; i <= n; i++)
{
cin >> name[i] >> score[i];
m[name[i]] += score[i];
}
for(int i = 1; i <= n; i++)
ret = max(ret, m[name[i]]);
map<string, int>c;
c.clear();
for(int i = 1; i <= n; i++)
{
c[name[i]] += score[i];
if(m[name[i]] >= ret && c[name[i]] >= ret)
{
cout << name[i] << endl;
break;
}
}
return 0;
}
layout: post title: Codeforces Beta Round 77 (Div. 2 Only) author: "luowentaoaa" catalog: true tags: mathjax: true - codeforces Portal A - Football (Sign) The meaning of problems Q. Is there...
layout: post title: Codeforces Beta Round 84 (Div. 2 Only) author: "luowentaoaa" catalog: true tags: mathjax: true - codeforces Portal have to say this ancient field too simple A - Nearly Lu...
Chips time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are n walruses sitting in a circle. All of them are numbered in the ...
A boy Bob likes to draw. Not long ago he bought a rectangular graph (checked) sheet with n rows and m columns. Bob shaded some of the squares on the sheet. Having seen his masterpi...
A - Panoramix’s Prediction Is b the first prime number greater than a B-Depression simulation C - Heroes Because there are three enemies, we use the ternary method to enumerate all situations. T...
Article catalog Foreword First, the topic link 1.[A. Chord](https://codeforces.com/contest/88/problem/A) 2.[B. Keyboard](https://codeforces.com/contest/88/problem/B) 3.[C. Trains](https://codeforces.c...
Write catalog title here First-level directory Secondary directory Three-level directory link A - The number of positions Question type: thinking Title: Code: B - Permutations Question type: Simulatio...
Fortunately, this problem ~ ~ 2B Subject to the effect: Given a matrix. Go left on the bottom right, you can only turn right or laid down. Each path has a grid number. The number obtained by multiplyi...
B. The least round way Topic connection: http://www.codeforces.com/contest/2/problem/B Description There is a square matrix n × n, consisting of non-negative integer numbers. You s...
B. The least round way time limit per test:2 seconds memory limit per test:64 megabytes There is a square matrix n × n, consisting of non-negative integer numbers. You should ...