Submission #123088

#TimeUsernameProblemLanguageResultExecution timeMemory
123088Mahdi_JfriWombats (IOI13_wombats)C++14
55 / 100
20065 ms17656 KiB
#include "wombats.h" #include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back const int maxn = 5e3 + 20; const int maxm = 2e2 + 20; int wH[maxn][maxm] , wV[maxn][maxm]; int d[maxm][maxm] , n , m; bool have[maxm]; void dij(int src) { if(have[src]) return; have[src] = 1; memset(d[src] , 63 , 4 * m); d[src][src] = 0; for(int i = 0; i < n; i++) { for(int j = 0; j + 1 < m; j++) d[src][j + 1] = min(d[src][j + 1] , d[src][j] + wH[i][j]); for(int j = m - 2; j >= 0; j--) d[src][j] = min(d[src][j] , d[src][j + 1] + wH[i][j]); if(i + 1 < n) for(int j = 0; j < m; j++) d[src][j] += wV[i][j]; } } void init(int R, int C, int H[5000][200], int V[5000][200]) { n = R , m = C; for(int i = 0; i < n; i++) for(int j = 0; j + 1 < m; j++) wH[i][j] = H[i][j]; for(int i = 0; i + 1 < n; i++) for(int j = 0; j < m; j++) wV[i][j] = V[i][j]; } void changeH(int P, int Q, int W) { wH[P][Q] = W; memset(have , 0 , sizeof have); } void changeV(int P, int Q, int W) { wV[P][Q] = W; memset(have , 0 , sizeof have); } int escape(int V1, int V2) { dij(V1); return d[V1][V2]; }

Compilation message (stderr)

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 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...
#Verdict Execution timeMemoryGrader output
Fetching results...