- 博客(18)
- 资源 (1)
- 收藏
- 关注
原创 51nod 2489 小b和灯泡【因子打表】
参看资料:https://blog.csdn.net/sodacoco/article/details/89291759题目:小b有n个关闭的灯泡,编号为1...n。小b会进行n轮操作,第i轮她会将编号为i的倍数的灯泡的开关状态取反,即开变成关,关变成开。求n轮操作后,有多少灯泡是亮着的。输入输入一个数字表示灯泡数n,其中1<n≤10000000输出输出一...
2019-04-14 01:35:59 297
原创 求因子数目/因子数目打表
参看资料:https://www.cnblogs.com/acgoto/p/9693207.htmlhttp://www.cnblogs.com/fzl194/p/9027045.html1》朴素算法求因子数目以及因子和#include<bits/stdc++.h>using namespace std;int get_num(int n){ int nu...
2019-04-14 01:28:13 352
原创 51nod 2488 矩形并的面积【思维】
题目:在二维平面上,给定两个矩形,满足矩形的每条边分别和坐标轴平行,求这个两个矩形的并的面积。即它们重叠在一起的总的面积。输入8个数,分别表示第一个矩形左下角坐标为(A,B),右上角坐标为(C,D);第二个矩形左下角坐标为(E,F),右上角坐标为(G,H)。保证A<C,B<D,E<G,F<H。保证所有数的绝对值不超过2*10^9,矩形并的面积≤2*10^...
2019-04-14 00:32:54 547
原创 51nod 2499 不降的数字【暴力】
题目:小b有一个非负整数N,她想请你找出≤N≤N的最大整数x,满足x各个位数上的数字是不降的。也就是说,设x的十进制表示为a1,a2,…,ama1,a2,…,am,则对于任意1≤i<m1≤i<m,ai≤ai+1ai≤ai+1。收起输入输入一个非负整数N。0≤N≤10^9输出输出一个整数,表示答案输入样例332输出样例299...
2019-04-13 12:39:03 216
原创 51nod 2497 数三角形【暴力】
题目:小b有一个仅包含非负整数的数组a,她想知道有多少个三元组(i,j,k),满足i<j<k且a[i],a[j],a[k]可能作为某个三角形的三条边的边长。输入第一行输入一个正整数n,表示数组a中元素个数;第二行n个非负整数,表示a中元素,以空格隔开;其中0<n≤1000,a中任意元素a[i]满足0≤a[i]≤1000。输出输出一个数,表示满足题意的三元组...
2019-04-13 11:10:10 668
原创 51nod 2494 最长配对【思维】
题目:小b有一个01序列,她想找到一个最长的区间使得这个区间的01能两两配对,即0的个数和1的个数相等。求最长区间的长度。输入第一行一个正整数n,表示数组长度,其中0<n≤50000;第二行n个0或1,以空格隔开。输出输出一个数,表示最长区间的长度输入样例30 1 0输出样例2题目大意: 给定一个长度为n的数组,数组内数字为...
2019-04-13 10:53:22 237
原创 POJ 3250 Bad Hair Day【单调栈】
题目:Some of Farmer John'sNcows (1 ≤N≤ 80,000) are having a bad hair day! Since each cow is self-conscious about her messy hairstyle, FJ wants to count the number of other cows that can see the t...
2019-04-08 11:57:53 329
原创 LightOJ 1321 Sending Packets【期望+SPFA】
参看资料:https://blog.csdn.net/qq_31759205/article/details/54716066题目:Alice and Bob are trying to communicate through the internet. Just assume that there areNrouters in the internet and they are...
2019-04-06 16:51:54 308
原创 LightOJ 1317 Throwing Balls into the Baskets【概率】
参看资料:https://blog.csdn.net/chy20142109/article/details/51774756题目:You probably have played the game "Throwing Balls into the Basket". It is a simple game. You have to throw a ball into a basket...
2019-04-06 10:43:27 248
原创 LightOJ1284 Lights inside 3D Grid【数学--期望】
参看资料:https://blog.csdn.net/wl16wzl/article/details/82858903题目:You are given a 3D grid, which has dimensionsX,YandZ. Each of theX x Y x Zcells contains a light. Initially all lights are of...
2019-04-05 21:59:48 218
原创 LightOJ 1265 Island of Survival【概率】
参看资料:https://blog.csdn.net/dllpXFire/article/details/81186064题目:You are in a reality show, and the show is way too real that they threw into an island. Only two kinds of animals are in the isla...
2019-04-05 17:31:25 128
原创 LightOJ 1248 Dice (III)【数学期望--几何分布】
参看资料:http://www.cnblogs.com/zhengguiping--9876/p/5758993.htmlhttps://baike.baidu.com/item/几何分布/10676983?fr=aladdin题目:Given a dice withnsides, you have to find the expected number of times y...
2019-04-05 13:47:34 368
原创 常见分布 的 数学期望以及方差公式
一、通用公式【数学期望】1》求解数学期望2》数学期望的性质二、常用分布的期望与方差1》精简版:2》叨叨版:
2019-04-05 12:13:09 268920 12
原创 LightOJ 1104 Birthday Paradox【概率】
参看资料:https://baike.baidu.com/item/%E7%94%9F%E6%97%A5%E6%82%96%E8%AE%BAhttp://www.cnblogs.com/-maybe/p/4521247.html题目:Sometimes some mathematical results are hard to believe. One of the common...
2019-04-05 11:27:45 302
原创 LightOJ 1079 Just another Robbery【概率DP】
题目:As Harry Potter series is over, Harry has no job. Since he wants to make quick money, (he wants everything quick!) so he decided to rob banks. He wants to make a calculated risk, and grab as muc...
2019-04-05 10:23:42 226
原创 LightOJ 1030 Discovering Gold
参看资料:https://blog.csdn.net/chenzhenyu123456/article/details/49760689https://blog.csdn.net/yopilipala/article/details/78997211题目:You are in a cave, a long cave! The cave can be represented by ...
2019-04-03 22:17:09 156
原创 LightOJ 1027 A Dangerous Maze【数学期望】
参看资料:https://www.cnblogs.com/By-ruoyu/p/4713535.html题目:You are in a maze; seeingndoors in front of you in beginning. You can choose any door you like. The probability for choosing a door is equ...
2019-04-03 21:43:09 198
原创 POJ 3090 Visible Lattice Points【欧拉函数】
题目:A lattice point (x,y) in the first quadrant (xandyare integers greater than or equal to 0), other than the origin, is visible from the origin if the line from (0, 0) to (x,y) does not pass ...
2019-04-03 21:04:07 147
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人