Submission #922480

# Submission time Handle Problem Language Result Execution time Memory
922480 2024-02-05T14:45:27 Z blackavar Ljeto (COCI21_ljeto) C++14
10 / 50
1 ms 348 KB
#include <bits/stdc++.h>
using namespace std;

struct event{
    long long t, a, b;
};

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    long long n;
    cin >> n;
    event arr[n + 1];
    for (int i = 1; i <= n; i++) cin >> arr[i].t >> arr[i].a >> arr[i].b;
    long long teama = 0, teamb = 0, num = 0, prev[9];
    for (int i = 1; i <= n; i++)
    {
        if (arr[i].a <= 4 && arr[i].b >= 5) 
        {
            if (i > 1 && arr[i].t - prev[arr[i].a] <= 10) teama += 50;
            teama += 100;
        }
        if (arr[i].a >= 5 && arr[i].b <= 4)
        {
            if (i > 1 && arr[i].t - prev[arr[i].a] <= 10) teamb += 50;
            teamb += 100;
        }
        prev[arr[i].a] = arr[i].t;
    }
    cout << teama << " " << teamb;
    return 0;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:17:37: warning: unused variable 'num' [-Wunused-variable]
   17 |     long long teama = 0, teamb = 0, num = 0, prev[9];
      |                                     ^~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -