Submission #743079

#TimeUsernameProblemLanguageResultExecution timeMemory
743079vjudge1Lightning Rod (NOI18_lightningrod)C++17
4 / 100
1448 ms2668 KiB
#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(i == 1) continue; if(y == 1 && recent == 0) --cnt; if(y == 0 && recent == 1) --cnt; recent = y; } cout << cnt; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...