Submission #520372

#TimeUsernameProblemLanguageResultExecution timeMemory
520372Alex_tz307Ljeto (COCI21_ljeto)C++17
50 / 50
1 ms312 KiB
#include <bits/stdc++.h>
#define INF 0x3f3f3f3f

using namespace std;

void test_case() {
  int n;
  cin >> n;
  int s1 = 0, s2 = 0;
  vector<int> last(9, -INF);
  for (int i = 1; i <= n; ++i) {
    int t, a, b;
    cin >> t >> a >> b;
    if (a <= 4) {
      s1 += 100;
      if (t - last[a] <= 10) {
        s1 += 50;
      }
    } else {
      s2 += 100;
      if (t - last[a] <= 10) {
        s2 += 50;
      }
    }
    last[a] = t;
  }
  cout << s1 << ' ' << s2 << '\n';
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int t = 1;
  for (int tc = 1; tc <= t; ++tc) {
    test_case();
  }
  return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...