Advertisement
MiinaMagdy

12015 - Google is Feeling Lucky

Sep 1st, 2022
1,043
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. #define ll long long
  6. #define endl '\n'
  7. #define sz(x) int(x.size())
  8. #define all(x) x.begin(), x.end()
  9.  
  10. int main() {
  11.     ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  12.     int testcases;
  13.     cin >> testcases;
  14.     for (int test = 1; test <= testcases; test++) {
  15.         vector<vector<string>> rates(105);
  16.         int k = -1;
  17.         for (int i = 0; i < 10; i++) {
  18.             string url;
  19.             int rate;
  20.             cin >> url >> rate;
  21.             k = max(rate, k);
  22.             rates[rate].push_back(url);
  23.         }
  24.         cout << "Case #" << test << ":\n";
  25.         for (auto& s : rates[k]) cout << s << endl;
  26.     }
  27.     return 0;
  28. }
  29.  
Tags: UVA
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement