# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1144726 | 2025-02-03 15:39:54 | Muaath_5 | 케이크 (CEOI14_cake) | C++20 | 컴파일 에러 | 0 ms | 0 KiB |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define int ll
#define pii pair<int, int>
const int N = 5e5+1;
// Use template for ordered_set to avoid namespace issues
template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
int n, a, d[N];
#define seg pii
seg tree[4*N];
seg INF = {1e9, 1e9};
// Update function with proper indentation
void update(int idx, seg val, int l = 1, int r = n, int node = 1) {
if (l == r) {
tree[node] = val;
return;
}
const int mid = (l + r) / 2;
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
컴파일 시 표준 에러 (stderr) 메시지
cake.cpp: In function 'void update(long long int, std::pair<long long int, long long int>, long long int, long long int, long long int)': cake.cpp:27:9: error: reference to 'tree' is ambiguous 27 | tree[node] = val; | ^~~~ In file included from cake.cpp:2: /usr/include/c++/11/ext/pb_ds/assoc_container.hpp:635:9: note: candidates are: 'template<class Key, class Mapped, class Cmp_Fn, class Tag, template<class Node_CItr, class Node_Itr, class Cmp_Fn_, class _Alloc_> class Node_Update, class _Alloc> class __gnu_pbds::tree' 635 | class tree : public PB_DS_TREE_BASE | ^~~~ cake.cpp:21:5: note: 'std::pair<long long int, long long int> tree [2000004]' 21 | seg tree[4*N]; | ^~~~ cake.cpp:36:5: error: reference to 'tree' is ambiguous 36 | tree[node] = min(tree[node * 2], tree[node * 2 + 1]); | ^~~~ In file included from cake.cpp:2: /usr/include/c++/11/ext/pb_ds/assoc_container.hpp:635:9: note: candidates are: 'template<class Key, class Mapped, class Cmp_Fn, class Tag, template<class Node_CItr, class Node_Itr, class Cmp_Fn_, class _Alloc_> class Node_Update, class _Alloc> class __gnu_pbds::tree' 635 | class tree : public PB_DS_TREE_BASE | ^~~~ cake.cpp:21:5: note: 'std::pair<long long int, long long int> tree [2000004]' 21 | seg tree[4*N]; | ^~~~ cake.cpp:36:22: error: reference to 'tree' is ambiguous 36 | tree[node] = min(tree[node * 2], tree[node * 2 + 1]); | ^~~~ In file included from cake.cpp:2: /usr/include/c++/11/ext/pb_ds/assoc_container.hpp:635:9: note: candidates are: 'template<class Key, class Mapped, class Cmp_Fn, class Tag, template<class Node_CItr, class Node_Itr, class Cmp_Fn_, class _Alloc_> class Node_Update, class _Alloc> class __gnu_pbds::tree' 635 | class tree : public PB_DS_TREE_BASE | ^~~~ cake.cpp:21:5: note: 'std::pair<long long int, long long int> tree [2000004]' 21 | seg tree[4*N]; | ^~~~ cake.cpp:36:38: error: reference to 'tree' is ambiguous 36 | tree[node] = min(tree[node * 2], tree[node * 2 + 1]); | ^~~~ In file included from cake.cpp:2: /usr/include/c++/11/ext/pb_ds/assoc_container.hpp:635:9: note: candidates are: 'template<class Key, class Mapped, class Cmp_Fn, class Tag, template<class Node_CItr, class Node_Itr, class Cmp_Fn_, class _Alloc_> class Node_Update, class _Alloc> class __gnu_pbds::tree' 635 | class tree : public PB_DS_TREE_BASE | ^~~~ cake.cpp:21:5: note: 'std::pair<long long int, long long int> tree [2000004]' 21 | seg tree[4*N]; | ^~~~ cake.cpp: In function 'std::pair<long long int, long long int> query(long long int, long long int, long long int, long long int, long long int)': cake.cpp:42:16: error: reference to 'tree' is ambiguous 42 | return tree[node]; | ^~~~ In file included from cake.cpp:2: /usr/include/c++/11/ext/pb_ds/assoc_container.hpp:635:9: note: candidates are: 'template<class Key, class Mapped, class Cmp_Fn, class Tag, template<class Node_CItr, class Node_Itr, class Cmp_Fn_, class _Alloc_> class Node_Update, class _Alloc> class __gnu_pbds::tree' 635 | class tree : public PB_DS_TREE_BASE | ^~~~ cake.cpp:21:5: note: 'std::pair<long long int, long long int> tree [2000004]' 21 | seg tree[4*N]; | ^~~~