제출 #858709

#제출 시각아이디문제언어결과실행 시간메모리
858709omeygunner죄수들의 도전 (IOI22_prison)C++17
0 / 100
0 ms348 KiB
#include "prison.h" #include <vector> using namespace std; int digit(int num, int place,int base){ for(int i=0;i<place;i++){ num = num/base; } return num%base; } std::vector<std::vector<int>> devise_strategy(int N) { vector<vector<int> > ans; vector<int> v; v.push_back(0); for(int i=1;i<=N;i++){ int s = 3; int f = digit(i,s,3); v.push_back(s + f*8 + 1); } ans.push_back(v); for(int f=0;f<3;f++){ for(int s=0;s<8;s++){ vector<int> v; int encoded = s + f*8 + 1; //If given number is of A, check B, vice verca if(s%2 == 1){ v.push_back(1); } else{ v.push_back(0); } // for(int i=0;;) for(int i=1;i<=N;i++){ int rf,rs; if(s>0) rs = s - 1; else{ rs = 0; } rf = digit(i,rs,3); int d,e; if(v[0] == 1){ d = -2; e = -1; } else { d = -1; e = -2; } if(rf > f){ v.push_back(d); } else if(rf < f){ v.push_back(e); } else{ int encoded2 = rs + rf*8 + 1; v.push_back(encoded2); } } ans.push_back(v); } } // for(auto v:ans){ // for(auto j:v){ // printf("%d ",j); // } // printf("\n"); // } return ans; }

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

prison.cpp: In function 'std::vector<std::vector<int> > devise_strategy(int)':
prison.cpp:33:9: warning: unused variable 'encoded' [-Wunused-variable]
   33 |     int encoded = s + f*8 + 1;
      |         ^~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...