Submission #1014716

#TimeUsernameProblemLanguageResultExecution timeMemory
1014716MODDIUnija (COCI17_unija)C++14
0 / 100
204 ms31100 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int32_t main() { ios_base::sync_with_stdio(false); cin.tie(0); int n; cin >> n; pair<int,int> pravoagolnik[n]; for (int i=0;i<n;i++) { cin >> pravoagolnik[i].first >> pravoagolnik[i].second; pravoagolnik[i].first/=2; pravoagolnik[i].second/=2; } sort(pravoagolnik, pravoagolnik+n); int rez=pravoagolnik[0].first*pravoagolnik[0].second; for (int i=1;i<n;i++) { rez+=(pravoagolnik[i].first-pravoagolnik[i-1].first)*pravoagolnik[i].second; } cout << 4*rez; }
#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...