fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. void solve(){
  5. int a, b, c;
  6. cin >> a >> b >> c;
  7.  
  8. // if(a == b && b == c){
  9. // cout << "1 1 1" << endl;
  10. // return;
  11. // }
  12.  
  13. if(a == b) {
  14. cout << "0 0 1" << endl;
  15. return;
  16. }
  17. if(b == c){
  18. cout << "1 0 0" << endl;
  19. return;
  20. }
  21. if(a == c){
  22. cout << "0 1 0" << endl;
  23. return;
  24. }
  25.  
  26. vector<int> v(3, 0);
  27. int maxi = max(a, max(b, c));
  28. if(maxi == a) v[0] = 1;
  29. // cout << "1 0 0" << endl;
  30. if(maxi == b) v[1] = 1;
  31. // cout << "0 1 0" << endl;
  32. if(maxi == c) v[2] = 1;
  33. // cout << "0 0 1" << endl;
  34. for(int i = 0; i < 3; i++) cout << v[i] << " ";
  35. cout << endl;
  36. }
  37.  
  38. int main() {
  39. int t;
  40. cin >> t;
  41. while(t--){
  42. solve();
  43. }
  44. return 0;
  45. }
Success #stdin #stdout 0s 5304KB
stdin
5
1 1 1
2 3 2
82 47 59
1 2 2
2 1 2
stdout
0 0 1
0 1 0
1 0 0 
1 0 0
0 1 0