Submission #1226018

#TimeUsernameProblemLanguageResultExecution timeMemory
1226018LIACluedo (IOI10_cluedo)C++17
0 / 100
0 ms400 KiB
#include "cluedo.h"
#include "grader.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() {
    memset(can,0, sizeof(can) );
    rec(1,1,1);
    return;
}

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;
      |          ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...