Submission #632234

#TimeUsernameProblemLanguageResultExecution timeMemory
632234deviceCluedo (IOI10_cluedo)C++17
100 / 100
26 ms244 KiB
#include <bits/stdc++.h>
using namespace std;
int Theory(int M, int L, int W);
void Solve();
queue<int> q1,q2,q3;

void Solve() {
	q1 = queue<int>(); 
	q2 = queue<int>();
	q3 = queue<int>();
    for(int i = 1; i <= 10; i++){
		if(i <= 6){
			q1.push(i);
			q3.push(i);
		}
		q2.push(i);
	}
	while(q1.size() >= 1 || q2.size() >= 1 || q3.size() >= 1){
		int ans = Theory(q1.front(),q2.front(),q3.front());
		if(ans == 1){
			q1.pop();
			q2.push(q2.front());
			q2.pop();
			q3.push(q3.front());
			q3.pop();
		}else if(ans == 2){
			q1.push(q1.front());
			q1.pop();
			q2.pop();
			q3.push(q3.front());
			q3.pop();
		}else if(ans == 3){
			q1.push(q1.front());
			q1.pop();
			q2.push(q2.front());
			q2.pop();
			q3.pop();
		}else return;
	}
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...