fork(2) download
  1. #include <stdint.h>
  2. #define N 1<<27
  3.  
  4. #define min(x, y) (x<y?x:y)
  5. #define max(x, y) (x<y?y:x)
  6. #define SWAP(x,y) { const uint64_t a = min(temp[x], temp[y]); const uint64_t b = max(temp[x], temp[y]); temp[x] = a; temp[y] = b;}
  7.  
  8. int main(void){
  9. uint32_t i;
  10. uint64_t temp[9] = {1};
  11.  
  12. for(i = 0; i < N; i ++){
  13. SWAP(0, 1);
  14. SWAP(3, 4);
  15. SWAP(6, 7);
  16. SWAP(1, 2);
  17. SWAP(4, 5);
  18. SWAP(7, 8);
  19. SWAP(0, 1);
  20. SWAP(3, 4);
  21. SWAP(6, 7);
  22. SWAP(0, 3);
  23. SWAP(3, 6);
  24. SWAP(0, 3);
  25. SWAP(1, 4);
  26. SWAP(4, 7);
  27. SWAP(1, 4);
  28. SWAP(2, 5);
  29. SWAP(5, 8);
  30. SWAP(2, 5);
  31. SWAP(1, 3);
  32. SWAP(5, 7);
  33. SWAP(2, 6);
  34. SWAP(4, 6);
  35. SWAP(2, 4);
  36. SWAP(2, 3);
  37. SWAP(5, 6);
  38. }
  39.  
  40. return temp[6];
  41. }
  42.  
Time limit exceeded #stdin #stdout 5s 2004KB
stdin
Standard input is empty
stdout
Standard output is empty