fork(1) download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. using System.Linq;
  5.  
  6. public class Test
  7. {
  8. public static void Main()
  9. {
  10. new Test().T();
  11. }
  12.  
  13. void T(){
  14. Action<string>C=Console.WriteLine;Func<string>R=Console.ReadLine;
  15. var w=new List<string>();
  16. for(var l=R();l!="";l=R())w.Add(l);
  17. var s=w.OrderBy(_=>Guid.NewGuid()).Take(10).ToList();
  18. s.ForEach(x=>C("=> "+x));
  19. var t=s.Select(x=>x.Length).Sum();
  20. var c=Stopwatch.StartNew();
  21. while(s.Any()){C(s.Remove(R())?"OK":"WRONG");}
  22. c.Stop();
  23. C("--> You have scored "+c.Elapsed.TotalSeconds*60/t+" CPM!");
  24. }
  25. }
Success #stdin #stdout 0.05s 37280KB
stdin
a1
a2
a3
a4
a5
a6
a7
a8
a9
a10

blah blah
a1
a2
a3
a4
a5
a6
a7
a8
a9
a10
stdout
=> a9
=> a1
=> a8
=> a10
=> a3
=> a7
=> a5
=> a2
=> a4
=> a6
WRONG
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
--> You have scored 0.00371 CPM!