-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01_game.cpp
45 lines (42 loc) · 901 Bytes
/
01_game.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Vidur Goel
#include<iostream>
#include<cmath>
#include<string>
#include<climits>
using namespace std;
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++){
string s;
cin>>s;
if(s=="1" || s=="0"){
cout<<"NET"<<endl;
}
else{
int num1=0;
int num0=0;
for(int i=0;i<s.length();i++){
if(s[i]=='0'){
num0++;
}
else if(s[i]=='1'){
num1++;
}
}
if(num1==0 || num0==0){
cout<<"NET"<<endl;
}
else{
int k=min(num1,num0);
if(k%2==1){
cout<<"DA"<<endl;
}
else{
cout<<"NET"<<endl;
}
}
}
}
return 0;
}