Advertisement
Guest User

Untitled

a guest
May 4th, 2019
506
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include "testlib.h"
  2. //#include "jngen.h"
  3. #include <bits/stdc++.h>
  4.  
  5. #define forn(i, n) for (int i = 0; i < int(n); i++)
  6.  
  7. using namespace std;
  8.  
  9.  
  10. int main(int argc, char* argv[]) {
  11.     registerGen(argc, argv, 1);
  12.    
  13.     int n = 83160, m = 200000;
  14.     set<pair<int, int>> res;
  15.     forn(i, m){
  16.         int x, y;
  17.         do{
  18.             x = rnd.next(n);
  19.             y = rnd.next(n - 1);
  20.             if (y >= x) ++y;
  21.         } while (res.count({x, y}) || res.count({y, x}));
  22.         res.insert({x, y});
  23.     }
  24.    
  25.     printf("%d %d\n", n, m);
  26.     for (auto it : res)
  27.         printf("%d %d\n", it.first + 1, it.second + 1);
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement