fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <cstdint>
  4. #include <algorithm>
  5.  
  6. typedef std::vector<std::uint64_t> DType;
  7.  
  8. DType MakeHoge(std::uint64_t L, std::uint64_t Radix) {
  9. DType R;
  10. //R.push_back(0);//すぺしゃらいず。
  11.  
  12. for (std::uint64_t i = 1; i < Radix; i++) {
  13. for (std::uint64_t j = 0; j < L; j) {
  14. j = (j*Radix)+i;
  15. R.push_back(j);
  16. }
  17. }
  18.  
  19.  
  20. return R;
  21. }
  22.  
  23. bool Show(DType D) {
  24. std::sort(D.begin(), D.end());
  25. for (auto& o : D) {
  26. std::cout << o << ',';
  27. }
  28. std::cout << std::endl;
  29. return true;
  30. }
  31.  
  32. int main() {
  33.  
  34. std::uint64_t L = 100000000;
  35. //std::uint64_t L = 1000;
  36. std::uint64_t Rdx = 10;
  37.  
  38. DType R = MakeHoge(L, Rdx);
  39. Show(R);
  40.  
  41. return 0;
  42. }
Success #stdin #stdout 0s 4384KB
stdin
Standard input is empty
stdout
1,2,3,4,5,6,7,8,9,11,22,33,44,55,66,77,88,99,111,222,333,444,555,666,777,888,999,1111,2222,3333,4444,5555,6666,7777,8888,9999,11111,22222,33333,44444,55555,66666,77777,88888,99999,111111,222222,333333,444444,555555,666666,777777,888888,999999,1111111,2222222,3333333,4444444,5555555,6666666,7777777,8888888,9999999,11111111,22222222,33333333,44444444,55555555,66666666,77777777,88888888,99999999,111111111,222222222,333333333,444444444,555555555,666666666,777777777,888888888,999999999,