| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1283823 | dhuyyyy | 로봇 (APIO13_robots) | C++20 | 1 ms | 332 KiB |
#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
using namespace std;
using ii = pair<int,int>;
const int MOD = 1e9+7;
const int N = 6005;
const int S = 17;
bool M1;
int n, m, c, d, e, x, y, ans = 0;
int pre[N][N];
bool ok(int x){
for (int i = x; i <= n; i++){
for (int j = x; j <= m; j++){
if (pre[i][j] - pre[i-x][j] - pre[i][j-x] + pre[i-x][j-x] <= e){
return 1;
}
}
}
return 0;
}
signed main(){
ios::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
freopen("PAPER.inp","r",stdin);
freopen("PAPER.out","w",stdout);
cin >> n >> m >> c >> d >> e;
for (int i = 1; i <= c; i++){
cin >> x >> y;
pre[x][y]++;
}
for (int i = 1; i <= n; i++){
for (int j = 1; j <= m; j++){
pre[i][j] += pre[i-1][j] + pre[i][j-1] - pre[i-1][j-1];
}
}
int l = 1, r = min(n,m) / d;
while (l <= r){
int mid = (l + r) >> 1;
if (ok(mid * d)){
ans = mid;
l = mid + 1;
} else r = mid - 1;
}
cout << ans * d;
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
