답안 #633639

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
633639 2022-08-23T00:00:35 Z Gabriel Ljeto (COCI21_ljeto) C++17
25 / 50
1 ms 212 KB
#include "bits/stdc++.h"
using namespace std;
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    long long a, b;
    pair<long long, bool> c, d, e, f, g, h, i, j;
    a = 0;
    b = 0;
    c.first = -1;
    c.second = 0;
    d.first = -1;
    d.second = 0;
    e.first = -1;
    e.second = 0;
    f.first = -1;
    f.second = 0;
    g.first = -1;
    g.second = 0;
    h.first = -1;
    h.second = 0;
    i.first = -1;
    i.second = 0;
    j.first = -1;
    j.second = 0;
    long long k;
    cin>>k;
    while(k--){
        long long l, m, n;
        cin>>l>>m>>n;
        switch(m){
            case 1:
            a += 100;
            if(c.first != -1){
                if(l - c.first <= 10){
                    c.second = 1;
                    a += 50 * c.second;
                } else {
                    c.second = 0;
                }
            } else {
                c.second = 1;
            }
            c.first = l;
            break;
            case 2:
            a += 100;
            if(d.first != -1){
                if(l - d.first <= 10){
                    d.second = 1;
                    a += 50 * d.second;
                } else {
                    d.second = 0;
                }
            } else {
                d.second = 1;
            }
            d.first = l;
            break;
            case 3:
            a += 100;
            if(e.first != -1){
                if(l - e.first <= 10){
                    e.second = 1;
                    a += 50 * e.second;
                } else {
                    e.second = 0;
                }
            } else {
                e.second = 1;
            }
            e.first = l;
            break;
            case 4:
            a += 100;
            if(f.first != -1){
                if(l - f.first <= 10){
                    c.second = 1;
                    a += 50 * f.second;
                } else {
                    f.second = 0;
                }
            } else {
                f.second = 1;
            }
            f.first = l;
            break;
            case 5:
            b += 100;
            if(g.first != -1){
                if(l - g.first <= 10){
                    g.second = 1;
                    b += 50 * g.second;
                } else {
                    g.second = 0;
                }
            } else {
                g.second = 1;
            }
            g.first = l;
            break;
            case 6:
            b += 100;
            if(h.first != -1){
                if(l - h.first <= 10){
                    h.second = 1;
                    b += 50 * h.second;
                } else {
                    h.second = 0;
                }
            } else {
                h.second = 1;
            }
            h.first = l;
            break;
            case 7:
            b += 100;
            if(i.first != -1){
                if(l - i.first <= 10){
                    i.second = 1;
                    b += 50 * i.second;
                } else {
                    i.second = 0;
                }
            } else {
                i.second = 1;
            }
            i.first = l;
            break;
            case 8:
            b += 100;
            if(j.first != -1){
                if(l - j.first <= 10){
                    j.second = 1;
                    b += 50 * j.second;
                } else {
                    j.second = 0;
                }
            } else {
                j.second = 1;
            }
            j.first = l;
        }
    }
    cout<<a<<" "<<b;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Incorrect 1 ms 212 KB Output isn't correct
12 Halted 0 ms 0 KB -