제출 #1135360

#제출 시각아이디문제언어결과실행 시간메모리
1135360adkjtLightning Rod (NOI18_lightningrod)C++20
0 / 100
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; int main() { int x,y,xnow=0,ynow=0,ans=0,n; cin>>n; for(int i=1;i<=n;i++) { cin>>x>>y; if(ynow<y) { if(abs(x-xnow)>y-ynow) ans++,xnow=x,ynow=y; } else if(y<ynow) if(abs(x-xnow)>ynow-y) ans++,xnow=x,ynow=y; else ans++,xnow=x,ynow=y; } cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...