Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int nr=0;
- int v[250];
- int deti(int li, int ls)
- {
- if(li==ls)
- {
- if(v[li]<0)
- nr++;
- return nr;
- }
- else
- {
- int mij,s1,s2;
- mij=(li+ls)/2;
- s1=deti(li,mij);
- s2=deti(mij+1,ls);
- return s1+s2;
- }
- }
- int main()
- {
- int n;
- cin>>n;
- for(int i=1;i<=n;++i)
- cin>>v[i];
- if(deti(1,n)%2==0)
- cout<<"DA";
- else
- cout<<"NU";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement