Submission #764904

# Submission time Handle Problem Language Result Execution time Memory
764904 2023-06-24T06:26:19 Z vjudge1 Speedrun (RMI21_speedrun) C++17
Compilation error
0 ms 0 KB
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <bitset>
#include <cmath>
#include <queue>
#include <map>
#include <set>
// #include "speedrun.h"

// Akhmet Issa

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define ent "\n"

const int maxn = 1e6 + 100;
const ll INF = (ll)2e18;
const int inf = (ll)2e9;
const int maxl = 20;
const int MOD = 1e9 + 7;

int r;
vector<int> g[maxn];
int used[maxn];

void assignHints(int subtask, int n, int A [], int B []){
    for(int i = 1; i < n; i++){
        g[A[i]].push_back(B[i]);
        g[B[i]].push_back(A[i]);
    }
    setHintLen(1);
    for(int i = 1; i <= n; i++){
        if(g[i].size() > 1){
            setHint(i, 1, 1);
            r = i;
        }
    }
    if(!r) r = 1;
}

void dfs(int v, int pr, int n){
    used[v] = 1;
    if(get(1)){
        for(int to = 1; to <= n; to++){
            if(!used[to]){
                goTo(to);
                dfs(to, v, n);
            }
        }
    } else{
        if(!used[r]){
            goTo(r);
            dfs(r, v, n);
        }
    }
    if(pr) goTo(pr);
}

void speedrun(int subtask, int n, int start){
    dfs(start, 0, n);
}

Compilation message

speedrun.cpp: In function 'void assignHints(int, int, int*, int*)':
speedrun.cpp:34:5: error: 'setHintLen' was not declared in this scope
   34 |     setHintLen(1);
      |     ^~~~~~~~~~
speedrun.cpp:37:13: error: 'setHint' was not declared in this scope
   37 |             setHint(i, 1, 1);
      |             ^~~~~~~
speedrun.cpp: In function 'void dfs(int, int, int)':
speedrun.cpp:46:13: error: no matching function for call to 'get(int)'
   46 |     if(get(1)){
      |             ^
In file included from /usr/include/c++/10/algorithm:60,
                 from speedrun.cpp:1:
/usr/include/c++/10/utility:223:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(std::pair<_Tp1, _Tp2>&)'
  223 |     get(std::pair<_Tp1, _Tp2>& __in) noexcept
      |     ^~~
/usr/include/c++/10/utility:223:5: note:   template argument deduction/substitution failed:
speedrun.cpp:46:13: note:   mismatched types 'std::pair<_Tp1, _Tp2>' and 'int'
   46 |     if(get(1)){
      |             ^
In file included from /usr/include/c++/10/algorithm:60,
                 from speedrun.cpp:1:
/usr/include/c++/10/utility:228:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&& std::get(std::pair<_Tp1, _Tp2>&&)'
  228 |     get(std::pair<_Tp1, _Tp2>&& __in) noexcept
      |     ^~~
/usr/include/c++/10/utility:228:5: note:   template argument deduction/substitution failed:
speedrun.cpp:46:13: note:   mismatched types 'std::pair<_Tp1, _Tp2>' and 'int'
   46 |     if(get(1)){
      |             ^
In file included from /usr/include/c++/10/algorithm:60,
                 from speedrun.cpp:1:
/usr/include/c++/10/utility:233:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr const typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(const std::pair<_Tp1, _Tp2>&)'
  233 |     get(const std::pair<_Tp1, _Tp2>& __in) noexcept
      |     ^~~
/usr/include/c++/10/utility:233:5: note:   template argument deduction/substitution failed:
speedrun.cpp:46:13: note:   mismatched types 'const std::pair<_Tp1, _Tp2>' and 'int'
   46 |     if(get(1)){
      |             ^
In file included from /usr/include/c++/10/algorithm:60,
                 from speedrun.cpp:1:
/usr/include/c++/10/utility:238:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr const typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&& std::get(const std::pair<_Tp1, _Tp2>&&)'
  238 |     get(const std::pair<_Tp1, _Tp2>&& __in) noexcept
      |     ^~~
/usr/include/c++/10/utility:238:5: note:   template argument deduction/substitution failed:
speedrun.cpp:46:13: note:   mismatched types 'const std::pair<_Tp1, _Tp2>' and 'int'
   46 |     if(get(1)){
      |             ^
In file included from /usr/include/c++/10/algorithm:60,
                 from speedrun.cpp:1:
/usr/include/c++/10/utility:247:5: note: candidate: 'template<class _Tp, class _Up> constexpr _Tp& std::get(std::pair<_T1, _T2>&)'
  247 |     get(pair<_Tp, _Up>& __p) noexcept
      |     ^~~
/usr/include/c++/10/utility:247:5: note:   template argument deduction/substitution failed:
speedrun.cpp:46:13: note:   mismatched types 'std::pair<_T1, _T2>' and 'int'
   46 |     if(get(1)){
      |             ^
In file included from /usr/include/c++/10/algorithm:60,
                 from speedrun.cpp:1:
/usr/include/c++/10/utility:252:5: note: candidate: 'template<class _Tp, class _Up> constexpr const _Tp& std::get(const std::pair<_T1, _T2>&)'
  252 |     get(const pair<_Tp, _Up>& __p) noexcept
      |     ^~~
/usr/include/c++/10/utility:252:5: note:   template argument deduction/substitution failed:
speedrun.cpp:46:13: note:   mismatched types 'const std::pair<_T1, _T2>' and 'int'
   46 |     if(get(1)){
      |             ^
In file included from /usr/include/c++/10/algorithm:60,
                 from speedrun.cpp:1:
/usr/include/c++/10/utility:257:5: note: candidate: 'template<class _Tp, class _Up> constexpr _Tp&& std::get(std::pair<_T1, _T2>&&)'
  257 |     get(pair<_Tp, _Up>&& __p) noexcept
      |     ^~~
/usr/include/c++/10/utility:257:5: note:   template argument deduction/substitution failed:
speedrun.cpp:46:13: note:   mismatched types 'std::pair<_T1, _T2>' and 'int'
   46 |     if(get(1)){
      |             ^
In file included from /usr/include/c++/10/algorithm:60,
                 from speedrun.cpp:1:
/usr/include/c++/10/utility:262:5: note: candidate: 'template<class _Tp, class _Up> constexpr const _Tp&& std::get(const std::pair<_T1, _T2>&&)'
  262 |     get(const pair<_Tp, _Up>&& __p) noexcept
      |     ^~~
/usr/include/c++/10/utility:262:5: note:   template argument deduction/substitution failed:
speedrun.cpp:46:13: note:   mismatched types 'const std::pair<_T1, _T2>' and 'int'
   46 |     if(get(1)){
      |             ^
In file included from /usr/include/c++/10/algorithm:60,
                 from speedrun.cpp:1:
/usr/include/c++/10/utility:267:5: note: candidate: 'template<class _Tp, class _Up> constexpr _Tp& std::get(std::pair<_Up, _Tp>&)'
  267 |     get(pair<_Up, _Tp>& __p) noexcept
      |     ^~~
/usr/include/c++/10/utility:267:5: note:   template argument deduction/substitution failed:
speedrun.cpp:46:13: note:   mismatched types 'std::pair<_Up, _Tp>' and 'int'
   46 |     if(get(1)){
      |             ^
In file included from /usr/include/c++/10/algorithm:60,
                 from speedrun.cpp:1:
/usr/include/c++/10/utility:272:5: note: candidate: 'template<class _Tp, class _Up> constexpr const _Tp& std::get(const std::pair<_Up, _Tp>&)'
  272 |     get(const pair<_Up, _Tp>& __p) noexcept
      |     ^~~
/usr/include/c++/10/utility:272:5: note:   template argument deduction/substitution failed:
speedrun.cpp:46:13: note:   mismatched types 'const std::pair<_Up, _Tp>' and 'int'
   46 |     if(get(1)){
      |             ^
In file included from /usr/include/c++/10/algorithm:60,
                 from speedrun.cpp:1:
/usr/include/c++/10/utility:277:5: note: candidate: 'template<class _Tp, class _Up> constexpr _Tp&& std::get(std::pair<_Up, _Tp>&&)'
  277 |     get(pair<_Up, _Tp>&& __p) noexcept
      |     ^~~
/usr/include/c++/10/utility:277:5: note:   template argument deduction/substitution failed:
speedrun.cpp:46:13: note:   mismatched types 'std::pair<_Up, _Tp>' and 'int'
   46 |     if(get(1)){
      |             ^
In file included from /usr/include/c++/10/algorithm:60,
                 from speedrun.cpp:1:
/usr/include/c++/10/utility:282:5: note: candidate: 'template<class _Tp, class _Up> constexpr const _Tp&& std::get(const std::pair<_Up, _Tp>&&)'
  282 |     get(const pair<_Up, _Tp>&& __p) noexcept
      |     ^~~
/usr/include/c++/10/utility:282:5: note:   template argument deduction/substitution failed:
speedrun.cpp:46:13: note:   mismatched types 'const std::pair<_Up, _Tp>' and 'int'
   46 |     if(get(1)){
      |             ^
In file included from /usr/include/c++/10/tuple:39,
                 from /usr/include/c++/10/functional:54,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from speedrun.cpp:1:
/usr/include/c++/10/array:334:5: note: candidate: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr _Tp& std::get(std::array<_Tp, _Nm>&)'
  334 |     get(array<_Tp, _Nm>& __arr) noexcept
      |     ^~~
/usr/include/c++/10/array:334:5: note:   template argument deduction/substitution failed:
speedrun.cpp:46:13: note:   mismatched types 'std::array<_Tp, _Nm>' and 'int'
   46 |     if(get(1)){
      |             ^
In file included from /usr/include/c++/10/tuple:39,
                 from /usr/include/c++/10/functional:54,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from speedrun.cpp:1:
/usr/include/c++/10/array:343:5: note: candidate: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr _Tp&& std::get(std::array<_Tp, _Nm>&&)'
  343 |     get(array<_Tp, _Nm>&& __arr) noexcept
      |     ^~~
/usr/include/c++/10/array:343:5: note:   template argument deduction/substitution failed:
speedrun.cpp:46:13: note:   mismatched types 'std::array<_Tp, _Nm>' and 'int'
   46 |     if(get(1)){
      |             ^
In file included from /usr/include/c++/10/tuple:39,
                 from /usr/include/c++/10/functional:54,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from speedrun.cpp:1:
/usr/include/c++/10/array:351:5: note: candidate: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr const _Tp& std::get(const std::array<_Tp, _Nm>&)'
  351 |     get(const array<_Tp, _Nm>& __arr) noexcept
      |     ^~~
/usr/include/c++/10/array:351:5: note:   template argument deduction/substitution failed:
speedrun.cpp:46:13: note:   mismatched types 'const std::array<_Tp, _Nm>' and 'int'
   46 |     if(get(1)){
      |             ^
In file included from /usr/include/c++/10/tuple:39,
                 from /usr/include/c++/10/functional:54,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from speedrun.cpp:1:
/usr/include/c++/10/array:360:5: note: candidate: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr const _Tp&& std::get(const std::array<_Tp, _Nm>&&)'
  360 |     get(const array<_Tp, _Nm>&& __arr) noexcept
      |     ^~~
/usr/include/c++/10/array:360:5: note:   template argument deduction/substitution failed:
speedrun.cpp:46:13: note:   mismatched types 'const std::array<_Tp, _Nm>' and 'int'
   46 |     if(get(1)){
      |             ^
In file included from /usr/include/c++/10/functional:54,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from speedrun.cpp:1:
/usr/include/c++/10/tuple:1294:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_UTypes ...> >& std::get(std::tuple<_UTypes ...>&)'
 1294 |     get(tuple<_Elements...>& __t) noexcept
      |     ^~~
/usr/include/c++/10/tuple:1294:5: note:   template argument deduction/substitution failed:
speedrun.cpp:46:13: note:   mismatched types 'std::tuple<_UTypes ...>' and 'int'
   46 |     if(get(1)){
      |             ^
In file included from /usr/include/c++/10/functional:54,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from speedrun.cpp:1:
/usr/include/c++/10/tuple:1300:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_UTypes ...> >& std::get(const std::tuple<_UTypes ...>&)'
 1300 |     get(const tuple<_Elements...>& __t) noexcept
      |     ^~~
/usr/include/c++/10/tuple:1300:5: note:   template argument deduction/substitution failed:
speedrun.cpp:46:13: note:   mismatched types 'const std::tuple<_UTypes ...>' and 'int'
   46 |     if(get(1)){
      |             ^
In file included from /usr/include/c++/10/functional:54,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from speedrun.cpp:1:
/usr/include/c++/10/tuple:1306:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_UTypes ...> >&& std::get(std::tuple<_UTypes ...>&&)'
 1306 |     get(tuple<_Elements...>&& __t) noexcept
      |     ^~~
/usr/include/c++/10/tuple:1306:5: note:   template argument deduction/substitution failed:
speedrun.cpp:46:13: note:   mismatched types 'std::tuple<_UTypes ...>' and 'int'
   46 |     if(get(1)){
      |             ^
In file included from /usr/include/c++/10/functional:54,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from speedrun.cpp:1:
/usr/include/c++/10/tuple:1315:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_UTypes ...> >&& std::get(const std::tuple<_UTypes ...>&&)'
 1315 |     get(const tuple<_Elements...>&& __t) noexcept
      |     ^~~
/usr/include/c++/10/tuple:1315:5: note:   template argument deduction/substitution failed:
speedrun.cpp:46:13: note:   mismatched types 'const std::tuple<_UTypes ...>' and 'int'
   46 |     if(get(1)){
      |             ^
In file included from /usr/include/c++/10/functional:54,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from speedrun.cpp:1:
/usr/include/c++/10/tuple:1338:5: note: candidate: 'template<class _Tp, class ... _Types> constexpr _Tp& std::get(std::tuple<_UTypes ...>&)'
 1338 |     get(tuple<_Types...>& __t) noexcept
      |     ^~~
/usr/include/c++/10/tuple:1338:5: note:   template argument deduction/substitution failed:
speedrun.cpp:46:13: note:   mismatched types 'std::tuple<_UTypes ...>' and 'int'
   46 |     if(get(1)){
      |             ^
In file included from /usr/include/c++/10/functional:54,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from speedrun.cpp:1:
/usr/include/c++/10/tuple:1344:5: note: candidate: 'template<class _Tp, class ... _Types> constexpr _Tp&& std::get(std::tuple<_UTypes ...>&&)'
 1344 |     get(tuple<_Types...>&& __t) noexcept
      |     ^~~
/usr/include/c++/10/tuple:1344:5: note:   template argument deduction/substitution failed:
speedrun.cpp:46:13: note:   mismatched types 'std::tuple<_UTypes ...>' and 'int'
   46 |     if(get(1)){
      |             ^
In file included from /usr/include/c++/10/functional:54,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from speedrun.cpp:1:
/usr/include/c++/10/tuple:1350:5: note: candidate: 'template<class _Tp, class ... _Types> constexpr const _Tp& std::get(const std::tuple<_UTypes ...>&)'
 1350 |     get(const tuple<_Types...>& __t) noexcept
      |     ^~~
/usr/include/c++/10/tuple:1350:5: note:   template argument deduction/substitution failed:
speedrun.cpp:46:13: note:   mismatched types 'const std::tuple<_UTypes ...>' and 'int'
   46 |     if(get(1)){
      |             ^
In file included from /usr/include/c++/10/functional:54,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from speedrun.cpp:1:
/usr/include/c++/10/tuple:1357:5: note: candidate: 'template<class _Tp, class ... _Types> constexpr const _Tp&& std::get(const std::tuple<_UTypes ...>&&)'
 1357 |     get(const tuple<_Types...>&& __t) noexcept
      |     ^~~
/usr/include/c++/10/tuple:1357:5: note:   template argument deduction/substitution failed:
speedrun.cpp:46:13: note:   mismatched types 'const std::tuple<_UTypes ...>' and 'int'
   46 |     if(get(1)){
      |             ^
speedrun.cpp:49:17: error: 'goTo' was not declared in this scope
   49 |                 goTo(to);
      |                 ^~~~
speedrun.cpp:55:13: error: 'goTo' was not declared in this scope
   55 |             goTo(r);
      |             ^~~~
speedrun.cpp:59:12: error: 'goTo' was not declared in this scope
   59 |     if(pr) goTo(pr);
      |            ^~~~