제출 #226329

#제출 시각아이디문제언어결과실행 시간메모리
226329kshitij_sodaniMeetings (JOI19_meetings)C++17
0 / 100
3089 ms1392 KiB
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef int64_t llo;
#define mp make_pair
#define pb push_back
#define a first
#define b second
#define endl "\n"
#include "meetings.h"

void Solve(int n){
	
	/*int arr[n];
	for(int i=0;i<n;i++){
		arr[i]=i;
	}*/
	int co[n];
	for(int i=0;i<n;i++){
		co[i]=0;
	}
	vector<int> dd[n];
	for(int i=0;i<n;i++){
		for(int j=i+1;j<n;j++){
			for(int kk=0;kk<n;kk++){
				int k=kk;
				if(k==i or k==j){
					continue;
				}
				int x=Query(i,j,k);
				if(i!=x){
					co[i]+=1;
					dd[i].pb(i);
				}
				if(j!=x){
					co[j]+=1;
					dd[x].pb(j);
				}
				break;
			}
		}
	}
	queue<int> ac;
	for(int i=0;i<n;i++){
		if(co[i]==0){
			ac.push(i);
		}
	}
	int par[n];
	while(ac.size()){
		int x=ac.front();
		for(auto j:dd[x]){
			co[j]-=1;
			if(co[j]==0){
				par[j]=x;
				ac.push(j);
			}
		}
	}


}

/*int main(){




	return 0;
}*/

컴파일 시 표준 에러 (stderr) 메시지

meetings.cpp: In function 'void Solve(int)':
meetings.cpp:49:6: warning: variable 'par' set but not used [-Wunused-but-set-variable]
  int par[n];
      ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...