Cod sursa(job #352865)
| Utilizator | Data | 3 octombrie 2009 16:45:26 | |
|---|---|---|---|
| Problema | Nivele | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.42 kb |
#include<stdio.h>
long n,t,i,aa,st[51000];
int main()
{
freopen("nivele.in","r",stdin);
freopen("nivele.out","w",stdout);
scanf("%ld",&t);
for(;t;--t)
{scanf("%ld",&n);
st[0]=0;
for(i=1;i<=n;++i)
{scanf("%ld",&st[++st[0]]);
while(st[st[0]]==st[st[0]-1]&&st[0]>1)st[--st[0]]--;}
if(st[0]==1&&st[1]==1)printf("DA");
else printf("NU");
printf("\n");}
return 0;
}
