답안 #1036252

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
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;
}
# 결과 실행 시간 메모리 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
# 결과 실행 시간 메모리 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