Submission #1199327

#TimeUsernameProblemLanguageResultExecution timeMemory
1199327santialt2Highway Tolls (IOI18_highway)C++20
0 / 100
33 ms2544 KiB
#include "highway.h" #include <bits/stdc++.h> using namespace std; #define ll int #define vl vector<ll> #define pb push_back #define pll pair<ll, ll> #define vs vector<string> #define vb vector<bool> #define all(aaa) aaa.begin(), aaa.end() #define rall(aaa) aaa.rbegin(), aaa.rend() #define ff(aa, bb, cc) for(ll aa = bb; aa < cc; aa++) #define IO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define ed "\n" #define fi first #define se second ll MOD = 1e9+7; /* ll A, B, N, s_, t_; ll ask(vl p){ ll c = 0; ff(i, s_, t_){ if(p[i] == 0){ c += A; } else{ c += B; } } cout << "ASK " << c << ed; for(ll q : p){ cout << q; } cout << ed; return c; } ll qq = 0, qqq = 0; void answer(ll a, ll b){ qq = a; qqq = b; cout << ed << "================== " << a << " " << b << ed; } */ void find_pair(ll n, vl U, vl V, ll a, ll b){ ll m = n-1; vl empty(m, 0); ll dist = ask(empty); dist /= a; //cout << "DIST " << dist << ed; ll l = 0, r = m-dist+1; while(r-l > 1){ ll mid = (l+r)/2; vl cur = empty; fill(cur.begin(), cur.begin()+mid, 1); ll x = ask(cur); if(x == dist*a){ //cout << "C1" << ed; l = mid; } else{ //cout << "C2" << ed; r = mid; } } r--; //cout << "R " << r << " " << " DIST " << dist << " SUMA " << r+dist << ed; answer(r, r+dist); } /* int main(){ cin >> N >> A >> B >> s_ >> t_; vl coso(N-1, 0); ff(i, 0, N){ ff(j, i+1, N){ s_ = i; t_ = j; find_pair(N, coso, coso, A, B); cout << "COSO " << qq << " " << qqq << ed << "PP " << i << " " << j << ed << ed << ed << ed; if(qq != i || qqq != j){ return 0; } } } find_pair(N, coso, coso, A, B); return 0; } */
#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...