#ifndef LOCAL
#include "grader.h"
#include "cluedo.h"
#endif // LOCAL
#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define ar array
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
#ifdef LOCAL
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;
}
#endif // LOCAL
void Solve(void)
{
int i[] = {1, 1, 1};
while(true){
int r = Theory(i[0], i[1], i[2]);
if(r == 0) return;
i[r - 1]++;
}
}
#ifdef LOCAL
int main(){
#ifdef LOCAL
freopen("A.INP", "r", stdin);
freopen("A.OUT", "w", stdout);
#endif // LOCAL
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;
}
#endif // LOCAL
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
14 ms |
256 KB |
Output is correct |
2 |
Correct |
17 ms |
384 KB |
Output is correct |
3 |
Correct |
14 ms |
256 KB |
Output is correct |
4 |
Correct |
16 ms |
256 KB |
Output is correct |
5 |
Correct |
17 ms |
256 KB |
Output is correct |
6 |
Correct |
16 ms |
384 KB |
Output is correct |
7 |
Correct |
15 ms |
256 KB |
Output is correct |
8 |
Correct |
14 ms |
256 KB |
Output is correct |
9 |
Correct |
15 ms |
384 KB |
Output is correct |
10 |
Correct |
16 ms |
256 KB |
Output is correct |
11 |
Correct |
16 ms |
256 KB |
Output is correct |
12 |
Correct |
14 ms |
384 KB |
Output is correct |
13 |
Correct |
9 ms |
256 KB |
Output is correct |
14 |
Correct |
14 ms |
256 KB |
Output is correct |
15 |
Correct |
17 ms |
256 KB |
Output is correct |
16 |
Correct |
14 ms |
256 KB |
Output is correct |
17 |
Correct |
14 ms |
256 KB |
Output is correct |
18 |
Correct |
17 ms |
256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
384 KB |
Output is correct |
2 |
Correct |
12 ms |
384 KB |
Output is correct |
3 |
Correct |
16 ms |
384 KB |
Output is correct |
4 |
Correct |
13 ms |
384 KB |
Output is correct |
5 |
Correct |
15 ms |
384 KB |
Output is correct |
6 |
Correct |
17 ms |
384 KB |
Output is correct |
7 |
Correct |
14 ms |
256 KB |
Output is correct |
8 |
Correct |
14 ms |
256 KB |
Output is correct |
9 |
Correct |
16 ms |
256 KB |
Output is correct |
10 |
Correct |
17 ms |
256 KB |
Output is correct |
11 |
Correct |
13 ms |
256 KB |
Output is correct |
12 |
Correct |
15 ms |
384 KB |
Output is correct |
13 |
Correct |
15 ms |
384 KB |
Output is correct |
14 |
Correct |
15 ms |
256 KB |
Output is correct |
15 |
Correct |
14 ms |
256 KB |
Output is correct |
16 |
Correct |
13 ms |
256 KB |
Output is correct |
17 |
Correct |
14 ms |
256 KB |
Output is correct |
18 |
Correct |
17 ms |
256 KB |
Output is correct |