Submission #537163

# Submission time Handle Problem Language Result Execution time Memory
537163 2022-03-14T17:00:19 Z davi_bart Ljeto (COCI21_ljeto) C++14
50 / 50
1 ms 340 KB
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int ll
#define fi first
#define se second
#define ld long double
#define pb push_back
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N;
    cin >> N;
    vector<array<int, 2> > v[2];
    array<int, 2> tot = {0, 0};
    vector<int> last(100, -1000);
    for (int i = 0; i < N; i++) {
        int a, b, c;
        cin >> a >> b >> c;
        v[b / 5].pb({a, b});
    }
    for (int i = 0; i < 2; i++) {
        sort(v[i].begin(), v[i].end());
        for (int j = 0; j < v[i].size(); j++) {
            tot[i] += 100;
            if (j > 0 && last[v[i][j][1]] + 10 >= v[i][j][0]) tot[i] += 50;
            last[v[i][j][1]] = v[i][j][0];
        }
    }
    cout << tot[0] << " " << tot[1] << '\n';
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:26:27: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::array<long long int, 2> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |         for (int j = 0; j < v[i].size(); j++) {
      |                         ~~^~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 324 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 324 KB Output is correct
3 Correct 1 ms 320 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 324 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 324 KB Output is correct
5 Correct 1 ms 320 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 324 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 260 KB Output is correct
12 Correct 1 ms 328 KB Output is correct
13 Correct 1 ms 212 KB Output is correct