# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1078755 | LittleOrange | Prisoner Challenge (IOI22_prison) | C++17 | 1 ms | 604 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "prison.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
using ll = int;
std::vector<std::vector<int>> devise_strategy(int N) {
ll n = N;
ll lvl = __lg(n)+1;
ll x = lvl*2+3;
vector<vector<ll>> ret;
vector<ll> mp;
{
vector<ll> a(n+1,0);
for(ll i = 1;i<=n;i++) a[i] = (i>>lvl&1)?1:2;
ret.push_back(a);
}
for(ll j = 0;j<=12;j++){
ll h = lvl-j;
ll tp = j&1^1;
{
vector<ll> a(n+1,tp);
for(ll i = 1;i<=n;i++){
if (i>>h&1) a[i] = min(x,((i<<1>>h&1)?1:2)+j*2+2);
else a[i] = -1-tp;
}
ret.push_back(a);
}
{
vector<ll> a(n+1,tp);
for(ll i = 1;i<=n;i++){
if (i>>h&1^1) a[i] = min(x,((i<<1>>h&1)?1:2)+j*2+2);
else a[i] = -2+tp;
}
ret.push_back(a);
}
}
//cerr << ret.size() << "\n";
//for(auto &o : ret){
// for(ll i = 0;i<=n;i++) cerr << o[i] << " \n"[i+1==n];
//}
return ret;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |