#include<iostream>
#include<vector>
#include<queue>
#include<deque>
#include<string>
#include<fstream>
#include<algorithm>
#include <iomanip>
#include<map>
#include <set>
#include <unordered_map>
#include <stack>
#include <unordered_set>
#include <cmath>
#include <cstdint>
#include <cassert>
#include <bitset>
#include <random>
#include <chrono>
#include <cstring>
#define shit short int
#define ll long long
#define ld long double
//#define int ll
#define For(i, n) for(int i = 0; i < (int)n; i++)
#define ffor(i, a, n) for(int i = (int)a; i < (int)n; i++)
#define rfor(i, n) for(int i = (int)n; i >= (int)0; i--)
#define rffor(i, a, n) for(int i = (int)n; i >= (int)a; i--)
#define vec vector
#define ff first
#define ss second
#define pb push_back
#define pii pair<long double, long double>
#define pld pair<ld, ld>
#define NEK 200000000000000
#define mod 1000000007
#define mod2 1000000009
#define rsz resize
#define prv 43
#define prv2 47
#define D 8
#define trav(a,x) for (auto& a: x)
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define all(x) (x).begin(), (x).end()
#define sig 0.0000001
using namespace std;
int daj(int a, int ktore) {
for (int k = 0; k < ktore; k++) {
a /= 4;
}
a %= 4;
return a;
}
vec<vec<int>> devise_strategy(int n) {
int x = 40;
vec<vec<int>> s(x + 1, vec<int>(n));
s[0][0] = 0;
for (int j = 2; j < n; j++) {
s[0][j] = 8 * daj(j, 0);
}
ffor(i, 1, x + 1) {
s[i][0] = 1 - (i % 2);
for (int j = 2; j < n; j++) {
//na tabuly je napisane i, ja som v krabici videl j
int ktore = (i-1) % 8;
int kolko = ((i-1) / 8) % 8;
int hod = daj(j, ktore);
if (hod == kolko) {
s[i][j] = (ktore + 1) + 8 * daj(j, ktore + 1) + 1;
}
else {
if (hod < kolko) {
s[i][j] = (-1) * (1 + s[i][0]) + 1;
}
if (hod > kolko) {
s[i][j] = (-1) * (2 - s[i][0]) + 1;
}
}
}
}
return s;
}
/*
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, m;
cin >> n >> m;
vec<int> x(m), y(m), w(m);
For(i, m) {
cin >> x[i] >> y[i] >> w[i];
}
cout << max_weights(n, m, x, y, w) << '\n';
return 0;
}*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |