이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long lo;
typedef pair< lo,lo > PII;
#define fi first
#define se second
#define int long long
#define mp make_pair
#define pb push_back
#define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR for(int i=1;i<=n;i++)
#define mid ((start+end)/2)
#define ort ((bas+son)/2)
const lo MAX = -1000000000000000000;
const lo MIN = 1000000000000000000;
const lo inf = 1000000000;
const lo KOK = 100000;
const lo LOG = 30;
const lo li = 500005;
const lo mod = 1000000007;
int n,m,b[li],a[li],k,flag,t;
int cev=1;
PII p[li];
string s;
vector<int> v[4];
inline int mul(int x,int y){
return (x%mod)*(y%mod)%mod;
}
inline int f(int sira,int sec,int sec1){
flag=0;
if(sira>n)return 1;
if(p[sec].se>p[sira].se || p[sira].fi>p[sec].se){
if(p[sira].se>p[sec].se)
f(sira+1,sira,sec1);
else f(sira+1,sec,sec1);
flag=1;
}
if(p[sec1].se>p[sira].se || p[sira].fi>p[sec1].se){
if(p[sira].se>p[sec1].se)
f(sira+1,sec,sira);
else f(sira+1,sec,sec1);
flag=1;
}
}
main(void){
scanf("%lld",&n);
FOR{
scanf("%lld %lld",&p[i].fi,&p[i].se);
}
sort(p+1,p+n+1);
FOR{
flag=1;
int flag1=1;
for(int j=0;j<(int)v[0].size();j++){
if(v[0][j]>p[i].fi && v[0][j]<p[i].se)flag=0;
}
for(int j=0;j<(int)v[1].size();j++){
if(v[1][j]>p[i].fi && v[1][j]<p[i].se)flag1=0;
}
if(flag==1)v[0].pb(p[i].se);
else if(flag1==1)v[1].pb(p[i].se);
flag+=flag1;
cev=mul(cev,flag);
//~ cout<<cev<<endl;
}
printf("%lld\n",cev);
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
port_facility.cpp:54:10: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
main(void){
^
port_facility.cpp: In function 'int main()':
port_facility.cpp:55:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%lld",&n);
~~~~~^~~~~~~~~~~
port_facility.cpp:57:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%lld %lld",&p[i].fi,&p[i].se);
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 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... |