답안 #925503

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
925503 2024-02-11T20:32:38 Z VMaksimoski008 삶의 질 (IOI10_quality) C++14
100 / 100
1288 ms 71348 KB
#include <iostream>
#include "quality.h"
using namespace std;

int pref[3001][3001];

int rectangle(int n, int m, int h, int w, int q[3001][3001]) {
    int l=0, r=1e9, ans = 0;

    while(l <= r) {
        int mid = (l + r) / 2;
        bool ok = 0;

        for(int i=1; i<=n; i++)
            for(int j=1; j<=m; j++)
                pref[i][j] = (q[i-1][j-1] <= mid) + pref[i-1][j] + pref[i][j-1] - pref[i-1][j-1];

        for(int i=1; i+h-1<=n; i++)
            for(int j=1; j+w-1<=m; j++)
                if(2 * (pref[i+h-1][j+w-1] - pref[i-1][j+w-1] - pref[i+h-1][j-1] + pref[i-1][j-1]) >= h * w) ok = 1;

        if(ok) ans = mid, r = mid - 1;
        else l = mid + 1;
    }

    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 1 ms 2420 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 1 ms 2420 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 3 ms 2908 KB Output is correct
5 Correct 2 ms 2908 KB Output is correct
6 Correct 2 ms 2908 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 1 ms 2420 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 3 ms 2908 KB Output is correct
5 Correct 2 ms 2908 KB Output is correct
6 Correct 2 ms 2908 KB Output is correct
7 Correct 13 ms 6072 KB Output is correct
8 Correct 13 ms 5892 KB Output is correct
9 Correct 12 ms 5980 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 1 ms 2420 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 3 ms 2908 KB Output is correct
5 Correct 2 ms 2908 KB Output is correct
6 Correct 2 ms 2908 KB Output is correct
7 Correct 13 ms 6072 KB Output is correct
8 Correct 13 ms 5892 KB Output is correct
9 Correct 12 ms 5980 KB Output is correct
10 Correct 133 ms 22480 KB Output is correct
11 Correct 132 ms 22868 KB Output is correct
12 Correct 88 ms 19880 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 1 ms 2420 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 3 ms 2908 KB Output is correct
5 Correct 2 ms 2908 KB Output is correct
6 Correct 2 ms 2908 KB Output is correct
7 Correct 13 ms 6072 KB Output is correct
8 Correct 13 ms 5892 KB Output is correct
9 Correct 12 ms 5980 KB Output is correct
10 Correct 133 ms 22480 KB Output is correct
11 Correct 132 ms 22868 KB Output is correct
12 Correct 88 ms 19880 KB Output is correct
13 Correct 1288 ms 71348 KB Output is correct
14 Correct 1168 ms 71132 KB Output is correct
15 Correct 1122 ms 70876 KB Output is correct