Raslboyy

411

Nov 27th, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.53 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <list>
  4. #include <algorithm>
  5. #include <string>
  6. #include <math.h>
  7. #include <climits>
  8.  
  9. //#include <chrono>
  10. //#include <fstream>
  11. //#include <bits/stdc++.h>
  12.  
  13. #define mp make_pair
  14. #define pb push_back
  15. #define eb emplace_back
  16. #define x first
  17. #define y second
  18. #define sz(x) (int)x.size()
  19. #define all(x) begin(x), end(x)
  20. #define rall(x) rbegin(x), rend(x)
  21. #define FOR(i,a,b) for (int i = (a); i < (b); i++)
  22. #define RFOR(i,b,a) for (int i = (b) - 1; i >= (a); i--)
  23.  
  24. using namespace std;
  25.  
  26. typedef unsigned long long ull;
  27. typedef long long ll;
  28. typedef long double ld;
  29. typedef pair<int, int> pi;
  30. typedef pair<ll, ll> pl;
  31. typedef vector<int> veci;
  32. typedef vector<bool> vecb;
  33. typedef vector<vector<int>> vvi;
  34. typedef vector<vector<bool>> vvb;
  35.  
  36. const int INF_I = 1e9;
  37. const ll INF_LL = 1e18;
  38.  
  39. int main() {
  40.     /*ifstream cin("in.txt");
  41.     ofstream cout("out.txt");
  42.     auto start_time = chrono::high_resolution_clock::now();*/
  43.  
  44.     ios::sync_with_stdio(false);
  45.     cin.tie(0);
  46.     cout.tie(0);
  47.  
  48.    
  49.     string str;
  50.     vector<string> vec(101);
  51.     int cnt = 0;
  52.     while (cin >> str) {
  53.         /*if (str == "0")
  54.             break;*/
  55.         vec[cnt] = str;
  56.         cnt++;
  57.     }
  58.     sort(vec.begin(), vec.begin() + cnt, [](string a, string b) {
  59.         return a + b > b + a;
  60.     });
  61.     for (int i = 0; i < cnt; i++)
  62.         cout << vec[i];
  63.     cout << endl;
  64.  
  65.     /*auto end_time = chrono::high_resolution_clock::now();
  66.     chrono::duration<double> duration = end_time - start_time;
  67.     cout << duration.count() << "\n";
  68.     cin.close();
  69.     cout.close();*/
  70.     return 0;
  71. }
Advertisement
Add Comment
Please, Sign In to add comment