Submission #21347

#TimeUsernameProblemLanguageResultExecution timeMemory
21347krauchBroken Device (JOI17_broken_device)C++14
0 / 100
49 ms4636 KiB
/* _ _ _______ _ _ | | / / | _____| | | / / | | / / | | | | / / | |/ / | |_____ | |/ / | |\ \ | _____| | |\ \ | | \ \ | | | | \ \ | | \ \ | |_____ | | \ \ |_| \_\ |_______| |_| \_\ */ #include <iostream> #include <cstdio> #include <set> #include <map> #include <stack> #include <queue> #include <vector> #include <cstring> #include <string> #include <iomanip> #include <cmath> #include <algorithm> #include <assert.h> #include "Annalib.h" using namespace std; typedef unsigned long long ull; typedef long long ll; typedef double ld; typedef pair <int, int> PII; typedef pair <ll, ll> PLL; #define F first #define S second #define pb push_back #define eb emplace_back #define right(x) x << 1 | 1 #define left(x) x << 1 #define forn(x, a, b) for (int x = a; x <= b; ++x) #define for1(x, a, b) for (int x = a; x >= b; --x) #define mkp make_pair #define sz(a) (int)a.size() #define all(a) a.begin(), a.end() #define y1 kekekek const long long ool = 1e18 + 9; const int oo = 1e9 + 9, base = 1e9 + 7; const double eps = 1e-7; const int N = 200; bool bad[N]; void Anna(int n, ll X, int K, int a[]) { memset(bad, 0, sizeof bad); forn(i, 0, K - 1) { bad[a[i]] = 1; } int ptr = 0; forn(i, 0, n - 1) { if (i + 1 < n && !bad[i] && !bad[i + 1]) { Set(i, 1); Set(i + 1, (X >> ptr) & 1); ++ptr; ++i; } else Set(i, 0); } }
/* _ _ _______ _ _ | | / / | _____| | | / / | | / / | | | | / / | |/ / | |_____ | |/ / | |\ \ | _____| | |\ \ | | \ \ | | | | \ \ | | \ \ | |_____ | | \ \ |_| \_\ |_______| |_| \_\ */ #include <iostream> #include <cstdio> #include <set> #include <map> #include <stack> #include <queue> #include <vector> #include <cstring> #include <string> #include <iomanip> #include <cmath> #include <algorithm> #include <assert.h> #include "Brunolib.h" using namespace std; typedef unsigned long long ull; typedef long long ll; typedef double ld; typedef pair <int, int> PII; typedef pair <ll, ll> PLL; #define F first #define S second #define pb push_back #define eb emplace_back #define right(x) x << 1 | 1 #define left(x) x << 1 #define forn(x, a, b) for (int x = a; x <= b; ++x) #define for1(x, a, b) for (int x = a; x >= b; --x) #define mkp make_pair #define sz(a) (int)a.size() #define all(a) a.begin(), a.end() #define y1 kekekek const long long ool = 1e18 + 9; const int oo = 1e9 + 9, base = 1e9 + 7; const double eps = 1e-7; const int N = 2e6 + 6; ll Bruno(int n, int a[]) { ll res = 0; int ptr = 0; forn(i, 0, n - 1) { if (a[i] == 1) { res |= (a[i + 1] << ptr); ++ptr; ++i; } } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...