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 optimize("Bismilahirrahmanirrahim")
//█▀█─█──█──█▀█─█▀█
//█▄█─█──█──█▄█─█■█
//█─█─█▄─█▄─█─█─█─█
//Allahuekber
//ahmet23 orz...
//FatihSultanMehmedHan
//YavuzSultanSelimHan
//AbdulhamidHan
//Sani buyuk Osman Pasa Plevneden cikmam diyor
#define author tolbi
#include <bits/stdc++.h>
using namespace std;
#define coutarr(x) for (auto &it : x) cout<<it<<" ";cout<<endl;
#define vint(x) vector<int> x
#define sortarr(x) sort(x.begin(), x.end())
#define sortrarr(x) sort(x.rbegin(), x.rend())
#define tol(bi) (1LL<<((int)(bi)))
typedef long long ll;
const int MOD = 1e9+7;
mt19937 ayahya(chrono::high_resolution_clock().now().time_since_epoch().count());
#include "vision.h"
void construct_network(int H, int W, int K) {
vector<int> final;
if (H*W==2){
if (K==1){
add_or({0,1});
}
else {
add_not(0);
}
return;
}
set<array<int,2>> st;
for (int i = 0; i < H; i++){
for (int j = 0; j < W; j++){
vector<int> arr;
for (int uza = 0; uza <= K; uza++){
int x = i+uza;
int y1 = j+(K-abs(uza));
int y2 = j-(K-abs(uza));
if (x<0 || x>=H) continue;
if (y1>=0 && y1<W && (st.find({i*W+j,x*W+y1})==st.end())){
st.insert({i*W+j,x*W+y1});
st.insert({x*W+y1,i*W+j});
arr.push_back(x*W+y1);
}
if (uza==0) continue;
if (y1==y2) continue;
if (y2>=0 && y2<W && (st.find({i*W+j,x*W+y2})==st.end())){
st.insert({i*W+j,x*W+y2});
st.insert({x*W+y2,i*W+j});
arr.push_back(x*W+y2);
}
}
if (arr.size()==0) continue;
int pos = add_xor(arr);
final.push_back(add_and({i*W+j,pos}));
}
}
add_or(final);
}
Compilation message (stderr)
vision.cpp:1: warning: ignoring '#pragma optimize ' [-Wunknown-pragmas]
1 | #pragma optimize("Bismilahirrahmanirrahim")
|
# | 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... |