Advertisement
Morass

Generator

Oct 1st, 2016
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.47 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define PB push_back
  4. #define ZERO (1e-10)
  5. #define INF (1<<30)
  6. #define CL(A,I) (memset(A,I,sizeof(A)))
  7. #define DEB printf("DEB!\n");
  8. #define D(X) cout<<"  "<<#X": "<<X<<endl;
  9. #define EQ(A,B) (A+ZERO>B&&A-ZERO<B)
  10. typedef long long ll;
  11. typedef long double ld;
  12. typedef pair<ll,ll> pll;
  13. typedef vector<int> vi;
  14. typedef pair<int,int> ii;
  15. typedef vector<ii> vii;
  16. #define IN(n) int n;scanf("%d",&n);
  17. #define FOR(i, m, n) for (int i(m); i < n; i++)
  18. #define REP(i, n) FOR(i, 0, n)
  19. #define F(n) REP(i, n)
  20. #define FF(n) REP(j, n)
  21. #define FT(m, n) FOR(k, m, n)
  22. #define aa first
  23. #define bb second
  24. void ga(int N,int *A){F(N)scanf("%d",A+i);}
  25. #define pc(C) (putchar_unlocked(C))
  26. ll R(int b=62){ll r(0);F(b)r<<=1,r|=rand()&1;return r;}
  27. #define r rand()
  28. #define GR int a,b;a=b=r%N;while(a==b)a=r%N;
  29. int A[666];
  30. int main(void){
  31.     srand(time(0));
  32.     int tt(100);//Number of test-cases
  33.     printf("%d\n",tt);
  34.     F(tt){
  35.         pc(10);//blank
  36.         int N=rand()%26+1;//# of nodes
  37.         F(N){
  38.             printf("%c %d",i+65,1+rand()%10);//print node+time
  39.             if(i){
  40.                 pc(32);
  41.                 set<char> S;//we don't want duplicities
  42.                 int H=rand()%i+1;//number of PARENTS
  43.                 while(S.size()^H)S.insert(rand()%i);//generate parents until size
  44.                 for(auto&h:S)pc(h+65);//print all parents
  45.             }
  46.             pc(10);//End of line
  47.         }
  48.     }
  49.     return 0;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement