Submission #105022

#TimeUsernameProblemLanguageResultExecution timeMemory
105022bert30702Simurgh (IOI17_simurgh)C++17
0 / 100
2 ms380 KiB
#include <bits/stdc++.h> #include "simurgh.h" #define pii pair<int, int> #define F first #define S second using namespace std; vector<int> ans; //int count_common_roads(vector<int> v) { // for(auto it: v) cout << it << ' '; cout << endl; // int a; cin >> a; return a; //} int dfs(int l, int r) { vector<int> que; for(int i = l; i <= r; i ++) que.push_back(i); int v = count_common_roads(que); if(!v) return 0; if(v == r - l + 1) return ans.insert(ans.end(), que.begin(), que.end()), v; int m = l + r >> 1; int k = dfs(l, m); if(k != v) dfs(m + 1, r); } vector<int> find_roads(int n, vector<int> u, vector<int> v) { dfs(0, u.size() - 1); return ans; } //main () { // vector<int> ans = find_roads(4, {0, 0, 0, 1, 1, 2}, {1, 2, 3, 2, 3, 3}); // for(auto it: ans) cout << it << ' '; cout << endl; //}

Compilation message (stderr)

simurgh.cpp: In function 'int dfs(int, int)':
simurgh.cpp:18:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  int m = l + r >> 1;
          ~~^~~
simurgh.cpp:21:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#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...