Submission #1226014

#TimeUsernameProblemLanguageResultExecution timeMemory
1226014LIACluedo (IOI10_cluedo)C++17
Compilation error
0 ms0 KiB
#include "cluedo.h"

#include <string.h>
#define ll int
#define vll vector<ll>
#define vvll vector<vll>
#define all(A) A.begin(), A.end()
#define pll pair<ll,ll>
#define vpll vector<pll>
ll inf = 1e18;
#define loop(i,s,e) for(ll i = s; i<e ;++i)
#define vb vector<bool>
bool found = false;

bool can[4][11];
void rec(ll l1, ll l2, ll l3) {
    if (found) return;
    ll r =  Theory(l1 , l2 ,l3);
    if (r==0) {
        found = 1;
        return;
    }
    ll prob;
    if (r==1) prob = l1;
    if (r==2) prob = l2;
    if (r==3) prob = l3;
    can[r][prob] = 1;
    if (found) return;

    if (r== 1) {
        if (found) return;

        loop(i,1,7) {
            if (found) return;

            if (can[r][i] == false)rec(i,l2,l3);
        }
    }
    if (r== 2) {
        if (found) return;

        loop(i,1,11){
            if (found) return;

            if (can[r][i] == false) rec(l1,i,l3);
        }
    }
    if (r== 3) {
        if (found) return;

        loop(i,1,7){
            if (found) return;

            if (can[r][i] == false) rec(l1,l2,i);
        }
    }



}
void Solve() {
    for (int m = 1; m <= 6; ++m) {
        for (int l = 1; l <= 10; ++l) {
            for (int w = 1; w <= 6; ++w) {
                int r = Theory(m, l, w);
                if (r == 0) {
                    return;   // Found!
                }
            }
        }
    }
}

Compilation message (stderr)

cluedo.cpp:10:10: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
   10 | ll inf = 1e18;
      |          ^~~~
cluedo.cpp: In function 'void rec(int, int, int)':
cluedo.cpp:18:13: error: 'Theory' was not declared in this scope
   18 |     ll r =  Theory(l1 , l2 ,l3);
      |             ^~~~~~
cluedo.cpp: In function 'void Solve()':
cluedo.cpp:65:25: error: 'Theory' was not declared in this scope
   65 |                 int r = Theory(m, l, w);
      |                         ^~~~~~