답안 #434043

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
434043 2021-06-20T14:24:59 Z ScarletS 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)
{
	vector<int> v;
	for (int i=0;i<H;++i)
		for (int j=0;j<W;++j)
		{
			for (int k=j+1;k<W;++k)
				if (k-j==K)
					v.push_back(add_and({i*W+j,i*W+k}));
			for (int k=i+1;k<H&&k-j<=K;++k)
			{
				if (k-i==K)
					v.push_back(add_and({i*W+j,k*W+j}));
				else
				{
					if (0<=j-K+k-i)
						v.push_back(add_and(i*W+j,k*W+j-K+k-i));
					if (j+K-k+i<w)
						v.push_back(add_and(i*W+j,k*W+j+K-k+i));
				}
			}
		}
	add_or(v);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:21:30: error: could not convert '((i * W) + j)' from 'int' to 'std::vector<int>'
   21 |       v.push_back(add_and(i*W+j,k*W+j-K+k-i));
      |                           ~~~^~
      |                              |
      |                              int
vision.cpp:22:18: error: 'w' was not declared in this scope
   22 |      if (j+K-k+i<w)
      |                  ^
vision.cpp:23:30: error: could not convert '((i * W) + j)' from 'int' to 'std::vector<int>'
   23 |       v.push_back(add_and(i*W+j,k*W+j+K-k+i));
      |                           ~~~^~
      |                              |
      |                              int