Submission #899179

# Submission time Handle Problem Language Result Execution time Memory
899179 2024-01-05T14:47:19 Z HamzaT Ljeto (COCI21_ljeto) C++14
50 / 50
1 ms 468 KB
//struct Edge {int u, v, weight;bool operator<(Edge const& other) {return weight < other.weight;}};
#include <bits/stdc++.h>
#define endl "\n"
#define ll long long
#define sp ' '
#define pb push_back
#define ar for(int i=1;i<=n;i++)
using namespace std;
ll t=1;
const ll N=3e5+100;
ll n,m,q,k;
ll a[N],b[N],c[N];
void solve()
{
    map<int,int>mp;
    for(int i=1;i<=8;i++){mp[i]=-100;}
    cin>>n;
    ll ans1=0,ans2=0;
    for(int i=1;i<=n;i++)
    {
        ll x,y,z;
        cin>>x>>y>>z;
        if(x-mp[y]>10&&y<=4){ans1+=100;mp[y]=x;}
        else if(x-mp[y]<=10&&y<=4){ans1+=150;mp[y]=x;}
        if(x-mp[y]>10&&y>4){ans2+=100;mp[y]=x;}
        else if(x-mp[y]<=10&&y>4){ans2+=150;mp[y]=x;}
    }
    cout<<ans1<<" "<<ans2<<endl;return;
}
int main()
{
    //freopen("shell.in", "r", stdin);
   // freopen("shell.out", "w", stdout);
    ios::sync_with_stdio(NULL);
    cin.tie(NULL);cout.tie(NULL);
    //  cin>>t;
    while(t--){solve();}
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 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 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 468 KB Output is correct
6 Correct 0 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 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 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 468 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct