Submission #743856

#TimeUsernameProblemLanguageResultExecution timeMemory
743856vjudge1Lightning Rod (NOI18_lightningrod)C++17
4 / 100
1331 ms304 KiB
#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 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...