Submission #1036136

# Submission time Handle Problem Language Result Execution time Memory
1036136 2024-07-27T03:50:10 Z vjudge1 Med (COCI22_med) C++17
50 / 50
8 ms 348 KB
#include <bits/stdc++.h>

using namespace std;

bool sup(pair<string,int> p,pair<string,int> p1)
{
	return p.second>p1.second || (p.second==p1.second && p.first<p1.first);
}

int main()
{
	int n;
	cin>>n;
	vector<pair<string,int>> sc(n);
	for (int i=0;i<n;i++)
	{
		cin>>sc[i].first;
		int x;
		for (int j=0;j<5;j++)
		{
			cin>>x;
			sc[i].second+=x;
		}
	}
	for (int i=0;i<n;i++)
	{
		int r=1;
		sc[i].second+=500;
		for (int j=0;j<n;j++)
			if (sup(sc[j],sc[i]))
				r++;
		sc[i].second-=500;
		cout<<r<<' ';
		r=1;
		for (int j=0;j<n;j++)
		{
			sc[j].second+=500;
			if (sup(sc[j],sc[i]))
				r++;
			sc[j].second-=500;
		}
		cout<<r<<endl;
	}
	
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 4 ms 348 KB Output is correct
6 Correct 7 ms 348 KB Output is correct
7 Correct 6 ms 348 KB Output is correct
8 Correct 8 ms 348 KB Output is correct
9 Correct 3 ms 348 KB Output is correct