Submission #785291

#TimeUsernameProblemLanguageResultExecution timeMemory
785291drdilyorHighway Tolls (IOI18_highway)C++17
5 / 100
12 ms1104 KiB
#include <bits/stdc++.h> #include "highway.h" #ifdef ONPC #include "t_debug.cpp" #else #define debug(...) 42 #endif using namespace std; //namespace pbds = __gnu_pbds; using ll = long long; const int inf = 1e9; const ll infl = 1e18; const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count(); mt19937 rng(RANDOM); template<typename T, typename U> istream& operator>>(istream& is, pair<T, U>& p) { return is >> p.first >> p.second; } template<typename Cont> int sz(const Cont& cont) { return int(cont.size()); } // template<typename Func> struct ycom { Func f; template<typename... T> auto operator()(T&&... args) { return f(*this, args...); } }; template<typename Func> ycom(Func) -> ycom<Func>; template<typename T> typename vector<T>::iterator operator+(const vector<T>& x, int i) { return x.begin() + i ;}; const string fileio = ""; constexpr int tests = 1, nmax = 2e5, nlog = __lg(nmax), mod = 1e9+7; void find_pair(int32_t n, std::vector<int32_t> u, std::vector<int32_t> v, int32_t a, int32_t b) { int m = u.size(); vector<vector<pair<int,int>>> adj(n); for (int i = 0; i < m; i++) { adj[u[i]].emplace_back(v[i], i); adj[v[i]].emplace_back(u[i], i); } int base = ask(vector(m, 0)); vector<int> ans; for (int i = 1; i < n; i++) { vector<int> w(m); for (auto[e, ei] : adj[i]) { w[ei] = 1; } int cost = ask(w); if (cost == base -a + b) { ans.push_back(i); } } ans.push_back(0); answer(ans[0], ans[1]); }
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...