Submission #341490

# Submission time Handle Problem Language Result Execution time Memory
341490 2020-12-29T21:08:14 Z Iwanttobreakfree Cluedo (IOI10_cluedo) C++
Compilation error
0 ms 0 KB
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include "grader.h"
#include "cluedo.h"
using namespace std;

int contador=0,M,L,W,contador;

int Theory(int A,int B,int C){
	cin>>M>>L>>W;
	if (M!=A){
	return 1;
	}
	else if (L!=B){
	return 2;
	}
	else if (W!=C){
	return 3;
	}
	else{
	return 0;
	}	
}

void Solve(){
   int r;
   r = Theory(1,2,3);
   if (r == 0) return;
   else if (r !=0){
   r = Theory (1,2,3);
   contador++;	
   }
   cout<<"OK "<<contador<<endl;
   contador=0;
   r = Theory(3,2,1);
   if (r == 0) return ;
   else if (r !=0){
   	r=Theory (3,2,1);
   	contador++;
   }
   cout<<"OK "<<contador<<endl;
   contador=0;
   r = Theory(4,4,4);
   if (r == 0) return ;
   else if (r !=0){
   	r=Theory (4,4,4);
   	contador++;
   }
   cout<<"OK "<<contador<<endl;
}

Compilation message

cluedo.cpp:10:22: error: redefinition of 'int contador'
   10 | int contador=0,M,L,W,contador;
      |                      ^~~~~~~~
cluedo.cpp:10:5: note: 'int contador' previously defined here
   10 | int contador=0,M,L,W,contador;
      |     ^~~~~~~~