PDA

View Full Version : [PBINFO] Problema #503



~Wolf~
04-11-2020, 09:04 AM
Site: pbinfo (<b>You have to register to ba able to see this link</b>)
Link problema: alternanta (<b>You have to register to ba able to see this link</b>)
-problema usoara, clasa a 9-a

#include <iostream>
using namespace std;

unsigned int n,i,ok=1;

int main()
{
cin>>n;
unsigned int v[n];
for(i=0;i<n;i++)
cin>>v[i];
for(i=0;i<n-1;i++)
{
if(v[i]==1 && v[i+1]==1)
{
ok=0;
break;
}
}
if(ok)
{
cout<<"DA";
}
else
{
cout<<"NU";
}
return 0;
}