Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _USE_MATH_DEFINES
- #include <iostream>
- #include <conio.h>
- #include <string>
- #include <set>
- #include <map>
- #include <algorithm>
- #include <string>
- #include <math.h>
- #include <vector>
- #include <cmath>
- using namespace std;
- int main()
- {
- map <string, string> com;
- vector <int> winner;
- int n;
- int ni, sum=0;
- for (int i = 1; i <= 12; i++)
- {
- string prom;
- cin >> prom;
- if (i <= 4)
- com.insert(pair <string, string>(prom, "gold"));
- else
- if (i <= 8)
- com.insert(pair <string, string>(prom, "silver"));
- else
- com.insert(pair <string, string>(prom, "bronze"));
- }
- cin >> n;
- for (int i = 1; i <= n; i++)
- {
- sum = 0;
- cin >> ni;
- for (int j = 1; j <= ni; j++)
- {
- string prom, prom2;
- cin >> prom;
- cin >> prom2;
- cin >> prom2;
- if (com.find(prom) != com.end())
- if (com[prom] == prom2)
- sum++;
- }
- winner.push_back(sum);
- }
- sort(winner.begin(), winner.end());
- int prom, prom2;
- prom=winner[winner.size() - 1];
- prom2 = 1;
- for (int i = winner.size() - 2; i >=0; i--)
- if (prom == winner[i])
- prom2 ++;
- else
- break;
- cout << prom2*5;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment