Submission #705134

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7051342023-03-03 12:23:04dubabubaToll (BOI17_toll)C++14
100 / 100
218 ms142176 KiB
#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int mxn = 3e5 + 10;
const int LOG = 20;
int ans[6][6], tmp[6][6];
int dp[mxn][LOG][6][6];
int k, n, m, q;
void ono_min(int &s, int t) {
if(s > t) s = t;
}
int box(int u) {
return u / k;
}
void build() {
for(int i = 1; i <= LOG; i++) {
for(int Lbox = 0; Lbox <= box(n - 1); Lbox++) {
int Mbox = Lbox + (1 << (i - 1));
int Rbox = Lbox + (1 << i);
if(Rbox > box(n - 1)) continue;
for(int l = 0; l < k; l++)
for(int r = 0; r < k; r++)
for(int m = 0; m < k; m++)
ono_min(dp[Lbox][i][l][r], dp[Lbox][i - 1][l][m] + dp[Mbox][i - 1][m][r]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...