답안 #138836

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
138836 2019-07-30T12:44:55 Z muradeyn 통행료 (IOI18_highway) C++14
0 / 100
82 ms 900 KB
#include "highway.h"
#include <bits/stdc++.h>
#define F first
#define S second
#define intt long long

using namespace std;

const int maxx = 100000;

vector<int>w;

void find_pair(int n, vector<int> u, vector<int> vv, int a, int b) {
	int m = u.size();
	w.resize(m , 0);
	intt ret = ask(w);
	intt len = ret / (1LL * a);
	int l = 0 , r = n - 1;
	while (r - l != len) {
		int mid = (l + r) >> 1;
		for (int i = l;i<mid;i++)w[i] = 0;
		for (int i = mid;i < r;i++)w[i] = 1;
		ret = ask(w);
		if (ret / len == b) l = mid;
		else if (ret / len == a) r = mid;
		else {
			for (int i = l;i<mid;i++) {
				intt res = 1LL * (mid - i) * a;
				res += 1LL * (len - (mid - i)) * b;
				if (res == ret) {
					l = i;
					r = i + len;
					break;
				}
			}
		}
	}
	answer(l , r);
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 248 KB Output is incorrect: more than 100 calls to ask.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Output is incorrect: {s, t} is wrong.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 504 KB Output is correct
2 Correct 59 ms 596 KB Output is correct
3 Incorrect 82 ms 900 KB Output is incorrect: more than 100 calls to ask.
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 296 KB Output is incorrect: more than 100 calls to ask.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 17 ms 524 KB Output is incorrect: more than 100 calls to ask.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 16 ms 524 KB Output is incorrect: {s, t} is wrong.
2 Halted 0 ms 0 KB -