답안 #1076205

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1076205 2024-08-26T11:44:31 Z Trumling 웜뱃 (IOI13_wombats) C++14
0 / 100
7 ms 16220 KB
#include "wombats.h"
#include <bits/stdc++.h>
using namespace std; 

typedef long long ll;
#define pb push_back
#define F first
#define S second
#define enter cout<<'\n';
#define INF 99999999999999999
#define MOD 1000000007
#define all(x) x.begin(),x.end()

ll sum=0;
vector<vector<ll>>dp;
int h[5000][200];
int v[5000][200];
int c;
int r;

void init(int R, int C, int H[5000][200], int V[5000][200]) {
    
    dp.assign(R,vector<ll>(C,0));

    for(int i=0;i<R;i++)
        for(int j=0;j<C-1;j++)
            h[i][j]=H[i][j];
        
    for(int i=0;i<R-1;i++)
        for(int j=0;j<C;j++)
            v[i][j]=V[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;
}

int escape(int V1, int V2) {
dp.assign(r,vector<ll>(c,INF));
dp[r-1][V2]=0;

for(int i=r-1;i>=0;i--)
    {
        if(i!=r-1)
            for(int j=0;j<c;j++)
                dp[i][j]=min(dp[i][j], dp[i+1][j] + v[i][j]);

        for(int j=1;j<c;j++)
            dp[i][j]=min(dp[i][j], dp[i][j-1] + h[i][j-1]);
        
        for(int j=c-2;j>=0;j--)
            dp[i][j]=min(dp[i][j], dp[i][j+1] + h[i][j]);
    }

return dp[0][V1];

}

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 Incorrect 2 ms 8796 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 2396 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 4 ms 5208 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 6 ms 16220 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 5 ms 5212 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 7 ms 13144 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -