Submission #805274

#TimeUsernameProblemLanguageResultExecution timeMemory
805274QwertyPiQuality Of Living (IOI10_quality)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int ps[3001][3001]; int sum(int x1, int x2, int y1, int y2){ return ps[x2 + 1][y2 + 1] - ps[x2 + 1][y1] - ps[x1][y2 + 1] + ps[x1][y1]; } bool ok(int R, int C, int H, int W, int Q[3001][3001], int x){ for(int i = 0; i < R; i++){ for(int j = 0; j < C; j++){ ps[i + 1][j + 1] = ps[i + 1][j] + ps[i][j + 1] - ps[i][j] + (Q[i][j] <= x); } } for(int i = 0; i <= R - H; i++){ for(int j = 0; j <= C - W; j++){ if(sum(i, i + H - 1, j, j + W - 1) >= (H * W + 1) / 2){ return true; } } } return false; } int rectangle(int R, int C, int H, int W, int Q[3001][3001]){ int lo = 1, hi = R * C; while(lo != hi){ int mid = (lo + hi) / 2; if(ok(R, C, H, W, Q, mid)){ hi = mid; }else{ lo = mid + 1; } } return lo; } int32_t main(){ int r, c, h, w; cin >> r >> c >> h >> w; int q[r][3001]; for(int i = 0; i < r; i++){ for(int j = 0; j < c; j++){ cin >> q[i][j]; } } cout << rectangle(r, c, h, w, q) << endl; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccmX6Sdt.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccClBPLr.o:quality.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status