# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
601038 | pakhomovee | Stove (JOI18_stove) | C++17 | 795 ms | 8948 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
using namespace std;
#define int long long
const int maxn = 100'001;
const int inf = 1e18;
int dp[maxn];
int dp1[maxn];
pair<int, int> eval(int lambda, vector<int> &t) {
const int n = t.size();
fill(dp, dp + maxn, inf);
fill(dp1, dp1 + maxn, inf);
dp[0] = 0;
dp1[0] = 0;
set<pair<int, int>> s;
for (int i = 1; i <= n; ++i) {
s.insert({ dp[i - 1] - t[i - 1] + 1 + lambda, dp1[i - 1] });
auto [val, cnt] = *s.begin();
dp[i] = val + t[i - 1];
dp1[i] = cnt + 1;
}
return { dp[n], dp1[n] };
}
int32_t main() {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |