Submission #1023532

# Submission time Handle Problem Language Result Execution time Memory
1023532 2024-07-14T23:53:33 Z vjudge1 Wombats (IOI13_wombats) C++17
55 / 100
20000 ms 26156 KB
#include "wombats.h"
#include<bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
int ans[200][200],lr[5000][200],dn[5000][200],col,row;
void init(int R, int C, int H[5000][200], int V[5000][200]) {
    memcpy(lr,H,sizeof lr);
    memcpy(dn,V,sizeof dn);
    memset(ans,-1,sizeof ans);
    row=R;
    col=C;
}

void changeH(int P, int Q, int W) {
    memset(ans,-1,sizeof ans);
    lr[P][Q]=W;
}

void changeV(int P, int Q, int W) {
    memset(ans,-1,sizeof ans);
    dn[P][Q]=W;
}
void calcstuff(int strt){
    int dp[200];
    memset(dp,7,sizeof dp);
    dp[strt]=0;
    for(int i=strt;i--;)
        dp[i]=dp[i+1]+lr[0][i];
    for(int i=strt;++i<col;)
        dp[i]=dp[i-1]+lr[0][i-1];
    for(int i=1;i<row;i++){
        for(int j=0;j<col;j++)
            dp[j]+=dn[i-1][j];
        for(int j=col;--j;)
            dp[j-1]=min(dp[j-1],dp[j]+lr[i][j-1]);
        for(int j=0;++j<col;)
            dp[j]=min(dp[j],dp[j-1]+lr[i][j-1]);
    }
    memcpy(ans[strt],dp,sizeof dp);
}
int escape(int V1, int V2) {
    if(ans[V1][V2]<0)
        calcstuff(V1);
    return ans[V1][V2];
}

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;
      |      ^~~
# Verdict Execution time Memory Grader output
1 Correct 11 ms 12252 KB Output is correct
2 Correct 15 ms 12380 KB Output is correct
3 Correct 55 ms 15016 KB Output is correct
4 Correct 17 ms 12380 KB Output is correct
5 Correct 12 ms 12376 KB Output is correct
6 Correct 4 ms 8284 KB Output is correct
7 Correct 4 ms 8280 KB Output is correct
8 Correct 5 ms 8284 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 8280 KB Output is correct
2 Correct 4 ms 8284 KB Output is correct
3 Correct 4 ms 8284 KB Output is correct
4 Correct 5 ms 8284 KB Output is correct
5 Correct 7 ms 8540 KB Output is correct
6 Correct 5 ms 8284 KB Output is correct
7 Correct 6 ms 8452 KB Output is correct
8 Correct 5 ms 8388 KB Output is correct
9 Correct 6 ms 8280 KB Output is correct
10 Correct 5 ms 8356 KB Output is correct
11 Correct 46 ms 10640 KB Output is correct
12 Correct 5 ms 8284 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 8540 KB Output is correct
2 Correct 10 ms 8536 KB Output is correct
3 Correct 11 ms 8680 KB Output is correct
4 Correct 11 ms 8508 KB Output is correct
5 Correct 10 ms 8536 KB Output is correct
6 Correct 4 ms 8284 KB Output is correct
7 Correct 5 ms 8280 KB Output is correct
8 Correct 5 ms 8284 KB Output is correct
9 Correct 9 ms 8568 KB Output is correct
10 Correct 5 ms 8280 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 52 ms 16220 KB Output is correct
2 Correct 49 ms 16220 KB Output is correct
3 Correct 61 ms 16220 KB Output is correct
4 Correct 84 ms 17532 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 9 ms 8516 KB Output is correct
2 Correct 10 ms 8520 KB Output is correct
3 Correct 11 ms 8680 KB Output is correct
4 Correct 11 ms 8564 KB Output is correct
5 Correct 9 ms 8536 KB Output is correct
6 Correct 49 ms 16220 KB Output is correct
7 Correct 49 ms 16220 KB Output is correct
8 Correct 47 ms 16216 KB Output is correct
9 Correct 69 ms 17556 KB Output is correct
10 Correct 13 ms 12124 KB Output is correct
11 Correct 12 ms 12324 KB Output is correct
12 Correct 50 ms 15060 KB Output is correct
13 Correct 16 ms 12120 KB Output is correct
14 Correct 12 ms 12124 KB Output is correct
15 Correct 7 ms 8280 KB Output is correct
16 Correct 4 ms 8284 KB Output is correct
17 Correct 4 ms 8384 KB Output is correct
18 Correct 4 ms 8284 KB Output is correct
19 Correct 5 ms 8284 KB Output is correct
20 Correct 4 ms 8284 KB Output is correct
21 Correct 4 ms 8284 KB Output is correct
22 Correct 5 ms 8436 KB Output is correct
23 Correct 5 ms 8484 KB Output is correct
24 Correct 5 ms 8284 KB Output is correct
25 Correct 46 ms 10680 KB Output is correct
26 Correct 5 ms 8280 KB Output is correct
27 Correct 10 ms 8540 KB Output is correct
28 Execution timed out 20016 ms 19976 KB Time limit exceeded
29 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 9 ms 8540 KB Output is correct
2 Correct 10 ms 8664 KB Output is correct
3 Correct 11 ms 8540 KB Output is correct
4 Correct 10 ms 8680 KB Output is correct
5 Correct 11 ms 8540 KB Output is correct
6 Correct 52 ms 16220 KB Output is correct
7 Correct 54 ms 16220 KB Output is correct
8 Correct 46 ms 16216 KB Output is correct
9 Correct 71 ms 17680 KB Output is correct
10 Correct 11 ms 12124 KB Output is correct
11 Correct 12 ms 12376 KB Output is correct
12 Correct 52 ms 14928 KB Output is correct
13 Correct 11 ms 12376 KB Output is correct
14 Correct 11 ms 12120 KB Output is correct
15 Correct 183 ms 26156 KB Output is correct
16 Execution timed out 20035 ms 24144 KB Time limit exceeded
17 Halted 0 ms 0 KB -