Submission #286793

# Submission time Handle Problem Language Result Execution time Memory
286793 2020-08-30T22:47:10 Z medmdg Vision Program (IOI19_vision) C++14
0 / 100
2 ms 1148 KB
#include<bits/stdc++.h>
#include "vision.h"
using namespace std;

void construct_network(int H, int W, int K){
    int b1=-1,b2;
    for(int i=0;i<H*W;i+=20){
        vector<int> h;
        for(int j=i;j<min(i+20,H*W);j++){
            h.push_back(j);
        }
        if(add_or(h)){
            for(int j=i;j<min(H*W,i+20);j++){
                if(add_not(j)==0){
                    if(b1==-1){
                        b1=j;
                    }else{
                        b2=j;
                    }
                }
            }
        }
    }
        int x1=b1%W;
        int x2=b2%W;
        int y1=b1/W;
        int y2=b2/W;
        bool tr=false;
        if(abs(x1-x2)+abs(y1-y2)==K){
            tr=true;
        }
        vector<int> h;
        h.push_back(b1);
        if(tr){
            int f=add_or(h);
        }else{
            int f=add_not(b1);
        }
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:35:17: warning: unused variable 'f' [-Wunused-variable]
   35 |             int f=add_or(h);
      |                 ^
vision.cpp:37:17: warning: unused variable 'f' [-Wunused-variable]
   37 |             int f=add_not(b1);
      |                 ^
vision.cpp:6:15: warning: 'b2' may be used uninitialized in this function [-Wmaybe-uninitialized]
    6 |     int b1=-1,b2;
      |               ^~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 1148 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -