# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
506158 | 2022-01-11T18:21:00 Z | jerzyk | 저장 (Saveit) (IOI10_saveit) | C++17 | 컴파일 오류 |
0 ms | 0 KB |
#include "grader.h" #include "encoder.h" #include<bits/stdc++.h> typedef long long ll; using namespace std; const int N = 1000 + 7; vector<int>ed[N]; int tab[38][1000 + 7], ws[N]; ll Return3(int v, int h) { ll w, m; for(int i = 1; i <= h; ++i) { if(tab[i][v] == tab[i][ws[i]]) m = 1; if(tab[i][v] > tab[i][ws[i]]) m = 2; w += m * pow(3LL, (ll)i - 1); } return w; } void PrintBits(ll x, int l) { for(int i = 1; i <= l; ++i) { encode_bit(x % 2); x /= 2; } } void DFS(int v) { for(int i = 0; i < (int)ed[v].size(); ++i) { if(ws[ed[v][i]] == 0) { ws[ed[v][i]] = v; DFS(ed[v][i]); } } } void BFS(int n, int s) { int v; queue<int> q; for(int i = 1; i <= n; ++i) tab[s][i] = N * 2; tab[s][s] = 0; q.push(s); while(q.size() > 0) { v = q.front(); q.pop(); for(int i = 0; i < (int)ed[v].size(); ++i) { if(tab[s][ed[v][i]] > tab[s][v] + 1) { tab[s][ed[v][i]] = tab[s][v] + 1; q.push(ed[v][i]); } } } } void encode(int n, int h, int m, int* a, int* b) { for(int i = 0; i < m; ++i) { ed[a[i] + 1].push_back(b[i] + 1); ed[a[i] + 1].push_back(b[i] + 1); } for(int i = 1; i <= h; ++i) BFS(n, i); ws[1] = 1; DFS(1); for(int i = 2; i <= h; ++i) cout << PrintBits(tab[i][1], 10); for(int i = 2; i <= n; ++i) { cout << PrintBits(ws[i], 10); cout << PrintBits(Return3(i, h), 58); } }
#include "grader.h" #include "encoder.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = 10000 + 7; int odl[37][N], dod[37][N], ws[N]; vector<int>ed[N]; void DFS(int v, int h) { for(int i = 1; i <= h; ++i) odl[i][v] = dod[i][v] + odl[i][ws[v]]; for(int i = 0; i < (int)ed[v].size(); ++i) DFS(ed[v][i]); } void Dod(ll l, int v, int h) { for(int i = 1; i <= h; ++i) { if(l % 3LL == 0) dod[i][v] = -1; if(l % 3LL == 2) dod[i][v] = 1; } } ll ReadBits(int n) { int b; ll w = 0LL; for(int i = 0; i < n; ++i) { b = decode_bit(); w += pow(2LL, j) * b; } return w; } void decode(int n, int h) { int b; ll x, l; for(int i = 2; i <= h; ++i) odl[i][1] = ReadBits(10); for(int i = 2; i <= n; ++i) { ws[i] = ReadBits(10); ed[ws[i]].push_back(i); Dod(ReadBits(58), i, h); } DFS(1); for(int i = 1; i <= h; ++i) for(int j = 1; j <= n; ++j) hops(i - 1, j - 1, odl[i][j]); }
Compilation message
encoder.cpp: In function 'll Return3(int, int)': encoder.cpp:16:32: error: reference to 'ws' is ambiguous 16 | if(tab[i][v] == tab[i][ws[i]]) | ^~ In file included from /usr/include/c++/10/istream:991, from /usr/include/c++/10/sstream:38, from /usr/include/c++/10/complex:45, from /usr/include/c++/10/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54, from encoder.cpp:3: /usr/include/c++/10/bits/istream.tcc:1024:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(std::basic_istream<_CharT, _Traits>&)' 1024 | ws(basic_istream<_CharT, _Traits>& __in) | ^~ encoder.cpp:9:24: note: 'int ws [1007]' 9 | int tab[38][1000 + 7], ws[N]; | ^~ encoder.cpp:18:31: error: reference to 'ws' is ambiguous 18 | if(tab[i][v] > tab[i][ws[i]]) | ^~ In file included from /usr/include/c++/10/istream:991, from /usr/include/c++/10/sstream:38, from /usr/include/c++/10/complex:45, from /usr/include/c++/10/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54, from encoder.cpp:3: /usr/include/c++/10/bits/istream.tcc:1024:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(std::basic_istream<_CharT, _Traits>&)' 1024 | ws(basic_istream<_CharT, _Traits>& __in) | ^~ encoder.cpp:9:24: note: 'int ws [1007]' 9 | int tab[38][1000 + 7], ws[N]; | ^~ encoder.cpp: In function 'void DFS(int)': encoder.cpp:38:12: error: reference to 'ws' is ambiguous 38 | if(ws[ed[v][i]] == 0) | ^~ In file included from /usr/include/c++/10/istream:991, from /usr/include/c++/10/sstream:38, from /usr/include/c++/10/complex:45, from /usr/include/c++/10/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54, from encoder.cpp:3: /usr/include/c++/10/bits/istream.tcc:1024:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(std::basic_istream<_CharT, _Traits>&)' 1024 | ws(basic_istream<_CharT, _Traits>& __in) | ^~ encoder.cpp:9:24: note: 'int ws [1007]' 9 | int tab[38][1000 + 7], ws[N]; | ^~ encoder.cpp:40:13: error: reference to 'ws' is ambiguous 40 | ws[ed[v][i]] = v; | ^~ In file included from /usr/include/c++/10/istream:991, from /usr/include/c++/10/sstream:38, from /usr/include/c++/10/complex:45, from /usr/include/c++/10/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54, from encoder.cpp:3: /usr/include/c++/10/bits/istream.tcc:1024:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(std::basic_istream<_CharT, _Traits>&)' 1024 | ws(basic_istream<_CharT, _Traits>& __in) | ^~ encoder.cpp:9:24: note: 'int ws [1007]' 9 | int tab[38][1000 + 7], ws[N]; | ^~ encoder.cpp: In function 'void encode(int, int, int, int*, int*)': encoder.cpp:78:5: error: reference to 'ws' is ambiguous 78 | ws[1] = 1; | ^~ In file included from /usr/include/c++/10/istream:991, from /usr/include/c++/10/sstream:38, from /usr/include/c++/10/complex:45, from /usr/include/c++/10/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54, from encoder.cpp:3: /usr/include/c++/10/bits/istream.tcc:1024:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(std::basic_istream<_CharT, _Traits>&)' 1024 | ws(basic_istream<_CharT, _Traits>& __in) | ^~ encoder.cpp:9:24: note: 'int ws [1007]' 9 | int tab[38][1000 + 7], ws[N]; | ^~ encoder.cpp:81:14: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'void') 81 | cout << PrintBits(tab[i][1], 10); | ~~~~ ^~ ~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | void | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/10/istream:39, from /usr/include/c++/10/sstream:38, from /usr/include/c++/10/complex:45, from /usr/include/c++/10/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54, from encoder.cpp:3: /usr/include/c++/10/ostream:108:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ostream_type& (*)(std::basic_ostream<_CharT, _Traits>::__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]' 108 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/10/ostream:108:36: note: no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 108 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/10/ostream:117:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ios_type& (*)(std::basic_ostream<_CharT, _Traits>::__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>; std::basic_ostream<_CharT, _Traits>::__ios_type = std::basic_ios<char>]' 117 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/10/ostream:117:32: note: no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 117 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/10/ostream:127:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]' 127 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/10/ostream:127:30: note: no known conversion for argument 1 from 'void' to 'std::ios_base& (*)(std::ios_base&)' 127 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/10/ostream:166:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]' 166 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/10/ostream:166:23: note: no known conversion for argument 1 from 'void' to 'long int' 166 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/10/ostream:170:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]' 170 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/10/ostream:170:32: note: no known conversion for argument 1 from 'void' to 'long unsigned int' 170 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/10/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]' 174 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/10/ostream:174:23: note: no known conversion for argument 1 from 'void' to 'bool' 174 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/10/ostream:784, from /usr/include/c++/10/istream:39, from /usr/include/c++/10/sstream:38, from /usr/include/c++/10/complex:45, from /usr/include/c++/10/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54, from encoder.cpp:3: /usr/include/c++/10/bits/ostream.tcc:91:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 91 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/10/bits/ostream.tcc:92:22: note: no known conversion for argument 1 from 'void' to 'short int' 92 | operator<<(short __n) | ~~~~~~^~~ In file included from /usr/include/c++/10/istream:39, from /usr/include/c++/10/sstream:38, from /usr/include/c++/10/complex:45, from /usr/include/c++/10/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54, from encoder.cpp:3: /usr/include/c++/10/ostream:181:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]' 181 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/10/ostream:181:33: note: no known conversion for argument 1 from 'void' to 'short unsigned int' 181 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ In file included from /usr/include/c++/10/ostream:784, from /usr/include/c++/10/istream:39, from /usr/include/c++/10/sstream:38, from /usr/include/c++/10/complex:45, from /usr/include/c++/10/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54, from encoder.cpp:3: /usr/include/c++/10/bits/ostream.tcc:105:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 105 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/10/bits/ostream.tcc:106:20: note: no known conversion for argument 1 from 'void' to 'int' 106 | operator<<(int __n) | ~~~~^~~ In file included from /usr/include/c++/10/istream:39, from /usr/include/c++/10/sstream:38, from /usr/include/c++/10/complex:45, from /usr/include/c++/10/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54, from encoder.cpp:3: /usr/include/c++/10/ostream:192:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]' 192 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/10/ostream:192:31: note: no known conversion for argument 1 from 'void' to 'unsigned int' 192 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/10/ostream:201:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]' 201 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/10/ostream:201:28: note: no known conversion for argument 1 from 'void' to 'long long int' 201 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/10/ostream:205:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]' 205 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/10/ostream:205:37: note: no known conversion for argument 1 from 'void' to 'long long unsigned int' 205 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/10/ostream:220:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]' 220 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/10/ostream:220:25: note: no known conversion for argument 1 from 'void' to 'double' 220 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/10/ostream:224:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]' 224 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/10/ostream:224:24: note: no known conversion for argument 1 from 'void' to 'float' 224 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/10/ostream:232:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]' 232 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/10/ostream:232:30: note: no known conversion for argument 1 from 'void' to 'long double' 232 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/10/ostream:245:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]' 245 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/10/ostream:245:30: note: no known conversion for argument 1 from 'void' to 'const void*' 245 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/10/ostream:250:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]' 250 | operator<<(nullptr_t) | ^~~~~~~~ /usr/include/c++/10/ostream:250:18: note: no known conversion for argument 1 from 'void' to 'std::nullptr_t' 250 | operator<<(nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/10/ostream:784, from /usr/include/c++/10/istream:39, from /usr/include/c++/10/sstream:38, from /usr/include/c++/10/complex:45, from /usr/include/c++/10/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54, from encoder.cpp:3: /usr/include/c++/10/bits/ostream.tcc:119:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__streambuf_type = std::basic_streambuf<char>]' 119 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/10/bits/ostream.tcc:120:34: note: no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'} 120 | operator<<(__streambuf_type* __sbin) | ~~~~~~~~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/10/regex:62, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:110, from encoder.cpp:3: /usr/include/c++/10/bits/regex.h:1647:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::__cxx11::sub_match<_Bi_iter>&)' 1647 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os, | ^~~~~~~~ /usr/include/c++/10/bits/regex.h:1647:5: note: template argument deduction/substitution failed: encoder.cpp:81:40: note: mismatched types 'const std::__cxx11::sub_match<_Bi_iter>' and 'void' 81 | cout << PrintBits(tab[i][1], 10); | ^ In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:45, from encoder.cpp:3: /usr/include/c++/10/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(std::byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/10/cstddef:125:5: note: template argument deduction/substitution failed: encoder.cpp:81:9: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 81 | cout << PrintBits(tab[i][1], 10); | ^~~~ In file included from /usr/incl decoder.cpp: In function 'void DFS(int, int)': decoder.cpp:14:40: error: reference to 'ws' is ambiguous 14 | odl[i][v] = dod[i][v] + odl[i][ws[v]]; | ^~ In file included from /usr/include/c++/10/istream:991, from /usr/include/c++/10/sstream:38, from /usr/include/c++/10/complex:45, from /usr/include/c++/10/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54, from decoder.cpp:3: /usr/include/c++/10/bits/istream.tcc:1024:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(std::basic_istream<_CharT, _Traits>&)' 1024 | ws(basic_istream<_CharT, _Traits>& __in) | ^~ decoder.cpp:8:29: note: 'int ws [10007]' 8 | int odl[37][N], dod[37][N], ws[N]; | ^~ decoder.cpp:16:21: error: too few arguments to function 'void DFS(int, int)' 16 | DFS(ed[v][i]); | ^ decoder.cpp:11:6: note: declared here 11 | void DFS(int v, int h) | ^~~ decoder.cpp: In function 'll ReadBits(int)': decoder.cpp:37:23: error: 'j' was not declared in this scope 37 | w += pow(2LL, j) * b; | ^ decoder.cpp: In function 'void decode(int, int)': decoder.cpp:50:9: error: reference to 'ws' is ambiguous 50 | ws[i] = ReadBits(10); | ^~ In file included from /usr/include/c++/10/istream:991, from /usr/include/c++/10/sstream:38, from /usr/include/c++/10/complex:45, from /usr/include/c++/10/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54, from decoder.cpp:3: /usr/include/c++/10/bits/istream.tcc:1024:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(std::basic_istream<_CharT, _Traits>&)' 1024 | ws(basic_istream<_CharT, _Traits>& __in) | ^~ decoder.cpp:8:29: note: 'int ws [10007]' 8 | int odl[37][N], dod[37][N], ws[N]; | ^~ decoder.cpp:51:12: error: reference to 'ws' is ambiguous 51 | ed[ws[i]].push_back(i); | ^~ In file included from /usr/include/c++/10/istream:991, from /usr/include/c++/10/sstream:38, from /usr/include/c++/10/complex:45, from /usr/include/c++/10/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54, from decoder.cpp:3: /usr/include/c++/10/bits/istream.tcc:1024:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(std::basic_istream<_CharT, _Traits>&)' 1024 | ws(basic_istream<_CharT, _Traits>& __in) | ^~ decoder.cpp:8:29: note: 'int ws [10007]' 8 | int odl[37][N], dod[37][N], ws[N]; | ^~ decoder.cpp:54:10: error: too few arguments to function 'void DFS(int, int)' 54 | DFS(1); | ^ decoder.cpp:11:6: note: declared here 11 | void DFS(int v, int h) | ^~~ decoder.cpp:44:9: warning: unused variable 'b' [-Wunused-variable] 44 | int b; | ^ decoder.cpp:45:8: warning: unused variable 'x' [-Wunused-variable] 45 | ll x, l; | ^ decoder.cpp:45:11: warning: unused variable 'l' [-Wunused-variable] 45 | ll x, l; | ^