제출 #805259

#제출 시각아이디문제언어결과실행 시간메모리
805259QwertyPi삶의 질 (IOI10_quality)C++14
0 / 100
1 ms468 KiB
#pragma once 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]; } int 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 + C - 1) >= H * W / 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; }

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

quality.cpp:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...