最近做了几个蚂蚁问题,还蛮有趣的。。。。。蚂蚁问题第一弹:poj 1852 Ants:AntsTime Limit:1000MSMemory Limit:30000KTotal Submissions:12214Accepted:5366DescriptionAn army of ants walk...
分类:
其他好文 时间:
2015-09-02 23:23:30
阅读次数:
501
求出家到其他点的最短路径,题目的条件变成了u->v不是回头路当且仅当d[u]>d[v]。然后根据这个条件建DAG图,跑dp统计方案数,dp[u] = sum(dp[v])。#includeusing namespace std;const int maxn = 1001, maxm = 2002;s...
分类:
其他好文 时间:
2015-09-02 20:36:28
阅读次数:
221
原文 As we had had a long walk through one of the markets of Old Delhi, we stopped at a square to have a rest. After a time, we noticed a snake charmer with two large baskets at the other side of t...
分类:
其他好文 时间:
2015-09-02 14:53:16
阅读次数:
167
题意:走n步,给出每步向左走概率l,向右走概率r,留在原地的概率 1-l-r,求能达到的最远右边距离的期望。分析;开始按期望逆求的方式分析,但让求的就是右边界没法退,懵了一会,既然逆着不能求,就先正着求概率,再根据期望的定义来求,试试行吗,想了想状态,dp[i][j][k],表示走了i步当前位置是j...
分类:
其他好文 时间:
2015-09-02 00:22:48
阅读次数:
177
程序设计思路:1. 利用os.walk()找出所有的文件;2.利用正则找到指定后缀的文件;3.找到需要的txt文件后,通过open().readlines()读取文件中每行数据;4.读取后,保存正则匹配到数据的文件;5.你懂的。#!/usr/bin/env python#coding:utf8imp...
分类:
编程语言 时间:
2015-09-01 12:35:08
阅读次数:
217
题意:给你一个无向图,你从任意一个起点出发,每到一个节点,随机去往与该节点相邻的一个节点,问你走了d步之后,不经 过每一个点的概率是多少。思路:枚举目标点,用dp[i][j]表示第i步第一次到达第j个点的概率。注意 是第一次。 然后再用 1-∑dp[i][pos] pos为目标点。...
分类:
其他好文 时间:
2015-09-01 12:25:29
阅读次数:
157
ESLint is a JavaScript linter (static analysis tool) that offers full support for ES6, JSX, and other modern tools via plugins. We walk through settin...
分类:
Web程序 时间:
2015-08-31 17:02:34
阅读次数:
187
7.2 There are three ants on different vertices of a triangle. What is the probability of collision (between any two or all of them) if they start walk...
分类:
其他好文 时间:
2015-08-28 12:39:05
阅读次数:
138
ESLint is a JavaScript linter (static analysis tool) that offers full support for ES6, JSX, and other modern tools via plugins. We walk through settin...
分类:
编程语言 时间:
2015-08-28 07:09:44
阅读次数:
273
bfs,多校,HDU5335
In an maze, the right-bottom corner is the exit (position is the exit). In every position of this maze, there is either a or a written on it.
An explorer gets lost in this grid. His position now is , and he wants to go to the exit. Sin...
分类:
其他好文 时间:
2015-08-27 16:45:12
阅读次数:
227