제출 #1179063

#제출 시각아이디문제언어결과실행 시간메모리
1179063Ahmed_Kaaniche코알라 (APIO17_koala)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "koala.h" using namespace std; #define endl "\n" #define ll long long #define fi first #define se second #define pb push_back int minValue(int N, int W) { vector<int> b(100, 0); vector<int> r(100); b[0] = 1; playRound(b, r); if (r[0] <= 1) return 0; else { for (int i = 0; i < N; ++i) { if (r[i] == 0) return i; } } } int maxValue(int N, int W) { } bool greaterValue(int N, int W) { } void allValues(int N, int W, vector<int> &P) { }

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

koala.cpp: In function 'int minValue(int, int)':
koala.cpp:17:15: error: cannot convert 'std::vector<int>' to 'int*'
   17 |     playRound(b, r);
      |               ^
      |               |
      |               std::vector<int>
In file included from koala.cpp:2:
koala.h:4:21: note:   initializing argument 1 of 'void playRound(int*, int*)'
    4 | void playRound(int *B, int *R);
      |                ~~~~~^
koala.cpp: In function 'int maxValue(int, int)':
koala.cpp:31:1: warning: no return statement in function returning non-void [-Wreturn-type]
   31 | }
      | ^
koala.cpp: At global scope:
koala.cpp:33:6: error: ambiguating new declaration of 'bool greaterValue(int, int)'
   33 | bool greaterValue(int N, int W) {
      |      ^~~~~~~~~~~~
In file included from koala.cpp:2:
koala.h:8:5: note: old declaration 'int greaterValue(int, int)'
    8 | int greaterValue(int N, int W);
      |     ^~~~~~~~~~~~
koala.cpp: In function 'bool greaterValue(int, int)':
koala.cpp:35:1: warning: no return statement in function returning non-void [-Wreturn-type]
   35 | }
      | ^
koala.cpp: In function 'int minValue(int, int)':
koala.cpp:27:1: warning: control reaches end of non-void function [-Wreturn-type]
   27 | }
      | ^