답안 #866732

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
866732 2023-10-27T00:35:07 Z becaido Ljeto (COCI21_ljeto) C++17
50 / 50
1 ms 348 KB
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx,popcnt,sse4,abm")
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define Waimai ios::sync_with_stdio(false), cin.tie(0)
#define FOR(x,a,b) for(int x = a, I = b; x <= I; x++)
#define pb emplace_back
#define F first
#define S second

int n;
int ans[2];
vector<int> v[10];

int main() {
    Waimai;
    cin >> n;
    while (n--) {
        int t, a, b;
        cin >> t >> a >> b;
        v[a].pb(t);
    }
    FOR (i, 1, 8) {
        int sum = 0;
        sort(v[i].begin(), v[i].end());
        FOR (j, 0, (int) v[i].size() - 1) {
            if (j == 0 || v[i][j] - v[i][j - 1] > 10) sum += 100;
            else sum += 150;
        }
        ans[(i - 1) / 4] += sum;
    }
    cout << ans[0] << ' ' << ans[1] << '\n';
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 344 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct