Submission #830511

# Submission time Handle Problem Language Result Execution time Memory
830511 2023-08-19T07:29:08 Z vjudge1 Lightning Rod (NOI18_lightningrod) C++17
11 / 100
1071 ms 78292 KB
#include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
using namespace std;
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int N;
    cin >> N;
    vector<int>X(N+1);
    vector<int>Y(N+1);
    int lrd1=0;
    bool sub1 = true;
    for(int i=1; i<=N; i++) {
        cin >> X[i] >> Y[i];
        if(Y[i]!=1) sub1=false;
        if(i>1 && X[i]!=X[i-1]) lrd1++;
    }
    lrd1++;
    if(sub1) {
        cout << lrd1 << endl;
        return 0;
    } else
    if(N==2) {
        if((abs(X[1]-X[2]) <= Y[1]-Y[2]) || (abs(X[2]-X[1]) <= Y[2]-Y[1])) {
            cout << "1" << endl;
        } else {
            cout << "2" << endl;
        }
        return 0;
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1042 ms 76196 KB Output is correct
2 Correct 1067 ms 75964 KB Output is correct
3 Correct 1071 ms 73920 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 320 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 316 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 320 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 316 KB Output is correct
8 Incorrect 0 ms 212 KB Output isn't correct
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 320 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 316 KB Output is correct
8 Incorrect 0 ms 212 KB Output isn't correct
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 320 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 316 KB Output is correct
8 Incorrect 0 ms 212 KB Output isn't correct
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1071 ms 78292 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1042 ms 76196 KB Output is correct
2 Correct 1067 ms 75964 KB Output is correct
3 Correct 1071 ms 73920 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 320 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 316 KB Output is correct
11 Incorrect 0 ms 212 KB Output isn't correct
12 Halted 0 ms 0 KB -