fork(3) download
  1. #include <cstdio>
  2. #include <ctime>
  3. #include <vector>
  4. #define at operator[]
  5.  
  6. int main(int argc, char **argv)
  7. {
  8. size_t const n = 1 << 16;
  9. std::vector<size_t> v(n, 1);
  10. clock_t begin = clock();
  11. for (int j = 0; j < 1 << 12; ++j)
  12. {
  13. for (size_t i = 8; i < n; ++i)
  14. {
  15. v.at(i) += v.at(i - 8);
  16. v.at(i) ^= v.at(i - 7);
  17. v.at(i) -= v.at(i - 6);
  18. v.at(i) ^= v.at(i - 5);
  19. v.at(i) += v.at(i - 4);
  20. v.at(i) ^= v.at(i - 3);
  21. v.at(i) -= v.at(i - 2);
  22. v.at(i) ^= v.at(i - 1);
  23. }
  24. }
  25. fprintf(stderr, "%u\n", clock() - begin);
  26. return 0;
  27. }
  28.  
Success #stdin #stdout #stderr 0.93s 3292KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
920000