Submission #1036252

# Submission time Handle Problem Language Result Execution time Memory
1036252 2024-07-27T07:09:34 Z vjudge1 Med (COCI22_med) C++17
50 / 50
25 ms 348 KB
#include <bits/stdc++.h>
using namespace std;

#define ll long long
int const N=2e5+5;
int const mod=1e9+7;


int main(){
	int n;
	cin>>n;
	vector<pair<int,string>> con;
	for (int i = 0; i < n; ++i)
	{
		con.push_back({0,"ief"});
		cin>>con[i].second;
		for (int j = 0; j < 5; ++j)
		{
			int a;
			cin>>a;
			con[i].first-=a;
		}
	}
	vector<pair<int,string>> cp;
	for (int i = 0; i < n; ++i)
	{
		con[i].first-=500;
		cp=con;
		sort(cp.begin(), cp.end());
		for (int j = 0; j < n; ++j)
			if(con[i]==cp[j]){
				cout<<j+1<<' ';
				break;
			}
		con[i].first+=1000;
		cp=con;
		sort(cp.begin(), cp.end());
		for (int j = 0; j < n; ++j)
			if(con[i]==cp[j]){
				cout<<j+1<<endl;
				break;
			}
		con[i].first-=500;
	}
	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 11 ms 348 KB Output is correct
6 Correct 22 ms 344 KB Output is correct
7 Correct 13 ms 348 KB Output is correct
8 Correct 25 ms 348 KB Output is correct
9 Correct 7 ms 348 KB Output is correct