#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
588 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
206 ms |
31044 KB |
Output is correct |
2 |
Correct |
199 ms |
31060 KB |
Output is correct |
3 |
Correct |
194 ms |
31056 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
1116 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
20 ms |
3160 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
53 ms |
9044 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
209 ms |
31048 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |