제출 #1305108

#제출 시각아이디문제언어결과실행 시간메모리
1305108hynmjLjeto (COCI21_ljeto)C++20
50 / 50
1 ms580 KiB
#include <bits/stdc++.h>
#define int long long
using namespace std;
const long long N = 2e5 + 5;
int a[N];

void solve()
{
    int n;
    cin >> n;
    int t, a, b;
    int red, blue;
    red = blue = 0;
    map<int, int> last;
    for (int i = 0; i < n; i++)
    {
        cin >> t >> a >> b;
        // t++;
        if (last.count(a))
        {
            if (t - last[a] <= 10)
            {
                if (a <= 4)
                {
                    blue += 150;
                }
                else
                    red += 150;
            }
            else
            {
                if (a <= 4)
                {
                    blue += 100;
                }
                else
                    red += 100;
                last[a] = t;
            }
        }
        else
        {
            if (a <= 4)
            {
                blue += 100;
            }
            else
                red += 100;
        }
        last[a] = t;
    }
    cout << blue << " " << red << endl;
}

signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
    int t = 1;
    // cin >> t;
    for (int i = 1; i <= t; i++)
    {
        // cout << "Case #" << i << ':' << ' ';
        solve();
        cout << endl;
    }
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...