제출 #383829

#제출 시각아이디문제언어결과실행 시간메모리
383829MODDICluedo (IOI10_cluedo)C++14
컴파일 에러
0 ms0 KiB
#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; } } } }

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

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 |