Submission #138842

# Submission time Handle Problem Language Result Execution time Memory
138842 2019-07-30T12:59:32 Z muradeyn Highway Tolls (IOI18_highway) C++14
6 / 100
130 ms 2092 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 == 0 && ret / len == b) l = mid;
		else if (ret % len == 0 && 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);
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 248 KB Output is incorrect: {s, t} is wrong.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output is incorrect: {s, t} is wrong.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 17 ms 504 KB Output is correct
2 Correct 31 ms 592 KB Output is correct
3 Correct 48 ms 812 KB Output is correct
4 Correct 127 ms 2092 KB Output is correct
5 Correct 114 ms 2092 KB Output is correct
6 Correct 130 ms 2056 KB Output is correct
7 Correct 128 ms 2088 KB Output is correct
8 Correct 115 ms 2060 KB Output is correct
9 Correct 122 ms 2048 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 248 KB Output is incorrect: {s, t} is wrong.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 520 KB Output is incorrect: {s, t} is wrong.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 11 ms 520 KB Output is incorrect: {s, t} is wrong.
2 Halted 0 ms 0 KB -