Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- struct st{
- int w = 0, t = 0;
- };
- int main() {
- queue<st> A;
- for (int i = 2; i<= 16; ++i) {
- A.push({(2 - i % 2) * 6, 0});
- }
- vector<queue<st>> k(5);
- vector<st> ch(8);
- ch[7] = {6, 1};
- while () {
- for(int i = 0; i < 8; ++i) {
- if (ch[i].t != 0) {
- ch[i].t--;
- if (ch[i].t == 0) {
- if (i == 4) {
- k[4].push(ch[i]);
- }
- if (i == 5) {
- k[3].push(ch[i]);
- }
- if (i == 6) {
- k[2].push(ch[i]);
- }
- if (i == 7) {
- k[1].push(ch[i]);
- }
- }
- }
- }
- if (k[4].size() > 0 && ch[3].t == 0) {
- сh[3] = {k[4].top().w, k[4].top().w / 3};
- k[4].pop()
- }
- if (k[2].size() > 0 && ch[0].t == 0) {
- сh[0] = {k[2].top().w, k[2].top().w / 3};
- k[2].pop();
- }
- if (k[3].size() > 0 && k[3].top().w == 6 && ch[1].t == 0) {
- сh[1] = {k[3].top().w, k[3].top().w / 6};
- k[3].pop();
- }
- if (k[3].size() > 0 && k[3].top().w == 12 && ch[2].t == 0) {
- сh[2] = {k[3].top().w, k[3].top().w / 12};
- k[3].pop();
- }
- if (k[3].size() > 0 && k[3].top().w == 6 && ch[1].t == 0) {
- сh[1] = {k[3].top().w, k[3].top().w / 6};
- k[3].pop();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement