This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>	
#include "grader.h"
#include "cluedo.h"
#define pb push_back
#define mp make_pair
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
 
void Solve(){
	int c=-1;
	vector<int> vect,mid;
	for(int i=1;i<=6;i++){
		int v=Theory(i,i,i);
		if(v==3) c=i;
		if(v<=2) vect.pb(i);
	}
	for(int i=7;i<=10;i++){
		if(Theory(c,i,c)!=3) mid.pb(i);
	}
	if(int(mid.size()==0)){
		if(int(vect.size())==3){
			Theory(vect[0],vect[1],vect[2]);
			Theory(vect[0],vect[2],vect[1]);
			Theory(vect[1],vect[0],vect[2]);
			Theory(vect[1],vect[2],vect[0]);
			Theory(vect[2],vect[1],vect[0]);
			Theory(vect[2],vect[0],vect[1]);
		}
		else if(int(vect.size()==1)) return;
		else{
			Theory(vect[0],vect[0],vect[1]);
			Theory(vect[0],vect[1],vect[1]);
			Theory(vect[1],vect[0],vect[0]);
			Theory(vect[1],vect[1],vect[0]);
			Theory(vect[1],vect[0],vect[1]);
			Theory(vect[0],vect[1],vect[0]);
		}
	}
	else{
		if(int(vect.size()==2)){
			Theory(vect[0],mid[0],vect[1]);
			Theory(vect[1],mid[0],vect[0]);
		}
		else{
			Theory(vect[1],mid[0],vect[1]);
			Theory(vect[0],mid[0],vect[0]);
		}
	}
}
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... |