QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#257307#7749. A Simple MST Problemucup-team2379Compile Error//C++142.5kb2023-11-19 02:16:182023-11-19 02:16:18

Details

answer.code: In member function ‘std::vector<int> dsu::leaders()’:
answer.code:40:5: warning: no return statement in function returning non-void [-Wreturn-type]
   40 |     }
      |     ^
answer.code: In function ‘void solve()’:
answer.code:74:47: error: ‘gcd’ was not declared in this scope
   74 |             pq.push({-omega[i]-omega[j]+omega[gcd(i,j)],i,j});
      |                                               ^~~
answer.code:74:20: error: no matching function for call to ‘std::priority_queue<std::tuple<long long int, long long int, long long int> >::push(<brace-enclosed initializer list>)’
   74 |             pq.push({-omega[i]-omega[j]+omega[gcd(i,j)],i,j});
      |             ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11/queue:64,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:86,
                 from answer.code:1:
/usr/include/c++/11/bits/stl_queue.h:640:7: note: candidate: ‘void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = std::tuple<long long int, long long int, long long int>; _Sequence = std::vector<std::tuple<long long int, long long int, long long int>, std::allocator<std::tuple<long long int, long long int, long long int> > >; _Compare = std::less<std::tuple<long long int, long long int, long long int> >; std::priority_queue<_Tp, _Sequence, _Compare>::value_type = std::tuple<long long int, long long int, long long int>]’
  640 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/11/bits/stl_queue.h:640:30: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const value_type&’ {aka ‘const std::tuple<long long int, long long int, long long int>&’}
  640 |       push(const value_type& __x)
      |            ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/11/bits/stl_queue.h:648:7: note: candidate: ‘void std::priority_queue<_Tp, _Sequence, _Compare>::push(std::priority_queue<_Tp, _Sequence, _Compare>::value_type&&) [with _Tp = std::tuple<long long int, long long int, long long int>; _Sequence = std::vector<std::tuple<long long int, long long int, long long int>, std::allocator<std::tuple<long long int, long long int, long long int> > >; _Compare = std::less<std::tuple<long long int, long long int, long long int> >; std::priority_queue<_Tp, _Sequence, _Compare>::value_type = std::tuple<long long int, long long int, long long int>]’
  648 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/11/bits/stl_queue.h:648:25: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::priority_queue<std::tuple<long long int, long long int, long long int> >::value_type&&’ {aka ‘std::tuple<long long int, long long int, long long int>&&’}
  648 |       push(value_type&& __x)
      |            ~~~~~~~~~~~~~^~~
answer.code:77:17: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’
   77 |             auto[x,y,z]=pq.top();
      |                 ^