2013 Asia Regional Changchun
Hard Code http://acm.hdu.edu.cn/showproblem.php?pid=4813
#include<cstdio>
char op[];
int main(){
int t,n,m;
while(~scanf("%d",&t)){
while(t--){
scanf("%d%d%s",&n,&m,op);
for(int i=;i<n;i++){
for(int j=;j<m;j++){
printf("%c",op[i*m+j]);
}
puts("");
}
}
}
return ;
}
Little Tiger vs. Deep Monkey http://acm.hdu.edu.cn/showproblem.php?pid=4815
dp求n个数的和为j的种数,除以总的种数就是概率,一旦概率大于等于p就是答案。
#include<cstdio>
#include<cstring>
#define mt(a,b) memset(a,b,sizeof(a))
typedef __int64 LL;
LL dp[][];
int a[];
int main(){
int n,t;
double p;
scanf("%d",&t);
while(t--){
scanf("%d%lf",&n,&p);
for(int i=;i<=n;i++){
scanf("%d",&a[i]);
}
mt(dp,);
dp[][]=;
for(int i=;i<=n;i++){
for(int j=;j<=;j++){
dp[i][j]+=dp[i-][j];
dp[i][j+a[i]]+=dp[i-][j];
}
}
LL sum=;
int ans=;
LL all=1LL<<n;
for(int i=;i<=;i++){
sum+=dp[n][i];
if(1.0*sum/all>=p){
ans=i;
break;
}
}
printf("%d\n",ans);
}
return ;
}
end
2013 Asia Regional Changchun的更多相关文章
- 2013 Asia Regional Changchun C
Little Tiger vs. Deep Monkey Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/65535 K ( ...
- HDU 4822 Tri-war(LCA树上倍增)(2013 Asia Regional Changchun)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4822 Problem Description Three countries, Red, Yellow ...
- HDU 4816 Bathysphere(数学)(2013 Asia Regional Changchun)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4816 Problem Description The Bathysphere is a spheric ...
- 2013 Asia Regional Changchun I 题,HDU(4821),Hash
题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=4821 解题报告:搞了很久,总算搞出来了,还是参考了一下网上的解法,的确很巧,和上次湘潭的比 ...
- hdu 5444 Elven Postman(二叉树)——2015 ACM/ICPC Asia Regional Changchun Online
Problem Description Elves are very peculiar creatures. As we all know, they can live for a very long ...
- (并查集)Travel -- hdu -- 5441(2015 ACM/ICPC Asia Regional Changchun Online )
http://acm.hdu.edu.cn/showproblem.php?pid=5441 Travel Time Limit: 1500/1000 MS (Java/Others) Memo ...
- (二叉树)Elven Postman -- HDU -- 54444(2015 ACM/ICPC Asia Regional Changchun Online)
http://acm.hdu.edu.cn/showproblem.php?pid=5444 Elven Postman Time Limit: 1500/1000 MS (Java/Others) ...
- 2015 ACM/ICPC Asia Regional Changchun Online HDU 5444 Elven Postman【二叉排序树的建树和遍历查找】
Elven Postman Time Limit: 1500/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)T ...
- 2015ACM/ICPC Asia Regional Changchun Online /HDU 5438 图
Ponds Time Limit: 1500/1000 MS (Java/Others) Memory Limit: 1310 ...
随机推荐
- 【原创】ORA-04068: 已丢弃程序包 的当前状态研究
不久前在市检的生产环境上有个存储过程执行报错,错误信息如下: ORA: 已丢弃程序包 的当前状态 ORA: package "ZHANGXSH.PR_TEST" 的当前状态失效 O ...
- Cocos2d-JS加速度计与加速度事件
在很多移动设备的游戏使用到了加速度计,Cocos2d-JS引擎提供了访问加速度计传感器的能力.本节我们首先介绍一下加速度计传感器,然后再介绍如何在Cocos2d-JS中访问加速度计.加速度计加速度计是 ...
- HTML+CSS学习笔记 (14) - 单位和值
标签:HTML+CSS 颜色值 在网页中的颜色设置是非常重要,有字体颜色(color).背景颜色(background-color).边框颜色(border)等,设置颜色的方法也有很多种: 1.英文命 ...
- 滚动视图和页面控制UIScollView,UIpageControlDemo
//// ViewController.m// UIScollView//// Created by hehe on 15/9/25.// Copyright (c) 2015年 wang.h ...
- UI3_视图切换
// // ViewController.m // UI3_视图切换 // // Created by zhangxueming on 15/7/3. // Copyright (c) 2015年 z ...
- Linux概述
Linux概述 1.计算机资源 硬件资源 软件资源 硬件资源与软件资源之间的桥梁就是操作系统 2.操作系统分类 Windows :个人版用户最多 Mac :土豪机 Linux :主要应用于服务器 Un ...
- js密码的校验(判断字符类型、统计字符类型个数)
/** *判断字符类型 */ function CharMode(iN) { if (iN >= 48 && iN <= 57) //数字 return 1; if (iN ...
- 转:JAVA中this用法小结
转:http://blog.sina.com.cn/s/blog_6a6badc90100t8hm.html#SinaEditor_Temp_FontName Java关键字this只能用于方法方法体 ...
- php学习日志(4)-The mbstring extension is missing. Please check your PHP configuration错误及解决方法
在安装好wampServer后,一直没有使用phpMyAdmin,今天用了一下,phpMyAdmin显示错误:The mbstring extension is missing. Please che ...
- 画了一张PHPCMSV9的运行流程思维导图
转载:http://www.cnblogs.com/fuyunbiyi/archive/2012/03/12/2391253.html