답안 #923361

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
923361 2024-02-07T06:57:50 Z Xiaoyang Advertisement 2 (JOI23_ho_t2) C++17
0 / 100
6 ms 2104 KB
#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize("Ofast")//Comment optimisations for interactive problems (use endl)
#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pii pair<int,int>
#define pll pair<long long,long long>
#define pb push_back
#define pq priority_queue
#define rep(i,a,b) for (int i=a;i<(b);i++)
#define MP make_pair
#define int long long
#define ll long long
#define ALL(x) x.begin(),x.end()
inline int readInt() {
    int x = 0;
    char ch = getchar();
    while (ch < '0' || ch > '9') ch = getchar_unlocked();
    while (ch >= '0' && ch <= '9'){
		x = (x << 3) + (x << 1) + ch - '0';
		ch = getchar_unlocked();
	}
    return x;
}
signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
    int n,x,y;
    n=readInt();
    stack<pii>s;
  	bool flag;
    rep(i,0,n){
        x=readInt();
		y=readInt();
        flag=true;
       	while(!s.empty()){
            int dx=s.top().fi;
            int dy=s.top().se;
            if(x-dx<=dy-y){
                flag=false;break;
            }
			if(x-dx<=y-dy)s.pop();
			else{break;}
        }
        if(flag){
            s.push({x,y});
        }
    }
    cout<<s.size();
    return 0;
}

Compilation message

Main.cpp:1: warning: ignoring '#pragma optimization_level ' [-Wunknown-pragmas]
    1 | #pragma optimization_level 3
      |
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 6 ms 2104 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 1 ms 856 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 1 ms 856 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 6 ms 2104 KB Output isn't correct
3 Halted 0 ms 0 KB -