Submission #1004635

# Submission time Handle Problem Language Result Execution time Memory
1004635 2024-06-21T11:01:35 Z DangerNoodle7591 Ljeto (COCI21_ljeto) C++17
50 / 50
1 ms 456 KB
#include  <bits/stdc++.h>
using namespace std;
#define lalala ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl '\n'
#define int long long int
//#define ll long long
#define pb push_back
#define p push
#define f first
#define s second

signed main(){
  lalala;
  int n;cin>>n;
  int arr[8];
  arr[0]=arr[1]=arr[2]=arr[3]=arr[4]=arr[5]=arr[6]=arr[7]=-10000;
  vector<tuple<int,int,int>> v;
  for(int i=0;i<n;i++){
    int a,b,c;cin>>a>>b>>c;
    b--;c--;
    v.pb({a,b,c});
  }
  sort(v.begin(),v.end());
  int cev=0,ans=0;
  for(auto u:v){
    int a,b,c;tie(a,b,c)=u;
    if(b<4){
      cev+=100;
      if(arr[b]+10>=a)cev+=50;
    }
    else{
      ans+=100;
      if(arr[b]+10>=a)ans+=50;
    }
    arr[b]=a;
  }
  cout<<cev<<" "<<ans<<endl;
 
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 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 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 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 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 456 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct