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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long double ld;
typedef pair<ll, ll> pll;
#define FOR(i, a, b) for(int i = a; i < b; i++)
#define ROF(i, a, b) for(int i = a; i >= b; i--)
#define ms memset
#define pb push_back
#define fi first
#define se second
vector<vi> devise_strategy(int N) {
vector<vi> ans;
// i=0
vi ans0(N+1); FOR(i,1,N+1){
if ((i&(1<<12)) != 0) ans0[i]=1;
else ans0[i]=2;
}
ans.pb(ans0);
// i=1 to x
FOR(i,1,13){
vi ans1(N+1); // if bit is on
vi ans2(N+1); // if bit is off
ans1[0] = (i%2); ans2[0] = (i%2);
FOR(j,1,N+1){
if ((j&(1<<(13-i))) != 0){
if ((j&(1<<(12-i))) != 0) ans1[j] = 2*i+1;
else ans1[j] = 2*i+2;
ans2[j] = (i%2) - 2; // person i%2 wins
}else{
ans1[j] = -1 - (i%2); // per
if ((j&(1<<(12-i))) != 0) ans2[j] = 2*i+1;
else ans2[j] = 2*i+2;
}
}
ans.pb(ans1);
ans.pb(ans2);
}
vi ans1(N+1), ans2(N+1);
ans1[0]=1; ans2[0]=1;
FOR(i,1,N+1){
if (i%2==1){
ans2[i]=-1;
}else{
ans1[i]=-2;
}
}
ans.pb(ans1); ans.pb(ans2);
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |