fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define pb push_back
  5. #define endl "\n"
  6. #define ll long long
  7. #define war() ios::sync_with_stdio(0); cin.tie(0);
  8.  
  9.  
  10.  
  11. #define int ll
  12. int R=0,D=0;
  13. int MOD=100;
  14.  
  15. mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
  16.  
  17. void solve(int T){
  18. vector<char>v;
  19. int ok=0;
  20. while(ok==0){
  21. ok=rnd()%MOD;
  22. }
  23. for(int i=0; i<ok; i++){
  24. int z=rnd();
  25. if(z%2){
  26. if(rnd()%2){v.pb('R');}
  27. else{v.pb('D');}
  28. }
  29. else{
  30. if(rnd()%2){v.pb('D');}
  31. else{v.pb('R');}
  32. }
  33. }
  34.  
  35. int sz=v.size();
  36. int temp_R=0, temp_D=0;
  37. for(int i=0; i<rnd()%100; i++){
  38. int z=rnd()%sz;
  39. if(v[z]=='R'){temp_R++;}
  40. else{temp_D++;}
  41. }
  42.  
  43. if(temp_D==temp_R){D++; R++;}
  44. else if(temp_D>temp_R){D++;}
  45. else{R++;}
  46.  
  47. }
  48.  
  49.  
  50.  
  51.  
  52.  
  53. int32_t main(){ //DRINK WATER
  54. war();
  55. //read(); write();
  56. /////////////////////////////////////
  57.  
  58. /////////////////////////////////////
  59. int tc=rnd()%MOD;
  60. for(int T=1; T<=tc; T++){
  61. solve(T);
  62. }
  63.  
  64. cout<<"D: "<<D<<endl;
  65. cout<<"R: "<<R<<endl;
  66. return 0;
  67. }
  68.  
  69. /*
  70.  
  71.   /\_/\
  72.   (= ._.)
  73.   / > \> Mr_Warlock
  74.   / \
  75.  
  76. */
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
D: 42
R: 34