Submission #1236086

#TimeUsernameProblemLanguageResultExecution timeMemory
1236086luvlorndevBroken Device (JOI17_broken_device)C++20
41 / 100
20 ms1592 KiB
#include "Annalib.h" #include <bits/stdc++.h> using namespace std; #define ll long long void Anna(int n, ll x, int k, int p[]) { vector <int> a(n, 1); for (int i = 0; i < k; i++) a[p[i]] = 0; for (int i = 0; i < n; i++) { if (i + 1 < n && a[i] && a[i + 1]) { Set(i, 1); Set(i + 1, x & 1); x >>= 1; i++; } else { Set(i, 0); } } }
#include "Brunolib.h" #include <bits/stdc++.h> using namespace std; #define ll long long ll Bruno (int n, int a[]) { ll now = 1, ans = 0; for (int i = 0; i + 1 < n; i++) { if (a[i] == 1) { ans = ans | now * a[i + 1]; now <<= 1; i++; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...