fork(5) download
  1. /*
  2. * @problem: random
  3. */
  4.  
  5. #include <iostream>
  6. #include <cstring>
  7. #include <cstdio>
  8. #include <cmath>
  9. #include <limits.h>
  10. #include <vector>
  11. #include <map>
  12. #include <bitset>
  13. #include <string>
  14. #include <iterator>
  15. #include <set>
  16. #include <utility>
  17. #include <queue>
  18. #include <numeric>
  19. #include <functional>
  20. #include <ctype.h>
  21. #include <stack>
  22. #include <algorithm>
  23. #include <cstdlib>
  24. #define MAX 100100
  25. #define mod 1000000001LL
  26. #define bitcnt(x) __builtin_popcount(x)
  27. #define MS0(x) memset(x, 0, sizeof(x))
  28. #define MS1(x) memset(x, -1, sizeof(x))
  29. #define ll long long int
  30. #define mp(x, y) make_pair(x, y)
  31. #define pii pair<int, int>
  32. #define pll pair<ll, ll>
  33. #define in(x) scanf("%lld", &x)
  34. #define ind(x) scanf("%d", &x)
  35. #define ins(x) scanf("%s", x)
  36. #define pr(x) printf("%lld\n", x)
  37. #define prd(x) printf("%d\n", x)
  38. #define prs(x) printf("%s\n", x)
  39. #define pi acos(-1.0)
  40. #define ff first
  41. #define ss second
  42.  
  43. using namespace std;
  44. int random(int l, int r) {
  45. int tmp = rand() % (r - l + 1);
  46. return tmp + l;
  47. }
  48.  
  49. int main()
  50. {
  51. freopen("input.txt", "w", stdout);
  52. //freopen("output.txt", "w", stdout);
  53. srand(time(NULL));
  54. int t = 100;
  55. cout << t << endl;
  56. while (t--) {
  57. int n = random(1, 100);
  58. int m = random(0, n * n);
  59. int d = random(1, n);
  60. int D = random(d, n);
  61. cout << n << " " << m << " " << d << " " << D << endl;
  62. }
  63. return 0;
  64. }
  65.  
Success #stdin #stdout 0s 3464KB
stdin
Standard input is empty
stdout
Standard output is empty