답안 #169231

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
169231 2019-12-19T07:23:20 Z aggu_01000101 Lightning Rod (NOI18_lightningrod) C++14
0 / 100
2000 ms 162440 KB
#include <iostream>
#include <algorithm>
#include <cmath>
#include <unordered_map>
#include <fstream>
#include <stack>
#include <vector>
#include <set>
#include <queue>
#include <cstdlib>
#include <cstring>
#include <map>
#define int long long
using namespace std;
int32_t main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin>>n;
    stack<pair<int, int>> st;
    for(int i =0 ;i<n;i++){
        int x, y;
        cin>>x>>y;
        bool toadd = true;
        while(!st.empty()){
            if(abs(x - st.top().first)<=(st.top().second - y)) toadd = false;
            else if(abs(x - st.top().first)<=(y-st.top().second)) st.pop();
            else break;
        }
        if(toadd) st.push(make_pair(x, y));
    }
    cout<<st.size()<<endl;
}
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2055 ms 162440 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Execution timed out 2055 ms 376 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Execution timed out 2055 ms 376 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Execution timed out 2055 ms 376 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Execution timed out 2055 ms 376 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2039 ms 376 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2055 ms 162440 KB Time limit exceeded
2 Halted 0 ms 0 KB -