Submission #170532

#TimeUsernameProblemLanguageResultExecution timeMemory
170532mdn2002Unija (COCI17_unija)C++14
0 / 100
64 ms65540 KiB
#include<bits/stdc++.h> using namespace std; const long long mod=998244353; multiset<int>ms; int n; vector<int>v[10000007]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); //freopen("lemonade.in","r",stdin); //freopen("lemonade.out","w",stdout); cin>>n; for(int i=0;i<n;i++) { int x,y; cin>>x>>y; x/=2; y/=2; ms.insert(x); v[y+1].push_back(x); } long long ans=0; for(int i=1;i<=10000000;i++) { for(int j=0;j<v[i].size();j++) { ms.erase(ms.lower_bound(v[i][j])); } if(ms.size()==0)break; ans+=*--ms.end(); } cout<<ans*4; }

Compilation message (stderr)

unija.cpp: In function 'int main()':
unija.cpp:27:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j=0;j<v[i].size();j++)
                     ~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...