|
|
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 Posted by Lion 3 Jan 2007 18:34 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 cool. you don't need to delete the character in each loop |
|
|