输入a b 求有多少对p, q 使得p*q == a && p = b
直接大整数分解 然后dfs搜出所有可能的解
#include
#include
#include
#include
#include
using namespace std;
typedef long long LL;
const int Times = 25;
LL factor[100], f[100];
i...
分类:
其他好文 时间:
2014-10-09 16:07:38
阅读次数:
179
n个面的骰子 求每个面至少扔到一次的期望值
设dp[i]为已经扔了i个不同面的期望值 dp[n] = 0 求dp[0]
因为dp[i]为还需要扔i个不同的面 每次可能扔中已经扔过的面或者没有扔到过的面2中情况
所以dp[i] = (i/n)*dp[i] + (n-i)/n*dp[i+1] +1 等号2边都有dp[i]
移项得dp[i] = dp[i+1]+n/(n-i)
#inclu...
分类:
其他好文 时间:
2014-10-09 16:03:25
阅读次数:
215
最近打算学习quick cocos2dx,所以首先打算学习一下lua这门语言,Lua 是一个小巧的脚本语言,轻量级,便于扩展。 Lua脚本基本的数据类型:nil、boolean、number、string、userdata、function、thread、table,table 是lua里的特...
分类:
其他好文 时间:
2014-10-09 15:13:03
阅读次数:
178
首先删除当前的MainCamera并保存当前的scene
选择菜单NGUI->Create->2D UI
添加后显示
Directional light是过后添加的直射光线
在Hierarchy窗口选择Camera,在Inspector窗口中,UICamera的Event Type选择2D UI。
然后在Build Settings...切换Android平台,下一步很重...
分类:
其他好文 时间:
2014-10-09 02:34:07
阅读次数:
244
?n个人 m个篮子 每一轮每个人可以选m个篮子中一个扔球 扔中的概率都是p 求k轮后所有篮子里面球数量的期望值
根据全期望公式 进行一轮球数量的期望值为dp[1]*1+dp[2]*2+...+dp[n]*n 记为w
其中dp[i]为i个人扔中的概率 dp[i] = C(n, i)*p^i*(1-p)^(n-i) 最终答案为w*k
#include
#include
using names...
页面中规定的中文字体不能正常显示,样式表中的中文字体是乱码统一页面、css、脚本的编码格式,中文字体名称用英文代替肯定是不会出问题的。Mac OS的一些:华文细黑:STHeiti Light [STXihei]华文黑体:STHeiti华文楷体:STKaiti华文宋体:STSong华文仿宋:STFan...
分类:
Web程序 时间:
2014-10-08 18:28:25
阅读次数:
234
初看好简单 一开始调试着一直re 后来也不知道怎么就对了 但是还有一些bug存在 ,
这道题的打印路径和light oj An Easy LCS(ps:点击打开链接)一样
但是只改一下会Tle 因为(1000*1000*1000)好大
但是把存储的字符串改为string 定义的就过了
但是还是有一点有点难受(下面会说出)
我也是醉了
#include
#include...
分类:
其他好文 时间:
2014-10-07 02:36:42
阅读次数:
405
Kiki & Little Kiki 2
时间限制:5000 ms | 内存限制:65535 KB
难度:4
描述There are n lights in a circle numbered from 1 to n. The left of light 1 is light n, and the left of light
k (1
Change the st...
分类:
其他好文 时间:
2014-10-05 15:25:28
阅读次数:
344
View
创建 colors.xml 文件定义两个颜色
1.
2. name="blue_pressed">@android:color/holo_blue_dark
3. name="blue_normal">@android:color/holo_blue_light
4.
我们这里使用android的 HOLO 色调:
1.
2. name="ho...
分类:
移动开发 时间:
2014-10-05 04:04:37
阅读次数:
265
Problem Description
The light travels in a straight line and always goes in the minimal path between two points, are the basic laws of optics.
Now, our problem is that, if a branch of light goes...
分类:
其他好文 时间:
2014-10-03 04:12:15
阅读次数:
162