Submission #848258

# Submission time Handle Problem Language Result Execution time Memory
848258 2023-09-11T20:39:59 Z vjudge1 Unija (COCI17_unija) C++17
10 / 100
1000 ms 45800 KB
#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long n,cnt=0;
    cin>>n;
    // vector<pair<long long,long long>>v(n);
    map<int,long long>p;
    for(int i=0 ; i<n ; i++)
    {
        long long x,y,z;
        cin>>x>>y;
        y/=2;x/=2;
        // v[i]={x,y};
        z=p[y];
        p[y]=max(z,x);
    }
    for(long long i=p .size() ; i>0 ; i--) p[i]=max(p[i],p[i+1]);
    for(auto i:p) cnt+=i.second;
    cout<<cnt*4<<endl;
}
# Verdict Execution time Memory 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
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 604 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1049 ms 45600 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 25 ms 2380 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 101 ms 8084 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 339 ms 23140 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1042 ms 45800 KB Time limit exceeded
2 Halted 0 ms 0 KB -