Submission #60453

# Submission time Handle Problem Language Result Execution time Memory
60453 2018-07-24T08:15:31 Z 정원준(#1745) Park (JOI17_park) C++11
10 / 100
90 ms 840 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: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 Correct 3 ms 248 KB Output is correct
2 Correct 10 ms 484 KB Output is correct
3 Correct 9 ms 552 KB Output is correct
4 Correct 12 ms 552 KB Output is correct
5 Correct 16 ms 552 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 58 ms 680 KB Wrong Answer[5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 90 ms 680 KB Wrong Answer[5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 63 ms 680 KB Wrong Answer[5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 56 ms 840 KB Wrong Answer[5]
2 Halted 0 ms 0 KB -