hdu6195(规律)
来源:互联网 发布:react 源码 component 编辑:程序博客网 时间:2024/06/11 12:35
cable cable cable
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 330 Accepted Submission(s): 265
Problem Description
Connecting the display screen and signal sources which produce different color signals by cables, then the display screen can show the color of the signal source.Notice that every signal source can only send signals to one display screen each time.
Now you haveM display screens and K different signal sources(K≤M≤232−1 ). Select K display screens from M display screens, how many cables are needed at least so that **any** K display screens you select can show exactly K different colors.
Now you have
Input
Multiple cases (no more than 100 ), for each test case:
there is one line contains two integersM and K .
there is one line contains two integers
Output
Output the minimum number of cables N .
Sample Input
3 220 15
Sample Output
490HintAs the picture is shown, when you select M1 and M2, M1 show the color of K1, and M2 show the color of K2.When you select M3 and M2, M2 show the color of K1 and M3 show the color of K2.When you select M1 and M3, M1 show the color of K1.
Source
2017 ACM/ICPC Asia Regional Shenyang Online
#include<cstdio>#include<iostream>#include<cstring>using namespace std;typedef long long ll;int main(){ll ans;ll k,m;while(scanf("%lld%lld",&m,&k)!=EOF){ans=(m-k)*k+k;printf("%lld\n",ans);}}
阅读全文
0 0
- hdu6195(规律)
- hdu6195 cable cable cable 找规律推公式
- hdu6195(数学)
- hdu6195(水)
- HDU6195 cable cable cable
- hdu6195 cable cable cable
- HDU6195-cable cable cable
- HDU6195 cable cable cable 签到
- HDOJ1021(找规律)
- hdu 3184 (规律)
- hdu 1210 (规律)
- POJ1740(找规律)
- hdu (找规律)
- hdu4915(找规律)
- HDU5100(找规律)
- UVA - 11308(规律)
- HDU2053(打表找规律)
- HDU2700(规律)
- windows server 2008 R2 远程桌面
- 文字漂浮的小功能 lua代码框架下实现
- TensorFlow安装(windows)
- C源文件到ELF可执行文件的生成过程
- 用js、css 弹出窗口
- hdu6195(规律)
- bieset学习、
- 认识RUP,XP,敏捷过程
- static_cast、dynamic_cast、const_cast和reinterpret_cast
- activemq 操作界面讲解
- jQuery操作input值总结
- 跟着《Learn Python The Hard Way》学Python(一)
- 如何进行数据的归一化问题
- bzoj 1689: [Usaco2005 Open] Muddy roads 泥泞的路(模拟)