Submission #129153

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1291532019-07-11 18:17:46mohammedehab2002Lamps (JOI19_lamps)C++11
4 / 100
244 ms73004 KiB
#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]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...