답안 #425152

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
425152 2021-06-12T14:03:36 Z schse Vision Program (IOI19_vision) C++17
컴파일 오류
0 ms 0 KB
#include "vision.h"
#ifndef EVAL
#include "grader.cpp"
#endif
#include <bits/stdc++.h>
using namespace std;

void construct_network(int H, int W, int K)
{
	assert(H - 1, W - 1);
	vector<int> xorrows;
	for (int r = 0; r < H; r++)
	{
		vector<int> v(W);
		iota(v.begin(), v.end(), r * W);
		xorrows.push_back(add_xor(v));
	}
	int diffrentcols = add_or(xorrows);
	int iscrows;
	{
		vector<int> c;
		for (int r = 1; r < H; r++)
		{
			c.push_back(add_and({xorrows[r], xorrows[r - 1]}));
		}
		iscrows = add_or(c);
	}

	vector<int> xorcols;
	for (int c = 0; c < W; c++)
	{
		vector<int> v;
		for (int r = 0; r < H; r++)
			v.push_back(c + r * W);
		xorcols.push_back(add_xor(v));
	}

	int diffrentrows = add_or(xorcols);
	int isccols;
	{
		vector<int> c;
		for (int r = 1; r < W; r++)
		{
			c.push_back(add_and({xorcols[r], xorcols[r - 1]}));
		}
		isccols = add_or(c);
	}
	add_and({add_xor({diffrentcols, diffrentrows}), add_xor({isccols, iscrows})});
	return;
}

Compilation message

vision.cpp:10:21: error: macro "assert" passed 2 arguments, but takes just 1
   10 |  assert(H - 1, W - 1);
      |                     ^
In file included from /usr/include/c++/10/cassert:44,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:33,
                 from vision.cpp:5:
/usr/include/assert.h:92: note: macro "assert" defined here
   92 | #  define assert(expr)       \
      | 
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:10:2: error: 'assert' was not declared in this scope
   10 |  assert(H - 1, W - 1);
      |  ^~~~~~
vision.cpp:6:1: note: 'assert' is defined in header '<cassert>'; did you forget to '#include <cassert>'?
    5 | #include <bits/stdc++.h>
  +++ |+#include <cassert>
    6 | using namespace std;