# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
708827 | LittleCube | Lamps (JOI19_lamps) | C++14 | 290 ms | 57184 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>
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define F first
#define S second
using namespace std;
// dp[i][bit][ono][toggle]
// let every character works like A --on/off/none-> A' --toggle-> B
// for on and off, none spilts them and each connected size S needs (S + 1) / 2 (where every neighbor is different)
// for toggle, each connected size S also needs (S + 1) / 2 (where every neighbor is different)
// bit: last one (off: 0, on: 1, none: 2)
// ono: current on/off is odd
// toggle: current toggle is odd
int N, dp[1000006][3][2][2], A[1000006], B[1000006];
signed main()
{
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
cin >> N;
for (int i = 1; i <= N; i++)
{
char c;
cin >> c;
A[i] = c - '0';
}
for (int i = 1; i <= N; i++)
{
# | 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... |