Submission #856770

# Submission time Handle Problem Language Result Execution time Memory
856770 2023-10-04T13:52:50 Z iulia_morariu Speedrun (RMI21_speedrun) C++14
Compilation error
0 ms 0 KB
#include <speedrun.h>
#include <bits/stdc++.h>
 
void assignHints (int subtask , int N, int A[], int B[]){
    vector <vector <int>> v[N + 1];
    setHintLen( N );
 
    for(int i = 1; i < N; i++){
        setHint( A[i], B[i], 1);
        setHint( B[i], A[i], 1);
    }
}
 
int vis[1001];
void dfs(int nd, int n){
    vis[nd] = 1;
    //cout << "Suntem la " << nd << endl;
    for(int i = 1; i <= n; i++){
        if( vis[i] || getHint(i) == 0 ) continue;
        //cout << "  -- > i = " << i << " getHint = " << getHint(i) << endl;
        goTo(i);
        vis[i] = 1;
        dfs(i, n);
        goTo(nd);
    }
}
 
void speedrun(int subtask , int N, int start ){
    for(int i = 0; i <= N; i++) vis[i] = 0;
    vis[start] = 1;
    stack<int> s;
    s.push(start);
 
    dfs(start, N);
}

Compilation message

speedrun.cpp: In function 'void assignHints(int, int, int*, int*)':
speedrun.cpp:5:5: error: 'vector' was not declared in this scope; did you mean 'std::vector'?
    5 |     vector <vector <int>> v[N + 1];
      |     ^~~~~~
      |     std::vector
In file included from /usr/include/c++/10/vector:67,
                 from /usr/include/c++/10/queue:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:86,
                 from speedrun.cpp:2:
/usr/include/c++/10/bits/stl_vector.h:389:11: note: 'std::vector' declared here
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
speedrun.cpp:5:21: error: expected primary-expression before 'int'
    5 |     vector <vector <int>> v[N + 1];
      |                     ^~~
speedrun.cpp: In function 'void speedrun(int, int, int)':
speedrun.cpp:31:5: error: 'stack' was not declared in this scope; did you mean 'std::stack'?
   31 |     stack<int> s;
      |     ^~~~~
      |     std::stack
In file included from /usr/include/c++/10/stack:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:89,
                 from speedrun.cpp:2:
/usr/include/c++/10/bits/stl_stack.h:99:11: note: 'std::stack' declared here
   99 |     class stack
      |           ^~~~~
speedrun.cpp:31:11: error: expected primary-expression before 'int'
   31 |     stack<int> s;
      |           ^~~
speedrun.cpp:32:5: error: 's' was not declared in this scope
   32 |     s.push(start);
      |     ^