# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1013032 | vjudge1 | ACM (COCI19_acm) | C++17 | 5 ms | 604 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
#define team "NijeZivotJedanACM"
map<string, pair<int,int> > points;
bool sorter(pair<int,pair<int,string> > a, pair<int, pair<int, string> > b)
{
if(a.first != b.first) return a.first > b.first;
return a.second < b.second;
}
int main()
{
int n, m;
cin >> n >> m;
for(int i = 0; i <= n; i ++)
{
string name;
cin >> name;
pair<int,int> score = {0, 0};
for(int j = 0; j < m; j ++)
{
string res;
cin >> res;
if(res[0] == '-') continue;
score.first++;
score.second += 20 * (res[1] - '1') * 60;
score.second += stoi(res.substr(3, 2)) * 3600;
score.second += stoi(res.substr(6, 2)) * 60;
score.second += stoi(res.substr(9, 2));
}
points[name] = score;
}
vector<pair<int, pair<int, string> > > vec;
for(auto x : points)
vec.push_back({x.second.first, {x.second.second, x.first}});
sort(vec.begin(), vec.end(), sorter);
for(int i = 0; i < vec.size(); i ++)
if(vec[i].second.second == team)
cout << i + 1 << endl;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |