fork(1) download
  1.  
  2. //|Art|
  3. #pragma GCC optimize("02,unroll-loops")
  4. #pragma GCC target("avx2,fma")
  5.  
  6. #include <iostream>
  7. #include <chrono>
  8.  
  9. //#include <bits/stdc++.h>
  10.  
  11. #define el cout << '\n'
  12. #define fi first
  13. #define se second
  14. #define pb push_back
  15. #define ll long long
  16. #define st string
  17. #define N 600
  18.  
  19. #define sz(x) (x).size()
  20. #define all(v) (v).begin(), (v).end()
  21. #define FOR(a,b,c) for(int a=b;a<=c;++a)
  22. #define FORE(a,b,c) for(int a=b;a>=c;--a)
  23. #define FED(a,b,c) for(int a=b;a<c;++a)
  24.  
  25. #define __Art__ signed main()
  26. #define NAME "Art"
  27.  
  28. using namespace std;
  29.  
  30. string a[10000];
  31. st p;
  32. int n, m, k, x;
  33. void cal (st s){
  34. if (sz(s) == n) cout << s, el;
  35. else FED (i, 0, k) cal(s + a[sz(s) + 1][i]);
  36. }
  37.  
  38. void sol(){
  39. n = 3, k = 2;
  40. //a[1] = "ag", a[2] = "iy", a[3] = "ef" ;
  41. st s = "";
  42. FOR (i, 1, m) cin >> s, a[i] = s;
  43. cout << a[1];
  44. //cal(s);
  45. }
  46.  
  47. __Art__{
  48.  
  49. if (fopen(NAME".INP", "r")) {
  50. freopen(NAME".INP", "r", stdin);
  51. freopen(NAME".OUT", "w", stdout);
  52. }
  53.  
  54. /*ios_base::sync_with_stdio(false);
  55.   cin.tie(nullptr);
  56.   cout.tie(nullptr);*/
  57.  
  58. int t = 1;
  59. //cin >> t;
  60. while (t--) sol();
  61.  
  62. cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << "s\n";
  63.  
  64. return (0 ^ 0);
  65. }
  66.  
Success #stdin #stdout #stderr 0.01s 5244KB
stdin
ag iy ef
stdout
Standard output is empty
stderr
Time elapsed: 0.005541s