# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
341335 | peijar | Aliens (IOI16_aliens) | C++17 | 2 ms | 364 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "aliens.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e18;
ll sq(ll x) {return x * x;}
ll take_photos(int nbInteret, int dim, int nbPhotos, vector<int> vy, vector<int> vx)
{
if (nbInteret <= 50 and dim <= 100 and nbPhotos == nbInteret)
{
vector<vector<bool>> marked(dim, vector<bool>(dim));
for (int i(0); i < nbInteret; ++i)
{
int a = min(vy[i], vx[i]);
int b = max(vy[i], vx[i]);
for (int y(a); y <= b; ++y)
for (int x(a); x <= b; ++x)
marked[y][x] = true;
}
ll ret(0);
for (auto v : marked)
for (auto w : v)
ret += w;
return ret;
}
if (nbInteret <= 500 and dim <= 1000)
{
sort(vy.begin(), vy.end());
vector<vector<ll>> dp(nbPhotos+1, vector<ll>(nbInteret+1));
for (int i(0); i <= nbPhotos; ++i)
dp[i][0] = 0;
for (int i(1); i <= nbInteret; ++i)
dp[0][i] = INF;
for (int photos(1); photos <= nbPhotos; ++photos)
for (int take(1); take <= nbInteret; ++take)
{
dp[photos][take] = dp[photos-1][take];
for (int lst_photo(1); lst_photo <= take; ++lst_photo)
dp[photos][take] = min(dp[photos][take], sq(1+vy[take-1]-vy[take-lst_photo-1]) + (lst_photo == take ? 0 : dp[photos-1][take-lst_photo]));
}
return dp[nbPhotos][nbInteret];
}
}
컴파일 시 표준 에러 (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... |