# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
129153 | mohammedehab2002 | Lamps (JOI19_lamps) | C++11 | 244 ms | 73004 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 <iostream>
using namespace std;
int dp[4][4][1000005],tpt[2][1000005];
int main()
{
int n;
string a,b;
cin >> n >> a >> b;
for (int j=0;j<4;j++)
{
for (int k=0;k<4;k++)
dp[j][k][0]=1e9;
}
dp[3][3][0]=0;
tpt[0][0]=1e9;
tpt[1][0]=1e9;
for (int i=0;i<=n;i++)
{
int mn=min(tpt[0][i],tpt[1][i]),md[4];
for (int j=0;j<4;j++)
md[j]=1e9;
md[2]=min(md[2],mn);
md[0]=min(md[0],tpt[0][i]);
md[1]=min(md[1],tpt[1][i]);
for (int j=0;j<4;j++)
{
for (int k=0;k<4;k++)
{
dp[j][k][i+1]=1e9;
mn=min(mn,dp[j][k][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... |