HDU
来源:互联网 发布:国际金融统计数据库 编辑:程序博客网 时间:2024/05/16 06:50
cable cable cable
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<iostream>#include<deque>#include<memory.h>#include<stdio.h>#include<map>#include<string>#include<algorithm>#include<vector>#include<math.h>#include<stack>#include<queue>#include<set>#define INF 1<<29using namespace std;typedef long long int ll;int main (){ ll m,k; while(~scanf("%I64d%I64d",&m,&k)) printf("%I64d\n",k*(m-k+1)); return 0;}
阅读全文
0 0
- hdu
- hdu
- HDU
- hdu ()
- hdu
- hdu
- HDU
- HDU
- hdu
- hdu
- HDU
- Hdu
- hdu
- hdu-
- hdu
- hdu
- hdu
- HDU
- 【前端】无后台静态页面实现联想输入Demo
- putty打包下载——程序、字体、配色方案
- 集成Firebase收集崩溃日志
- 进阶篇:5.2)统计公差法;
- TCP的Nagle算法介绍
- HDU
- 解决POST提交中文乱码问题
- android中AnimatorSet配合ObjectAnimator运用
- hdu6198 number number number(找规律+矩阵快速幂)
- 2017.9.10
- TimeLine讲解
- React Native 集成分享第三方登录功能分享第三方登录模块开发(Android)
- Tensorflow介绍
- php 数据结构概述