cable cable cable

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)

Total Submission(s): 2084    Accepted Submission(s): 1348


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 have M 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.
 

Input
Multiple cases (no more than 100),
for each test case:

there is one line contains two integers M and K.
 

Output
Output the minimum number of cables N.
 

Sample Input

3 2
20 15
 

Sample Output

4
90

Hint


As 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.

 

Statistic | Submit | Clarifications | Back

题意:给出m个显示屏和k个信号,要求任选k个显示屏都可以显示所有的信号

思路:找规律

#include <iostream>

using namespace std;
typedef long long ll;
int main()
{
ll m,k;
while(cin>>m>>k)
{ ll tmp=m-(k+1);
cout<<k*2+tmp*k<<endl;
}
return 0;
}

hdu6195 cable cable cable的更多相关文章

  1. About USB Data Link Cable API

    About USB Data Link Cable API The text on this webpage is licensed under the Creative Commons Attrib ...

  2. hdu6195 cable cable cable(from 2017 ACM/ICPC Asia Regional Shenyang Online)

    最开始一直想不通,为什么推出这个公式,后来想了半天,终于想明白了. 题目大意是,有M个格子,有K个物品.我们希望在格子与物品之间连数量尽可能少的边,使得——不论是选出M个格子中的哪K个,都可以与K个物 ...

  3. POJ 1966 Cable TV Network

    Cable TV Network Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 4702   Accepted: 2173 ...

  4. POJ 1064 Cable master (二分)

    题目链接: 传送门 Cable master Time Limit: 1000MS     Memory Limit: 65536K 题目描述 有N条绳子,它们长度分别为Li.如果从它们中切割出K条长 ...

  5. Cable TV Network-POJ1966图的连通度

    Cable TV Network Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 4404 Accepted: 2047 Desc ...

  6. win7下用python3.3获取cable modem的设备信息

    毕业一年多了,一直做cable modem的测试,总是觉得在国内这一行的人才很少,想找个师傅真的很不容易. 苦闷了许久之后,终于决定,自己去写点东西,万一就找到同行了呢? 下面就是本小姐写的第一篇博客 ...

  7. [ACM] poj 1064 Cable master (二分查找)

    Cable master Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 21071   Accepted: 4542 Des ...

  8. POJ 1966 Cable TV Network(顶点连通度的求解)

                               Cable TV Network Time Limit: 1000MS   Memory Limit: 30000K Total Submissi ...

  9. Determining IP information for eth0... failed; no link present. Check cable?

    在RedHat下重启网络,service network restart之后,出现问题 Determining IP information for eth0... failed; no link p ...

随机推荐

  1. mysql控制流程函数(case,if,ifnull,nullif)

    1.case...when... 用法 参考:http://www.cnblogs.com/qlqwjy/p/7476533.html CASE value WHEN [compare-value] ...

  2. POJ 3169_Layout

    大早上水一发=.= 题意: n头牛按编号顺序站成一列,给定n头牛之间的位置关系,求出第n头牛和第一头牛之间的最大距离. 分析: 差分约束系统,这题不等式关系还是挺好找的.注意因为按照顺序排列,所以有d ...

  3. JSP的过滤器

    以下内容引用自http://wiki.jikexueyuan.com/project/jsp/writing-filters.html: Servlet和JSP过滤器都是Java类,可以在Servle ...

  4. JSP中HTTP状态码

    以下内容引用自http://wiki.jikexueyuan.com/project/jsp/http-status-codes.html: HTTP请求格式和HTTP响应消息的格式一样,都有以下结构 ...

  5. LINUX 内核结构

    http://blog.csdn.net/hguisu/article/details/6122513 http://blog.csdn.net/hguisu/article/category/796 ...

  6. 8VC Venture Cup 2016 - Final Round (Div2) E

    贪心.当前位置满油可达的gas station中,如果有比它小的,则加油至第一个比他小的.没有,则加满油,先到达这些station中最小的.注意数的范围即可. #include <iostrea ...

  7. 赵雅智_Android的getResources()资源引用

    今天做一个Android的刮刮乐项目.里面用到非常多的地方用到了getResources. <span style="font-size:12px;"> // 获得图片 ...

  8. 在head里的CSS link 竟然粗如今body里了?

    watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcGVhY2Vfb2Zfc291bA==/font/5a6L5L2T/fontsize/400/fill/I0 ...

  9. jacoco+maven生成单元测试覆盖率报告

    参考:https://www.petrikainulainen.net/programming/maven/creating-code-coverage-reports-for-unit-and-in ...

  10. react新特性 react hooks

    本文介绍的是react新特性react hooks,本文面向的是有一定react开发经验的小伙伴,如果你对react还不是很熟悉的话我建议你先学习react并多多联系. 首先我们都知道react有3种 ...