Submission #1089885

#TimeUsernameProblemLanguageResultExecution timeMemory
1089885toast12Ljeto (COCI21_ljeto)C++14
50 / 50
0 ms348 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    vector<vector<int>> v(1+8);
    for (int i = 0; i < n; i++) {
        int t, a, b;
        cin >> t >> a >> b;
        v[a].push_back(t);
    }
    int a = 0, b = 0;
    for (int i = 1; i <= 4; i++) {
        a += v[i].size() * 100;
        for (int j = 1; j < v[i].size(); j++) {
            if (v[i][j]-v[i][j-1] <= 10)
                a += 50;
        }
    }
    for (int i = 5; i <= 8; i++) {
        b += v[i].size() * 100;
        for (int j = 1; j < v[i].size(); j++) {
            if (v[i][j]-v[i][j-1] <= 10)
                b += 50;
        }
    }
    cout << a << ' ' << b << '\n';
    return 0;
}

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:16:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |         for (int j = 1; j < v[i].size(); j++) {
      |                         ~~^~~~~~~~~~~~~
Main.cpp:23:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |         for (int j = 1; j < v[i].size(); j++) {
      |                         ~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...