#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(x) begin(x),end(x)
#define pb push_back
#define sz(x) (int)x.size()
#define s second
#define f first
int main() {
cin.tie(0)->sync_with_stdio(0);
int n;cin >> n;
vector<pair<ll,ll>> a(n);
for(auto &[x,y]:a){
cin >> x >> y;
x/=2;
y/=2;
}
sort(all(a),greater<pair<ll,ll>>());
ll mxy = 0,ans = 0;
for(auto &[x,y]:a){
if(y <= mxy) continue;
ans += x*(y-mxy);
mxy = y;
}
cout << ans*4;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
340 KB |
Output is correct |
2 |
Correct |
2 ms |
340 KB |
Output is correct |
3 |
Correct |
2 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
296 ms |
15956 KB |
Output is correct |
2 |
Correct |
259 ms |
15956 KB |
Output is correct |
3 |
Correct |
273 ms |
15956 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
724 KB |
Output is correct |
2 |
Correct |
7 ms |
1108 KB |
Output is correct |
3 |
Correct |
9 ms |
1108 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
25 ms |
1876 KB |
Output is correct |
2 |
Correct |
26 ms |
3172 KB |
Output is correct |
3 |
Correct |
26 ms |
3296 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
92 ms |
4948 KB |
Output is correct |
2 |
Correct |
82 ms |
9036 KB |
Output is correct |
3 |
Correct |
79 ms |
8980 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
261 ms |
15952 KB |
Output is correct |
2 |
Correct |
279 ms |
30956 KB |
Output is correct |
3 |
Correct |
282 ms |
30936 KB |
Output is correct |