http://codeforces.me/contest/898/submission/33391085
The case in witch memory limit is exceeded is:
20 nxj 6 7 6 6 7 7 7 nxj 10 8 5 1 7 6 1 0 7 0 6 nxj 2 6 5 nxj 10 6 7 6 6 5 8 3 6 6 8 nxj 10 6 1 7 6 7 1 8 7 8 6 nxj 10 8 5 8 6 5 6 1 9 6 3 nxj 10 8 1 6 4 8 0 4 6 0 1 nxj 9 2 6 6 8 1 1 3 6 6 nxj 10 8 9 0 9 1 3 2 3 2 3 nxj 6 6 7 0 8 1 2 nxj 7 7 7 8 1 3 6 9 nxj 10 2 7 0 1 5 1 9 1 2 6 nxj 6 9 6 9 6 3 7 nxj 9 0 1 7 8 2 6 6 5 6 nxj 4 0 2 3 7 nxj 10 0 4 0 6 1 1 8 8 4 7 nxj 8 4 6 2 6 6 1 2 7 nxj 10 5 3 4 2 1 0 7 0 7 6 nxj 10 9 6 0 6 1 6 2 1 9 6
so the map will have 1 entry nxj->vector of all above numbers, which is not much by any means. Is there something I'm missing?