제출 #1260058

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

using namespace std;

const int MAXN = 5e5 + 10;

int minValue(int n, int w)
{
	vector <int> b(n, 0);
	vector <int> r(n, 0);
	b[0] = 1;
	playRound(b, r);
	for (int i = 0; i < n; i++)
	{
		if (b[i] >= r[i])
			return i;
	}
}

int maxValue(int n, int w)
{
	return 0;
}

int greaterValue(int n, int w)
{
	return 0;
}

void allValues(int n, int w, int *p)
{

}

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

koala.cpp: In function 'int minValue(int, int)':
koala.cpp:13:19: error: cannot convert 'std::vector<int>' to 'int*'
   13 |         playRound(b, r);
      |                   ^
      |                   |
      |                   std::vector<int>
In file included from koala.cpp:1:
koala.h:4:21: note:   initializing argument 1 of 'void playRound(int*, int*)'
    4 | void playRound(int *B, int *R);
      |                ~~~~~^
koala.cpp:19:1: warning: control reaches end of non-void function [-Wreturn-type]
   19 | }
      | ^