Submission #383829

# Submission time Handle Problem Language Result Execution time Memory
383829 2021-03-30T20:53:46 Z MODDI Cluedo (IOI10_cluedo) C++14
Compilation error
0 ms 0 KB
#include "grader.h"
#include "cluedo.h"

void Solve(){
	
	bool killer[6], locations[10], weapon[6];
	memset(killer,	true,sizeof(killer));
	memset(locations, true, sizeof(locations));
	memset(weapon, true, sizeof(weapon));
   for(int i = 1; i <= 6; i++){
   		if(!killer[i-1])
   			continue;
		for(int j = 1; j <= 10; j++){
			if(!locations[j-1])	continue;
			for(int k = 1; k <= 6; k++){
				if(!weapon[k-1])	continue;
				int call = Theory(i, j, k);
				if(call == 0)
					return ;
				if(call == 1)
					killer[i-1] = false;
				if(call == 2)
					locations[j-1] = false;
				if(call == 3)
					weapon[k-1] = false;
			}
		}
	}
}

Compilation message

cluedo.cpp: In function 'void Solve()':
cluedo.cpp:7:2: error: 'memset' was not declared in this scope
    7 |  memset(killer, true,sizeof(killer));
      |  ^~~~~~
cluedo.cpp:3:1: note: 'memset' is defined in header '<cstring>'; did you forget to '#include <cstring>'?
    2 | #include "cluedo.h"
  +++ |+#include <cstring>
    3 |