# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
135423 |
2019-07-24T05:23:10 Z |
Talant |
Wombats (IOI13_wombats) |
C++17 |
|
8872 ms |
32124 KB |
#include "wombats.h"
//#include "grader.cpp"
#include <bits/stdc++.h>
#define sc second
#define fr first
#define mk make_pair
#define pb push_back
using namespace std;
const int N = (1e6 + 5);
const int inf = (1e9 + 7);
int n,m;
int d[N];
vector <pair<int,int> > g[N];
void init(int R, int C, int H[5000][200], int V[5000][200]) {
n = R,m = C;
for (int i = 1; i <= n; i ++) {
for (int j = 1; j < m; j ++) {
int cur = (i - 1) * m + j;
g[cur].pb(mk(cur + 1,H[i - 1][j - 1]));
g[cur + 1].pb(mk(cur,H[i - 1][j - 1]));
}
}
for (int i = 1; i < n; i ++) {
for (int j = 1; j <= m; j ++) {
int cur = (i - 1) * m + j;
g[cur].pb(mk(cur + m,V[i - 1][j - 1]));
}
}
}
void changeH(int P, int Q, int W) {
}
void changeV(int P, int Q, int W) {
}
void djikstra(int v) {
for (int i = 1; i <= n * m; i ++) d[i] = inf;
d[v] = 0;
priority_queue<pair<int,int> > q;
q.push(mk(0,v));
while (!q.empty()) {
int v = q.top().sc,cur = -q.top().fr;
q.pop();
if (cur > d[v]) continue;
for (auto to : g[v]) {
if (d[v] + to.sc < d[to.fr]) {
d[to.fr] = d[v] + to.sc;
q.push(mk(-d[to.fr],to.fr));
}
}
}
}
int escape(int V1, int V2) {
V1 ++,V2 ++;
djikstra(V1);
return d[(n - 1) * m + V2];
}
Compilation message
grader.c: In function 'int main()':
grader.c:15:6: warning: variable 'res' set but not used [-Wunused-but-set-variable]
int res;
^~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
82 ms |
27896 KB |
Output is correct |
2 |
Incorrect |
82 ms |
28024 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
23 ms |
23800 KB |
Output is correct |
2 |
Correct |
23 ms |
23800 KB |
Output is correct |
3 |
Correct |
23 ms |
23928 KB |
Output is correct |
4 |
Correct |
43 ms |
23928 KB |
Output is correct |
5 |
Correct |
32 ms |
23928 KB |
Output is correct |
6 |
Correct |
34 ms |
23928 KB |
Output is correct |
7 |
Correct |
49 ms |
23928 KB |
Output is correct |
8 |
Correct |
38 ms |
23928 KB |
Output is correct |
9 |
Correct |
42 ms |
23932 KB |
Output is correct |
10 |
Correct |
40 ms |
23900 KB |
Output is correct |
11 |
Correct |
8872 ms |
26476 KB |
Output is correct |
12 |
Correct |
49 ms |
23928 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
181 ms |
24676 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
484 ms |
32124 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
184 ms |
24644 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
181 ms |
24652 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |