Codeforces Round #304 (Div. 2) C. Soldier and Cards stl应用

Two bored soldiers are playing card war. Their card deck consists of exactlyncards, numbered from1ton,all values are different. They divide cards between them in some manner, it’s possible that they have different number of cards. Then they play a "war"-like card game.

The rules are following. On each turn afighthappens. Each of them picks card from the top of his stack and puts on the table. The one whose card value is bigger wins thisfightand takes both cards from the table to the bottom of his stack. More precisely, he first takes his opponent’s card and puts to the bottom of his stack, and then he puts his card to the bottom of his stack. If after some turn one of the player’s stack becomes empty, he loses and the other one wins.

You have to calculate how manyfightswill happen and who will win the game, or state that game won’t end.

,海阔凭鱼跃,天高任鸟飞。我要加油,冲向我的理想。

Codeforces Round #304 (Div. 2) C. Soldier and Cards stl应用

相关文章:

你感兴趣的文章:

标签云: