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 <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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |