HDU6195
cable cable cable
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 102 Accepted Submission(s): 89
Problem Description
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
there is one line contains two integers M and K.
Output
Sample Input
20 15
Sample Output
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.
Source
//2017-09-10
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define ll long long using namespace std; int main()
{
ll n, k;
while(cin>>n>>k){
cout<<(n-k+)*k<<endl;
} return ;
}
HDU6195的更多相关文章
- hdu6195 cable cable cable(from 2017 ACM/ICPC Asia Regional Shenyang Online)
最开始一直想不通,为什么推出这个公式,后来想了半天,终于想明白了. 题目大意是,有M个格子,有K个物品.我们希望在格子与物品之间连数量尽可能少的边,使得——不论是选出M个格子中的哪K个,都可以与K个物 ...
- hdu6195 cable cable cable
cable cable cable Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others ...
随机推荐
- BigDecimalUtils
package com.sprucetec.tms.utils; import java.math.BigDecimal;import java.text.SimpleDateFormat;impor ...
- python项目实现配置统一管理的方法
一个比较大的项目总是会涉及到很多的参数,最好的方法就是在一个地方统一管理这些参数.最近看了不少的python项目,总结了两种很有意思的配置管理方法. 第一种 基于easydict实现的配置管理 首先需 ...
- 【May Be DNK】JSON.parse() and JSON.stringify()的两个实用技巧
结论 一.数据深拷贝 使用方法:JSON.parse(JSON.stringify(param)) let o = {a: 1, b: 2} let o1 = JSON.parse(JSON.stri ...
- mybatis四大接口之 StatementHandler
1. 继承结构 StatementHandler:顶层接口 BaseStatementHandler : 实现顶层接口的抽象类,实现了部分接口,并定义了一个抽象方法 SimpleStatementHa ...
- vue路由router的三种传参方式
方法三: 传参页面传递参数方式: this.$router.push({ path: 'indexTwoDetails', query: { "id": id } }) 接受参数页 ...
- elasticsearch5.6.3插件部署
需要注意的是,5.x和2.x插件方面改动很大.参考:https://www.elastic.co/blog/running-site-plugins-with-elasticsearch-5-0.因为 ...
- mysql之视图,存储过程,触发器,事务
视图 视图是一个虚拟表(非真实存在),其本质是[根据SQL语句获取动态的数据集,并为其命名],用户使用时只需使用[名称]即可获取结果集,可以将该结果集当做表来使用. 使用视图我们可以把查询过程中的临时 ...
- Linux inode空间占满 “no space left on device”
Linux inode空间占满 提示 “no space left on device” 中文环境:“无法创建XXX目录,设备没有空间” Linux系统iNode耗尽硬盘无法写入文件怎么办?df -h ...
- 抓包和测试Api类工具
1.PostMan 测试api 2.Fiddler4抓包工具使用教程一
- 字符、字符串和文本的处理之String类型
.Net Framework中处理字符和字符串的主要有以下这么几个类: (1).System.Char类 一基础字符串处理类 (2).System.String类 一处理不可变的字符串(一经创建,字符 ...