Submission #743856

# Submission time Handle Problem Language Result Execution time Memory
743856 2023-05-18T05:23:50 Z vjudge1 Lightning Rod (NOI18_lightningrod) C++17
4 / 100
1331 ms 304 KB
#include<bits/stdc++.h>
using namespace std;

#define pii pair<int,int>

inline void read(int &x)
{
    x = 0;
    char ch = getchar_unlocked();
    while (ch & 16)
    {
        x = (x << 3) + (x << 1) + (ch & 15);
        ch = getchar_unlocked();
    }
}

int n;
int cnt = 0;
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    read(n);
    int recent;
    cnt = n;
    for(int i=1;i<=n;++i)
    {
        int x,y;
        cin >> x >> y;
        if(i == 1) continue;
        if(y == 1 && recent == 0) --cnt;
        if(y == 0 && recent == 1) --cnt;
        recent = y;
    }
    cout << n;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1218 ms 300 KB Output is correct
2 Correct 1218 ms 300 KB Output is correct
3 Correct 1271 ms 304 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1331 ms 300 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1218 ms 300 KB Output is correct
2 Correct 1218 ms 300 KB Output is correct
3 Correct 1271 ms 304 KB Output is correct
4 Incorrect 0 ms 212 KB Output isn't correct
5 Halted 0 ms 0 KB -