| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 712634 | minhnhatnoe | Aliens (IOI16_aliens) | C++17 | 13 ms | 316 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "aliens.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll sq(ll a) {return a * a;}
pair<ll, int> alien_solve(int m, const vector<pair<ll, ll>> &p, ll cost){
vector<pair<ll, int>> dp(p.size());
for (int i=0; i<dp.size(); i++){
dp[i] = make_pair(sq(p[i].second - p[0].first + 1) + cost, 1);
for (int j=1; j<=i; j++){
ll value = dp[j-1].first + sq(p[i].second - p[j].first + 1) -
sq(max(0LL, p[j-1].second - p[j].first + 1));
int used = dp[j-1].second + 1;
dp[i] = min(dp[i], make_pair(value + cost, used));
}
}
return dp.back();
}
ll take_photos(int n, int m, int k, vector<int> r, vector<int> c){
vector<pair<ll, ll>> p(n);
for (int i=0; i<n; i++) p[i] = minmax(r[i], c[i]);
sort(p.begin(), p.end());
ll bl = 0, br = 1e12;
while (bl < br){
ll bm = (bl + br)>>1;
if (alien_solve(m, p, bm).second > k) bl = bm + 1;
else br = bm;
}
pair<ll, int> result = alien_solve(m, p, bl);
return result.first - result.second * bl;
}
컴파일 시 표준 에러 (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... | ||||
