Submission #1028870

#TimeUsernameProblemLanguageResultExecution timeMemory
1028870tolbiWombats (IOI13_wombats)C++17
9 / 100
6517 ms24668 KiB
#include "wombats.h" #include <bits/stdc++.h> using namespace std; const int MAXR = 5000; const int MAXC = 200; typedef long long ll; const ll INF = 1e15; ll H[MAXR][MAXC]={},V[MAXR][MAXC]={}; int C,R; void init(int RR, int CC, int HH[5000][200], int VV[5000][200]) { C=CC,R=RR; for (int i = 0; i < R; i++){ for (int j = 0; j < C; j++){ if (j+1<C) H[i][j]=HH[i][j]; if (i+1<R) V[i][j]=VV[i][j]; } } } void changeH(int P, int Q, int W) { H[P][Q]=W; } void changeV(int P, int Q, int W) { V[P][Q]=W; } ll ans[MAXR][MAXC]; ll nans[MAXR][MAXC]; ll cur[MAXR][MAXC]; int escape(int V1, int V2) { for (int i = 0; i < C; i++){ for (int j = 0; j < C; j++){ if (i==j) ans[i][j]=0; else ans[i][j]=INF; } } for (int x = 0; x < R; x++){ for (int i = 0; i < C; i++){ ll somma = 0; for (int j = i; j < C; j++){ cur[i][j]=somma+V[x][j]; somma+=H[x][j]; } somma=0; for (int j = i-1; j >= 0; j--){ somma+=H[x][j]; cur[i][j]=somma+V[x][j]; } for (int j = 0; j < C; j++){ nans[i][j]=INF; for (int k = 0; k < C; k++){ nans[i][j]=min(nans[i][j],ans[i][k]+cur[k][j]); } } } for (int i = 0; i < C; i++){ for (int j = 0; j < C; j++){ ans[i][j]=nans[i][j]; } } } return ans[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]
   15 |  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...