Submission #1013026

# Submission time Handle Problem Language Result Execution time Memory
1013026 2024-07-03T05:52:20 Z vjudge1 ACM (COCI19_acm) C++17
50 / 50
6 ms 604 KB
#include <bits/stdc++.h>
using namespace std;

#define ll long long
int const N=2e5+5;
int const mod=1e9+7;
string ourteam="NijeZivotJedanACM";
vector<pair<pair<int,int>,string>> teams;
int main(){
	int n,m;
	cin>>n>>m;
	for (int i = 0; i <=n; ++i)
	{
		string t;
		cin>>t;
		int s=0;
		int pen=0;
		for (int j = 0; j < m; ++j)
		{
			string p;
			cin>>p;
			if(p[0]=='-')
				continue;
			s++;
			pen+=(p[1]-'1')*20*60;
			pen+=(p[4]-'0')*60*60;
			pen+=(p[6]-'0')*10*60;
			pen+=(p[7]-'0')*60;
			pen+=(p[9]-'0')*10;
			pen+=(p[10]-'0');
		}
		if(i<n && t==ourteam)
			continue;
		// cout<<t<<' '<<s<<' '<<pen<<endl;
		teams.push_back({{-s,pen},t});
	}
	sort(teams.begin(), teams.end());
	for (int i = 0; i < n; ++i)
		if(teams[i].second==ourteam)
			cout<<i+1<<endl;
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 3 ms 444 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 3 ms 604 KB Output is correct
5 Correct 6 ms 604 KB Output is correct