Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cmath>
- #include <iostream>
- #include <vector>
- #include <algorithm>
- #include <string>
- #include <set>
- #include <map>
- #include <list>
- #include <time.h>
- #include <math.h>
- #include <random>
- #include <deque>
- #include <queue>
- #include <cassert>
- #include <unordered_map>
- #include <unordered_set>
- #include <iomanip>
- #include <bitset>
- #include <sstream>
- #include <chrono>
- #include <cstring>
- using namespace std;
- typedef long long ll;
- int main()
- {
- int t1 = 0, t2 = 0;
- vector<int> a(420, 1);
- vector<vector<int>> q(10000, vector<int>());
- bool found = false;
- int ans = 0;
- for (int i = 0; i < 100; ++i) {
- q[t1].push_back(0);
- t1 += 15;
- }
- for (int i = 0; i < 100; ++i) {
- q[t2].push_back(1);
- t2 += 8;
- }
- cout << endl;
- for (int i = 0; i < 1000 && !found; ++i) {
- for (int j = 0; j < 420; ++j) {
- a[j]--;
- if (a[j] < 0)
- a[j] = 0;
- }
- if (q[i].size() > 0) {
- bool x1 = false;
- bool check = false;
- for (int u : q[i]) {
- if (u == 0) {
- x1 = true;
- ++ans;
- for (int j = 0; j < 420; ++j) {
- bool flag = true;
- if (a[j] <= 0) {
- for (int k = 0; k < 80; ++k) {
- if (k + j >= 420 || a[j + k] > 0)
- flag = false;
- }
- }
- else
- flag = false;
- if (flag) {
- check = true;
- for (int k = 0; k < 80; ++k) {
- a[j + k] = 42;
- }
- break;
- }
- }
- }
- else {
- for (int j = 0; j < 420; ++j) {
- bool flag = true;
- if (a[j] <= 0) {
- for (int k = 0; k < 40; ++k) {
- if (k + j >= 420 || a[j + k] > 0)
- flag = false;
- }
- }
- else
- flag = false;
- if (flag) {
- for (int k = 0; k < 40; ++k) {
- a[j + k] = 21;
- }
- break;
- }
- }
- }
- }
- if (x1 && !check) {
- cout << ans << endl;
- found = true;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement