bhupixb

Test Case Generator

Apr 2nd, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include "bits/stdc++.h"
  2. using namespace std;
  3.  
  4. int rand(int l, int r){
  5. static mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  6. uniform_int_distribution<int> uid(l, r); return uid(rng);
  7. }
  8.  
  9. signed main() {
  10. srand(time(nullptr));
  11.  
  12. ofstream out;
  13. out.open("input.txt");
  14.  
  15. int t = rand(1, 4);
  16. out << t << '\n';
  17. while(t--) {
  18. int n;
  19. n = rand(1, 10);
  20. out << n << '\n';
  21. while(n--)
  22. out << rand(1, 25) << ' ';
  23. out << '\n';
  24. }
  25. }
Add Comment
Please, Sign In to add comment