답안 #644936

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
644936 2022-09-25T15:21:26 Z a_aguilo Vision Program (IOI19_vision) C++14
컴파일 오류
0 ms 0 KB
#include "vision.h"
#include<bits/stdc++.h>

using namespace std;

void construct_network(int H, int W, int K) {
	vector<int> possibilities;
	memset(possibilities, 0, sizeof(possibilities));
	for(int w = 0; w <= min(K, W-1); ++w){
        int h = K - w;
        if(h >= H) continue;
        possibilities.push_back(add_and({0, h*W+w}));
	}
	add_or(possibilities);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:8:9: error: cannot convert 'std::vector<int>' to 'void*'
    8 |  memset(possibilities, 0, sizeof(possibilities));
      |         ^~~~~~~~~~~~~
      |         |
      |         std::vector<int>
In file included from /usr/include/features.h:461,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h:518,
                 from /usr/include/c++/10/bits/stl_algobase.h:59,
                 from /usr/include/c++/10/vector:60,
                 from vision.h:5,
                 from vision.cpp:1:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:59:1: note:   initializing argument 1 of 'void* memset(void*, int, size_t)'
   59 | __NTH (memset (void *__dest, int __ch, size_t __len))
      | ^~~~~