hdoj pbd
来源:互联网 发布:wifi共享大师for mac 编辑:程序博客网 时间:2024/05/18 18:01
/*PBD
Problem Description
PrisonBreak is a popular TV programme in HDU. ACboy likes it very much,
and he join a PrisonBreak discussing team called "PBD".Every Tuesday night,
a lot of PBDers will contact with each other to discuss the newest plot of PrisonBreak
season2. Generally speaking, every PBDer has distinct ideas about the play,
so everyone want to know all the others' ideas. For example, when ACboy contract with Sam,
ACboy will tell all the ideas he konws to Sam, and Sam will also tell all the ideas he
konws to ACboy, and the call costs 5 yuan.
If there are N people in the "PBD" team, what is the minimum cost to let everyone
knows all the others' ideas?
Input
The input contains multiple test cases.
Each test case contains a number N, means there are N people in the "PBD" team.
N = 0 ends the input.(A call cost 5 yuan).
Output
for each case, output a integer represent the minimum cost to let everyone knows all
the others' ideas.
Sample Input
1
2
3
4
0
Sample Output
0
5
15
20
Hint
If there are 2 people, for example, named A, B. Then A calls B,
then A and B will know each other's ideas, so it only
needs one call, so the minimum cost is 1*5 = 5 yuan.*/
<span style="font-size:18px;">#include<stdio.h>int main(){ int n,i,m; while(scanf("%d",&n),n!=0) { if(n==1 || n==2) printf("%d\n",5*(n-1)); if(n==3 || n==4) printf("%d\n",5*n); if(n>=5) { for(m=4,i=5;i<=n;i++) m=m+2; printf("%d\n",m*5); } } return 0;}</span>
- hdoj pbd
- HDOJ--PBD
- HDOJ 1703 PBD (规律)
- PBL(PBD) File Format
- Powerbuilder PBD Syntax
- hdu 1703 PBD
- HDUoj PBD 题目1703
- pbd文件格式分析(powerbuilder6.5)
- 将PBL、PBD导入Application
- HDU 1703 PBD 递推
- HDU 1703 PBD(递推)
- powerbuilder pbd文件混淆器原理探秘
- 关于对pbd反编译器的期待
- hdu 1703 PBD(找规律)
- 利用pb本身的功能,反编译pbd文件中的dw
- PBD文件中的DW导出到PBL中
- PowerBuilder程序暴力破解实例(PBD文件编辑法)
- powerbuilder pbd文件保护方式-pb防止反编译研究
- iOS-OAuth授权
- 使用struts2进行文件下载以及下载权限控制的例子
- 模态窗口返回值给当前窗口页面
- 【转】MySQL日期时间函数大全
- POJ-3264-Balanced Lineup-单点更新
- hdoj pbd
- hdu5299 Circles Game
- c++大数加减法的实现
- 欢迎使用CSDN-markdown编辑器
- Windows下重置MySQL密码
- malloc
- 上传文件file按钮的美化处理
- linux下杀死进程(kill)的N种方法
- Eclipse上Logcat不显示日志的解决办法和注意事项