ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1098. Questions

Orz C++'s effectivity
Posted by StarForever 3 Jan 2007 07:17
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
Posted by Anisimov Dmitry 6 Oct 2008 21:07
What does "Orz C++" stand for?
Re: Orz C++'s effectivity
Posted by inatial_D 25 Apr 2013 08:40
cool. you don't need to delete the character in each loop