Educational Codeforces Round 90 (Rated for Div. 2) B. 01 Game (900)

    技术2022-07-11  84

    思路: 求01串当中0和1中数量较小的的那一个的奇偶性

    代码附:

    #pragma GCC optimize("Ofast","inline","-ffast-math") #pragma GCC target("avx,sse2,sse3,sse4,mmx") #include<bits/stdc++.h> #define int long long using namespace std; const int N = 2e5+10; signed main() { ios::sync_with_stdio(false); cin.tie(0); int t; cin>>t; while(t--) { string ss; cin>>ss; int cnt=0; for(int i=0;ss[i];++i)if(ss[i]=='0')cnt++; cnt=min(cnt,ss.length()-cnt); if(cnt&1)cout<<"DA"<<endl; else cout<<"NET"<<endl; } return 0; }
    Processed: 0.012, SQL: 9