Submission #366952

#TimeUsernameProblemLanguageResultExecution timeMemory
366952nafis_shifatCluedo (IOI10_cluedo)C++14
100 / 100
14 ms384 KiB
#include "grader.h"
#include "cluedo.h"
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
using namespace std;
const int mxn=1e5+5;
const int inf=1e9;
void Solve(){
   int ok1[7];
   for(int i = 1; i <= 6; i++) ok1[i] = 1;
   int ok2[11];
   for(int i = 1; i <= 10; i++) ok2[i] = 1;
   int ok3[7];
   for(int i = 1; i <= 6; i++) ok3[i] = 1;

   	while(1) {
   		int cnt1 = 0,cnt2 = 0,cnt3 = 0;
   		int m,l,w;
   		for(int i = 1; i <= 6; i++) {
   			cnt1 += ok1[i];
   			if(ok1[i]) m = i;
   		}
   		for(int i = 1; i <= 10; i++) {
   			cnt2 += ok2[i];
   			if(ok2[i]) l = i;
   		}
   		for(int i = 1; i <= 6; i++) {
   			cnt3 += ok3[i];
   			if(ok3[i]) w = i;
   		}

   		

   		int x = Theory(m,l,w);
   		if(x == 0) return;

   		if(x == 1) ok1[m] = 0;
   		else if(x == 2) ok2[l] = 0;
   		else ok3[w] = 0;

   	}

}

Compilation message (stderr)

cluedo.cpp: In function 'void Solve()':
cluedo.cpp:39:29: warning: 'l' may be used uninitialized in this function [-Wmaybe-uninitialized]
   39 |      else if(x == 2) ok2[l] = 0;
      |                      ~~~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...