This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#pragma GCC optimize("unroll-loops,Ofast,O3")
#include <bits/stdc++.h>
#include "vision.h"
#define pb push_back
#define mp make_pair
#define spc << " " <<
#define endl "\n"
#define all(x) x.begin(), x.end()
//#define int long long
#define ii pair<long long,int>
#define vi vector<int>
#define vii vector<ii>
#define st first
#define nd second
#define inf 1e15
#define MOD 1000000007
#define MX 50005
using namespace std;
void construct_network(int H, int W, int K){
vi results;
for(int i=0; i<H; i++){
for(int j=0; j<W; j++){
vi ors;
for(int k=0; k<=K; k++){
if(i+k<H && j+K-k<W) ors.pb((i+k)*W+(j+K-k));
if(i+k<H && j-K+k>=0) ors.pb((i+k)*W+(j-K+k));
if(i-k>=0 && j+K-k<W) ors.pb((i-k)*W+(j+K-k));
if(i-k>=0 && j-K+k>=0) ors.pb((i-k)*W+(j-K+k));
}
if(ors.empty()) continue;
results.pb(add_and({i*W+j, add_or(ors)}));
}
}
add_or(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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |