Submission #166944

#TimeUsernameProblemLanguageResultExecution timeMemory
166944AKaan37Port Facility (JOI17_port_facility)C++17
10 / 100
6087 ms46144 KiB
#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 = 1000005; 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 add(int x,int y){ if(x+y>=mod)return x+y-mod; return x+y; } inline void f(int sira,vector<int> v[4]){ if(sira>n){cev=add(cev,1);return ;} flag=1; int flag1=1; for(int j=0;j<(int)v[0].size();j++){ if(v[0][j]>p[sira].fi && v[0][j]<p[sira].se)flag=0; } for(int j=0;j<(int)v[1].size();j++){ if(v[1][j]>p[sira].fi && v[1][j]<p[sira].se)flag1=0; } vector<int> v1[4]; v1[0]=v[0]; v1[1]=v[1]; v1[0].pb(p[sira].se); vector<int> v2[4]; v2[0]=v[0]; v2[1]=v[1]; v2[1].pb(p[sira].se); if(flag==1)f(sira+1,v1); if(flag1==1)f(sira+1,v2); } main(void){ scanf("%lld",&n); FOR{ scanf("%lld %lld",&p[i].fi,&p[i].se); } sort(p+1,p+n+1); FOR{ //~ cout<<cev<<endl; } vector<int> v3[4]; v3[0].clear(); v3[1].clear(); v3[2].clear(); f(1,v3); printf("%lld\n",add(cev,mod-1)); return 0; }

Compilation message (stderr)

port_facility.cpp:63: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:64:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%lld",&n);
  ~~~~~^~~~~~~~~~~
port_facility.cpp:66: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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...