제출 #1123733

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
11237332024-12-04 05:46:26math_rabbit_1028나일강 (IOI24_nile)C++20
컴파일 에러
0 ms0 KiB
#include "nile.h"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
int N;
struct minseg {
ll tree[404040];
void init(int v, int st, int ed) {
if (st == ed) {
tree[v] = 1e18;
return;
}
int mid = (st+ed)/2;
init(2*v, st, mid);
init(2*v+1, mid+1, ed);
tree[v] = min(tree[2*v], tree[2*v+1]);
}
void update(int v, int st, int ed, int idx, ll val) {
if (st > idx || ed < idx) return;
if (st == idx && ed == idx) {
tree[v] = min(tree[v], val);
return;
}
int mid = (st+ed)/2;
update(2*v, st, mid, idx, val);
update(2*v+1, mid+1, ed, idx, val);
tree[v] = min(tree[2*v], tree[2*v+1]);
}
ll get(int v, int st, int ed, int lt, int rt) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

nile.cpp: In function 'std::vector<long long int> calculate_costs(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
nile.cpp:64:38: error: 'greater' was not declared in this scope
   64 |     priority_queue<pll, vector<pll>, greater<pll>> two, one;
      |                                      ^~~~~~~
nile.cpp:64:38: note: suggested alternatives:
In file included from /usr/include/c++/11/bits/iterator_concepts.h:37,
                 from /usr/include/c++/11/bits/stl_iterator_base_types.h:71,
                 from /usr/include/c++/11/bits/stl_algobase.h:65,
                 from /usr/include/c++/11/vector:60,
                 from nile.h:1,
                 from nile.cpp:1:
/usr/include/c++/11/bits/ranges_cmp.h:140:10: note:   'std::ranges::greater'
  140 |   struct greater
      |          ^~~~~~~
In file included from /usr/include/c++/11/bits/stl_pair.h:65,
                 from /usr/include/c++/11/bits/stl_algobase.h:64,
                 from /usr/include/c++/11/vector:60,
                 from nile.h:1,
                 from nile.cpp:1:
/usr/include/c++/11/compare:53:57: note:   'std::__cmp_cat::_Ord::greater'
   53 |     enum class _Ord : type { equivalent = 0, less = -1, greater = 1 };
      |                                                         ^~~~~~~
nile.cpp:64:5: error: 'priority_queue' was not declared in this scope
   64 |     priority_queue<pll, vector<pll>, greater<pll>> two, one;
      |     ^~~~~~~~~~~~~~
nile.cpp:2:1: note: 'std::priority_queue' is defined in header '<queue>'; did you forget to '#include <queue>'?
    1 | #include "nile.h"
  +++ |+#include <queue>
    2 | using namespace std;
nile.cpp:64:23: error: expected primary-expression before ',' token
   64 |     priority_queue<pll, vector<pll>, greater<pll>> two, one;
      |                       ^
nile.cpp:64:36: error: expected primary-expression before ',' token
   64 |     priority_queue<pll, vector<pll>, greater<pll>> two, one;
      |                                    ^
nile.cpp:64:49: error: expected primary-expression before '>' token
   64 |     priority_queue<pll, vector<pll>, greater<pll>> two, one;
      |                                                 ^~
nile.cpp:64:52: error: 'two' was not declared in this scope
   64 |     priority_queue<pll, vector<pll>, greater<pll>> two, one;
      |                                                    ^~~
nile.cpp:64:57: error: 'one' was not declared in this scope
   64 |     priority_queue<pll, vector<pll>, greater<pll>> two, one;
      |                                                         ^~~
nile.cpp:72:5: error: 'map' was not declared in this scope
   72 |     map<ll, ll> ans;
      |     ^~~
nile.cpp:2:1: note: 'std::map' is defined in header '<map>'; did you forget to '#include <map>'?
    1 | #include "nile.h"
  +++ |+#include <map>
    2 | using namespace std;
nile.cpp:72:11: error: expected primary-expression before ',' token
   72 |     map<ll, ll> ans;
      |           ^
nile.cpp:72:15: error: expected primary-expression before '>' token
   72 |     map<ll, ll> ans;
      |               ^
nile.cpp:72:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   72 |     map<ll, ll> ans;
      |                 ^~~
      |                 abs
nile.cpp:77:12: error: expected primary-expression before ',' token
   77 |     map<pll, ll> blocks;
      |            ^
nile.cpp:77:16: error: expected primary-expression before '>' token
   77 |     map<pll, ll> blocks;
      |                ^
nile.cpp:77:18: error: 'blocks' was not declared in this scope; did you mean 'block'?
   77 |     map<pll, ll> blocks;
      |                  ^~~~~~
      |                  block
nile.cpp:103:61: error: could not convert '{<expression error>, <expression error>}' from '<brace-enclosed initializer list>' to 'pll' {aka 'std::pair<long long int, long long int>'}
  103 |             pll temp = {prev->first.first, now->first.second};
      |                                                             ^
      |                                                             |
      |                                                             <brace-enclosed initializer list>