fork download
  1. #pragma GCC optimize("Ofast")
  2. #pragma GCC optimize("unroll-loops")
  3. #pragma GCC optimize("inline")
  4. #include<bits/stdc++.h>
  5. using namespace std;
  6. struct Rand{
  7. unsigned x;
  8. unsigned y;
  9. unsigned z;
  10. unsigned w;
  11. Rand(void){
  12. x=123456789;
  13. y=362436069;
  14. z=521288629;
  15. w=(unsigned)time(NULL);
  16. }
  17. Rand(unsigned seed){
  18. x=123456789;
  19. y=362436069;
  20. z=521288629;
  21. w=seed;
  22. }
  23. inline unsigned get(void){
  24. unsigned t;
  25. t = (x^(x<<11));
  26. x=y;
  27. y=z;
  28. z=w;
  29. w = (w^(w>>19))^(t^(t>>8));
  30. return w;
  31. }
  32. inline double getUni(void){
  33. return get()/4294967296.0;
  34. }
  35. inline int get(int a){
  36. return (int)(a*getUni());
  37. }
  38. inline int get(int a, int b){
  39. return a+(int)((b-a+1)*getUni());
  40. }
  41. inline long long get(long long a){
  42. return(long long)(a*getUni());
  43. }
  44. inline long long get(long long a, long long b){
  45. return a+(long long)((b-a+1)*getUni());
  46. }
  47. inline double get(double a, double b){
  48. return a+(b-a)*getUni();
  49. }
  50. inline int getExp(int a){
  51. return(int)(exp(getUni()*log(a+1.0))-1.0);
  52. }
  53. inline int getExp(int a, int b){
  54. return a+(int)(exp(getUni()*log((b-a+1)+1.0))-1.0);
  55. }
  56. }
  57. ;
  58. #define main dummy_main
  59. int main(){
  60. return 0;
  61. }
  62. #undef main
  63. Rand rnd;
  64. class Solution{
  65. public:
  66. string findDifferentBinaryString(vector<string>& A){
  67. int N = A.size();
  68. string str;
  69. for(;;){
  70. int i;
  71. str = "";
  72. for(i=(0);i<(N);i++){
  73. str += (char)('0' + rnd.get(2));
  74. }
  75. for(i=(0);i<(N);i++){
  76. if(str == A[i]){
  77. goto Lj4PdHRW;
  78. }
  79. }
  80. break;
  81. Lj4PdHRW:;
  82. }
  83. return str;
  84. }
  85. }
  86. ;
  87. // cLay version 20210926-1
  88.  
  89. // --- original code ---
  90. // #define main dummy_main
  91. // {}
  92. // #undef main
  93. //
  94. // Rand rnd;
  95. //
  96. // class Solution {
  97. // public:
  98. // string findDifferentBinaryString(vector<string>& A) {
  99. // int N = A.size();
  100. // string str;
  101. // for(;;){
  102. // str = "";
  103. // rep(i,N) str += (char)('0' + rnd.get(2));
  104. // rep(i,N) if(str == A[i]) break_continue;
  105. // break;
  106. // }
  107. // return str;
  108. // }
  109. // };
  110.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty