제출 #1039370

#제출 시각아이디문제언어결과실행 시간메모리
1039370Maite_Morale죄수들의 도전 (IOI22_prison)C++17
65 / 100
9 ms1116 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; ll x=24; ll bsbit=8; ll r[2]={-1,-2};//Respuesta vector<int> bs={2187,729,243,81,27,9,3,1}; std::vector<std::vector<int>> devise_strategy(int N) { vector<vector<int>> v (x+1,vector<int> (N + 1, 0)); for(int i=0;i<=x;i++){ if(i==0){ v[0][0]=1; for(int j=1;j<=N;j++){ ll valuebit=(j/bs[0])%3; v[i][j]=1+(valuebit*bsbit+0); //cerr<<v[i][j]<<" "; }//cerr<<"\n\n"; continue; }//cout ll inf=i-1; ll bit=inf%bsbit; ll value=inf/bsbit; v[i][0]=bit%2; for(int j=1;j<=N;j++){ ll valuebit=(j/bs[bit])%3; ll valuenext=0; if(bit+1<bs.size())valuenext=(j/bs[bit+1])%3; if(value==valuebit){ v[i][j]=1+(valuenext*bsbit+bit+1); } else{ if(valuebit<value)v[i][j]=r[v[i][0]]; else v[i][j]=r[v[i][0]^1]; } //cerr<<v[i][j]<<" "; }//cerr<<"\n\n"; } return v; }

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

prison.cpp: In function 'std::vector<std::vector<int> > devise_strategy(int)':
prison.cpp:27:19: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |           if(bit+1<bs.size())valuenext=(j/bs[bit+1])%3;
      |              ~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...