Submission #952483

#TimeUsernameProblemLanguageResultExecution timeMemory
952483kilkuwuCluedo (IOI10_cluedo)C++17
100 / 100
6 ms344 KiB
#ifndef LOCAL #include "grader.h" #include "cluedo.h" #else int Theory(int M, int L, int W); void Solve(); #endif #include <bits/stdc++.h> #ifdef LOCAL #include "template\debug.hpp" #else #define dbg(...) ; #define timer(...) ; #endif void Solve() { std::vector<int> murderers(6), locations(10), weapons(6); for (int i = 0; i < 6; i++) { murderers[i] = weapons[i] = i + 1; } for (int i = 0; i < 10; i++) { locations[i] = i + 1; } while (true) { int res = Theory(murderers.back(), locations.back(), weapons.back()); if (res == 0) return; if (res == 1) { murderers.pop_back(); } else if (res == 2) { locations.pop_back(); } else { weapons.pop_back(); } } } #ifdef LOCAL #include <stdio.h> #include <stdlib.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; } 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; } #endif
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...