|
|
back to boardI don't understand. I use quicksort and then find solution very fast. MLE #21 say me that memory limit! I use c#. Edited by author 26.03.2017 21:16 Edited by author 26.03.2017 21:16 Edited by author 26.03.2017 21:17 Edited by author 26.03.2017 21:37 AND i use List MLE - your program spent too much memory. No perfomance problem detected. Looks like you read all N inputs into list. Try using dictionary K -> count. I use Dictionary and get MLE too. I think problem in input data. I enter input data like: string[] input = Console.In.ReadToEnd().Split( new char[] { ' ', '\t', '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries); And add in dictionary for (int i = 0; i < input.Length; i++){ ... } I don't understand what's wrong :( Was wrong. Dictionary => TLE. Got input into List, sorted List, took middle one => AC. Just avoid reading whole input. Use something like static int readInt() { return Int.Parse(Console.ReadLine()); } Thanks! I read data like: static int readInt() { return Int.Parse(Console.ReadLine()); } But ... I have WA #25.. |
|
|