Submission #974641

# Submission time Handle Problem Language Result Execution time Memory
974641 2024-05-03T14:52:35 Z vjudge1 Ljeto (COCI21_ljeto) C++17
50 / 50
1 ms 436 KB
#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
using namespace std;

// ll dx[4]={0,-1,0,1};
// ll dy[4]={-1,0,1,0};

void solve(){
    ll n; cin>>n;
    ll acnt=0,bcnt=0;
    ll last[8];
    memset(last,-30,sizeof(last));
    for(int i=0;i<n;i++){
        ll t,a,b; cin>>t>>a>>b;
        if(a==1 || a==2 || a==3|| a==4){
            acnt+=100;
        }
        else{
            bcnt+=100;
        }
        if(last[a-1]>=t-10){
            if(a==1 || a==2 || a==3|| a==4){
                acnt+=50;
            }
            else{
                bcnt+=50;
            }
        }
        last[a-1]=t;
    }
    cout<<acnt<<' '<<bcnt<<endl;

    // ll n,m; cin>>n>>m;
    // char arr[n][m];
    // for(int i=0;i<n;i++){
    //     for(int j=0;j<m;j++){
    //         cin>>arr[i][j];
    //     }
    // }
    // bool vis[n][m];
    // memset(vis,0,sizeof(vis));
    // queue<pair<ll,ll>>q;
    // q.push({1,1});
    // vis[1][1]=1;
    // ll cnt=1;
    
    // while(!q.empty()){
    //     ll x=q.front().first; ll y=q.front().second;
    //     for(int i=0;i<4;i++){
    //         if(arr[x+dx[i]][y+dy[i]]!='#'){

    //         }
    //     }
    // }
}

int main(){
    ll tc; tc=1;
    while(tc--){
        solve();
    }
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 436 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 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 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 436 KB Output is correct
3 Correct 1 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
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct