답안 #979077

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
979077 2024-05-10T07:51:48 Z WongYiKai 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> Ns;
	vector<int> output;
	int count=0;
	for (int i=0;i<H*W;i++){
		Ns.clear();
		int x=K+i%W,y=i/W;
		//cout << "loop " << x << " " << y << "\n";
		while (x>=W){
			x--;
			y++;
		}
		while (x>=i%W&&y<H&&y>=0){
			//Ns = {i,y*W+x};
			//cout << i << " " << y*W+x << "\n";
			Ns.push_back(y*W+x);
			x--;
			y++;
		}
		x=i%W-K;
		y=i/W;
		//cout << "loop " << x << " " << y << "\n";
		while (x<0){
			x++;
			y++;
		}
		while (x<i%W&&y<H&&y>=0){
			//Ns = {i,y*W+x};
			//cout << i << " " << y*W+x << "\n";
			Ns.push_back(y*W+x);
		x=K+i%W-1,y=i/W-1;
		//cout << "loop " << x << " " << y << "\n";
		while (x>=W){
			x--;
			y--;
		}
		while (x>=i%W&&y<H&&y>=0){
			//Ns = {i,y*W+x};
			//cout << i << " " << y*W+x << "\n";
			Ns.push_back(y*W+x);
			x--;
			y--;
		}
		x=i%W-K+1;
		y=i/W-1;
		//cout << "loop " << x << " " << y << "\n";
		while (x<0){
			x++;
			y--;
		}
		while (x<i%W&&y<H&&y>=0){
			//Ns = {i,y*W+x};
			//cout << i << " " << y*W+x << "\n";
			Ns.push_back(y*W+x);
			x++;
			y--;
		}
		int c = add_not(i);
		int d = add_or(Ns);
		int e = add_or({c,d});
		output.push_back(e);
		count += Ns.size()+3;
	}
	int b = add_and(output);
	count++;
	//cout << "count " << count << "\n";
	return;
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:68:6: warning: unused variable 'b' [-Wunused-variable]
   68 |  int b = add_and(output);
      |      ^
vision.cpp:72:1: error: expected '}' at end of input
   72 | }
      | ^
vision.cpp:5:45: note: to match this '{'
    5 | void construct_network(int H, int W, int K) {
      |                                             ^