Codeforces Round 832 (Div. 2) 1747C. Swap Game Solution
Problem Link : https://codeforces.com/contest/1747/problem/C
Solution in C++:
- /// Author : AH_Tonmoy
- #include <bits/stdc++.h>
- using namespace std;
- int32_t main() {
- ios_base::sync_with_stdio(0);
- cin.tie(0);
- int t;
- cin >> t;
- while (t--) {
- int n ; cin >> n ;
- int mn = 2e9 , a[n+1] ;
- for ( int i = 0 ; i < n ; i++){
- cin >> a[i];
- mn = min(mn,a[i]) ;
- }
- if(a[0]==mn ){
- cout <<"Bob\n" ;
- }
- else {
- cout <<"Alice\n";
- }
- }
- return 0 ;
- }
No comments