제출 #624219

#제출 시각아이디문제언어결과실행 시간메모리
624219MatesV13Jelly Flavours (IOI20_jelly)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int find_maximum_unique(int x, int y, int a[], int b[]){ int maks = 0; int n = sizeof(a)/sizeof(a[0]); for (int i=0; i<pow(3, n); i++){ int tempi = i; int tempx = x; int tempy = y; int br=0; for (int j=0; j<n; j++){ if (tempi%3){ if (tempi%3==1) tempx -= a[j]; else tempy -= b[j]; br++; } tempi /= 3; } if (tempx >= 0 and tempy >= 0) maks = max(maks, br); } return maks; }

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

jelly.cpp: In function 'int find_maximum_unique(int, int, int*, int*)':
jelly.cpp:6:31: warning: 'sizeof' on array function parameter 'a' will return size of 'int*' [-Wsizeof-array-argument]
    6 |  int maks = 0; int n = sizeof(a)/sizeof(a[0]);
      |                              ~^~
jelly.cpp:4:43: note: declared here
    4 | int find_maximum_unique(int x, int y, int a[], int b[]){
      |                                       ~~~~^~~
/usr/bin/ld: /tmp/ccFtfDyK.o: in function `main':
grader.cpp:(.text.startup+0x234): undefined reference to `find_maximum_unique(int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status