Submission #1195297

#TimeUsernameProblemLanguageResultExecution timeMemory
1195297nikulidVision Program (IOI19_vision)C++20
Compilation error
0 ms0 KiB
#include "vision.h" #include <math.h> #include <vector> using namespace std; int dist(int a, int b, int w){ int ra, ca, rb, cb; ra = a%w; rb = b%w; ca = a/w; cb = b/w; return abs(ra-rb)+abs(ca-cb); } void construct_network(int H, int W, int K) { // subtask everything: // this is such krazy problem: I like a lot // thus I have decided to not attempt q3 and just waste the rest of my time getting what will likely be 0 on q2 // :sunglasses: vector<int> ns, pns; vector<int> rows; // indices of XORs of rows vector<int> columns; // indices of XORs of columns // handle each horizontal row (whatever that means) (I just yap) int i_want_a_banana = true; for(int y=0; y<H; y++){ ns.clear(); for(int x=0; x<W; x++){ ns.push_back(y*W + x); } i_want_a_banana = add_xor(ns); rows.push_back(i_want_a_banana); } for(int x=0; x<W; x++){ ns.clear(); for(int y=0; y<H; y++){ ns.push_back(y*W + x); } i_want_a_banana = add_xor(ns); columns.push_back(i_want_a_banana); } vector<int> all_working_scenarios; vector<int> deltas; int P1, P2, FP1, FP2; if(K==1){ // let's handle this subtask real quick (subtask 7) // I do want 14 marks after all :yum: // (a,b) === (row[], column[]) === (y,x) // scenario 1: difference of indices are (0+1) // we need straight 0s in `rows` i_want_a_banana = add_or(rows); P1 = add_not(i_want_a_banana); // <=> we need P1=true // and we need one pair of contiguous 1s in `columns` // <=> we need there to be a distance of `1` inbetween the 1s in `columns` for(int i=1; i<W; i++){ ns = {columns[i-1], columns[i]}; i_want_a_banana = add_and(ns); pns.push_back(i_want_a_banana); } P2 = add_or(pns); // <=> we need P2=true // ;) FP1 = add_and(P1, P2); // scenario 2: difference of indices are (1+0) // we need straight 0s in `columns` i_want_a_banana = add_or(columns); P1 = add_not(i_want_a_banana); // <=> we need P1 = true // and we need one pair of contiguous 1s in `rows` // <=> we need there to be a distance of `1` inbetween the 1s in `columns` for(int i=1; i<H; i++){ ns = {rows[i-1], rows[i]}; i_want_a_banana = add_and(ns); pns.push_back(i_want_a_banana); } P2 = add_or(pns); // <=> we need P2=true FP2 = add_and(P1, P2); add_or(FP1, FP2); } }

Compilation message (stderr)

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:76:31: error: could not convert 'P1' from 'int' to 'std::vector<int>'
   76 |                 FP1 = add_and(P1, P2);
      |                               ^~
      |                               |
      |                               int
vision.cpp:95:31: error: could not convert 'P1' from 'int' to 'std::vector<int>'
   95 |                 FP2 = add_and(P1, P2);
      |                               ^~
      |                               |
      |                               int
vision.cpp:97:24: error: could not convert 'FP1' from 'int' to 'std::vector<int>'
   97 |                 add_or(FP1, FP2);
      |                        ^~~
      |                        |
      |                        int