Submission #1256012

#TimeUsernameProblemLanguageResultExecution timeMemory
1256012comgaTramAnhWombats (IOI13_wombats)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "wombats.h" long long sum = 0LL; int h[5000][200]; int v[5000][200]; int f[5000][200]; int n, m; void init(int R, int C, int H[5000][200], int V[5000][200]) { n = R; m = C; for (int i = 0; i < R; i++) { for (int j = 0; j < C; j++) { h[i][j] = H[i][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) { const int inf = 1000000007; priority_queue <tuple <int, int, int>, vector <tuple <int, int, int>>, greater <tuple <int, int, int>>> pq; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { f[i][j] = inf; } } f[0][V1] = 0; pq.push(make_tuple(f[0][V1], 0, V1)); while (pq.empty() == false) { tuple <int, int, int> element = pq.top(); pq.pop(); int dist = get <0>(element); int i = get <1>(element); int j = get <2>(element); if (f[i][j] != dist) { continue; } if (j > 0) { if (f[i][j - 1] > f[i][j] + h[i][j - 1]) { f[i][j - 1] = f[i][j] + h[i][j - 1]; pq.push(make_tuple(f[i][j - 1], i, j - 1)); } } if (j < m - 1) { if (f[i][j + 1] > f[i][j] + h[i][j]) { f[i][j + 1] = f[i][j] + h[i][j]; pq.push(make_tuple(f[i][j + 1], i, j + 1)); } } if (i < n - 1) { if (f[i + 1][j] > f[i][j] + v[i][j]) { f[i + 1][j] = f[i][j] + v[i][j]; pq.push(make_tuple(f[i + 1][j], i + 1, j)); } } } return f[n - 1][V2]; }

Compilation message (stderr)

wombats.cpp: In function 'int escape(int, int)':
wombats.cpp:26:19: error: 'tuple' was not declared in this scope; did you mean 'std::tuple'?
   26 |   priority_queue <tuple <int, int, int>, vector <tuple <int, int, int>>, greater <tuple <int, int, int>>> pq;
      |                   ^~~~~
      |                   std::tuple
In file included from /usr/include/c++/11/bits/move.h:57,
                 from /usr/include/c++/11/bits/stl_pair.h:59,
                 from /usr/include/c++/11/bits/stl_algobase.h:64,
                 from /usr/include/c++/11/bits/specfun.h:45,
                 from /usr/include/c++/11/cmath:1935,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41,
                 from wombats.cpp:1:
/usr/include/c++/11/type_traits:45:11: note: 'std::tuple' declared here
   45 |     class tuple;
      |           ^~~~~
wombats.cpp:26:3: error: 'priority_queue' was not declared in this scope; did you mean 'std::priority_queue'?
   26 |   priority_queue <tuple <int, int, int>, vector <tuple <int, int, int>>, greater <tuple <int, int, int>>> pq;
      |   ^~~~~~~~~~~~~~
      |   std::priority_queue
In file included from /usr/include/c++/11/queue:64,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:86,
                 from wombats.cpp:1:
/usr/include/c++/11/bits/stl_queue.h:456:11: note: 'std::priority_queue' declared here
  456 |     class priority_queue
      |           ^~~~~~~~~~~~~~
wombats.cpp:26:26: error: expected primary-expression before 'int'
   26 |   priority_queue <tuple <int, int, int>, vector <tuple <int, int, int>>, greater <tuple <int, int, int>>> pq;
      |                          ^~~
wombats.cpp:33:3: error: 'pq' was not declared in this scope
   33 |   pq.push(make_tuple(f[0][V1], 0, V1));
      |   ^~
wombats.cpp:33:11: error: 'make_tuple' was not declared in this scope; did you mean 'std::make_tuple'?
   33 |   pq.push(make_tuple(f[0][V1], 0, V1));
      |           ^~~~~~~~~~
      |           std::make_tuple
In file included from /usr/include/c++/11/functional:54,
                 from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/11/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
                 from wombats.cpp:1:
/usr/include/c++/11/tuple:1605:5: note: 'std::make_tuple' declared here
 1605 |     make_tuple(_Elements&&... __args)
      |     ^~~~~~~~~~
wombats.cpp:35:12: error: expected primary-expression before 'int'
   35 |     tuple <int, int, int> element = pq.top();
      |            ^~~
wombats.cpp:37:24: error: 'element' was not declared in this scope
   37 |     int dist = get <0>(element);
      |                        ^~~~~~~
wombats.cpp:37:16: error: 'get' was not declared in this scope
   37 |     int dist = get <0>(element);
      |                ^~~~~~~
wombats.cpp:37:16: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:133,
                 from wombats.cpp:1:
/usr/include/c++/11/variant:1145:27: note:   'std::get'
 1145 |     constexpr const _Tp&& get(const variant<_Types...>&& __v)
      |                           ^~~
In file included from /usr/include/c++/11/bits/ranges_algo.h:36,
                 from /usr/include/c++/11/algorithm:64,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
                 from wombats.cpp:1:
/usr/include/c++/11/bits/ranges_util.h:381:5: note:   'std::ranges::get'
  381 |     get(subrange<_It, _Sent, _Kind>&& __r)
      |     ^~~