Submission #725680

# Submission time Handle Problem Language Result Execution time Memory
725680 2023-04-17T21:09:09 Z kyanl9 Cluedo (IOI10_cluedo) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.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)){ // middle empty
		if(int(vect.size())==3){ // all different numbers;
			if(Theory(vect[0],vect[1],vect[2])) return;
			if(Theory(vect[0],vect[2],vect[1])) return;
			if(Theory(vect[1],vect[0],vect[2])) return;
			if(Theory(vect[1],vect[2],vect[0])) return;
			if(Theory(vect[2],vect[1],vect[0])) return;
			if(Theory(vect[2],vect[0],vect[1])) return;
		}
		else if(int(vect.size()==1)) return;
		else{
			if(Theory(vect[0],vect[0],vect[1])) return;
			if(Theory(vect[0],vect[1],vect[1])) return;
			if(Theory(vect[1],vect[0],vect[0])) return;
			if(Theory(vect[1],vect[1],vect[0])) return;
			if(Theory(vect[1],vect[0],vect[1])) return;
			if(Theory(vect[0],vect[1],vect[0])) return;
		}
	}
	else{
		if(int(vect.size()==2)){
			if(Theory(vect[0],mid[0],vect[1])) return;
			if(Theory(vect[1],mid[0],vect[0])) return;
		}
		else{
			if(Theory(vect[1],mid[0],vect[1])) return;
			if(Theory(vect[0],mid[0],vect[0])) return;
		}
	}
}

Compilation message

cluedo.cpp: In function 'void solve()':
cluedo.cpp:14:9: error: 'Theory' was not declared in this scope
   14 |   int v=Theory(i,i,i);
      |         ^~~~~~
cluedo.cpp:19:6: error: 'Theory' was not declared in this scope
   19 |   if(Theory(c,i,c)!=3) mid.pb(i);
      |      ^~~~~~
cluedo.cpp:23:7: error: 'Theory' was not declared in this scope
   23 |    if(Theory(vect[0],vect[1],vect[2])) return;
      |       ^~~~~~
cluedo.cpp:24:7: error: 'Theory' was not declared in this scope
   24 |    if(Theory(vect[0],vect[2],vect[1])) return;
      |       ^~~~~~
cluedo.cpp:25:7: error: 'Theory' was not declared in this scope
   25 |    if(Theory(vect[1],vect[0],vect[2])) return;
      |       ^~~~~~
cluedo.cpp:26:7: error: 'Theory' was not declared in this scope
   26 |    if(Theory(vect[1],vect[2],vect[0])) return;
      |       ^~~~~~
cluedo.cpp:27:7: error: 'Theory' was not declared in this scope
   27 |    if(Theory(vect[2],vect[1],vect[0])) return;
      |       ^~~~~~
cluedo.cpp:28:7: error: 'Theory' was not declared in this scope
   28 |    if(Theory(vect[2],vect[0],vect[1])) return;
      |       ^~~~~~
cluedo.cpp:32:7: error: 'Theory' was not declared in this scope
   32 |    if(Theory(vect[0],vect[0],vect[1])) return;
      |       ^~~~~~
cluedo.cpp:33:7: error: 'Theory' was not declared in this scope
   33 |    if(Theory(vect[0],vect[1],vect[1])) return;
      |       ^~~~~~
cluedo.cpp:34:7: error: 'Theory' was not declared in this scope
   34 |    if(Theory(vect[1],vect[0],vect[0])) return;
      |       ^~~~~~
cluedo.cpp:35:7: error: 'Theory' was not declared in this scope
   35 |    if(Theory(vect[1],vect[1],vect[0])) return;
      |       ^~~~~~
cluedo.cpp:36:7: error: 'Theory' was not declared in this scope
   36 |    if(Theory(vect[1],vect[0],vect[1])) return;
      |       ^~~~~~
cluedo.cpp:37:7: error: 'Theory' was not declared in this scope
   37 |    if(Theory(vect[0],vect[1],vect[0])) return;
      |       ^~~~~~
cluedo.cpp:42:7: error: 'Theory' was not declared in this scope
   42 |    if(Theory(vect[0],mid[0],vect[1])) return;
      |       ^~~~~~
cluedo.cpp:43:7: error: 'Theory' was not declared in this scope
   43 |    if(Theory(vect[1],mid[0],vect[0])) return;
      |       ^~~~~~
cluedo.cpp:46:7: error: 'Theory' was not declared in this scope
   46 |    if(Theory(vect[1],mid[0],vect[1])) return;
      |       ^~~~~~
cluedo.cpp:47:7: error: 'Theory' was not declared in this scope
   47 |    if(Theory(vect[0],mid[0],vect[0])) return;
      |       ^~~~~~