답안 #861737

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
861737 2023-10-16T22:11:40 Z HossamHero7 Ljeto (COCI21_ljeto) C++14
50 / 50
1 ms 504 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n'
void solve(){
    int n;
    cin>>n;
    vector<array<ll,3>> v(n);
    for(auto &[t,a,b] : v) cin>>t>>a>>b;
    vector<int> lst(10,-1e9);
    ll ans1 = 0;
    ll ans2 = 0;
    for(auto [t,a,b] : v){
        if(a <= 4) {
            ans1 += 100;
            if(t-lst[a] <= 10) ans1 += 50;
        }
        else {
            ans2 += 100;
            if(t-lst[a] <= 10) ans2 += 50;
        }
        lst[a] = t;
    }
    cout<<ans1<<' '<<ans2<<endl;
}
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);      cout.tie(0);
    int t=1;
    //cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

Compilation message

Main.cpp: In function 'void solve()':
Main.cpp:9:15: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
    9 |     for(auto &[t,a,b] : v) cin>>t>>a>>b;
      |               ^
Main.cpp:13:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   13 |     for(auto [t,a,b] : v){
      |              ^
# 결과 실행 시간 메모리 Grader output
1 Correct 0 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 344 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 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 344 KB Output is correct
4 Correct 0 ms 344 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 348 KB Output is correct
9 Correct 1 ms 504 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 344 KB Output is correct
12 Correct 1 ms 344 KB Output is correct
13 Correct 0 ms 348 KB Output is correct