Submission #1014718

# Submission time Handle Problem Language Result Execution time Memory
1014718 2024-07-05T10:37:21 Z whitewind664 Unija (COCI17_unija) C++17
0 / 100
207 ms 43760 KB
#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;
    vector<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;
    }
    pravoagolnik.push_back({ 0, 100000000 });
    sort(pravoagolnik.begin(), pravoagolnik.end());
    // 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;
    // }
    int rez = 0;
    for (int i = n; i >= 0; i--) {
        rez += (pravoagolnik[i].first - pravoagolnik[i - 1].first) * pravoagolnik[i].second;
    }
    
    cout << 4 * rez << endl;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 452 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 604 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 203 ms 43760 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 1624 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 4700 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 66 ms 13148 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 207 ms 43704 KB Output isn't correct
2 Halted 0 ms 0 KB -