-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path1373_B_01Game.cpp
More file actions
36 lines (33 loc) · 819 Bytes
/
1373_B_01Game.cpp
File metadata and controls
36 lines (33 loc) · 819 Bytes
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
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
string str;
cin >> str;
int count = 0;
vector<char> prev;
for(int i=0; i<str.size(); i++){
if(i+1 < str.size() && str[i] != str[i+1]){
count++;
i++;
}
else{
if(prev.size() > 0 && prev[prev.size()-1] != str[i]){
count++;
prev.pop_back();
}
else{
// cout << "Note : " << str[i] << endl;
prev.push_back(str[i]);
}
}
}
if(count%2 == 0){
cout << "NET" << endl;
}
else cout << "DA" << endl;
}
return 0;
}