제출 #627253

#제출 시각아이디문제언어결과실행 시간메모리
627253haojiandan죄수들의 도전 (IOI22_prison)C++17
0 / 100
6 ms672 KiB
#include "prison.h" #include <bits/stdc++.h> using namespace std; int bel[5010]; vector<vector<int>> devise_strategy(int n) { vector<vector<int> > res(22,vector<int>(n+1)); for (int I=0;I<7;I++) { int L=I*3,R=L+2; for (int i=L;i<=R;i++) res[i][0]=I&1; int A=-1,B=-2; if (I&1) swap(A,B); for (int i=L;i<=R;i++) { int l=-1,r=-1; for (int j=1;j<=n;j++) { if (bel[j]<i) res[i][j]=A; else if (bel[j]>i) res[i][j]=B; else { if (l==-1) l=j; r=j; } } if (l!=-1) { res[i][l]=A,res[i][r]=B; int p=R,len=(r-1-l+2)/3; for (int k=l+1;k<r;k++) { if ((k-l-1)%len==0) p++; res[i][k]=min(p,21); } } } for (int i=1;i<=n;i++) if (bel[i]>=L&&bel[i]<=R) { bel[i]=res[bel[i]][i]; if (bel[i]==B) bel[i]=1e9; } } return res; }

컴파일 시 표준 에러 (stderr) 메시지

prison.cpp: In function 'std::vector<std::vector<int> > devise_strategy(int)':
prison.cpp:17:6: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   17 |      if (l==-1) l=j; r=j;
      |      ^~
prison.cpp:17:22: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   17 |      if (l==-1) l=j; r=j;
      |                      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...