C - Color the Ball Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionThere are infinite balls in a line (num...
分类:
其他好文 时间:
2015-01-24 13:04:14
阅读次数:
195
题目:hdu-1902-The Dragon of Loowater贪心,两遍排序。 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 9 int nn[20010],mm[200...
分类:
其他好文 时间:
2015-01-22 14:55:07
阅读次数:
110
链接:
poj3687
题意:
有N个标号为1~N的小球,重量(不包括断言)依次增加 ,现给出M句断言 ,断言格式为a b
表示小球a轻于小球b 要求根据重量大小依次输出1~N号小球应在的的位置(重量递增)不满足断言则输出-1
题解:
因为重量是依次增加的 不能按常规的构造edge[a][b]=1生成拓扑排序
既然关系格式和一般拓扑排序是相反的 ...
分类:
编程语言 时间:
2015-01-22 13:28:22
阅读次数:
204
题目大意:
黑箱子里有w只白老鼠和b只黑老鼠,dragon和Princess轮流从箱子中拿出一只老鼠,先取到白老鼠的人赢,但是dragon每次拿的时候都会多跑出一只老鼠。
思路分析:
dp[i][j] 表示箱子里有i只白老鼠和j只黑老鼠的时候 Princess 先取赢的概率。
那么转移方程就有4个。
分别是 :
直接取到白老鼠
取到黑老鼠,dragon也拿到了黑老鼠,跑了一只...
分类:
其他好文 时间:
2015-01-19 15:49:32
阅读次数:
185
基本环境准备;[root@localhost~]#vim/etc/sysconfig/network(修改主机名)NETWORKING=yesHOSTNAME=node1.dragon.com(这里每台主机自行修改为node1,2,3)[root@localhost~]#vim/etc/hosts(修改主机文件,分别指向node1,2,3)127.0.0.1localhostlocalhost.localdomainlocalho..
分类:
其他好文 时间:
2015-01-19 06:59:25
阅读次数:
401
Labeling Balls
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 11256
Accepted: 3230
Description
Windy has N balls of distinct weights from 1 unit to N un...
分类:
编程语言 时间:
2015-01-12 09:26:20
阅读次数:
266
PDF versionPMFSuppose that a sample of size $n$ is to be chosen randomly (without replacement) from an urn containing $N$ balls, of which $m$ are whit...
分类:
其他好文 时间:
2015-01-06 19:47:28
阅读次数:
225
水题,直接贴代码。
//poj 3646
//sep9
#include
#include
using namespace std;
const int maxN=20012;
int a[maxN],b[maxN];
int main()
{
int n,m;
while(scanf("%d%d",&n,&m)==2&&n+m){
int i,j;
for(i=0;i<n;+...
分类:
编程语言 时间:
2014-12-30 00:33:09
阅读次数:
233
Problem Description
Mery has a beautiful necklace. The necklace is made up of N magic balls. Each ball has a beautiful value. The balls with the same beautiful value look the same, so if two or mor...
分类:
编程语言 时间:
2014-12-29 01:05:55
阅读次数:
209
Problem C: The Dragon of LoowaterOnce upon a time, in the Kingdom of Loowater, a minor nuisance turned into a major problem.The shores of Rellau Creek...
分类:
其他好文 时间:
2014-12-15 18:50:08
阅读次数:
323