제출 #287641

#제출 시각아이디문제언어결과실행 시간메모리
287641fgojko삶의 질 (IOI10_quality)C++14
컴파일 에러
0 ms0 KiB
#include <vector> #include <algorithm> using namespace std; typedef unsigned long long ull; int rectangle(int n, int m, int x, int y, int** mat){ vector<ull> vec; ull max = n*m; for(int i = 0; i <= n-x; ++i){ for(int j = 0; j <= m-y; ++j){ vec.resize(0); for(int a = i; a < i+x; ++a){ for(int b =j; b < j+y; ++b){ vec.push_back(mat[a][b]); } } sort(vec.begin(), vec.end()); #ifdef FEEDBACK cout << "( " << i << ", " << j << " )\n"; cout << "median = " << vec[vec.size()/2] << endl; #endif // FEEDBACK if(max > vec[vec.size()/2]){ max = vec[vec.size()/2]; } } } }

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

quality.cpp: In function 'int rectangle(int, int, int, int, int**)':
quality.cpp:29:1: warning: no return statement in function returning non-void [-Wreturn-type]
   29 | }
      | ^
/tmp/ccedwu3M.o: In function `main':
grader.cpp:(.text.startup+0xcd): undefined reference to `rectangle(int, int, int, int, int (*) [3001])'
collect2: error: ld returned 1 exit status