Submission #68758

#TimeUsernameProblemLanguageResultExecution timeMemory
68758TalantSimurgh (IOI17_simurgh)C++17
0 / 100
30 ms23988 KiB
#include "simurgh.h" //#include "grader.cpp" #include <bits/stdc++.h> #define sc second #define fr first #define mk make_pair #define pb push_back using namespace std; const int N = (1e6 + 5); const int inf = (1e9 + 7); vector <pair<int,int> > g[N]; vector <int> vec,ans; int was[N]; int nn; int f; void dfs (int v) { if (f) return; was[v] = 1; for (auto to : g[v]) { if (!was[to.fr]) { vec.pb(to.sc); dfs(to.fr); vec.pop_back(); } } was[v] = 0; if (vec.size() == nn - 1) { int o = count_common_roads(vec); if (o == nn - 1) { ans = vec; f = 1; return; } } } vector<int> find_roads(int n, vector<int> u, vector<int> v) { nn = n; for (int i = 0; i < u.size(); i ++) { g[u[i]].pb(mk(v[i],i)); g[v[i]].pb(mk(u[i],i)); } for (int i = 0; i < n; i ++) { dfs(i); if (f) return ans; } return ans; }

Compilation message (stderr)

simurgh.cpp: In function 'void dfs(int)':
simurgh.cpp:34:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if (vec.size() == nn - 1) {
           ~~~~~~~~~~~^~~~~~~~~
simurgh.cpp: In function 'std::vector<int> find_roads(int, std::vector<int>, std::vector<int>)':
simurgh.cpp:45:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < u.size(); i ++) {
                  ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...