Submission #970360

# Submission time Handle Problem Language Result Execution time Memory
970360 2024-04-26T12:14:30 Z emptypringlescan Park (JOI17_park) C++17
20 / 100
80 ms 644 KB
#include <bits/stdc++.h>
using namespace std;
#include "park.h"
int n;
void dnc(int a, int b){
	if(a>b) swap(a,b);
	assert(a!=b);
	assert(a>=0&&b>=0);
	int lo=0,hi=n,mid;
	while(lo<hi){
		mid=(lo+hi)/2;
		int place[n];
		for(int i=0; i<mid; i++) place[i]=1;
		for(int i=mid; i<n; i++) place[i]=0;
		place[a]=1; place[b]=1;
		int x=Ask(a,b,place);
		if(x) hi=mid;
		else lo=mid+1;
	}
	if(lo==0) Answer(a,b);
	else{
		dnc(a,lo-1);
		dnc(lo-1,b);
	}
}
void Detect(int t, int N){
	n=N;
	if(t==1){
		int place[n];
		for(int i=0; i<n; i++) place[i]=0;
		for(int i=0; i<n; i++){
			for(int j=i+1; j<n; j++){
				place[i]=1;
				place[j]=1;
				int x=Ask(i,j,place);
				if(x) Answer(i,j);
				place[i]=0;
				place[j]=0;
			}
		}
	}
	else if(t==2){
		dnc(0,n-1);
	}
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 3 ms 456 KB Output is correct
3 Correct 3 ms 344 KB Output is correct
4 Correct 4 ms 348 KB Output is correct
5 Correct 4 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 22 ms 348 KB Output is correct
2 Correct 80 ms 600 KB Output is correct
3 Correct 62 ms 644 KB Output is correct
4 Correct 21 ms 604 KB Output is correct
5 Correct 21 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Wrong Answer[6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Wrong Answer[6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Wrong Answer[6]
2 Halted 0 ms 0 KB -