Submission #765742

#TimeUsernameProblemLanguageResultExecution timeMemory
765742ono_de206Highway Tolls (IOI18_highway)C++14
6 / 100
85 ms2080 KiB
#include "highway.h" #include<bits/stdc++.h> using namespace std; #define in insert #define all(x) x.begin(),x.end() #define pb push_back #define eb emplace_back #define ff first #define ss second // #define int long long typedef long long ll; typedef vector<int> vi; typedef set<int> si; typedef multiset<int> msi; typedef pair<int, int> pii; typedef vector<pii> vpii; const int mxn = 1e5 + 10; void find_pair(int n, vector<int> U, vector<int> V, int A, int B) { int m = U.size(); vector<int> q(m, 1); long long tot = ask(q); int dis = tot / B; int L = 0, R = n - 1; while(R - L > 1) { int M = (R + L) / 2; for(int i = 0; i < M; i++) { q[i] = 0; } long long ans = ask(q); for(int i = 0; i < M; i++) { q[i] = 1; } if(ans != tot) R = M; else L = M; } answer(L, L + dis); }
#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...