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 <stdio.h>
#include <vector>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>
#include <bitset>
#include <map>
#include <set>
#include <tuple>
#include <string.h>
#include <math.h>
#include <random>
#include <functional>
#include <assert.h>
#include <math.h>
#define all(x) (x).begin(), (x).end()
#define xx first
#define yy second
using namespace std;
template<typename T, typename Pr = less<T>>
using pq = priority_queue<T, vector<T>, Pr>;
using i64 = long long int;
using ii = pair<int, int>;
using ii64 = pair<i64, i64>;
vector<vector<int>> devise_strategy(int N) {
vector<vector<int>> res(42, vector<int>(N + 1, 0));
for (int num = 0; num <= 13; num++)
{
int bit = (1 << (13 - num));
res[num][0] = 0;
for (int a = 1; a <= N; a++)
{
if ((a & bit) != 0)
res[num][a] = 14 + num * 2 + 1;
else
res[num][a] = 14 + num * 2;
}
}
for (int num = 14; num < 42; num++)
{
res[num][0] = 1;
int ahas = num % 2;
int bit = 1 << (13 - (num - 14) / 2);
for (int b = 1; b <= N; b++)
{
int bhas = (b & bit) != 0 ? 1 : 0;
if (ahas == bhas)
res[num][b] = (num - 13) / 2 + 1;
else if (ahas > bhas)
res[num][b] = -2;
else
res[num][b] = -1;
}
}
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |