# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
982450 | MarwenElarbi | Roller Coaster Railroad (IOI16_railroad) | C++17 | 273 ms | 524288 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>
using namespace std;
//#pragma GCC optimize("O3")
//#pragma GCC optimize("unroll-loops")
#define fi first
#define se second
#define ll long long
#define pb push_back
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) {
int n = (int)s.size();
long long dp[(1<<n)][n];
for (int i = 0; i < (1<<n); ++i)
{
for (int j = 0; j < n; ++j)
{
dp[i][j]=1e18;
}
}
for (int i = 0; i < n; ++i)
{
dp[(1<<i)][i]=0;
}
for (int mask = 1; mask < (1<<n); ++mask)
{
for (int i = 0; i < n; ++i)
{
if((1<<i)&mask){
int submask=mask-(1<<i);
for (int j = 0; j < n; ++j)
# | 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... |