|
|
back to boardOrz C++'s effectivity I just use two lines in my code. pos=(pos+N-1)%question.length(); question.erase(pos,1); and I got AC... though it is a bit slow. But still unbelievable. Re: Orz C++'s effectivity It is Josephus problem... Change your solution: for(int len = question.length(); len>0; len--) pos = (pos+ N-1)%len; printf("%d", question[pos]); Re: Orz C++'s effectivity What does "Orz C++" stand for? Re: Orz C++'s effectivity Posted by JieJie 25 Apr 2013 08:40 cool. you don't need to delete the character in each loop |
|
|