Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Face The Right Way
Description Farmer John has arranged his Fortunately, FJ recently bought an automatic cow turning machine. Since he purchased the discount model, it must be irrevocably preset to turn Because FJ must pick a single, never-changing value of Input Line 1: A single integer: N
Lines 2.. N+1: Line i+1 contains a single character, F or B, indicating whether cow i is facing forward or backward.Output Line 1: Two space-separated integers: K and MSample Input 7 B B F B F B B Sample Output 3 3 Hint For K = 3, the machine must be operated three times: turn cows (1,2,3), (3,4,5), and finally (5,6,7)Source |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator