# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
152055 | beso123 | Vision Program (IOI19_vision) | C++14 | 10 ms | 1116 KiB |
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 <bits/stdc++.h>
#include "vision.h"
using namespace std;
int h,w;
int to(int x,int y){
int j=w*x+y;
return j;
}
void construct_network(int H, int W, int K){
h=H;
w=W;
int ind=0,x=0,y=0,x2=0,y2=0;
for(int k=0;k<H;k++){
vector <int> v;
for(int i=0;i<W;i++){
int j=to(k,i);
v.push_back(j);
}
int i=add_or(v);
if(i==1){
if(x==0)
x=k;
else x2=k;
ind++;
}
}
if(ind==1)
x2=x;
ind=0;
for(int k=0;k<W;k++){
vector <int> v;
for(int i=0;i<H;i++){
int j=to(i,k);
v.push_back(j);
}
int i=add_or(v);
if(i==1){
if(y==0)
y=k;
else y2=k;
ind++;
}
}
if(ind==1)
y2=y;
int p=abs(x-x2)+abs(y-y2);
if(p==K){
vector <int> sab;
sab.push_back(to(x,x2));
add_and(sab);
}
}
Compilation message (stderr)
# | 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... |