이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |