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. Same Tree (二叉树DFS)

    Given two binary trees, write a function to check if they are equal or not. Two binary trees are con ...

  2. Ubuntu16.04安装deb文件时提示:此软件来自第三方且可能包含非自由组件

    解决方式: 1.在Ubuntu软件中心安装GDebi. 2.安装好之后,选择这个要安装的deb文件右键,打开方式选择GDebi,然后输入管理员密码等待安装,期间如果不行需要重试几次. 3.另外的方法, ...

  3. SD卡 驱动层测速

    init_timer(&timer1); timer1.function = test_time; timer1.data = ; timer1.expires = jiffies + mse ...

  4. 在 Web 开发中,img 标签用来呈现图片,而且一般来说,浏览器是会对这些图片进行缓存的。

    在 Web 开发中,img 标签用来呈现图片,而且一般来说,浏览器是会对这些图片进行缓存的. 比如访问百度,我们可以发现,图片.脚本这种都是从缓存(内存缓存/磁盘缓存)中加载的,而不是再去访问一次百度 ...

  5. 在JAR中打包使用JAR库

    不知大家在写Java程序的时候有没有这种需求: 将引用其他第三方JAR库的项目打包成一个JAR文件执行.也就是说在你打包好的JAR文件里再包括那些你引用的第三方JAR文件,合成一个JAR包,这样仅仅需 ...

  6. HttpURL连接远程serverGet和Post方式请求并返回数据

    查看原文:http://www.ibloger.net/article/1813.html package cn.gis; import java.io.BufferedReader; import ...

  7. 为什么有些信号线串接33R小电阻?

    本人只是刚入坑的硬件助理,一名小白,很多都知识不懂,以下信息多数来自网络,可能不准确,恳请批评指正! 正文: 参考资料:http://blog.csdn.net/xiangyuqxq/article/ ...

  8. iOS tableview cell 的展开收缩

    iOS tableview cell 的展开收缩 #import "ViewController.h" @interface ViewController ()<UITabl ...

  9. HttpUtils 发送http请求工具类

    import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URISyntaxEx ...

  10. 模式识别之ocr---文字识别Tesseract-OCR 进行文字识别 VS2010

    近日做铸件文字识别的项目,需要识别铸件上的字符和数字,找到开源的识别库Tesseract,下面简单记录下怎么使用. 首先在项目主页http://code.google.com/p/tesseract- ...