제출 #1056225

#제출 시각아이디문제언어결과실행 시간메모리
1056225epicci23죄수들의 도전 (IOI22_prison)C++17
컴파일 에러
0 ms0 KiB
#include "bits/stdc++.h" #include "prison.h" #define all(v) v.begin() , v.end() #define sz(a) (int)a.size() using namespace std; vector<vector<int>> devise_strategy(int N) { vector<vector<int> v(27,vector<int>(N+1)); v[0][0]=0; for(int i=1;i<=N;i++) v[0][i]=1+(a>>12); for(int i=1;i<=26;i++){ if((i-1)%4<=1) v[i][0]=1; else v[i][0]=0; } for(int j=12;j>=1;j--){ for(int i=1;i<=N;i++){ int xd=i>>j&1; int xd2=!((i>>(j-1))&1); if(xd){ v[(13-j)*2][i]=(14-j)*2-xd2; v[(13-j)*2-1][i]=-1; } else{ v[(13-j)*2][i]=-2; v[(13-j)*2-1][i]=(14-j)*2-xd2; } } } for(int i=1;i<=N;i++){ if(i&1) v[25][i]=-1; else v[25][i]=0; if(i&1) v[26][i]=0; else v[26][i]=-2; } return v; } /*void _(){ } int32_t main(){ cin.tie(0); ios::sync_with_stdio(0); int tc=1;//cin >> tc; while(tc--) _(); return 0; }*/

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

prison.cpp: In function 'std::vector<std::vector<int> > devise_strategy(int)':
prison.cpp:10:43: error: template argument 1 is invalid
   10 |   vector<vector<int> v(27,vector<int>(N+1));
      |                                           ^
prison.cpp:10:43: error: template argument 2 is invalid
prison.cpp:11:3: error: 'v' was not declared in this scope
   11 |   v[0][0]=0;
      |   ^
prison.cpp:12:36: error: 'a' was not declared in this scope
   12 |   for(int i=1;i<=N;i++) v[0][i]=1+(a>>12);
      |                                    ^