转载请注明出处:
题意:输入完了后,第i道题有ai种可能的正确选项,有ai-1种某人可能选的选项,问期望对多少题。
这道题的期望对于两道题之间是无关的。
只需要对每道题单独讨论
a种正确选项,b种可能选项
对于某种正确选项,某人有1/b的概率做对
总几率:1/b/a。
而这样的正确选项有min(a,b)种。
恩,就是这样。
代码:
#include
#...
分类:
其他好文 时间:
2015-01-19 21:02:16
阅读次数:
141
AI的实验报告,改了改发上来。希望路过的大牛不吝赐教。非常是纳闷我的ida*怎么还没有双搜快。还有发现基于不在位启示的A*和Ida*都挺慢。尤其是ida* 搜索31步的竟然要十几秒。是我写的代码有问题吗?忘路过的大牛指导啊!!!!另外声明一下,有些东西也是看网上各路牛人的blog学来的,因为比較杂,...
分类:
其他好文 时间:
2015-01-19 20:52:31
阅读次数:
1181
Simple
calculations
The Problem
There is a sequence of n+2 elements a0, a1,…, an+1 (n i 1000). It is known that ai = (ai–1 + ai+1)/2 – ci for
each i=1, 2, ..., n. You are given a0, ...
分类:
其他好文 时间:
2015-01-18 18:37:25
阅读次数:
252
Given n non-negative integers a1, a2,
..., an, where each represents a point at coordinate (i, ai). n vertical
lines are drawn such that the two endpoints of line i is at (i, ai) and (i,
0). Fin...
分类:
其他好文 时间:
2015-01-17 23:33:30
阅读次数:
190
A1 = ?
Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 5300 Accepted Submission(s): 3359
Problem Description
有如下方程:Ai = (Ai-1 + ...
分类:
其他好文 时间:
2015-01-16 16:46:14
阅读次数:
150
题目大意:有A,B两种机器,A有1~n种模式 , B有1~m种模式 , 对于每一项任务,都要用到Ai 或 Bj中的一个 , 将所有任务都做完,模式转换次数最少的次数根据题目所给的x , y的关系 , 很容易画出二部图的基本框架, 这里不难看出是求一个最小的点覆盖集在二部图中 , 最小点覆盖数 = 二...
分类:
其他好文 时间:
2015-01-16 01:02:09
阅读次数:
211
Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of ...
分类:
其他好文 时间:
2015-01-15 18:07:39
阅读次数:
131
题目大意:给定a1,a2,...,an,求
由于φ是积性函数,我们可以将i1i2...in分解质因数,对于每个质因数分开讨论,求积即可
将每个a分解质因数,假设分解后某个质数p在每个ai中的次数分别是bi,那么p对答案的贡献就是
于是对p^j维护一个前缀和,直接计算即可
#include
#include
#include
#include
#define MOD ...
分类:
其他好文 时间:
2015-01-15 14:20:26
阅读次数:
694
Max SequenceTime Limit:3000MSMemory Limit:65536KTotal Submissions:16001Accepted:6715DescriptionGive you N integers a1, a2 ... aN (|ai| 2 int main() 3....
分类:
其他好文 时间:
2015-01-15 12:44:07
阅读次数:
166
重定向符号和tee命令区别功能说明:读取标准输入的数据,并将其内容输出成文件。语法:tee[-ai][--help][--version][文件...]补充说明:tee指令会从标准输入设备读取数据,将其内容输出到标准输出设备,同时保存成文件。参数:-a或--append附加到既有文件的后面,而非覆盖它.-..
分类:
其他好文 时间:
2015-01-15 01:57:24
阅读次数:
268