답안 #743943

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
743943 2023-05-18T06:29:55 Z vjudge1 Lightning Rod (NOI18_lightningrod) C++17
4 / 100
1369 ms 80584 KB
#include<bits/stdc++.h>
using namespace std;

struct point
{
    int x,y;
};

int n;
vector<point> vec;

int cnt = 0;

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin >> n;
    stack<point> st;
    for(int i=0;i<n;++i)
    {
        int a,b;
        cin >> a >> b;
        if(!st.empty() && b < st.top().y && abs(a-st.top().x) <= st.top().y-b) continue;
        if(!st.empty() && b == st.top().y)
        {
            ++cnt;
            st.push({a,b});
            continue;
        }
        if(st.empty())
        {
            ++cnt;
            st.push({a,b});
        }
    }
    cout << cnt;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1318 ms 80584 KB Output is correct
2 Correct 1369 ms 79676 KB Output is correct
3 Correct 1303 ms 77460 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1276 ms 41048 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1318 ms 80584 KB Output is correct
2 Correct 1369 ms 79676 KB Output is correct
3 Correct 1303 ms 77460 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Incorrect 1 ms 212 KB Output isn't correct
6 Halted 0 ms 0 KB -