Submission #342089

# Submission time Handle Problem Language Result Execution time Memory
342089 2021-01-01T10:59:15 Z Alma Cluedo (IOI10_cluedo) C++14
Compilation error
0 ms 0 KB
#include <iostream>
#include <cluedo.h>
#include <grader.h>
using namespace std;
 
int Solve (int M, int L, int W) {
    int M = 1; int L = 1; int W = 1;
    while (Theory (M, L, W) != 0) {
        if (Theory (M, L, W) == 1) { M++; }
        else if (Theory (M, L, W) == 2) { L++; }
        else { W++; }
    }
    return Theory (M, L, W);
}

Compilation message

cluedo.cpp: In function 'int Solve(int, int, int)':
cluedo.cpp:7:9: error: declaration of 'int M' shadows a parameter
    7 |     int M = 1; int L = 1; int W = 1;
      |         ^
cluedo.cpp:7:20: error: declaration of 'int L' shadows a parameter
    7 |     int M = 1; int L = 1; int W = 1;
      |                    ^
cluedo.cpp:7:31: error: declaration of 'int W' shadows a parameter
    7 |     int M = 1; int L = 1; int W = 1;
      |                               ^