Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- cin >> n >> k >> x ;
- for( int i = 0 ; i < n ; i++ )
- {
- scanf("%d", &a[i] ) ;
- }
- sort( a, a+ n );
- mx = a[n-1] ;
- mn = a[n] ;
- int cnt = 0 ;
- while(cnt < k )
- {
- cnt++ ;
- for( int i = 0 ; i < n ; i+= 2 ) a[i] = a[i] ^ x ;//, cout << a[i] << endl ;
- sort( a , a + n ) ;
- mn = a[0] ;
- mx = a[n-1] ;
- }
- cout << mx << " " << mn ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement