fork download
  1. #define ARRAY_SIZE 10000000
  2.  
  3. void randomize(vector<int> &arr) {
  4. double fillRatio = 0.004;
  5.  
  6. mt19937 mt(time(0));
  7.  
  8. iota(arr.begin(), arr.end(), 0);
  9. fill_n(arr.begin(), ARRAY_SIZE*fillRatio, mt()%ARRAY_SIZE);
  10.  
  11. shuffle(arr.begin(), arr.end(), mt);
  12. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:3:16: error: variable or field ‘randomize’ declared void
 void randomize(vector<int> &arr) {
                ^~~~~~
prog.cpp:3:16: error: ‘vector’ was not declared in this scope
prog.cpp:3:23: error: expected primary-expression before ‘int’
 void randomize(vector<int> &arr) {
                       ^~~
stdout
Standard output is empty