fork(1) download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace ConsoleApplication1
  6. {
  7. class Program
  8. {
  9. static void Main(string[] args)
  10. {
  11.  
  12. DateTime now;
  13.  
  14. int i, j, k, x;
  15. long counter;
  16.  
  17. counter = 0;
  18.  
  19. now = DateTime.Now;
  20.  
  21. /* LOOP */
  22. for (x = 0; x < 10; x++)
  23. {
  24. counter = -1234567890 + x + 2 + counter;
  25.  
  26. for (j = 0; j < 1000; j++)
  27. {
  28. for (i = 0; i < 1000; i++)
  29. {
  30. for (k = 0; k < 1000; k++)
  31. {
  32. if (counter > 10000)
  33. {
  34. counter = counter - 9999 + i + j + k;
  35. }
  36. else
  37. {
  38. counter = counter + 1 + i + j + k;
  39. }
  40. }
  41. }
  42. }
  43.  
  44. }
  45.  
  46. Console.Write("counter = {0} \n", counter.ToString());
  47. Console.Write("Elapsed time = {0} seconds", DateTime.Now - now);
  48. }
  49. }
  50. }
  51.  
  52.  
  53.  
Time limit exceeded #stdin #stdout 5s 36240KB
stdin
Standard input is empty
stdout
Standard output is empty