Advertisement
Ryuuk

RIG_xyz

Jul 9th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5.  
  6. int main()
  7. {
  8.     freopen("output.txt","w",stdout);
  9.     srand(time(0));
  10.     for(int l =0;l<100;l++)
  11.     {
  12.         int vertices = rand()%10 +1 ;
  13.         cout<<vertices<<endl;
  14.         for(int j=0;j<vertices;j++)
  15.         {
  16.             int e=rand()%10+1;
  17.             int w ;
  18.             (j==0)?w=0:w=rand()%200-100;
  19.             cout<<w<<" "<<e<<" ";
  20.             vector<int> v;
  21.             v.resize(e);
  22.             for(int c=0;c<e;c++)
  23.                 v[c]=c+1;
  24.             for(int j=1;j<=e;j++)
  25.             {
  26.                 int u=rand()%v.size();
  27.                 cout<<v[u]<<" ";
  28.                 v.erase(v.begin()+u);
  29.             }
  30.             cout<<endl;
  31.         }
  32.     }
  33.     cout<<"-1"<<endl;
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement