Submission #847913

# Submission time Handle Problem Language Result Execution time Memory
847913 2023-09-10T19:49:26 Z vjudge1 Unija (COCI17_unija) C++17
10 / 100
559 ms 23756 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);
    for(int i=0 ; i<n ; i++)
    {
        long long xx,yy;
        cin>>xx>>yy;
        yy/=2;xx/=2;
        v[i]={xx,yy};
    }
    sort(v.begin(),v.end());
    reverse(v.begin(),v.end());
    long long j=0,k=1;
    cnt=0;
    for(long long i=v[0].first ; i>0 ; i--)
    {
        if(i==v[k].first && v[k].second>v[j].second) j=k;
        if (i==v[k].first)k++;
        cnt+=v[j].second;
        
    }
    cout<<cnt*4<<endl;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 756 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 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 559 ms 23756 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 14 ms 1116 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 50 ms 2904 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 152 ms 7248 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 535 ms 23632 KB Output isn't correct
2 Halted 0 ms 0 KB -