# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
96319 | Noam527 | Hotter Colder (IOI10_hottercolder) | C++17 | 872 ms | 13232 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define CHECK cout << "ok" << endl
#define finish(x) return cout << x << endl, 0
typedef long long ll;
typedef long double ldb;
const int md = 1e9 + 7;
const ll inf = 9e18;
using namespace std;
const int debugmode = 0;
const int more1 = 0;
const int more2 = 0;
const int L = 25;
int dp[2 * L + 2][L + 1][L + 1][2 * L + 2] = {};
int to[2 * L + 2][L + 1][L + 1][2 * L + 2] = {};
int calc(int sz, int l, int r, int prev, int change = 0) {
if (l >= r) return 1;
sz = min(sz, 2 * r);
prev = min(prev, 2 * r);
if (dp[sz][l][r][prev] != 0) return dp[sz][l][r][prev];
int &D = dp[sz][l][r][prev], &t = to[sz][l][r][prev];
int mn = md, tmp1, tmp2;
for (int i = 1; i <= 2 * r && i <= sz; i++)
if (i != prev) {
int mid1 = (prev + i - 1) / 2, mid2 = (prev + i) / 2 + 1;
if ((l <= mid1 && mid1 < r) || (l < mid2 && mid2 <= r)) {
tmp1 = calc(sz, l, mid1, i, 0);
tmp2 = calc(sz, mid2, r, i, 0);
# | 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... |