# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1101703 | rainboy | Flights (JOI22_flights) | C++17 | 183 ms | 2340 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.
/* https://www2.ioi-jp.org/camp/2022/2022-sp-tasks/contest2/flights-review.pdf */
#include "Ali.h"
#include <cstring>
#include <string>
#include <vector>
using namespace std;
typedef vector<int> vi;
namespace Ali {
const int N = 10000, B = 7, K = B * 2 - 1, M = (N + B - 1) / B;
const int L = 20;
const int LN = 14; /* LN = ceil(log2(N)) */
const int LK = 4; /* LK = ceil(log2(K)) */
const int LT = 9; /* LT = ceil(log2(dp[B] + ... + dp[K])) */
int min(int a, int b) { return a < b ? a : b; }
int dp[K + 1];
void init() {
memset(dp, 0, (K + 1) * sizeof *dp), dp[0] = 1;
for (int s1 = 0; s1 < B; s1++) {
for (int s2 = 0; s2 < s1; s2++)
dp[s1 + s2 + 1] += dp[s1] * dp[s2];
dp[s1 + s1 + 1] += dp[s1] * (dp[s1] + 1) / 2;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |