제출 #1164440

#제출 시각아이디문제언어결과실행 시간메모리
1164440SmuggingSpunPrisoner Challenge (IOI22_prison)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #include "prison.h" using namespace std; vector<vector<int>>devise_strategy(int n){ vector<vector<int>>s(27, vector<int>(n + 1)); s[0][0] = 0; for(int i = 1; i <= n; i++){ s[0][i] = ((i & 4096) ? 2 : 1); } for(int i = 1; i < 27; i++){ bool on = (i & 1) ^ 1; int bit = 12 - ((i - 1) >> 1); if(bit & 1){ s[i][0] = 0; for(int j = 1; j <= n; j++){ if(1 << bit & j){ s[i][j] = (on ? i + 2 : -2); } else{ s[i][j] = (on ? i + 2 : -1); } } } else{ s[i][0] = 1; for(int j = 1; j <= n; j++){ if(1 << bit & j){ s[i][j] = (on ? i + 2 : -1) } else{ s[i][j] = (on ? -2 : i + 2); } } } } return s; }

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

prison.cpp: In function 'std::vector<std::vector<int> > devise_strategy(int)':
prison.cpp:28:48: error: expected ';' before '}' token
   28 |                     s[i][j] = (on ? i + 2 : -1)
      |                                                ^
      |                                                ;
   29 |                 }
      |                 ~