답안 #24604

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
24604 2017-06-10T17:43:59 Z bill_kondo CEOI16_icc (CEOI16_icc) C++14
컴파일 오류
0 ms 0 KB
#include "icc.h"
#include <bits/stdc++.h>
using namespace std;

typedef pair <int, int> pii;

set <pii> e;

void acha ()
{
	for (int a = 1; a <= n; ++a)
		for (int b = a + 1; b <= n; ++b)
			if (e.find (pii (a, b)) == e.end())
			{
				int c[] = {a};
				int d[] = {b};
				if (query (1, 1, c, d))
				{
					e.insert (pii (a, b));
					setRoad (a, b);
					return;
				}
			}
}

void run (int N)
{
	for (int i = 1; i <= n - 1; ++i)
		acha ();
}

Compilation message

icc.cpp: In function 'void acha()':
icc.cpp:11:23: error: 'n' was not declared in this scope
  for (int a = 1; a <= n; ++a)
                       ^
icc.cpp: In function 'void run(int)':
icc.cpp:28:23: error: 'n' was not declared in this scope
  for (int i = 1; i <= n - 1; ++i)
                       ^