Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <algorithm>
- using namespace std;
- class Team {
- public:
- long long int name;
- int min[4], sec[4], sum = 0;
- bool operator()(const Team& t1, const Team& t2) const {
- return t1.sum < t2.sum;
- }
- };
- int main() {
- do {
- int n;
- cin >> n;
- if (n == 0) break;
- vector<Team> teams;
- for (int i = 0; i < n; i++) {
- Team t;
- cin >> t.name;
- t.sum = 0;
- for (int j = 0; j < 4; j++) {
- cin >> t.min[j] >> t.sec[j];
- t.sum += t.min[j] * 60 + t.sec[j];
- }
- teams.push_back(t);
- }
- sort(teams.begin(), teams.end(), Team());
- cout << teams.at(0).name << endl;
- cout << teams.at(1).name << endl;
- cout << teams.at(n - 2).name << endl;
- }
- while (1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement