#include <bits/stdc++.h>
#include "vision.h"
// #include "grader.cpp"
using namespace std;
#define ll long long
// #define int ll
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) for (int i = (n)-1; i >= 0; i--)
#define RREP1(i, n) for (int i = (n); i >= 1; i--)
#define REP1(i, n) FOR(i, 1, n+1)
#define pii pair<int, int>
#define ppi pair<pii, int>
#define pip pair<int, pii>
#define f first
#define s second
#define pb push_back
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) (int)((x).size())
#define endl '\n'
#define IOS() ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
const ll maxn = 2e5+5;
const ll inf = 1e9;
const ll mod = 998244353;
ll pw(ll x, ll p, ll m){
ll ret = 1;
while(p > 0){
if (p & 1){
ret *= x;
ret %= m;
}
x *= x;
x %= m;
p >>= 1;
}
return ret;
}
ll inv(ll x, ll m){
return pw(x, m-2, m);
}
void construct_network(int H, int W, int K) {
/*std::vector<int> Ns;
Ns = {0, 1};
int a = add_and(Ns);
Ns = {0, a};
int b = add_or(Ns);
Ns = {0, 1, b};
int c = add_xor(Ns);
add_not(c);
*/
vector<vector<int>> pos;
REP(i, H){
REP(j, W){
FOR(a, i, H){
REP(b, W){
if (abs(a-i) + abs(b-j) == K){
pos.pb({i*W+j, a*W+b});
}
}
}
}
}
random_shuffle(ALL(pos));
vector<int> tt;
REP(i, SZ(pos)){
tt.pb(i+H*W);
int ret = add_and(pos[i]);
if (ret == 1){
add_and({pos[i][0]});
return;
}
}
add_or(tt);
return;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |