Submission #1062319

#TimeUsernameProblemLanguageResultExecution timeMemory
1062319sleepntsheepPort Facility (JOI17_port_facility)C11
Compilation error
0 ms0 KiB
#include <stdio.h> #include<utility> #include<algorithm> #include<vector> #include<queue> using namespace std; const int N=2005; int n,a[N],b[N]; vector<int>g[N]; int cut(int i, int j){ return (a[i]<a[j] and b[i] > a[j] and b[i]<b[j]) or(a[j]<a[i] and b[j]>a[i] and b[j]<b[i]); } int main() { scanf("%d",&n); for(int i=0;i<n;++i)scanf("%d%d",a+i,b+i); for(int i=0;i<n;++i)for(int j=0;j<n;++j)if(cut(i,j)){ g[i].push_back(j); } int comp{}; vector<int>col(n),pw2(n); pw2[0]=1;for(int i=1;i<n;++i)pw2[i]=pw2[i-1]*2%1000000007; for(int i=0;i<n;++i){ if(col[i])continue; queue<int>q; q.push(i);col[i]=1; while(q.size()){ auto u=q.front();q.pop(); for(auto v:g[u]) if(0==col[v])col[v]=col[u]==1?2:1,q.push(v); else if(col[v]==col[u]) return 0*puts("0"); } ++comp; } printf("%d\n",pw2[comp]); }

Compilation message (stderr)

port_facility.c:2:9: fatal error: utility: No such file or directory
    2 | #include<utility>
      |         ^~~~~~~~~
compilation terminated.