Advertisement
Guest User

Untitled

a guest
Aug 27th, 2017
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <vector>
  4. #include <cmath>
  5. #include <algorithm>
  6. #include <string>
  7. #include <queue>
  8. #include <utility>
  9. #include <set>
  10. #include <iomanip>
  11. #include <ctime>
  12.  
  13. using namespace std;
  14.  
  15. #define ll long long
  16. #define pi 3.141592653589793
  17. #define pb push_back
  18. #define forto(l,a,b) for(long long l = a; l <= b; ++l)
  19. #define downto(l,a,b) for(long long l = a; l >= b; --l)
  20. #define Fred_Flinstone ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
  21. #define ln '\n'
  22. #define decimal cout<<fixed<<setprecision(15)
  23.  
  24. bool cmp(long &a, long &b){
  25. string s;
  26. cout << "1 " << a << ' ' << b << ln;
  27. cout << flush;
  28. cin >> s;
  29. if (s[0] == 'Y') return 1;
  30. return 0;
  31. }
  32.  
  33. int main()
  34. {
  35. Fred_Flinstone;
  36. long n;
  37. vector< long > v;
  38.  
  39. cin >> n;
  40.  
  41. forto(f, 1, n){
  42. v.pb(f);
  43. }
  44.  
  45. sort(v.begin(), v.end(), cmp);
  46.  
  47. cout << "0 ";
  48. forto(f, 0, n-1){
  49. cout << v[f] << ' ';
  50. }
  51. return 0;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement