# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
488570 | keta_tsimakuridze | Lamps (JOI19_lamps) | C++14 | 54 ms | 17464 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 f first
#define s second
#define pii pair<int,int>
#define int long long
using namespace std;
const int N = 2e5 + 5, mod = 1e9 + 7; // !
int t, n,dp[N][4];
string s1,s2;
int get(char c, int k) {
if(c == '#') return '#';
if(!k) return c;
if(k == 2) return '1';
return '0';
}
main() {
cin >> n;
cin >> s1 >> s2;
int n = s1.size();
s1 = '#' + s1, s2 = '#' + s2;
dp[0][0] = 0;
for(int k = 1; k < 3; k++) dp[0][k] = n;
for(int i = 1; i <= n; i++) {
for(int k = 0; k < 3; k++) {dp[i][k] = n;
for(int j = 0; j < 3; j++) {
int plus = 0;
if(k != j && k) plus += 1;
if(get(s1[i], k) != s2[i]) {
if(get(s1[i - 1], j) == s2[i - 1]) plus++;
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... |