제출 #829243

#제출 시각아이디문제언어결과실행 시간메모리
829243caganyanmaz죄수들의 도전 (IOI22_prison)C++17
0 / 100
1 ms468 KiB
#include <bits/stdc++.h> #include "prison.h" #ifdef DEBUGGING #include "../debug.h" #else #define debug(x...) void(42) #endif #include <vector> using namespace std; int x = 23; vector<vector<int>> devise_strategy(int N) { int n = N; vector<vector<int>> v(x+1, vector<int>(n+1)); debug(v); v[0][0] = 0; for (int i = 1; i <= n; i++) { v[0][i] = 21+(i>>(12)); } debug(v); for (int i = 12; i >= 3; i--) { int a = (i-2) * 2 + 1; debug(i, a, a+1); int current = (i+1)&1; // 0 a, 1 b int rmask = (1<<i) - 1; v[a][0] = v[a+1][0] = current; for (int j = 1; j <= n; j++) { int draw; if (j&(1<<i)) { v[a][j] = 2 - current; draw = a+1; } else { draw = a; v[a+1][j] = - 1 - current; } if ((j&rmask) == 0) v[draw][j] = - 1 - current; else if ((j&rmask) == rmask) v[draw][j] = 2-current; else v[draw][j] = a-2+((j>>(i-1))&1); } } debug(v); v[1][0] = v[2][0] = 1; for (int i = 1; i <= n; i++) { int draw; if (i&4) { v[1][i] = -1; if ((i&3) == 2) v[2][i] = -1; else if ((i&3) == 0) v[2][i] = -2; else v[2][0] = 23; } else { v[2][i] = -2; if ((i&3) == 1) v[1][i] = -2; else if ((i&3) == 3) v[1][i] = -1; else v[1][i] = 23; } } debug(v); v[23][0] = 0; for (int i = 1; i <= n; i++) { if (i&2) v[23][i] = -2; else v[23][i] = -1; } return v; }

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

prison.cpp: In function 'std::vector<std::vector<int> > devise_strategy(int)':
prison.cpp:57:7: warning: unused variable 'draw' [-Wunused-variable]
   57 |   int draw;
      |       ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...