Submission #848260

# Submission time Handle Problem Language Result Execution time Memory
848260 2023-09-11T20:47:24 Z vjudge1 Unija (COCI17_unija) C++17
0 / 100
1000 ms 65536 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,int>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(int i=10000001/2 ; 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 Runtime error 482 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 478 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 476 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 503 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1046 ms 31976 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 486 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 469 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 506 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 645 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1054 ms 34080 KB Time limit exceeded
2 Halted 0 ms 0 KB -