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 "vision.h"
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
// #define int long long
typedef long long ll ;
const ll ooo = 1e14 ;
const ll oo = 2e9 ;
const double PI = acos(-1) ;
const ll M = 1e9 + 7 ;
const int N = 10000010 ;
map<pair<int , int> , int > mp ;
void construct_network(int H, int W, int K) {
vector<int> Ns , f;
for(int i = 0 ; i < H ; ++i){
for(int j = 0 ; j < W ; ++j){
for(int l = 0 ; l <= K ; l++){
int u = K - l ;
int nx = i + l , ny = j + u ;
int vl = i * W + j , vl1 = nx * W + ny;
//cout << "X : " << i << ' ' << j << endl;
if(min(nx , ny) >= 0 && nx < H && ny < W && !mp[{vl , vl1}]){
//cout << nx << ' ' << ny << endl;
mp[{vl , vl1}] = 1;
mp[{vl1 , vl}] = 1;
Ns = {vl , vl1};
int a = add_and(Ns);
f.push_back(a);
}
nx = i - l , ny = j + u;
vl1 = nx * W + ny;
if(min(nx , ny) >= 0 && nx < H && ny < W && !mp[{vl , vl1}]){
//cout << nx << ' ' << ny << endl;
mp[{vl , vl1}] = 1;
mp[{vl1 , vl}] = 1;
Ns = {vl , vl1};
int a = add_and(Ns);
f.push_back(a);
}
nx = i - l , ny = j - u;
vl1 = nx * W + ny;
if(min(nx , ny) >= 0 && nx < H && ny < W && !mp[{vl , vl1}]){
//cout << nx << ' ' << ny << endl;
mp[{vl , vl1}] = 1;
mp[{vl1 , vl}] = 1;
Ns = {vl , vl1};
int a = add_and(Ns);
f.push_back(a);
}
nx = i + l , ny = j - u;
vl1 = nx * W + ny;
if(min(nx , ny) >= 0 && nx < H && ny < W && !mp[{vl , vl1}]){
//cout << nx << ' ' << ny << endl;
mp[{vl , vl1}] = 1;
mp[{vl1 , vl}] = 1;
Ns = {vl , vl1};
int a = add_and(Ns);
f.push_back(a);
}
}
}
}
// int c = add_xor(Ns);
// add_not(c);
add_or(f);
return ;
}
// freopen("C:\\Users\\mhmdsa\\Documents\\c++\\input.txt" , "r" , stdin );
// freopen("C:\\Users\\mhmdsa\\Documents\\c++\\output.txt" , "w" , stdout );
# | 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... |