Submission #1089924

#TimeUsernameProblemLanguageResultExecution timeMemory
1089924JovicaSimurgh (IOI17_simurgh)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #include "simurgh.h" vector<int> odg; void f(vector<int> v,int p,int m,int n) { if (p==m) { if (count(common_roads(v))==m-1) odg = v; return; } f(v,p+1,m,n); if (v.size()<n-1) { v.push_back(p); f(v,p+1,m,n); } } vector<int> find_roads(int n, vector<int> u, vector<int> v) { f({},0,u.size(),n); return odg; } /* int main() { vector<int> odg = find_roads(4, [0, 0, 0, 1, 1, 2], [1, 2, 3, 2, 3, 3]); for (int i=0;i<odg.size();i++) cout<<odg[i]<<" "; return 0; }*/

Compilation message (stderr)

simurgh.cpp: In function 'void f(std::vector<int>, int, int, int)':
simurgh.cpp:12:19: error: 'common_roads' was not declared in this scope; did you mean 'count_common_roads'?
   12 |         if (count(common_roads(v))==m-1) odg = v;
      |                   ^~~~~~~~~~~~
      |                   count_common_roads
simurgh.cpp:17:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   17 |     if (v.size()<n-1)
      |         ~~~~~~~~^~~~