제출 #413534

#제출 시각아이디문제언어결과실행 시간메모리
413534LouayFarah웜뱃 (IOI13_wombats)C++14
컴파일 에러
0 ms0 KiB
#include "bits/stdc++.h" #include "wombats.h" using namespace std; #define pb push_back #define make_pair mp #define fi first #difine se second int r, c; vector<vector<int>> h, v; void init(int R, int C, int H[][100], int V[][100]) { r = R; c = C; h.resize(R); for(int i = 0; i<R; i++) h[i].resize(C-1); v.resize(R-1); for(int i = 0; i<R-1; i++) v[i].resize(C); 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) { V2+=(r-1)*c; vector<bool> visited(r*c, false); vector<int> dist(r*c, 1e8); priority_queue<pair<int, int>> pq; pq.push(mp(0, V1)); dist[V1] = false; while(!pq.empty()) { int u = pq.top().se; pq.pop(); if(visited[u]) continue; visited[u] = true; if((u%c)>0) { int b = u-1; int w = h[b/c][b%c]; if(dist[u]+w<dist[b]) { dist[b] = dist[u]+w; pq.push(mp(-dist[b], b)); } } if((u%c)<c-1) { int b = u+1; int w = h[u/c][u%c]; if(dist[u]+w<dist[b]) { dist[b] = dist[u]+w; pq.push(mp(-dist[b], b)); } } if((u-(r-1)*c)<0) { int b = u+c; int w = v[u/c][u%c]; if(dist[u]+w<dist[b]) { dist[b] = dist[u]+w; pq.push(mp(-dist[b], b)); } } } return dist[V2]; }

컴파일 시 표준 에러 (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;
      |      ^~~
wombats.cpp:8:2: error: invalid preprocessing directive #difine; did you mean #define?
    8 | #difine se second
      |  ^~~~~~
      |  define
wombats.cpp: In function 'int escape(int, int)':
wombats.cpp:60:13: error: 'mp' was not declared in this scope
   60 |     pq.push(mp(0, V1));
      |             ^~
wombats.cpp:65:26: error: 'const value_type' {aka 'const struct std::pair<int, int>'} has no member named 'se'
   65 |         int u = pq.top().se;
      |                          ^~