fork(5) download
  1. // iostream is too mainstream
  2. #include <cstdio>
  3. // bitch please
  4. #include <iostream>
  5. #include <algorithm>
  6. #include <cstdlib>
  7. #include <vector>
  8. #include <set>
  9. #include <map>
  10. #include <queue>
  11. #include <stack>
  12. #include <list>
  13. #include <cmath>
  14. #include <iomanip>
  15. #define dibs reserve
  16. #define OVER9000 1234567890
  17. #define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
  18. #define tisic 47
  19. #define soclose 1e-6
  20. #define chocolate win
  21. // so much chocolate
  22. #define patkan 9
  23. #define ff first
  24. #define ss second
  25. #define abs(x) ((x < 0)?-(x):x)
  26. #define uint unsigned int
  27. using namespace std;
  28. // mylittledoge
  29.  
  30. int main() {
  31. cin.sync_with_stdio(0);
  32. cin.tie(0);
  33. int N;
  34. cin >> N;
  35. string s ="((A0|B0)|(A0|B0))";
  36. for(int i =1; i < N; i++) {
  37. string x ="", y ="";
  38. int z =i;
  39. while(z > 0) {
  40. x +=char(z%10+'0');
  41. y +=char(z%10+'0');
  42. z /=10;}
  43. x +="A"; y +="B";
  44. reverse(x.begin(),x.end());
  45. reverse(y.begin(),y.end());
  46. string t ="((";
  47. t +=x;
  48. t +="|";
  49. t +=y;
  50. t +=")|(";
  51. t +=s;
  52. t +="|((";
  53. t +=x;
  54. t +="|";
  55. t +=x;
  56. t +=")|(";
  57. t +=y;
  58. t +="|";
  59. t +=y;
  60. t +="))))";
  61. s =t;}
  62. cout << s << "\n";
  63. return 0;}
  64.  
  65. // look at my code
  66. // my code is amazing
Time limit exceeded #stdin #stdout 5s 5172KB
stdin
Standard input is empty
stdout
Standard output is empty