Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <vector>
- #include <queue>
- #include <algorithm>
- #include <string>
- #include <stack>
- #include <set>
- #include <map>
- #define pii pair <int, int>
- #define pb(x) push_back(x)
- using namespace std;
- using ll = long long;
- using ld = long double;
- using db = double;
- void cv(vector <int> &v) {
- for (auto x : v) cout << x << ' ';
- cout << "\n";
- }
- void cvl(vector <ll> &v) {
- for (auto x : v) cout << x << ' ';
- cout << "\n";
- }
- void cvv(vector <vector <int> > &v) {
- for (auto x : v) cv(x);
- cout << "\n";
- }
- void cvb(vector <bool> v) {
- for (bool x : v) cout << x << ' ';
- cout << "\n";
- }
- void cvs(vector <string> v) {
- for (auto a : v) {
- cout << a << "\n";
- }
- }
- void cvp(vector <pii> a) {
- for (auto p : a) {
- cout << p.first << ' ' << p.second << "\n";
- }
- cout << "\n";
- }
- vector <vector <int> > dp(21, vector <int> (10, 0));
- int main() {
- ios::sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);
- dp[4][0] = 1;
- for (int i = 5; i <= 19; ++i) {
- dp[i][0] = dp[i - 1][0] * 2;
- }
- dp[1][2] = 50520;
- dp[3][2] = 43957;
- for (int i = 4; i <= 8; ++i) {
- dp[i][1] = 1;
- }
- for (int i = 9; i <= 10; ++i) dp[i][1] = 2;
- for (int i = 11; i <= 12; ++i) dp[i][1] = 3;
- for (int i = 13; i <= 14; ++i) dp[i][1] = 4;
- for (int i = 15; i <= 19; ++i) dp[i][1] = 5;
- int c1 = dp[1][2];
- int c3 = dp[3][2];
- vector <int> to = {
- 1,
- 2,
- 3,
- 4,
- 5,
- 3,
- 6,
- 3,
- 7,
- 3,
- 6,
- 1,
- 2,
- 3,
- 4,
- 5,
- };
- //cvv(dp);
- for (int c2 = 0; c2 < 1000000; ++c2) {
- vector <int> now;
- for (int i = 4; i<=19; ++i) {
- int S = 0;
- S += (c1 / dp[i][0]) % 2 * 4;
- S += (c2 / dp[i][0]) % 2 * 2;
- S += (c3 / dp[i][0]) % 2;
- S %= 2;
- now.pb(S);
- }
- if (now == to) {
- cout << "OK\n";
- cout << c2;
- break;
- }
- cv(now);
- }
- //cvv(dp);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement