답안 #760399

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
760399 2023-06-17T14:34:16 Z raysh07 Vision Program (IOI19_vision) C++17
컴파일 오류
0 ms 0 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;

void construct_network(int h, int w, int k) {
// 	std::vector<int> Ns;
// 	Ns = {0, 1};
// 	int a = add_and(Ns);
// 	Ns = {0, a};
// 	int b = add_or(Ns);
// 	Ns = {0, 1, b};
// 	int c = add_xor(Ns);
// 	add_not(c);
    vector <int> a;
    for (int i = 0; i < h; i++){
        for (int j = 0; j < w; j++){
            vector <int> b;
            for (int i1 = i; i1 < h; i1++){
                for (int j1 = 0; j1 < w; j1++){
                    if (abs(i - i1) + abs(j - j1) == k){
                        // int lol = add_and({i * w + j, i1 * w + j1});
                        // a.push_back(lol);
                        b.push_back(i1 * w + j1);
                    }
                }
            }
            
            if (b.size() == 1){
                int lol = add_and({i * w + j, i1 * w + j1});
                a.push_back(lol);
            } else if (b.size() > 1){
                int l1 = add_or(b);
                int l2 = add_and({l1, i * w + j});
                a.push_back(l2);
            }
        }
    }
    
    int x = add_or(a);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:29:47: error: 'i1' was not declared in this scope; did you mean 'i'?
   29 |                 int lol = add_and({i * w + j, i1 * w + j1});
      |                                               ^~
      |                                               i
vision.cpp:29:59: error: could not convert '{((i * w) + j), <expression error>}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
   29 |                 int lol = add_and({i * w + j, i1 * w + j1});
      |                                                           ^
      |                                                           |
      |                                                           <brace-enclosed initializer list>
vision.cpp:39:9: warning: unused variable 'x' [-Wunused-variable]
   39 |     int x = add_or(a);
      |         ^