제출 #958113

#제출 시각아이디문제언어결과실행 시간메모리
958113hyakup삶의 질 (IOI10_quality)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "quality.h" using namespace std; const int maxn = 3e3 + 10; vector<vector<int>> v( maxn, vector<int>(maxn)), s1( maxn, vector<int>(maxn)), s2( maxn, vector<int>(maxn)); bool check( int n, int m, int h, int w, int k ){ for( int i = 1; i <= n; i++ ) for( int j = 1; j <= m; j++ ){ s1[i][j] = ((v[i][j] < k) ? 1 : 0 ) + s1[i - 1][j] + s1[i][j - 1] - s1[i - 1][j - 1]; if( i >= h && j >= w ){ int v1 = s1[i][j] - s1[i - h][j] - s1[i][j - w] + s1[i - h][j - w]; if( v1 >= (h*w + 1)/2 ) return true; } } return false; } int bs( int n, int m, int h, int w ){ int l = 1, r = n*m; while( l < r ){ int mid = ( l + r )/2; if( check(n, m, h, w, mid) ) r = mid; else l = mid + 1; } return r - 1; } int rectangle( int n, int m, int h, int w, int q[maxn][maxn] ){ for( int i = 1; i <= n; i++ ) for( int j = 1; j <= m; j++ ) v[i][j] = q[i - 1][j - 1]; return bs(n, m, h, w); } // int q[maxn][maxn]; // // int main(){ // int n, m, h, w; cin >> n >> m >> h >> w; // for( int i = 0; i < n; i++ ) for( int j = 0; j < m; j++ ) cin >> q[i][j]; // cout << rectangle( n, m, h, w, q ); // }

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

/usr/bin/ld: /tmp/ccECrZwn.o: in function `main':
grader.cpp:(.text.startup+0xe9): undefined reference to `rectangle(int, int, int, int, int (*) [3001])'
collect2: error: ld returned 1 exit status