Submission #920425

# Submission time Handle Problem Language Result Execution time Memory
920425 2024-02-02T14:26:26 Z SuPythony Ljeto (COCI21_ljeto) C++17
25 / 50
1 ms 348 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int n; cin>>n;
    ll prev=-1;
    int prev_p[2];
    fill(prev_p,prev_p+2,0);
    ll pi=0;
    ll bl=0;
    while (n--) {
        ll t, a,b; cin>>t>>a>>b;
        if (prev==-1) {
            prev=t;
            if (a<=4) {
                prev_p[0]=a;
                pi+=100;
            }
            else {
                prev_p[1]=a;
                bl+=100;
            }
        } else {
            if (t-prev<=10) {
                prev=t;
                if (a<=4) {
                    if (prev_p[0]==a) pi+=150;
                    else {
                        prev_p[0]=a;
                        pi+=100;
                    }
                }
                else {
                    if (prev_p[1]==a) bl+=150;
                    else {
                        prev_p[1]=a;
                        bl+=100;
                    }
                }
            } else {
                prev=t;
                if (a<=4) {
                    prev_p[0]=a;
                    pi+=100;
                }
                else {
                    prev_p[1]=a;
                    bl+=100;
                }
            }
        }
    }
    cout<<pi<<" "<<bl;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Incorrect 0 ms 344 KB Output isn't correct
11 Halted 0 ms 0 KB -