Submission #848346

# Submission time Handle Problem Language Result Execution time Memory
848346 2023-09-12T07:59:19 Z vjudge1 Unija (COCI17_unija) C++17
0 / 100
526 ms 39700 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;
    int p[10000001]={};
    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-1 ; i>=0 ; i--) p[i]=max(p[i],p[i+1]);
    // for(auto i:p) cnt+=i.second;
    for(int i=0 ; i<10000001 ; i++)cnt+=p[i];
    cout<<cnt*4<<endl;
}
# Verdict Execution time Memory Grader output
1 Incorrect 57 ms 39512 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 57 ms 39516 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 57 ms 39700 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 59 ms 39512 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 510 ms 39512 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 56 ms 39512 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 68 ms 39512 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 97 ms 39512 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 181 ms 39512 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 526 ms 39540 KB Output isn't correct
2 Halted 0 ms 0 KB -