이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
컴파일 시 표준 에러 (stderr) 메시지
Main.cpp:1: warning: ignoring '#pragma optimization_level ' [-Wunknown-pragmas]
1 | #pragma optimization_level 3
|
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |