제출 #312827

#제출 시각아이디문제언어결과실행 시간메모리
312827zwliewCluedo (IOI10_cluedo)C++17
100 / 100
11 ms384 KiB
#include "cluedo.h"
#include "grader.h"

void Solve() {
//   bool murderer[7], location[11], weapon[7];
//   for (int i = 0; i < 7; ++i) {
//     murderer[i] = false;
//     weapon[i] = false;
//     location[i] = false;
//   }
//   for (int i = 7; i < 11; ++i) {
//     location[i] = false;
//   }

  int i = 1, j = 1, k = 1;
  int idx;
  while (idx = Theory(i, j, k)) {
    if (idx == 1) {
      ++i;
    } else if (idx == 2) {
      ++j;
    } else {
      ++k;
    }
  }
}

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

cluedo.cpp: In function 'void Solve()':
cluedo.cpp:17:14: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   17 |   while (idx = Theory(i, j, k)) {
      |          ~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...