제출 #1327509

#제출 시각아이디문제언어결과실행 시간메모리
1327509nicolo_010Vision Program (IOI19_vision)C++20
컴파일 에러
0 ms0 KiB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

void construct_network(int H, int W, int K) {
	int id = H*W;
	for (int i=0; i<H*W) {
		if (i+k >= H*W) continue;
		add_and({i, i+k});
		id++;
	}
	vector<int> res;
	for (int i=H*W; i<id; i++) {
		res.push_back(i);
	}
	add_or(res);
}

컴파일 시 표준 에러 (stderr) 메시지

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:8:28: error: expected ';' before ')' token
    8 |         for (int i=0; i<H*W) {
      |                            ^
      |                            ;
vision.cpp:9:23: error: 'k' was not declared in this scope
    9 |                 if (i+k >= H*W) continue;
      |                       ^
vision.cpp:10:31: error: 'k' was not declared in this scope
   10 |                 add_and({i, i+k});
      |                               ^
vision.cpp:10:24: error: could not convert '{i, <expression error>}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
   10 |                 add_and({i, i+k});
      |                 ~~~~~~~^~~~~~~~~~
      |                        |
      |                        <brace-enclosed initializer list>