quality.cpp:16:30: error: declaration of 'rec' as multidimensional array must have bounds for all dimensions except the first
bool chk( int mid, int rec[][] ) {
^
quality.cpp: In function 'bool chk(...)':
quality.cpp:18:18: error: 'mid' was not declared in this scope
for( int i = mid + 1 ; i <= n ; i++ ) sum[pos[i].x][pos[i].y]++;
^~~
quality.cpp: At global scope:
quality.cpp:29:54: error: declaration of 'rec' as multidimensional array must have bounds for all dimensions except the first
int rectangle( int R, int C, int H, int W, int rec[][] ) {
^
quality.cpp: In function 'int rectangle(...)':
quality.cpp:30:9: error: 'R' was not declared in this scope
r = R, c = C, w = W, h = H;
^
quality.cpp:30:16: error: 'C' was not declared in this scope
r = R, c = C, w = W, h = H;
^
quality.cpp:30:23: error: 'W' was not declared in this scope
r = R, c = C, w = W, h = H;
^
quality.cpp:30:30: error: 'H' was not declared in this scope
r = R, c = C, w = W, h = H;
^
quality.cpp:32:68: error: 'rec' was not declared in this scope
for( int i = 0 ; i < r ; i++ ) for( int j = 0 ; j < c ; j++ ) pos[rec[i][j]] = pii( i+1, j+1 );
^~~
quality.cpp:32:68: note: suggested alternative: 'getc'
for( int i = 0 ; i < r ; i++ ) for( int j = 0 ; j < c ; j++ ) pos[rec[i][j]] = pii( i+1, j+1 );
^~~
getc
quality.cpp:35:25: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
int mid = l + r + 1 >> 1;
~~~~~~^~~
quality.cpp:36:23: error: 'rec' was not declared in this scope
if( chk( mid, rec ) ) l = m;
^~~
quality.cpp:36:23: note: suggested alternative: 'getc'
if( chk( mid, rec ) ) l = m;
^~~
getc
quality.cpp:36:35: error: 'm' was not declared in this scope
if( chk( mid, rec ) ) l = m;
^
quality.cpp:37:18: error: 'm' was not declared in this scope
else r = m - 1;
^