# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
743068 | vjudge1 | Lightning Rod (NOI18_lightningrod) | C++17 | 1667 ms | 304 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
#define iii tuple<int,int,int>
int n;
int cnt = 0;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
cin >> n;
int recent;
cnt = n;
for(int i=1;i<=n;++i)
{
int x,y;
cin >> x >> y;
if(y == 1 && recent == 0) --cnt;
if(y == 0 && recent == 1) --cnt;
recent = y;
}
cout << cnt;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |