上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 50 下一页
摘要: 欧拉函数之和 51Nod - 1239 预处理2/3 1 #include <bits/stdc++.h> 2 using namespace std; 3 #define ll long long 4 const int maxn=5e6+5; 5 const int mod = 10000000 阅读全文
posted @ 2017-10-02 02:03 yijiull 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 莫比乌斯函数之和 51Nod - 1244 题意: 1 #include <bits/stdc++.h> 2 using namespace std; 3 #define ll long long 4 const int maxn=1e7+5; 5 int mu[maxn], pri[maxn]; 阅读全文
posted @ 2017-10-01 23:50 yijiull 阅读(153) 评论(0) 推荐(0) 编辑
摘要: Find the Border UVALive - 3218 PSGL 1 #include <bits/stdc++.h> 2 using namespace std; 3 #define pb push_back 4 const double eps = 1e-8; 5 const int in 阅读全文
posted @ 2017-10-01 10:27 yijiull 阅读(246) 评论(0) 推荐(0) 编辑
摘要: Primitive Roots POJ - 1284 原根~ 1 #include <iostream> 2 #include <cstring> 3 #include <cstdio> 4 using namespace std; 5 #define ll long long 6 const in 阅读全文
posted @ 2017-09-29 11:34 yijiull 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 神、上帝以及老天爷 HDU - 2048 错排~ c[n] = (n-1) * (c[n-1] + c[n-2]); c[1] = 0; c[2] = 1; 1 #include <bits/stdc++.h> 2 using namespace std; 3 #define ll long lon 阅读全文
posted @ 2017-09-27 16:40 yijiull 阅读(167) 评论(0) 推荐(0) 编辑
摘要: Rank HDU - 2643 题意:n个人比赛,问最后的排名有多少种情况。 第二类斯特林数~ 最后可能有i个名次(因为有并列),所以我们把n个人分成i个集合,s2(n,i),然后这i个集合再全排列。 i = 1,2,3,……,n. 1 #include <bits/stdc++.h> 2 usin 阅读全文
posted @ 2017-09-27 16:03 yijiull 阅读(230) 评论(0) 推荐(0) 编辑
摘要: Examining the Rooms HDU - 3625 题意:n个房间,每个房间里有一把钥匙(等概率),每进到一个房间可以得到钥匙去该钥匙对应的房间,如果当前没有钥匙则可以破门而入(1号房间不能破门而入),不过最多破门而入k次,问成功进入n个房间的总概率。 明显是求n个元素的i个环排列,i = 阅读全文
posted @ 2017-09-27 15:42 yijiull 阅读(256) 评论(0) 推荐(0) 编辑
摘要: Count the Buildings HDU - 4372 题意:n个高楼,问从左边看到f座,从右边看到b座的情况有多少种。 第一类斯特林数~ 最高的楼一定可以看到,不用考虑。 剩下n-1座楼,左边要求有f-1个环排列,右边要求有b-1个环排列。然后把每个环最高的楼放到前面(相对)。 即n-1座楼 阅读全文
posted @ 2017-09-27 15:15 yijiull 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Airport UVA - 11168 题意: 给n个点,让求一条直线使得所有点都在它的同侧,并且距离最小。 直线一定是凸包上的某一条边~ 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int maxn = 10010; 4 co 阅读全文
posted @ 2017-09-26 22:36 yijiull 阅读(137) 评论(0) 推荐(0) 编辑
摘要: G. Finding the Radius for an Inserted Circle 题目:链接 让求第k个内切圆的半径 r[k] 这题我们没做出来,主要是因为我发现的太晚了...... 一开始看到的时候觉得图看起来太复杂就没去看.... 最后还剩二十分钟的时候开始做,本来应该也是可以过的,结果 阅读全文
posted @ 2017-09-24 18:27 yijiull 阅读(174) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 50 下一页