A - Hard Code Hdu 4813

题目大意:给你一坨字符串,让你输出其栅栏密码的解码形式

思路:水题模拟

 #include<iostream>
#include<cstdio>
#include <math.h>
#include<algorithm>
#include<string.h>
#include<queue>
#define MOD 1000003
#define maxn 2009
using namespace std;
char ch[maxn];
int main()
{
int n,m,t;
scanf("%d",&t);
while(t--)
{
scanf("%d%d",&n,&m);
scanf("%s",ch+);
int now=;
for(int i=;i<=n;i++)
{
for(int j=;j<=m;j++)
{
printf("%c",ch[++now]);
}
printf("\n");
}
}
return ;
}

 C - Little Tiger vs. Deep Monkey HDU4815

题目大意:有N道题目,每道题目有一定分值,现在猴子同学是乱答的,也就是每道题有50%的机会答对,问至少要答对多少分才能使赢猴子的概率大于P

思路:概率DP,dp[i][mark]表示回答到第i道题,猴子得到mark分的概率,所以转移就是dp[i][mark]=dp[i-1][mark-a[i]]*0.5+dp[i-1][mark]*0.5

 #include<iostream>
#include<cstdio>
#include <math.h>
#include<algorithm>
#include<string.h>
#include<queue>
#define MOD 1000003
#define maxn 2009
using namespace std;
double dp[][*];
int a[];
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
memset(dp,,sizeof(dp));
int n,sum=;double p;
scanf("%d%lf",&n,&p);
dp[][]=;
for(int i=;i<=n;i++)scanf("%d",&a[i]),sum+=a[i];
for(int i=;i<=n;i++)
{
for(int j=;j<=sum;j++)
{
if(j<a[i])dp[i][j]=dp[i-][j]*0.5;
else dp[i][j]=dp[i-][j-a[i]]*0.5+dp[i-][j]*0.5;
}
}
for(int i=;i<=sum;i++)
{
dp[n][i]+=dp[n][i-];
if(dp[n][i]>=p){printf("%d\n",i);break;}
}
}
return ;
}

 G - Mosaic

二维线段树,解题在:http://www.cnblogs.com/philippica/p/4279969.html

2013 年 acm 长春现场赛的更多相关文章

  1. HDU 4816 Bathysphere (2013长春现场赛D题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4816 2013长春区域赛的D题. 很简单的几何题,就是给了一条折线. 然后一个矩形窗去截取一部分,求最 ...

  2. 2011 ACM/ICPC 成都赛区(为2013/10/20成都现场赛Fighting)

    hdu 4111  Alice and Bob 博弈:http://www.cnblogs.com/XDJjy/p/3350014.html hdu 4112 Break the Chocolate ...

  3. 2015年ACM长春区域赛比赛感悟

    距离长春区域赛结束已经4天了,是时候整理一下这次比赛的点点滴滴了. 也是在比赛前一周才得到通知要我参加长春区域赛,当时也是既兴奋又感到有很大的压力,毕竟我的第一场比赛就是区域赛水平,还是很有挑战性的. ...

  4. 2014 acm鞍山现场赛总结

    好像大家都习惯打完比赛写总结,我也来水一发好了.. 记一下流水账,那么多第一次献给了acm,不记一下就白去那么远的地方了.. 首先比赛前网上买了机票跟火车票了.比赛前一天早上6点钟起来收拾东西6点半坐 ...

  5. HDU 4821 String(2013长春现场赛I题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4821 字符串题. 现场使用字符串HASH乱搞的. 枚举开头! #include <stdio.h ...

  6. HDU 4818 Golden Radio Base (2013长春现场赛B题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4814 进制转换. 现场根据题目给的两个公式,不断更新!!! 胡搞就可以了. 现场3A,我艹,一次循环开 ...

  7. HDU 4815 Little Tiger vs. Deep Monkey(2013长春现场赛C题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4815 简单的DP题. #include <stdio.h> #include <st ...

  8. HDU 4813 Hard Code(水题,2013年长春现场赛A题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4813 签到题. 把一个字符串按照格式输出就可以了,很水 #include <stdio.h> ...

  9. HDU 4815 Little Tiger vs. Deep Monkey 2013 长春现场赛C题

    链接:http://acm.hdu.edu.cn/showproblem.php?pid=4815 [题意] n个题目,每题有各自的分数,A有50%的概率答对一道题目得到相应分数,B想要在至少P的概率 ...

随机推荐

  1. SnowKiting

    原文 Let's go fly a kite...in the snow Reach into your closet,find that dusty kite and clean it off - ...

  2. 如何在Kubernetes里创建一个Nginx service

    Jerry之前的文章如何在Kubernetes里创建一个Nginx应用,已经使用kubectl命令行创建了Pod,但是在kubernetes中,Pod的IP地址会随着Pod的重启而变化,因此用Pod的 ...

  3. 使用js将后台返回的数据转换成树形结构

    将类似如下数据转换成树形的数据: [ { id: 1, name: '1', }, { id: 2, name: '1-1', parentId: 1 }, { id: 3, name: '1-1-1 ...

  4. velocity生成静态页面代码

    首先需要必备的jar包: web.xml <!-- load velocity property --> <servlet> <servlet-name>veloc ...

  5. Bootstrap历练实例:按钮组大小

    <!DOCTYPE html><html><head><meta http-equiv="Content-Type" content=&q ...

  6. iOS开源库

    项目告一段落,总结一下最近学习到的优秀的三方库,希望能帮到别人. (一)网络中常用的 1.网络库:AFNetworking 2.图片缓存:SDWebImage 3.网络监测  Reachability ...

  7. js事件(事件冒泡与事件捕获)

    事件冒泡和事件捕获分别由微软和网景公司提出,这两个概念都是为了解决页面中事件流(事件发生顺序)的问题. <div id='aa' click='po'> <p id='bb' cli ...

  8. Codeforces Round #510 #A

    http://codeforces.com/contest/1042/problem/A 题目大意就是: 现在公园里有n个长椅(要多长有多长),第i个长椅上有a[i]个人(泰山崩于前而不乱),现在又有 ...

  9. springboot 修炼之路

    网上无意中发现一份关于springboot的教程说明,说的很详细,大家可以参考.具体地址:http://www.spring4all.com/article/246

  10. git 常用命令及虚拟机服务器仓库搭建

    $ git config --global user.email "you@example.com" $ git config --global user.name "Y ...