Submission #1199343

#TimeUsernameProblemLanguageResultExecution timeMemory
1199343santialt2통행료 (IOI18_highway)C++20
0 / 100
32 ms2532 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 = U.size();
	vl empty(m, 0);
	ll dist = ask(empty);
	dist /= a;
	//cout << "DIST " << dist << ed;
	ll l = 0, r = m+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 << "AAAAAAAAAAA " << r << " " << U[r] << ed;
	answer(r, r+dist);
	return;
}
/*
int main(){
	cin >> N >> A >> B >> s_ >> t_;
	vl q1(N-1), q2(N-1);
	ff(i, 0, N-1){
		cin >> q1[i];
	}
	ff(i, 0, N-1){
		cin >> q2[i];
	}
	
	find_pair(N, q1, q2, 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...