Submission #1069939

#TimeUsernameProblemLanguageResultExecution timeMemory
1069939vjudge1Cluedo (IOI10_cluedo)C++17
50 / 100
129 ms344 KiB
#include "grader.h"
#include "cluedo.h"

void Solve() {
    // Определение возможных значений
    const int num_murderers = 6;
    const int num_locations = 10;
    const int num_weapons = 6;
    
    // Инициализация переменных
    int correctMurderer = -1;
    int correctLocation = -1;
    int correctWeapon = -1;

    // Попробуем перебор
    for (int m = 1; m <= num_murderers; ++m) {
        for (int l = 1; l <= num_locations; ++l) {
            for (int w = 1; w <= num_weapons; ++w) {
                int result = Theory(m, l, w);
                if (result == 0) {
                    correctMurderer = m;
                    correctLocation = l;
                    correctWeapon = w;
                    return;
                } else if (result == 1) {
                    // Убийца неверен, исключаем `m`
                } else if (result == 2) {
                    // Место неверно, исключаем `l`
                } else if (result == 3) {
                    // Оружие неверно, исключаем `w`
                }
            }
        }
    }
}

Compilation message (stderr)

cluedo.cpp: In function 'void Solve()':
cluedo.cpp:11:9: warning: variable 'correctMurderer' set but not used [-Wunused-but-set-variable]
   11 |     int correctMurderer = -1;
      |         ^~~~~~~~~~~~~~~
cluedo.cpp:12:9: warning: variable 'correctLocation' set but not used [-Wunused-but-set-variable]
   12 |     int correctLocation = -1;
      |         ^~~~~~~~~~~~~~~
cluedo.cpp:13:9: warning: variable 'correctWeapon' set but not used [-Wunused-but-set-variable]
   13 |     int correctWeapon = -1;
      |         ^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...