fork download
  1. /* ___
  2.   _______________| |_
  3.   /\ \
  4.  / \ \
  5. /____\__________________\
  6. | | |
  7. | | Date : |
  8. | | Author : pppssslc|
  9. |____|__________________|
  10. */
  11. #include<bits/stdc++.h>
  12.  
  13. using namespace std;
  14.  
  15. typedef string str;
  16. typedef long long ll;
  17. typedef unsigned long long ull;
  18. typedef double db;
  19. typedef long double ldb;
  20. typedef pair<int, int> pii;
  21. typedef pair<ll, ll> pll;
  22. typedef vector<int> vi;
  23. typedef vector<ll> vl;
  24. typedef vector<vector<int>> vii;
  25. typedef vector<vector<ll>> vll;
  26. typedef map<int, int> mpii;
  27. typedef map<ll, ll> mpll;
  28. typedef set<int> si;
  29. typedef set<ll> sl;
  30. #define prio_que priority_queue
  31.  
  32. #define se second
  33. #define fi first
  34. #define For(i, l, r, x) for(int i = l; i <= r; i += x)
  35. #define Ford(i, l, r, x) for(int i = l; i >= r; i -= x)
  36. #define Fore(x, a) for(auto x: a)
  37. #define pb push_back
  38. #define ins insert
  39. #define all(a) a.begin(), a.end()
  40.  
  41. #define phongdeptrainhatquadat main()
  42.  
  43. const ll inf = 1e18 + 1;
  44. const int mod = 1e9 + 7;
  45. const int maxn = 10;
  46.  
  47. int phongdeptrainhatquadat{
  48. ios_base::sync_with_stdio(false);
  49. cin.tie(NULL); cout.tie(NULL);
  50. int n = 10, q = 10;
  51. cout << n << ' ' << q << '\n';
  52. For(i, 1, n, 1){
  53. int x = rand() % maxn;
  54. cout << x << ' ';
  55. }
  56. cout << "\b\n";
  57. For(i, 1, q, 1){
  58. int t = rand() % 4 + 1;
  59. if(t <= 2){
  60. int r = rand() % n + 1;
  61. int l = rand() % r + 1;
  62. int x = rand() % 10 + 1;
  63. cout << t << ' ' << l << ' ' << r << ' ' << x << '\n';
  64. }else if(t == 3){
  65. int p = rand() % (n + 1) + 1;
  66. int x = rand() % 10 + 1;
  67. cout << t << ' ' << p << ' ' << x << '\n'; ++n;
  68. }else{
  69. int r = rand() % n + 1;
  70. int l = rand() % r + 1;
  71. cout << t << ' ' << l << ' ' << r << '\n';
  72. }
  73. }
  74. return (0 ^ 0);
  75. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
10 10
3 6 7 5 3 5 6 2 9 1 
3 8 1
4 7 8
1 3 11 7
4 7 9
2 1 5 3
4 4 4
2 7 8 9
2 4 10 7
4 8 11
2 5 5 5