Submission #743848

# Submission time Handle Problem Language Result Execution time Memory
743848 2023-05-18T05:12:12 Z vjudge1 Lightning Rod (NOI18_lightningrod) C++17
4 / 100
1540 ms 157680 KB
#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();
}

# Verdict Execution time Memory 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
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory Grader output
1 Incorrect 1540 ms 141132 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory 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 -