Advertisement
MohamedAbdel3al

A. Long Comparison

Sep 5th, 2022 (edited)
652
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.44 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. #define cin(vec) for(auto& i : vec) cin >> i
  6. #define cin_2d(vec, n, m) for(int i = 0; i < n; i++) for(int j = 0; j < m && cin >> vec[i][j]; j++);
  7. #define cout(vec) for(auto& i : vec) cout << i << " "; cout << "\n";
  8. #define cout_2d(vec, n, m) for(int i = 0; i < n; i++, cout << "\n") for(int j = 0; j < m && cout << vec[i][j] << " "; j++);
  9. #define cout_map(mp) for(auto& [f, s] : mp) cout << f << "  " << s << "\n";
  10. #define Time cerr << "Time Taken: " << (float)clock() / CLOCKS_PER_SEC << " Secs" << "\n";
  11. #define fixed(n) fixed << setprecision(n)
  12. //#define ceil(n, m) (((n) / (m)) + ((n) % (m) ? 1 : 0))
  13. #define fill(vec, value) memset(vec, value, sizeof(vec));
  14. #define Num_of_Digits(n) ((int)log10(n)+1)
  15. #define all(vec) vec.begin(),vec.end()
  16. #define rall(vec) vec.rbegin(),vec.rend()
  17. #define sz(x) int(x.size())
  18. #define TC int t; cin >> t;   while(t--)
  19. #define fi first
  20. #define se second
  21. #define Pair pair < int, int >
  22. #define ll long long
  23. #define ull unsigned long long
  24. #define Mod  1'000'000'007
  25. #define OO 2'000'000'000
  26. #define EPS 1e-9f
  27. #define PI acos(-1)
  28. #define imin INT_MIN
  29. #define imax INT_MAX
  30. #define getline(s) getline(cin >> ws , s)
  31. #define pb(x) push_back(x)
  32. #define to_decimal(bin) stoi(bin, nullptr, 2)
  33. #define mod_combine(a, b, m) (((a % m) * (b % m)) % m)
  34. #define debug(x) cout << #x << ": " << (x) << "\n";
  35.  
  36.  
  37. void Code_Crush(){
  38.     ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  39. #ifndef ONLINE_JUDGE
  40.     freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);  
  41. #endif
  42.     Time
  43. }
  44.  
  45. /*
  46.     Notes
  47.  
  48.     Lower bound -> smallest number greater than or (equal) tagret
  49.     Upper bound -> smallest number greater than target
  50.     n % a = (n + x * a) % a
  51. */
  52.  
  53. int n;
  54. vector < pair < int, int > > nums;
  55.  
  56. bool Comp(pair < int, int >& a, pair < int, int >& b){
  57.     return a.first - a.second > b.first - b.second;
  58. }
  59.  
  60. void Solve(){
  61.     ll x1, x2, p1, p2;
  62.     cin >> x1 >> p1 >> x2 >> p2;
  63.     int Min = min(p1, p2);
  64.     p1 -= Min, p2 -= Min;
  65.     for(int i = 1; i <= p1 && x1 <= x2; i++)
  66.         x1 *= 10;
  67.     for(int i = 1; i <= p2 && x2 <= x1; i++)
  68.         x2 *= 10;
  69.     if(x1 == x2)
  70.         cout << '=';
  71.     else if(x1 > x2)
  72.         cout << '>';
  73.     else
  74.         cout << '<';
  75.     cout << '\n';
  76. }
  77.  
  78. int main (){
  79.     Code_Crush();
  80.     int t = 1;
  81.     cin >> t;
  82.     while(t--){
  83.         Solve();
  84.     }
  85.     return 0;
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement