Submission #847903

# Submission time Handle Problem Language Result Execution time Memory
847903 2023-09-10T19:01:27 Z vjudge1 Unija (COCI17_unija) C++17
10 / 100
541 ms 16212 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=0;
    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 0 ms 348 KB Output is correct
2 Correct 0 ms 348 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 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 541 ms 16212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 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 14 ms 860 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 51 ms 1992 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 165 ms 5204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 531 ms 16208 KB Output isn't correct
2 Halted 0 ms 0 KB -