acm 2016/5/18 hpu15级练习 G
来源:互联网 发布:白岩松事件犯众怒知乎 编辑:程序博客网 时间:2024/05/17 23:37
<div class="plm" style="text-align: center; font-size: 12pt; color: rgb(34, 34, 34); clear: both;"><div class="ptt" id="problem_title" style="font-size: 18pt; font-weight: bold; color: blue; padding: 10px;"><span style="color: green;">G - </span>Toy Army</div><span id="crawlSuccess" class="crawlInfo" style="display: inline;"><strong>Time Limit:</strong><span id="timeLimit">2000</span>MS <strong>Memory Limit:</strong><span id="memoryLimit">262144</span>KB <strong>64bit IO Format:</strong><span id="_64IOFormat">%I64d & %I64u</span></span><div id="problem_opt" style="font-size: 12px; margin-top: 10px;"><a target=_blank id="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" style="display: inline-block; position: relative; padding: 0px; margin-right: 0.1em; cursor: pointer; vertical-align: middle; overflow: visible; font-family: Verdana, Arial, sans-serif; font-size: 1em; border: 1px solid rgb(211, 211, 211); color: rgb(85, 85, 85); border-radius: 4px; background: url(http://acm.hust.edu.cn/vjudge/jquery-ui-1.11.1.custom/images/ui-bg_glass_75_e3e4f8_1x400.png) 50% 50% repeat-x rgb(227, 228, 248);"><span class="ui-button-text" style="display: block; padding: 0.4em 1em;">Submit</span></a> <a target=_blank id="problem_status" href="http://acm.hust.edu.cn/vjudge/contest/view.action?cid=116190#status//G/0" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" style="display: inline-block; position: relative; padding: 0px; margin-right: 0.1em; cursor: pointer; vertical-align: middle; overflow: visible; text-decoration: none; font-family: Verdana, Arial, sans-serif; font-size: 1em; border: 1px solid rgb(211, 211, 211); color: rgb(85, 85, 85); border-radius: 4px; background: url(http://acm.hust.edu.cn/vjudge/jquery-ui-1.11.1.custom/images/ui-bg_glass_75_e3e4f8_1x400.png) 50% 50% repeat-x rgb(227, 228, 248);"><span class="ui-button-text" style="display: block; padding: 0.4em 1em;">Status</span></a> <a target=_blank id="problem_practice" target="_blank" href="http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=20292" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" style="display: inline-block; position: relative; padding: 0px; margin-right: 0.1em; cursor: pointer; vertical-align: middle; overflow: visible; text-decoration: none; font-family: Verdana, Arial, sans-serif; font-size: 1em; border: 1px solid rgb(211, 211, 211); color: rgb(85, 85, 85); border-radius: 4px; background: url(http://acm.hust.edu.cn/vjudge/jquery-ui-1.11.1.custom/images/ui-bg_glass_75_e3e4f8_1x400.png) 50% 50% repeat-x rgb(227, 228, 248);"><span class="ui-button-text" style="display: block; padding: 0.4em 1em;">Practice</span></a> <a target=_blank id="problem_origin" target="_blank" href="http://acm.hust.edu.cn/vjudge/problem/visitOriginUrl.action?id=20292" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" style="display: inline-block; position: relative; padding: 0px; margin-right: 0.1em; cursor: pointer; vertical-align: middle; overflow: visible; text-decoration: none; font-family: Verdana, Arial, sans-serif; font-size: 1em; border: 1px solid rgb(211, 211, 211); color: rgb(85, 85, 85); border-radius: 4px; background: url(http://acm.hust.edu.cn/vjudge/jquery-ui-1.11.1.custom/images/ui-bg_glass_75_e3e4f8_1x400.png) 50% 50% repeat-x rgb(227, 228, 248);"><span class="ui-button-text" style="display: block; padding: 0.4em 1em;">CodeForces 84A</span></a></div></div><div style="color: rgb(34, 34, 34); font-family: Verdana, Arial, sans-serif; font-size: 14px; width: 960px; margin: auto;"><div class="hiddable" id="vj_description" style="font-family: 'times new roman'; font-size: 17px;"><p class="pst" style="font-family: Arial, Helvetica, sans-serif; font-size: 18pt; font-weight: bold; color: blue; margin-bottom: 0px;">Description</p><div class="textBG" style="border-radius: 10px; padding: 10px; border-style: dotted; border-width: 2px; background-color: rgb(234, 235, 255);"><p>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.</p><p>There are two armies on the playing field each of which consists of <span class="tex-span" style="font-size: 21.25px;"><em>n</em></span> men (<span class="tex-span" style="font-size: 21.25px;"><em>n</em></span> 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.</p><p>The game "GAGA" consists of three steps: first Valera makes a move, then Arcady, then Valera again and the game ends.</p><p>You are asked to calculate the maximum total number of soldiers that may be killed during the game.</p></div></div><div class="hiddable" id="vj_input" style="font-family: 'times new roman'; font-size: 17px;"><p class="pst" style="font-family: Arial, Helvetica, sans-serif; font-size: 18pt; font-weight: bold; color: blue; margin-bottom: 0px;">Input</p><div class="textBG" style="border-radius: 10px; padding: 10px; border-style: dotted; border-width: 2px; background-color: rgb(234, 235, 255);"><p>The input data consist of a single integer <span class="tex-span" style="font-size: 21.25px;"><em>n</em></span> (<span class="tex-span" style="font-size: 21.25px;">2 ≤ <em>n</em> ≤ 10<sup class="upper-index">8</sup></span>, <span class="tex-span" style="font-size: 21.25px;"><em>n</em></span> is even). Please note that before the game starts there are <span class="tex-span" style="font-size: 21.25px;">2<em>n</em></span> soldiers on the fields.</p></div></div><div class="hiddable" id="vj_output" style="font-family: 'times new roman'; font-size: 17px;"><p class="pst" style="font-family: Arial, Helvetica, sans-serif; font-size: 18pt; font-weight: bold; color: blue; margin-bottom: 0px;">Output</p><div class="textBG" style="border-radius: 10px; padding: 10px; border-style: dotted; border-width: 2px; background-color: rgb(234, 235, 255);"><p>Print a single number — a maximum total number of soldiers that could be killed in the course of the game in three turns.</p></div></div><div class="hiddable" id="vj_sampleInput" style="font-family: 'times new roman'; font-size: 17px;"><p class="pst" style="font-family: Arial, Helvetica, sans-serif; font-size: 18pt; font-weight: bold; color: blue; margin-bottom: 0px;">Sample Input</p></div></div>
Output
3
Input
4
Output
6
Hint
The first sample test:
1) Valera's soldiers 1 and 2 shoot at Arcady's soldier 1.
2) Arcady's soldier 2 shoots at Valera's soldier 1.
3) 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.
</pre><pre code_snippet_id="1687783" snippet_file_name="blog_20160518_3_7945206" name="code" class="html">#include <cstdio>int main(){int n;while(~scanf("%d",&n)){printf("%d\n",n+n/2);}return 0;}
0 0
- acm 2016/5/18 hpu15级练习 G
- acm 2016/5/18 hpu15级练习 A
- acm 2016/5/18 hpu15级练习 B
- acm 2016/5/18 hpu15级练习 C
- acm 2016/5/18 hpu15级练习 J
- HPU15级练习(一)并查集 :A - Ubiquitous Religions
- HPU15级练习(一)并查集 :C - The Suspects
- HPU15级练习(一)并查集 :B - Wireless Network
- ACM第一次练习—1006G
- ACM递归递推练习Problem G
- ACM-递归递推练习G-Fighting_小银考呀考不过四级
- acm G
- ACM 练习
- acm 练习
- 2016山东省acm省赛 G题尼姆博奕
- 2016 acm河南省赛 G Prototypes analyze
- 哈理工校园编程练习赛杭电 acm 4432 G.Sum of divisors
- ACM大一练习赛-第三场------G - EPR悖论<克鲁斯卡尔算法>
- mysql workbench 快捷键
- Notepad++使用教程
- SRM 658 DIV1 650 二分答案 动态规划
- Androin学习笔记二十一:wifi的简单使用方法----获得本机或主机信息
- c++中 static修饰修饰类声明部分
- acm 2016/5/18 hpu15级练习 G
- 为什么做java的web开发我们会使用struts2,springMVC和spring这样的框架?
- ssh: connect to host localhost port 22: Connection refused 问题
- Eclipse如何生成文档(javadoc):
- 2016阿里前端实习生北京一面(已挂)
- 自定义标题时you can not combine custom title with other title features
- 关于命令行参数argv(《学习OpenCV》)
- nginx变量使用方法详解(5)
- ssh,scp远程连接,上传下载文件