# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
230169 | DS007 | Lamps (JOI19_lamps) | C++14 | 74 ms | 7304 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define find(l, r) (1 + (r - l) / 2)
int n, n_;
string a, b, a_, b_;
int toggle(int p) {
while (p != n_ && a_[p] != 2 && a_[p] != b_[p])
p++;
return p;
}
int solve(int lp) {
while (lp != n_ && a_[lp] == b_[lp])
lp++;
if (lp == n_)
return 0;
if (lp == n_ - 1)
return 1;
int last = n_;
for (int p = lp; p < n_; p++) {
if (a_[p] == b_[p])
return find(lp, p) + solve(p + 1);
if (a_[p] == '2')
last = n_;
else if (last == n_)
last = p;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |