http://acm.hdu.edu.cn/showproblem.php?pid=5001
应该算是一道简单的概率题。想了两个多小时,结果越想越麻烦。最后敲出来了,但是MLE。
最后借鉴实验室学长的思路,发现这样想很直观,正退就可以。
设dp[j][d]表示不能经过i点走了d步到达j点的概率。那么dp[j][d] = ∑ dp[k][d-1]/edge[k].size()。那么不经...
分类:
其他好文 时间:
2014-09-13 20:10:15
阅读次数:
235
题意:
给定n个点m条边的无向图
问:
从任意点出发任意走d步,从不经过某个点的概率
dp[i][j]表示从不经过i点的前提下,走了d步到达j点的概率。
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define N 55
#define...
分类:
其他好文 时间:
2014-09-13 18:49:45
阅读次数:
145
import com.hephec01;
public class HashSetTest{
public static void main(String[] args){
Random rand=new Random();
Set hash=new HashSet();
for(int i=0;i
hash.add(rand.nextInt(30));
System.out.pri...
分类:
其他好文 时间:
2014-09-13 09:25:55
阅读次数:
196
可生成准考证字样的图片 最终效果为:public void CreateImage() { var ImaeUrl = @"E:\Test"; Random random = new Random(); Bitmap bt = new Bitmap(351, 402, ...
分类:
其他好文 时间:
2014-09-12 08:53:03
阅读次数:
416
“$random函数调用时返回一个32位的随机数,它是一个带符号的整形数...”,并给出了一个例子:EX-1:reg[23:0] rand;rand=$random%60; //产生一个在 -59—59范围的随机数又给出了一个产生0~59之间的随机数的例子:EX-2: reg[23:0] rand;...
分类:
其他好文 时间:
2014-09-11 01:08:31
阅读次数:
778
1.通过树形结构生成随机数select 1090900+round(rownum/2), round(dbms_random.value(100000,10001000),0)from dualconnect by rownum DATA GENERATOR
分类:
其他好文 时间:
2014-09-10 17:35:50
阅读次数:
223
import traceback
import random
import pygame
from pygame.locals import *
pygame.display.init()
pygame.font.init()
sizes = {
"screen" : ( 300, 480 )
}
colors = {
"font" : ( 138, 69, 252 ),
...
分类:
其他好文 时间:
2014-09-09 18:19:59
阅读次数:
350
1 package sorts; 2 3 import java.util.Arrays; 4 import java.util.Random; 5 6 public class QuickSort { 7 public static > 8 void sort(T[] a,...
分类:
其他好文 时间:
2014-09-07 14:45:55
阅读次数:
230
1 package sorts; 2 3 import java.util.ArrayList; 4 import java.util.List; 5 import java.util.Random; 6 7 public class PriorityQueue> { // mi...
分类:
其他好文 时间:
2014-09-06 13:34:03
阅读次数:
179
这题用MILLER测试应该是不可避免的。#include #include #include #include #define LL __int64using namespace std;LL random(LL n){ return (LL)((double)rand()/RAND_MAX*n+0...
分类:
其他好文 时间:
2014-09-06 10:53:13
阅读次数:
165