#include<bits/stdc++.h>
using namespace std;
using ll = long long ;
using pii = pair<ll , ll> ;
using i3 = tuple<ll , ll , ll> ;
const int N = 2e5+5 ;
const int MOD = 1e9+7 ;
int n ;
map<pii , bool> vis ;
struct Points {
int x , y ;
};
vector<Points> point ;
stack<Points> st ;
int main(){
ios_base::sync_with_stdio(0); cin.tie(0);
cin >> n ;
for(int i=0;i<n;i++){
int x , y ; cin >> x >> y ;
point.push_back({x , y}) ;
}
for(int i=0;i<n;i++){
while(!st.empty() && point[i].y - st.top().y >= point[i].x - st.top().x){
st.pop();
}
st.push(point[i]);
}
cout << st.size();
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1519 ms |
157680 KB |
Output is correct |
2 |
Correct |
1515 ms |
156876 KB |
Output is correct |
3 |
Correct |
1488 ms |
152716 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Incorrect |
0 ms |
320 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Incorrect |
0 ms |
320 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Incorrect |
0 ms |
320 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Incorrect |
0 ms |
320 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1540 ms |
141132 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1519 ms |
157680 KB |
Output is correct |
2 |
Correct |
1515 ms |
156876 KB |
Output is correct |
3 |
Correct |
1488 ms |
152716 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Incorrect |
0 ms |
320 KB |
Output isn't correct |
7 |
Halted |
0 ms |
0 KB |
- |