제출 #1260227

#제출 시각아이디문제언어결과실행 시간메모리
1260227arashmemar코알라 (APIO17_koala)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#include "koala.h"

using namespace std;

bool mark[maxn];

int minValue(int N, int W) {
	if (W != 100)
	{
		return 0;
	}
	int r[N];
	int b[N];
	for (int i = 0;i < N;i++)
	{
		b[i] = mark[i];
	}
	for (int i = 0;i < N;i++)
	{
		if (mark[i] == 0)
		{
			b[0] = 1;
			break;
		}
	}
	playRound(b, r);
	for (int i = 0;i < N;i++)
	{
		if (b[i] == 0 and r[i] == 0)
		{
			mark[i] = 1;
			return i;
		}
		if (b[i] and r[i] > b[i])
		{
			mark[i] = 1;
			return i;
		}
	}
	return 0;
}

int maxValue(int N, int W) {
    // TODO: Implement Subtask 2 solution here.
    // You may leave this function unmodified if you are not attempting this
    // subtask.
    return 0;
}

int greaterValue(int N, int W) {
    // TODO: Implement Subtask 3 solution here.
    // You may leave this function unmodified if you are not attempting this
    // subtask.
    return 0;
}

void allValues(int N, int W, int *P) {
    if (W == 2*N) {
        // TODO: Implement Subtask 4 solution here.
        // You may leave this block unmodified if you are not attempting this
        // subtask.
    } 
	else {
		for (int i = 1;i <= N;i++)
		{
			P[minValue(N, W)] = i;
		}
		return ;
    }
}

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

koala.cpp:6:11: error: 'maxn' was not declared in this scope
    6 | bool mark[maxn];
      |           ^~~~
koala.cpp: In function 'int minValue(int, int)':
koala.cpp:17:24: error: 'mark' was not declared in this scope
   17 |                 b[i] = mark[i];
      |                        ^~~~
koala.cpp:21:21: error: 'mark' was not declared in this scope
   21 |                 if (mark[i] == 0)
      |                     ^~~~
koala.cpp:32:25: error: 'mark' was not declared in this scope
   32 |                         mark[i] = 1;
      |                         ^~~~
koala.cpp:37:25: error: 'mark' was not declared in this scope
   37 |                         mark[i] = 1;
      |                         ^~~~