Submission #821573

# Submission time Handle Problem Language Result Execution time Memory
821573 2023-08-11T11:41:59 Z Dan4Life Highway Tolls (IOI18_highway) C++17
6 / 100
99 ms 6860 KB
#include "highway.h"
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
#define pb push_back
#define sz(a) (int)a.size()
#define all(a) begin(a),end(a)
const int mxN = (int)2e5+10;
using ll = long long;
vector<pair<int,int>> adj[mxN];
int n, m, dist, dis[mxN];

void find_pair(int N, vi u, vi v, int A, int B) {
	n = N; m = sz(u); vi w(m,0);
	ll toll = ask(w);
	int l = 0, r = m-1;
	while(l<r){
		int mid = (l+r)/2; fill(all(w),0);
		fill(begin(w),begin(w)+mid+1,1);
		if(ask(w)!=toll) r=mid;
		else l=mid+1;
	}
	int x = l; l = 0, r = m-1;
	while(l<r){
		int mid = (l+r+1)/2; fill(all(w),0);
		fill(begin(w)+mid,end(w),1);
		if(ask(w)!=toll) l=mid;
		else r=mid-1;
	}
	answer(x,l+1);
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 4944 KB Output is incorrect: {s, t} is wrong.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 4944 KB Output is incorrect: {s, t} is wrong.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 10 ms 5072 KB Output is correct
2 Correct 24 ms 5376 KB Output is correct
3 Correct 19 ms 5584 KB Output is correct
4 Correct 60 ms 6764 KB Output is correct
5 Correct 69 ms 6764 KB Output is correct
6 Correct 65 ms 6860 KB Output is correct
7 Correct 76 ms 6776 KB Output is correct
8 Correct 99 ms 6760 KB Output is correct
9 Correct 63 ms 6776 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 4944 KB Output is incorrect: {s, t} is wrong.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 5200 KB Output is incorrect: {s, t} is wrong.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 5204 KB Output is incorrect: {s, t} is wrong.
2 Halted 0 ms 0 KB -