#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define replr(i, a, b) for (int i = int(a); i <= int(b); ++i)
#define reprl(i, a, b) for (int i = int(a); i >= int(b); --i)
#define rep(i, n) for (int i = 0; i < int(n); ++i)
#define mkp(a, b) make_pair(a, b)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<PII> VPI;
typedef vector<VI> VVI;
typedef vector<VVI> VVVI;
typedef vector<VPI> VVPI;
typedef pair<ll, ll> PLL;
typedef vector<ll> VL;
typedef vector<PLL> VPL;
typedef vector<VL> VVL;
typedef vector<VVL> VVVL;
typedef vector<VPL> VVPL;
template<class T> T setmax(T& a, T b) {if (a < b) return a = b; return a;}
template<class T> T setmin(T& a, T b) {if (a < b) return a; return a = b;}
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template<class T>
using indset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#include "wombats.h"
const int MAXC = 200;
int n, m;
struct PART {
int d[MAXC][MAXC];
PART() {
rep(i, m) rep(j, m) d[i][j] = 2e9;
}
void add(const PART& b) {
PART c;
rep(u, m) rep(v, m) rep(mid, m) {
setmin(c.d[u][v], d[u][mid] + b.d[mid][v]);
}
rep(u, m) rep(v, m) d[u][v] = c.d[u][v];
}
};
void combine(const PART& a, const PART& b) {
PART c;
rep(u, m) rep(v, m) rep(mid, m) {
setmin(c.d[u][v], a.d[u][mid] + b.d[mid][v]);
}
}
vector<PART> a;
PART answer;
void init(int R, int C, int H[5000][200], int V[5000][200]) {
n = R;
m = C;
a = vector<PART>(R);
rep(u, n) {
replr(i, 0, m-1) {
int sum = 0;
replr(j, i, m-1) {
a[u].d[i][j] = sum + (u == n-1 ? 0 : V[u][j]);
a[u].d[j][i] = sum + (u == n-1 ? 0 : V[u][i]);
if (j != m-1) sum += H[u][j];
}
}
}
/*rep(i, n) {*/
/* cout << "LAYER " << i << endl;*/
/* rep(u, m) rep(v, m) {*/
/* cout << "from " << u << " to " << v << ": ";*/
/* cout << a[i].d[u][v] << endl;*/
/* }*/
/*}*/
answer = a[0];
replr(i, 1, n-1) answer.add(a[i]);
/* ... */
}
void changeH(int P, int Q, int W) {
/* ... */
}
void changeV(int P, int Q, int W) {
/* ... */
}
int escape(int u, int v) {
return answer.d[u][v];
}
Compilation message
grader.c: In function 'int main()':
grader.c:15:6: warning: variable 'res' set but not used [-Wunused-but-set-variable]
15 | int res;
| ^~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
13 ms |
26204 KB |
Output is correct |
2 |
Incorrect |
12 ms |
26204 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
604 KB |
Output is correct |
2 |
Correct |
0 ms |
604 KB |
Output is correct |
3 |
Correct |
0 ms |
604 KB |
Output is correct |
4 |
Correct |
1 ms |
1112 KB |
Output is correct |
5 |
Correct |
1 ms |
1116 KB |
Output is correct |
6 |
Correct |
1 ms |
1116 KB |
Output is correct |
7 |
Correct |
1 ms |
1116 KB |
Output is correct |
8 |
Correct |
1 ms |
1116 KB |
Output is correct |
9 |
Correct |
1 ms |
1116 KB |
Output is correct |
10 |
Correct |
1 ms |
1116 KB |
Output is correct |
11 |
Correct |
39 ms |
3444 KB |
Output is correct |
12 |
Correct |
1 ms |
1116 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
83 ms |
9048 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
16 ms |
33880 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
84 ms |
9048 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
83 ms |
9048 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |