Submission #152058

# Submission time Handle Problem Language Result Execution time Memory
152058 2019-09-06T07:25:29 Z beso123 Vision Program (IOI19_vision) C++14
0 / 100
11 ms 1092 KB
#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=-1,y=0,x2=-1,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 o=add_or(v);
if(o==1){
if(x==-1)
    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 o=add_or(v);
if(o==1){
if(y==-1)
    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

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:28:1: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
 if(ind==1)
 ^~
vision.cpp:30:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
     ind=0;
     ^~~
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 348 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 348 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 348 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 348 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB on inputs (0, 0), (1, 0), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 11 ms 1092 KB on inputs (196, 156), (197, 156), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 348 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -