# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
955858 | Flan312 | Toll (BOI17_toll) | C++17 | 113 ms | 160344 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 ll long long
#define ld long double
#define eb emplace_back
#define task ""
#define fast ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define nx freopen (task".inp","r",stdin), freopen (task".out","w",stdout);
#define fi first
#define se second
#define pii pair <int, int>
#define tii tuple <int, int, int>
using namespace std;
const int nmax = 5e4 + 2;
int n, m, q, k;
ll dp[nmax][16][5][5], ans[5], nxt[5];
/*
dp[u][i][remU][remV]: đường đi ngắn nhất từ u*k + remU -> (u + 2^i - 1) * k + remv
đường ngắn nhất từ đỉnh remU của tầng u đến đỉnh remV tầng u + 2^i - 1
*/
void merge(int i, int j, int ii, int jj, int iii, int jjj)
{
for (int ru = 0; ru < k; ++ru)
for (int rv = 0; rv < k; ++rv)
for (int rt = 0; rt < k; ++rt)
dp[i][j][ru][rv] = min(dp[i][j][ru][rv], dp[ii][jj][ru][rt] + dp[iii][jjj][rt][rv]);
}
int main()
{
if (ifstream(task".inp")) nx
fast
Compilation message (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... |