Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

handshakes

pascal

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1 phananhtuan

phananhtuan

    CC Newcomer

  • Member
  • PipPip
  • 21 posts

Posted 07 August 2014 - 06:27 AM

3rd JUNIOR BALKAN OLYMPIAD IN INFORMATICS 
(JBOI 2009) 
November 27 – 29, 2009 
Shumen, Bulgaria
Task 1. HANDSHAKES
Before sport contest event all participants are lined up, each one is turned left or right. 
Simultaneously, all participants in the row who at present are facing each other shake hands 
and then turn around to face the participant on their other side. The time for one handshake 
and a turn is 1 second. The rest of the players keep their orientation. Then follow new 
handshakes and turnings, etc. 
The event will begin when the handshakes end. If they finish at all. 
Input 
From the standard input is read a string of letters L and R, where L means a player, turned to 
the left at the starting moment, while R means a player turned to the right. The length of the 
sting is 100000 at max. 
Output 
At the standard output to be brought out divided by space: the time for the handshakes and all 
handshakes made by the players. If the handshakes never cease then to be brought out 
NEVEREND. 


#2 Sundance

Sundance

    CC Devotee

  • Validating
  • PipPipPipPipPipPip
  • 572 posts

Posted 07 August 2014 - 07:55 AM

Awesome...so how much code have you done so far? Show us what you have & what you're stuck on? :)


Please read the

FaQ & Guidelines


#3 phananhtuan

phananhtuan

    CC Newcomer

  • Member
  • PipPip
  • 21 posts

Posted 07 August 2014 - 08:00 AM

i want to know optimal algorithm

 

#4 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts

Posted 07 August 2014 - 08:48 AM

Could you provide an example of what this looks like with a small number of players? I'm not clear on what's happening.


Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download