Submission #742109

# Submission time Handle Problem Language Result Execution time Memory
742109 2023-05-15T15:32:32 Z Ahmed57 Ljeto (COCI21_ljeto) C++17
25 / 50
1 ms 300 KB
#include <bits/stdc++.h>

using namespace std;

signed main(){
    int n;cin>>n;
    vector<vector<int>> v;
    for(int i = 0;i<n;i++){
        int a,b,c;cin>>a>>b>>c;
        v.push_back({a,b,c});
    }
    sort(v.begin(),v.end());
    long long sum1 = 0 , sum2 = 0;
    queue<int> q[10];
    for(auto i:v){
        if(i[1]<=4)sum1+=100;
        else sum2+=100;
        while(!q[i[1]].empty()&&i[0]-q[i[1]].front()>10)q[i[1]].pop();
        if(i[1]<=4)sum1+=q[i[1]].size()*50;
        else sum2+=q[i[1]].size()*50;
        q[i[1]].push(i[0]);
    }
    cout<<sum1<<" "<<sum2<<endl;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 300 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 300 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Incorrect 1 ms 212 KB Output isn't correct
12 Halted 0 ms 0 KB -