Submission #1077152

#TimeUsernameProblemLanguageResultExecution timeMemory
1077152pccPrisoner Challenge (IOI22_prison)C++17
30 / 100
545 ms2896 KiB
#include "prison.h" #include <vector> #include <bits/stdc++.h> using namespace std; std::vector<std::vector<int>> devise_strategy(int N) { int ans = 13*2*2;//nowbit,turn,bit of a vector<vector<int>> re(ans,vector<int>(N+1,-1)); for(int i = 0;i<ans;i++){ int turn = ((i>>1)&1); int tar = 12-(i>>2); int bit = i&1; if(turn == 0)re[i][0] = 0; else re[i][0] = 1; for(int j = 1;j<=N;j++){ if(turn == 0){ re[i][j] = (i/4*4)|2|((j>>tar)&1); } else{ if(bit != ((j>>tar)&1)){ if((j>>tar)&1)re[i][j] = -1; else re[i][j] = -2; } else{ re[i][j] = ((i/4+1)*4); if(re[i][j]>=ans)re[i][j] = -1; } } } } for(int i = 0;i<ans;i++){ if(re[i][0] < 0)re[i][0] = 0; for(int j = 0;j<=N;j++)assert(re[i][j]<ans); cerr<<i<<":"; for(int j = 0;j<=N;j++)cerr<<re[i][j]<<' ';cerr<<endl; } cerr<<"INIT DONE!"<<endl; return re; }

Compilation message (stderr)

prison.cpp: In function 'std::vector<std::vector<int> > devise_strategy(int)':
prison.cpp:36:3: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   36 |   for(int j = 0;j<=N;j++)cerr<<re[i][j]<<' ';cerr<<endl;
      |   ^~~
prison.cpp:36:46: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   36 |   for(int j = 0;j<=N;j++)cerr<<re[i][j]<<' ';cerr<<endl;
      |                                              ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...