답안 #1064907

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1064907 2024-08-18T19:14:37 Z Ahmed57 Vision Program (IOI19_vision) C++17
컴파일 오류
0 ms 0 KB
#include "bits/stdc++.h"
using namespace std;
#include "vision.h"

void construct_network(int H, int W, int K){
    for(int i = 0;i<H;i++){
        vector<int> v;
        for(int j = 0;j<W;j++){
            v.push_back(i*W+j);
        }
        int val = add_xor(v);
    }
    for(int j = 0;j<W;j++){
        vector<int> v;
        for(int i = 0;i<H;i++){
            v.push_back(i*W+j);
        }
        int val = add_xor(v);
    }
    int init = H*W;
    for(int i = 0;i<H;i++){
        vector<int> v;
        v.push_back(init+i);
        if(i)v.push_back(init+H+W+i-1);
        int val = add_xor(v);
    }
    init = H*W+H;
    for(int i = 0;i<W;i++){
        vector<int> v;
        v.push_back(init+i);
        if(i)v.push_back(init+H+W+i-1);
        int val = add_xor(v);
    }
    init = H*W+H+W;
    int val = add_not(init);
    vector<int> bits;
    for(int i = 0;i<15;i++){
        bits.push_back(add_and({val,init}));
    }
    for(int i = 0;i<H+W;i++){
        vector<int> nbits;
        vector<int> lol = {init+i};
        for(int i = 0;i<15;i++){
            int val = add_and(val);
            nbits.push_back(add_xor({val,bits[i]}));
            lol.push_back(bits[i]);
        }
        bits=nbits;
    }
    vector<int> nbits;
    for(int i = 0;i<15;i++){
        if(K&(1<<i)){
            nbits.push_back(bits[i]);
        }else nbits.push_back(add_not(bits[i]));
    }
    int val = add_and(nbits);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:11:13: warning: unused variable 'val' [-Wunused-variable]
   11 |         int val = add_xor(v);
      |             ^~~
vision.cpp:18:13: warning: unused variable 'val' [-Wunused-variable]
   18 |         int val = add_xor(v);
      |             ^~~
vision.cpp:25:13: warning: unused variable 'val' [-Wunused-variable]
   25 |         int val = add_xor(v);
      |             ^~~
vision.cpp:32:13: warning: unused variable 'val' [-Wunused-variable]
   32 |         int val = add_xor(v);
      |             ^~~
vision.cpp:44:31: error: could not convert 'val' from 'int' to 'std::vector<int>'
   44 |             int val = add_and(val);
      |                               ^~~
      |                               |
      |                               int
vision.cpp:56:9: error: redeclaration of 'int val'
   56 |     int val = add_and(nbits);
      |         ^~~
vision.cpp:35:9: note: 'int val' previously declared here
   35 |     int val = add_not(init);
      |         ^~~