# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
126425 | TadijaSebez | Lamps (JOI19_lamps) | C++11 | 452 ms | 43644 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int N=1000050;
const int inf=1e9+7;
int dp[N][2][5];
char a[N],b[N];
int main()
{
int n;
scanf("%i %s %s",&n,a+1,b+1);
for(int i=0;i<2;i++) for(int j=0;j<5;j++) dp[0][i][j]=inf;
dp[0][0][0]=0;
for(int i=1;i<=n;i++)
{
for(int j=0;j<2;j++)
{
for(int k=0;k<5;k++)
{
int mask=min(k,3)+j*4;
int now=a[i]-'0';
if(k>0 && (k&1)) now=0;
else if(k>0) now=1;
if(j) now^=1;
dp[i][j][k]=inf;
if(now==b[i]-'0')
{
for(int j2=0;j2<2;j2++)
{
for(int k2=0;k2<5;k2++)
{
컴파일 시 표준 에러 (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... |