CF84A.Toy Army
入门
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
The hero of our story, Valera, and his best friend Arcady are still in school, and therefore they spend all the free time playing turn-based strategy "GAGA: Go And Go Again". The gameplay is as follows.
There are two armies on the playing field each of which consists of n men (n is always even). The current player specifies for each of her soldiers an enemy's soldier he will shoot (a target) and then all the player's soldiers shot simultaneously. This is a game world, and so each soldier shoots perfectly, that is he absolutely always hits the specified target. If an enemy soldier is hit, he will surely die. It may happen that several soldiers had been indicated the same target. Killed soldiers do not participate in the game anymore.
The game "GAGA" consists of three steps: first Valera makes a move, then Arcady, then Valera again and the game ends.
You are asked to calculate the maximum total number of soldiers that may be killed during the game.
我们故事的主角瓦莱拉(Valera)和他的好朋友阿尔卡季(Arcady)仍在上学,因此他们把所有空闲时间都花在玩回合制策略游戏“GAGA:Go And Go Again”上。游戏规则如下:
游戏场地上有两支军队,每支军队均由 n 名士兵组成(n 恒为偶数)。当前行动的玩家需为己方每一名士兵指定一名敌方士兵作为射击目标;随后,该玩家的所有士兵同时开火。这是个游戏世界,因此每位士兵都能完美命中——即他必定击中所指定的目标。若一名敌方士兵被击中,则他必然阵亡。可能出现多名士兵指定同一目标的情况。阵亡的士兵将不再参与后续游戏。
游戏“GAGA”共包含三个回合:首先由瓦莱拉行动,接着由阿尔卡季行动,最后再由瓦莱拉行动,之后游戏结束。
你需要计算:在整个游戏过程中,可能被击杀的士兵总数的最大值。
输入格式
The input data consist of a single integer n (2 ≤ n ≤ 108, n is even). Please note that before the game starts there are 2_n_ soldiers on the fields.
输入数据包含一个整数 n(2 ≤ n ≤ 108,且 n 为偶数)。请注意,游戏开始前,战场上共有 2n 名士兵。
输出格式
Print a single number — a maximum total number of soldiers that could be killed in the course of the game in three turns.
输出一个整数——即在三回合的游戏过程中最多可以消灭的士兵总数。
输入输出样例
输入#1
2
输出#1
3
输入#2
4
输出#2
6
说明/提示
The first sample test:
-
Valera's soldiers 1 and 2 shoot at Arcady's soldier 1.
-
Arcady's soldier 2 shoots at Valera's soldier 1.
-
Valera's soldier 1 shoots at Arcady's soldier 2.
There are 3 soldiers killed in total: Valera's soldier 1 and Arcady's soldiers 1 and 2.
第一个样例测试:
-
瓦列拉的士兵 1 和 2 向阿尔卡季的士兵 1 射击。
-
阿尔卡季的士兵 2 向瓦列拉的士兵 1 射击。
-
瓦列拉的士兵 1 向阿尔卡季的士兵 2 射击。
总共阵亡了 3 名士兵:瓦列拉的士兵 1,以及阿尔卡季的士兵 1 和 2。
输入解题思路,AI测评打分。不知道怎么写?