fork download
  1. #include <iostream>
  2. #include<algorithm>
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <time.h>
  6. using namespace std;
  7. bool comp(int a,int b){
  8. cout<<a<<"--"<<b<<endl;
  9. return a>b;
  10. }
  11.  
  12. int main() {
  13. int n;
  14. cin>>n;
  15. // int*arr=new int[n];
  16. // for(int i=0;i<n;++i){
  17. // cin>>arr[i];
  18. // }
  19. // sort(arr,arr+n,comp);
  20. //for(int i=0;i<n;++i){
  21. // cout<<arr[i]<<" ";
  22. //}
  23. // cout<<"Graph G{"<<endl;
  24. // sort(arr,arr+n,comp);
  25. // cout<<"}";
  26. // cout<<"Graph F{"<<endl;
  27. // sort(arr,arr+n,comp);
  28. // cout<<"}";
  29. int *random=new int[n];
  30. for(int i=0;i<n;++i){
  31. random[i]=rand()%100+1;
  32. }
  33. sort(random,random+n,comp);
  34. cout<<"}";
  35. cout<<"Graph F{"<<endl;
  36. sort(random,random+n,comp);
  37. cout<<"}";
  38.  
  39. return 0;
  40. }
Success #stdin #stdout 0s 5348KB
stdin
30
stdout
87--27
27--36
87--36
87--36
78--36
16--36
36--84
94--36
36--36
36--68
87--36
93--36
50--36
22--36
36--24
36--63
63--36
28--36
36--31
36--83
91--36
60--36
64--36
27--36
36--30
36--68
41--36
27--36
36--69
73--36
37--36
12--36
36--12
36--37
87--63
63--37
87--63
78--63
84--63
94--63
68--63
87--63
93--63
50--63
63--37
63--73
63--63
63--69
36--63
63--41
63--68
83--63
91--63
60--63
63--64
60--63
63--64
87--63
78--87
78--63
78--87
84--87
84--63
84--78
84--87
94--87
68--94
68--63
68--78
87--94
87--63
87--68
87--78
87--84
87--87
93--94
93--63
93--68
93--78
93--84
93--87
93--87
93--94
73--94
73--63
73--68
73--78
69--94
69--63
69--68
69--73
68--94
68--63
68--68
83--94
83--63
83--68
83--68
83--69
83--73
83--78
83--84
91--94
91--63
91--68
91--68
91--69
91--73
91--78
91--83
91--84
91--87
91--87
91--93
64--94
64--63
64--68
60--94
60--63
36--94
36--60
41--36
41--60
63--36
63--41
63--60
63--63
50--36
50--41
50--60
37--36
37--41
12--36
27--12
27--36
27--12
27--27
30--12
30--27
30--27
30--36
28--12
28--27
28--27
28--30
31--12
31--27
31--27
31--28
31--30
31--36
22--12
22--27
24--12
24--22
24--27
36--12
36--22
36--24
36--27
36--27
36--28
36--30
36--31
36--36
16--12
16--22
}Graph F{
93--60
60--12
93--60
91--60
87--60
87--60
84--60
83--60
78--60
73--60
69--60
68--60
68--60
64--60
63--60
63--60
94--60
50--60
60--12
60--16
60--22
60--24
60--27
60--27
60--28
60--30
60--31
60--36
60--36
60--37
60--41
60--50
60--94
93--60
91--93
91--60
91--93
87--93
87--60
87--91
87--93
87--60
87--87
84--93
84--60
84--87
83--93
83--60
83--84
78--93
78--60
78--83
73--93
73--60
73--78
69--93
69--60
69--73
68--93
68--60
68--69
68--93
68--60
68--68
64--93
64--60
64--68
63--93
63--60
63--64
63--93
63--60
63--63
94--93
50--60
41--50
37--41
36--37
36--36
31--36
30--31
28--30
27--28
27--27
24--27
22--24
16--22
12--16
}