fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #pragma region Macros
  5. #define Faster ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  6. #define ll long long
  7. #define ld long double
  8. #define pii pair<int, int>
  9. #define pll pair<long long, long long>
  10. #define all(x) x.begin(), x.end()
  11. #define rall(x) x.rbegin(), x.rend()
  12. #define pb push_back
  13. #define ff first
  14. #define ss second
  15. #define endl '\n'
  16. #define yes cout << "YES" << endl
  17. #define no cout << "NO" << endl
  18. #define m1 cout << -1 << endl
  19. #pragma endregion
  20.  
  21. #pragma region Math
  22. const ll MOD = 1e9 + 7;
  23. ll gcd(ll a, ll b) { return __gcd(a, b); }
  24. ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
  25. #pragma endregion
  26.  
  27. void solve() {
  28. int n,k; cin>>n>>k;
  29. string s; cin>>s;
  30. if(n<2*k){
  31. cout<<"Alice"<<endl;
  32. return;
  33. }
  34. int cnt=0;
  35. for(auto x:s){
  36. if(x=='1')
  37. cnt++;
  38. }
  39. if(cnt<=k) cout<<"Alice"<<endl;
  40. else cout<<"Bob"<<endl;
  41. }
  42.  
  43. int main() {
  44. Faster;
  45. int t = 1;
  46. cin >> t;
  47. while (t--) solve();
  48. return 0;
  49. }
Success #stdin #stdout 0s 5320KB
stdin
6
5 2
11011
7 4
1011011
6 1
010000
4 1
1111
8 3
10110110
6 4
111111
stdout
Bob
Alice
Alice
Bob
Bob
Alice