# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1137032 | alterio | Aliens (IOI16_aliens) | C++20 | 101 ms | 2376 KiB |
#include "aliens.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll take_photos(int n, int m, int k, vector<int> r, vector<int> c) {
sort(r.begin(), r.end());
ll dp[n + 1][k + 1];
for (int i = 0; i <= n; i++)
for (int j = 0; j <= k; j++) dp[i][j] = 1e16;
dp[0][0] = 0;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= k; j++) {
dp[i][j] = dp[i][j - 1];
for (int l = i; l >= 1; l--) {
int diff = r[i - 1] - r[l - 1] + 1;
dp[i][j] = min(dp[i][j], dp[l - 1][j - 1] + diff * diff);
}
}
}
return dp[n][k];
}
컴파일 시 표준 에러 (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |