Submission #60450

# Submission time Handle Problem Language Result Execution time Memory
60450 2018-07-24T08:13:26 Z 정원준(#1745) Park (JOI17_park) C++11
0 / 100
68 ms 616 KB
#include "park.h"
#include <bits/stdc++.h>
#define L long long

using namespace std;

void Answer(int,int);
int Ask(int,int,int*);

int t,n;
int arr[2222];
int bu[2222],lev[2222];

L fin(L x){
    return x==bu[x]?x:bu[x]=fin(bu[x]);
}

void uni(int x,int y){
    x=fin(x);
    y=fin(y);
    if(x==y) return;
    if(lev[x]>lev[y]) swap(x,y);
    bu[x]=y;
    if(lev[x]==lev[y]) lev[y]++;
}


void Detect(int T,int N){
	t=T;
	n=N;
	int i,j;
	for(i=1;i<=n;i++)
    {
        bu[i]=i;
    }
	if(1)
	{
		for(i=1;i<=n;i++)
		{
			for(j=i+1;j<=n;j++)
			{
			    if(fin(i)==fin(j)) continue;
				arr[i-1]=arr[j-1]=1;
				int temp=Ask(i-1,j-1,arr);
				if(temp==1)
                {
                    uni(i,j);
                    Answer(i-1,j-1);
                }
				arr[i-1]=arr[j-1]=0;
			}
		}
		return;
	}
}


/*

int Ask(int st,int ed,int *arr){
    return 1;
}

void Answer(int s,int e){

}
int main()
{

}
//*/

# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 376 KB Wrong Answer[6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 61 ms 616 KB Wrong Answer[5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 68 ms 616 KB Wrong Answer[5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 65 ms 616 KB Wrong Answer[5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 49 ms 616 KB Wrong Answer[5]
2 Halted 0 ms 0 KB -