fork download
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4. using System.Threading;
  5.  
  6. namespace A
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. int k = 10000000;
  13. int a, b, c;
  14. System.Diagnostics.Stopwatch sw;
  15. sw = new System.Diagnostics.Stopwatch(); sw.Start(); sw.Stop();
  16.  
  17. sw = new System.Diagnostics.Stopwatch();
  18. sw.Start();
  19. for (int i = 0; i < k; i++)
  20. {
  21. a = 0; b = 1; c = (a == 0 ? b : a);
  22. a = 1; b = 1; c = (a == 0 ? b : a);
  23. }
  24. sw.Stop();
  25. Console.WriteLine("JUMP {0}", sw.ElapsedTicks);
  26.  
  27. sw = new System.Diagnostics.Stopwatch();
  28. sw.Start();
  29. for (var i = 0; i < k; i++)
  30. {
  31. a = 0; b = 1; c = a - a * a * b + b;
  32. a = 1; b = 1; c = a - a * a * b + b;
  33. }
  34. sw.Stop();
  35. Console.WriteLine("BIT {0}", sw.ElapsedTicks);
  36.  
  37. }
  38. }
  39. }
Success #stdin #stdout 0.07s 34744KB
stdin
Standard input is empty
stdout
JUMP 182626
BIT 136986