L - Huatuo's Medicine

Time Limit: 1 Sec

Memory Limit: 256 MB

题目连接

Description

Huatuo was a famous doctor. He use identical bottles to carry the medicine. There are different types of medicine. Huatuo put medicines into the bottles and chain these bottles together.

However, there was a critical problem. When Huatuo arrived the patient's home, he took the chain out of his bag, and he could not recognize which bottle contains which type of medicine, but he remembers the order of the bottles on the chain.

Huatuo has his own solution to resolve this problem. When he need to bring 2 types of medicines, E.g. A and B, he will put A into one bottle and put B into two bottles. Then he will chain the bottles in the order of -B-A-B-. In this way, when he arrived the patient's home, he knew that the bottle in the middle is medicine A and the bottle on two sides are medicine B.

Now you need to help Huatuo to work out what's the minimal number of bottles needed if he want to bring N types of medicine.

Input

For each test case, output one line containing Case #x: y, where x is the test case number (starting from 1) and y is the minimal number of bottles Huatuo needed.

Output

For each test case, output
one line containing Case #x:, where x is the test case number (starting
from 1). Then output 4 lines with 4 characters each. indicate the
recovered board.

Sample Input

1
2

Sample Output

Case #1: 3

HINT

题意

华佗有n种药,让你构成一条最短的链,他能够在黑暗中也能找到自己想找到的药品

题解:

对称就好了,例如:D-C-B-A-B-C-D

所以答案2n-1

代码:

#include<iostream>
#include<stdio.h>
using namespace std; int main()
{
int t;scanf("%d",&t);
for(int cas = ;cas <= t;cas ++)
{
int n;scanf("%d",&n);
printf("Case #%d: %d\n",cas,*n-);
}
}

2015南阳CCPC L - Huatuo's Medicine 水题的更多相关文章

  1. 2015南阳CCPC L - Huatuo's Medicine 签到

    L - Huatuo's Medicine Description Huatuo was a famous doctor. He use identical bottles to carry the ...

  2. 2015南阳CCPC A - Secrete Master Plan 水题

    D. Duff in Beach Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 无 Description Master Mind KongMing gave ...

  3. The 2015 China Collegiate Programming Contest L. Huatuo's Medicine hdu 5551

    Huatuo's Medicine Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others ...

  4. codeforces Gym 100187L L. Ministry of Truth 水题

    L. Ministry of Truth Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100187/p ...

  5. 2015南阳CCPC D - Pick The Sticks dp

    D - Pick The Sticks Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 无 Description The story happened lon ...

  6. 2015南阳CCPC C - The Battle of Chibi DP

    C - The Battle of Chibi Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 无 Description Cao Cao made up a ...

  7. 2015南阳CCPC D - Pick The Sticks 背包DP.

    D - Pick The Sticks Description The story happened long long ago. One day, Cao Cao made a special or ...

  8. 「2015南阳CCPC D」金砖 解题报告

    金砖 Problem 有一个长度为L的板凳,可以放一排金砖,金砖不能重叠.特别的,摆放的金砖可以超出板凳,前提是必须保证该金砖不会掉下去,即该金砖的重心必须在板凳上. 每块金砖都一个长度和价值,且金砖 ...

  9. 2015南阳CCPC E - Ba Gua Zhen 高斯消元 xor最大

    Ba Gua Zhen Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 无 Description During the Three-Kingdom perio ...

随机推荐

  1. 五分钟solr4.5教程(搭建、运行)

    环境要求 jdk1.6及以上版本 solr发布版本 下载地址 http://lucene.apache.org/solr/mirrors-solr-latest-redir.html? 启动solr ...

  2. android 应用页面与数据申请逻辑剥离;

    1.页面与数据申请剥离,数据申请框架可以灵活更换,解耦合: 2.对应页面的数据申请类中,将返回数据解析剥离,灵活更换数据返回及对应解析: 二.模块划分: 1.一些通用的工具类,可以考虑迁移到com.c ...

  3. duilib入门之贴图描述、类html文本描述、动态换肤、Dll插件、资源打包

    转载自duilib入门文档 贴图描述: Duilib的表现力丰富很大程度上得益于贴图描述的简单强大.Duilib的贴图描述分为简单模式和复杂模式两种. 简单模式使用文件名做为贴图描述内容,在这种方式下 ...

  4. iOS数据存储之对象归档

    iOS数据存储之对象归档 对象归档 对象归档是iOS中数据持久化的一种方式. 归档是指另一种形式的序列化,但它是任何对象都可以实现的更常规的类型.使用对模型对象进行归档的技术可以轻松将复杂的对象写入文 ...

  5. 各个城市优步uber注册司机官网地址汇总

    uber城市 开通uber城市 开通优步城市 哪些城市开通了uber   哪些城市开通了优步 分类: uber专车资讯 作为专车模式的创立者,Uber公司很早就进入了中国区域.优步在中国市场也是胸怀大 ...

  6. CentOS 7 安装 PyCharm for python

    下载链接:http://www.jetbrains.com/pycharm/ 如果只是为了开发python,这个免费版的应该已经够了. 今天讲的是怎么在CentOS7下面安装 pycharm: 下载完 ...

  7. leetcode@ [310] Minimum Height Trees

    For a undirected graph with tree characteristics, we can choose any node as the root. The result gra ...

  8. 第二百四十九天 how can I 坚持

    竟然让我跟着他们去旅游..泡温泉,滑雪..西北坡,不去白不去. 罗娜,你别把我拉黑啊.哎,不知道咋办. 晚上玩了四局LOL,全输了,伤心. 还有今天抢票没抢到. 该怎么破,12点半正好在吃饭啊. 睡觉 ...

  9. 设置结点的ID为固定ID

    https://www.java.net//forum/topic/jxta/jxta-community-forum/how-initialize-pse-jxse-27 ————————————— ...

  10. UVALive 6910 Cutting Tree(离线逆序并查集)

    [题目]:(地址:) http://acm.hust.edu.cn/vjudge/contest/view.action?cid=97671#problem/E [题意]: 给出多棵树和两类操作:操作 ...