Mthis is a task from serbian regional contest
i sorted all the arrays for 'A' to 'Z' char and then i add the minimal valuesd but what should i do to make it more efficient since i get TLE on 2 test cases
Mi used selection sort
what sort is faster?:D
i work in pascal so i guess the speed of reading in pascal is lower than in C so it is also one of the reasons of TLE
ANo no no, you must use quick sort or heap sort. If you use Free Pascal you'll have quick sort in Examples folder so learn it. You'll need it for many tasks and of course for competitions.
Mok will do it up to now i only now selection sort and bubble sort and i was really wondering why doesnt this work but now i realise...thanks guys:D
and how should i solve the task MaxGCD.
i used euclids algorithm and i get 2 TLE
AMy code for MaxGCD is very similar to yours and it passed ... Try to submit in GPC, I think that you'll avoid TLE by doing that. :)
AVersion of Pascal, but it's faster on Z-Trening than Free Pascal . Just use GPC as your default language . ;)
MOK thanks now it has passed.is this pascal available to use in the competitions
ANo you just need to use it on Z-Trening, on competition regular Pascal works fine I think .