답안 #38328

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
38328 2018-01-04T01:25:01 Z funcsr 웜뱃 (IOI13_wombats) C++14
55 / 100
20000 ms 17644 KB
#include "wombats.h"
#include <iostream>
#include <vector>
#include <set>
#include <queue>
#include <string>
#define rep(i, n) for (int i=0; i<(n); i++)
#define pb push_back
#define INF 1145141919
#define _1 first
#define _2 second
using namespace std;

int W, H;
int yoko[200][5000];
int tate[200][5000];
int dp[200];

void init(int R, int C, int _yoko[5000][200], int _tate[5000][200]) {
  W = C, H = R;
  rep(y, H) rep(x, W-1) yoko[x][y] = _yoko[y][x];
  rep(x, W) rep(y, H-1) tate[x][y] = _tate[y][x];
}

void changeH(int P, int Q, int W) {
  yoko[Q][P] = W;
}

void changeV(int P, int Q, int W) {
  tate[Q][P] = W;
}

int escape(int V1, int V2) {
  rep(x, W) dp[x] = INF;
  dp[V1] = 0;
  rep(x, W-1) dp[x+1] = min(dp[x+1], dp[x]+yoko[x][0]);
  for (int x=W-1; x>0; x--) dp[x-1] = min(dp[x-1], dp[x]+yoko[x-1][0]);

  rep(y, H-1) {
    rep(x, W) dp[x] += tate[x][y];
    rep(x, W-1) dp[x+1] = min(dp[x+1], dp[x]+yoko[x][y+1]);
    for (int x=W-1; x>0; x--) dp[x-1] = min(dp[x-1], dp[x]+yoko[x-1][y+1]);
  }
  return dp[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;
      ^
# 결과 실행 시간 메모리 Grader output
1 Correct 9 ms 17644 KB Output is correct
2 Correct 9 ms 17644 KB Output is correct
3 Correct 3086 ms 17644 KB Output is correct
4 Correct 6 ms 17644 KB Output is correct
5 Correct 6 ms 17644 KB Output is correct
6 Correct 0 ms 17644 KB Output is correct
7 Correct 0 ms 17644 KB Output is correct
8 Correct 0 ms 17644 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 17644 KB Output is correct
2 Correct 0 ms 17644 KB Output is correct
3 Correct 0 ms 17644 KB Output is correct
4 Correct 0 ms 17644 KB Output is correct
5 Correct 0 ms 17644 KB Output is correct
6 Correct 0 ms 17644 KB Output is correct
7 Correct 0 ms 17644 KB Output is correct
8 Correct 0 ms 17644 KB Output is correct
9 Correct 0 ms 17644 KB Output is correct
10 Correct 0 ms 17644 KB Output is correct
11 Correct 413 ms 17644 KB Output is correct
12 Correct 0 ms 17644 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 17644 KB Output is correct
2 Correct 3 ms 17644 KB Output is correct
3 Correct 6 ms 17644 KB Output is correct
4 Correct 9 ms 17644 KB Output is correct
5 Correct 6 ms 17644 KB Output is correct
6 Correct 0 ms 17644 KB Output is correct
7 Correct 0 ms 17644 KB Output is correct
8 Correct 0 ms 17644 KB Output is correct
9 Correct 13 ms 17644 KB Output is correct
10 Correct 0 ms 17644 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 56 ms 17644 KB Output is correct
2 Correct 56 ms 17644 KB Output is correct
3 Correct 63 ms 17644 KB Output is correct
4 Correct 5379 ms 17644 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 17644 KB Output is correct
2 Correct 6 ms 17644 KB Output is correct
3 Correct 13 ms 17644 KB Output is correct
4 Correct 6 ms 17644 KB Output is correct
5 Correct 6 ms 17644 KB Output is correct
6 Correct 59 ms 17644 KB Output is correct
7 Correct 69 ms 17644 KB Output is correct
8 Correct 56 ms 17644 KB Output is correct
9 Correct 5299 ms 17644 KB Output is correct
10 Correct 6 ms 17644 KB Output is correct
11 Correct 6 ms 17644 KB Output is correct
12 Correct 3043 ms 17644 KB Output is correct
13 Correct 9 ms 17644 KB Output is correct
14 Correct 6 ms 17644 KB Output is correct
15 Correct 0 ms 17644 KB Output is correct
16 Correct 0 ms 17644 KB Output is correct
17 Correct 0 ms 17644 KB Output is correct
18 Correct 0 ms 17644 KB Output is correct
19 Correct 0 ms 17644 KB Output is correct
20 Correct 0 ms 17644 KB Output is correct
21 Correct 0 ms 17644 KB Output is correct
22 Correct 0 ms 17644 KB Output is correct
23 Correct 0 ms 17644 KB Output is correct
24 Correct 0 ms 17644 KB Output is correct
25 Correct 406 ms 17644 KB Output is correct
26 Correct 0 ms 17644 KB Output is correct
27 Correct 6 ms 17644 KB Output is correct
28 Execution timed out 20000 ms 17644 KB Execution timed out
29 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 17644 KB Output is correct
2 Correct 6 ms 17644 KB Output is correct
3 Correct 6 ms 17644 KB Output is correct
4 Correct 6 ms 17644 KB Output is correct
5 Correct 3 ms 17644 KB Output is correct
6 Correct 56 ms 17644 KB Output is correct
7 Correct 53 ms 17644 KB Output is correct
8 Correct 56 ms 17644 KB Output is correct
9 Correct 5283 ms 17644 KB Output is correct
10 Correct 9 ms 17644 KB Output is correct
11 Correct 9 ms 17644 KB Output is correct
12 Correct 3149 ms 17644 KB Output is correct
13 Correct 6 ms 17644 KB Output is correct
14 Correct 13 ms 17644 KB Output is correct
15 Correct 329 ms 17644 KB Output is correct
16 Runtime error 0 ms 0 KB -1: Interrupted system call
17 Halted 0 ms 0 KB -