Submission #1114628

# Submission time Handle Problem Language Result Execution time Memory
1114628 2024-11-19T09:26:06 Z expert007 Lightning Rod (NOI18_lightningrod) C++14
0 / 100
1388 ms 209772 KB
#include "bits/stdc++.h"
using namespace std;
#define ull unsigned long long
#define int long long
const int MOD = 1e9 + 7;

void setIO() {
    cin.tie(0)->sync_with_stdio(0);
}

void solve() {
    int n;
    cin >> n;
    vector<pair<int, int>> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i].first >> a[i].second;
    }
    sort(a.begin(), a.end());

    int ct = 0;
    if(a[0].second < a[1].second){
        if(a[1].first - a[0].first <= a[1].second - a[0].second){
            ct = 1;
        }
        else{
            ct = 2;
        }
    }
    else if(a[0].second >  a[1].second){
        if(a[0].first - a[1].first <= a[0].second - a[1].second){
            ct = 1;
        }
        else{ct = 2;}
    }
    else{
        ct = 2;
    }
    cout << ct << endl;
}

int32_t main() {
    setIO();
    solve();
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1388 ms 209772 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Incorrect 1 ms 592 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Incorrect 1 ms 592 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Incorrect 1 ms 592 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Incorrect 1 ms 592 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1274 ms 200232 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1388 ms 209772 KB Output isn't correct
2 Halted 0 ms 0 KB -