# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
542104 | AJ00 | Cluedo (IOI10_cluedo) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "grader.h"
#include "cluedo.h"
static int M,L,W,gotit,cnt,maxcnt;
int Theory(int m, int l, int w) {
++cnt;
if (m < 1 || m > 6 || l < 1 || l > 10 || w < 1 || w > 6) exit(92);
if (rand()%2 && m != M) return 1;
else if (rand()%2 && l != L) return 2;
else if (rand()%2 && w != W) return 3;
else if (m != M) return 1;
else if (l != L) return 2;
else if (w != W) return 3;
gotit = 1;
return 0;
}
void Solve(){
int m = 1, l = 1, w = 1, verdict = -1;
while(verdict != 0){
verdict = Theory(m,l,w);
if (verdict == 1){
m++;
}
if (verdict == 2){
l++;
}
if (verdict == 3){
w++;
}
// cout << m << " " << l << " " << w << "\n";
}
return;
}
int main(){
while (3 == scanf("%d%d%d",&M,&L,&W)) {
cnt = gotit = 0;
Solve();
if (cnt > maxcnt) maxcnt = cnt;
if (!gotit) {
printf("NO\n");
return 91;
}
}
printf("OK %d\n",maxcnt);
return 0;
}