제출 #542103

#제출 시각아이디문제언어결과실행 시간메모리
542103AJ00Cluedo (IOI10_cluedo)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

int Theory(int m, int l, int w) {
  // ++cnt;
   if (m < 1 || m > 6 || l < 1 || l > 10 || w < 1 || w > 6) exit(92);
   if (rand()%2 && m != M) return 1;
   else if (rand()%2 && l != L) return 2;
   else if (rand()%2 && w != W) return 3;
   else if (m != M) return 1;
   else if (l != L) return 2;
   else if (w != W) return 3;
  // gotit = 1;
   return 0;
}
void Solve(){
    int m = 1, l = 1, w = 1, verdict = -1;
    while(verdict != 0){
        verdict = Theory(m,l,w);
        if (verdict == 1){
            m++;
        }
        if (verdict == 2){
            l++;
        }
        if (verdict == 3){
            w++;
        }
       // cout << m << " " << l << " " << w << "\n";
    }
    return;
}

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

cluedo.cpp: In function 'int Theory(int, int, int)':
cluedo.cpp:7:25: error: 'M' was not declared in this scope
    7 |    if (rand()%2 && m != M) return 1;
      |                         ^
cluedo.cpp:8:30: error: 'L' was not declared in this scope
    8 |    else if (rand()%2 && l != L) return 2;
      |                              ^
cluedo.cpp:9:30: error: 'W' was not declared in this scope
    9 |    else if (rand()%2 && w != W) return 3;
      |                              ^