Submission #790959

#TimeUsernameProblemLanguageResultExecution timeMemory
790959penguinmanPrisoner Challenge (IOI22_prison)C++17
0 / 100
1 ms300 KiB
#include "prison.h"

#include <bits/stdc++.h>

using std::vector;
using std::string;
using std::cin;
using std::cout;
using ll = int;
using vi = vector<ll>;
using vii = vector<vi>;
using pii = std::pair<ll,ll>;
#define ln "\n"
#define rep(i,j,k) for(ll i=ll(j); i<ll(k); i++)
#define REP(i,j,k) for(ll i=ll(j); i<=ll(k); i++)
#define per(i,j,k) for(ll i=ll(j); i>=ll(k); i--)
#define all(a) a.begin(), a.end()
#define mp std::make_pair
#define pb emplace_back

std::vector<std::vector<int>> devise_strategy(int N) {
  constexpr ll log = 13;
  constexpr ll x = log*3;
  vii ret(x+1, vi(N+1));
  REP(i,0,log*3){
    ll bit = i/3;
    if(i%3 == 2){
      ret[i][0] = 0;
      REP(j,1,N){
        if(j & (1ll<<bit)) ret[i][j] = bit*3+1;
        else ret[i][j] = bit*3;
      }
    }
    else{
      ret[i][0] = 1;
      REP(j,1,N){
        ll A = i%3;
        ll B = 0;
        if(j & (1ll<<bit)) B = 1;
        if(A == B){
          ll nbit = bit-1;
          ret[i][j] = nbit*3+2;
        }
        else if(A < B){
          ret[i][j] = -1;
        }
        else{
          ret[i][j] = -2;
        }
      }
    }
  }
  return ret;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...