답안 #875574

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
875574 2023-11-20T04:37:39 Z ifateen Ljeto (COCI21_ljeto) C++14
50 / 50
1 ms 1884 KB
#include "bits/stdc++.h"
using namespace std;
#define int long long
struct spray { int time, player1, onplayer2; };
const int MAXN = 101;
spray sprays[MAXN];
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> sprays[i].time >> sprays[i].player1 >> sprays[i].onplayer2;
    vector<vector<int>> count1(1001, vector<int>(101)), count2(1001, vector<int>(101));
    int team1 = 0, team2 = 0;
    for (int i = 1; i <= n; i++) {
        spray x = sprays[i];
        bool first_to_second = 1 <= x.player1 && x.player1 <= 4 && 5 <= x.onplayer2 && x.onplayer2 <= 8;
        if (first_to_second) team1 += 100;
        else team2 += 100;
        count1[x.time][x.player1] |= first_to_second, count2[x.time][x.player1] |= !first_to_second;
        for (int j = 1; j <= 10; j++) {
            if (x.time - j < 0) break;
            if (count1[x.time - j][x.player1] && first_to_second) {
                team1 += 50;
                break;
            }
            if (count2[x.time - j][x.player1] && !first_to_second) {
                team2 += 50;
                break;
            }
        }
    }
    cout << team1 << ' ' << team2;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1880 KB Output is correct
2 Correct 1 ms 1884 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1884 KB Output is correct
2 Correct 1 ms 1884 KB Output is correct
3 Correct 1 ms 1884 KB Output is correct
4 Correct 1 ms 1884 KB Output is correct
5 Correct 1 ms 1884 KB Output is correct
6 Correct 1 ms 1884 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1880 KB Output is correct
2 Correct 1 ms 1884 KB Output is correct
3 Correct 1 ms 1884 KB Output is correct
4 Correct 1 ms 1884 KB Output is correct
5 Correct 1 ms 1884 KB Output is correct
6 Correct 1 ms 1884 KB Output is correct
7 Correct 1 ms 1884 KB Output is correct
8 Correct 1 ms 1884 KB Output is correct
9 Correct 1 ms 1884 KB Output is correct
10 Correct 1 ms 1884 KB Output is correct
11 Correct 1 ms 1884 KB Output is correct
12 Correct 1 ms 1884 KB Output is correct
13 Correct 1 ms 1884 KB Output is correct