fork download
  1. #include<bits/stdc++.h>
  2.  
  3. #pragma GCC optimize("O2")
  4. #pragma GCC optimize("O3")
  5. #pragma GCC optimize("Ofast")
  6.  
  7. #define int long long
  8.  
  9. #define pii pair<int,int>
  10. #define ii int,int
  11. #define fi first
  12. #define se second
  13. #define pb push_back
  14. #define lb lower_bound
  15. #define ub upper_bound
  16. #define umap unordered_map
  17. #define BIT(mask, i) ((mask >> i)&1)
  18. #define ALL(c) c.begin(), c.end()
  19.  
  20. using namespace std;
  21.  
  22. mt19937 rd(chrono::high_resolution_clock::now().time_since_epoch().count());
  23. int rand(int l, int r){
  24. return l + rd()*rd()%(r-l+1);
  25. }
  26.  
  27. const int N = 1e6+7;
  28. const int M = 1e3+3;
  29. const int MOD = 1e9+7;
  30. const int inf = 3e18;
  31.  
  32. signed main(){
  33. ios_base::sync_with_stdio(0);
  34. cin.tie(0);
  35. cout.tie(0);
  36. string a, b;
  37.  
  38. int sz = min(a.size(), b.size());
  39. int ok = 0; // ok = 1 -> a > b, ok = 2 -> a < b
  40. for(int i = 0; i < sz; i++){
  41. if(a[i] > b[i]){
  42. ok = 1;
  43. break;
  44. }
  45. if(a[i] < b[i]){
  46. ok = 2;
  47. break;
  48. }
  49. }
  50. if(ok == 0){
  51. if(a.size() < b.size()) ok = 2;
  52. if(a.size() > b.size()) ok = 1;
  53. }
  54.  
  55. if(ok == 0){
  56. cout << a;
  57. }
  58. if(ok == 1){
  59. cout << a;
  60. }
  61. if(ok == 2){
  62. cout << b;
  63. }
  64.  
  65. }
  66.  
  67.  
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
Standard output is empty