Submission #1014728

#TimeUsernameProblemLanguageResultExecution timeMemory
1014728whitewind664Unija (COCI17_unija)C++17
30 / 100
209 ms31060 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 i = 0; while (i < n - 1 && pravoagolnik[i].first == pravoagolnik[i + 1].first) { cout << "!" << endl; i++; } int rez=pravoagolnik[i].first*pravoagolnik[i].second; int prevWidth = pravoagolnik[i].first; i++; for (;i<n;i++) { if (i < n - 1 && pravoagolnik[i].first == pravoagolnik[i + 1].first) { continue; } rez+=(pravoagolnik[i].first-prevWidth)*pravoagolnik[i].second; prevWidth = pravoagolnik[i].first; } cout << 4*rez << 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...