제출 #848256

#제출 시각아이디문제언어결과실행 시간메모리
848256vjudge1Unija (COCI17_unija)C++17
10 / 100
1047 ms60240 KiB
#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,long long>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(long long i=p .size() ; i>0 ; i--) p[i]=max(p[i],p[i+1]); for(auto i:p) cnt+=i.second; cout<<cnt*4<<endl; }
#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...