Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- using ll = long long;
- map<string, int> acs;
- map<string, int> tim;
- map<string, map<char, int>> was;
- int main() {
- ios::sync_with_stdio(false);
- int n, m, p;
- cin >> n >> m >> p;
- vector<string> teams;
- for (int i = 0; i < n; i++) {
- string w;
- cin >> w;
- teams.push_back(w);
- }
- int b1 = 0, b2 = 0;
- int ans = 0;
- int last_t = 0;
- while (m--) {
- string w;
- char p;
- int t;
- string verd;
- cin >> w >> p >> t >> verd;
- int ok = 0;
- ok += acs[teams[0]] == b1;
- ok += tim[teams[0]] == b2;
- if (ok == 2) {
- ans += t - last_t;
- }
- if (verd == "NO") {
- was[w][p]++;
- } else if (verd == "OK") {
- acs[w]++;
- tim[w] += t + 20 * was[w][p];
- if (acs[w] > b1) {
- b1 = acs[w];
- b2 = tim[w];
- } else if (acs[w] == b1) {
- b2 = min(b2, tim[w]);
- }
- }
- last_t = t;
- }
- int ok = 0;
- ok += acs[teams[0]] == b1;
- ok += tim[teams[0]] == b2;
- if (ok == 2) {
- ans += 300 - last_t;
- }
- cout << ans << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement