Submission #1285769

#TimeUsernameProblemLanguageResultExecution timeMemory
1285769MMihalev축구 경기장 (IOI23_soccer)C++20
Compilation error
0 ms0 KiB
#include<iostream> #include<vector> #include<algorithm> #include<tuple> #include<queue> #include "soccer.h" using namespace std; const int MAX_N=2e3+3; int a[MAX_N][MAX_N]; int p[MAX_N][MAX_N]; int n; bool allempty(int x1,int y1,int x2,int y2) { int x11=min(x1,x2),x22=max(x1,x2); int y11=min(y1,y2),y22=max(y1,y2); x1=x11+1;y1=y11+1;x2=x22+1;y2=y22+1; if(p[x2][y2]-p[x1-1][y2]-p[x2][y1-1]+p[x1-1][y1-1]==(x2-x1+1)*(y2-y1+1))return 1; return 0; } bool reacheable(int x1,int y1,int x2,int y2) { if(allempty(x1,y1,x2,y1) && allempty(x2,y1,x2,y2))return 1; if(allempty(x1,y1,x1,y2) && allempty(x1,y2,x2,y2))return 1; return 0; } bool checkslow() { vector<pair<int,int>>cells; for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { if(a[i][j]==0)cells.push_back({i,j}); } } for(int i=0;i<cells.size();i++) { for(int j=i+1;j<cells.size();j++) { if(!reacheable(cells[i].first,cells[i].second,cells[j].first,cells[j].second))return 0; } } return 1; } vector<pair<int,int>>intervals; bool inside(int i,int j) { if(intervals[j].first<=intervals[i].first && intervals[j].second>=intervals[i].second)return 1; return 0; } bool check() { intervals.clear(); int hasprev=0,haslast=0; for(int i=0;i<n;i++) { int f=-1,s=-2; for(int j=0;j<n;j++) { if(a[i][j]==0) { if(f==-1)f=j; s=j; } } for(int j=f;j<=s;j++) { if(a[i][j])return 0; } int hasnow=(f!=-1 ? 1 : 0); if(hasnow) { intervals.push_back({f,s}); if(haslast==0 && hasprev)return 0; } haslast=hasnow; hasprev=max(hasprev,hasnow); } for(int i=1;i<intervals.size();i++) { if(inside(i-1,i)){seq=1;continue;} for(int j=0;j<i;j++) { if(inside(i,j) or inside(j,i))continue; return 0; } for(int j=i+1;j<intervals.size();j++) { if(inside(j,j-1))continue; return 0; } return 1; } return 1; } int biggest_stadium(int N, std::vector<std::vector<int>> F) { n=N; int empsz=0; for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { a[i][j]=F[i][j]; if(a[i][j]==0)empsz++; } } for(int i=1;i<=n;i++) { for(int j=1;j<=n;j++) { p[i][j]=(a[i-1][j-1]==0)+p[i-1][j]+p[i][j-1]-p[i-1][j-1]; } } /*if(checkslow()!=check()) { for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { cout<<a[i][j]<<" "; } cout<<"\n"; } return 1; } return 0;*/ if(check())return empsz; return -1; }

Compilation message (stderr)

soccer.cpp: In function 'bool check()':
soccer.cpp:84:27: error: 'seq' was not declared in this scope; did you mean '__pstl::execution::v1::seq'?
   84 |         if(inside(i-1,i)){seq=1;continue;}
      |                           ^~~
      |                           __pstl::execution::v1::seq
In file included from /usr/include/c++/13/pstl/glue_algorithm_defs.h:15,
                 from /usr/include/c++/13/algorithm:73,
                 from soccer.cpp:3:
/usr/include/c++/13/pstl/execution_defs.h:110:46: note: '__pstl::execution::v1::seq' declared here
  110 | _GLIBCXX17_INLINE constexpr sequenced_policy seq{};
      |                                              ^~~