# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1002173 | biximo | Netrpeljivost (COI23_netrpeljivost) | C++17 | 1509 ms | 77996 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 N 2048
#define INF 1000000000000000000LL
using namespace std;
typedef vector<vector<long long>> vvt;
typedef vector<long long> vt;
int n, cost[N][N];
long long abc[N][N], cda[N][N];
vvt DNC(int x, int y) {
if(x == y) {
vvt res = vvt(1,vt(1,0));
return res;
}
int z = (x+y)>>1;
vvt cs1 = DNC(x,z), cs2 = DNC(z+1,y), ans = vvt(y-x+1,vt(y-x+1,INF));
for(int a = 0; a <= z-x; a ++) {
for(int c = 0; c <= z-x; c ++) {
abc[a][c] = INF;
for(int b = 0; b <= z-x; b ++) {
abc[a][c] = min(abc[a][c], cs1[a][b]+cost[b+x][c+z+1]);
}
}
}
for(int c = 0; c <= z-x; c ++) {
for(int a = 0; a <= z-x; a ++) {
cda[c][a] = INF;
for(int d = 0; d <= z-x; d ++) {
cda[c][a] = min(cda[c][a], cs2[c][d]+cost[d+z+1][a+x]);
}
}
# | 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... |