会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
asdflkj
博客园
|
首页
|
新随笔
|
新文章
|
联系
|
订阅
|
管理
上一页
1
2
3
2014年9月21日
hdu 5023 A Corrupt Mayor's Performance Art (线段树)
摘要: 把求和操作改为或操作,就可以了。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define lson l,m,rt>1;27 build(lson);28 build(rson);29 up(r...
阅读全文
posted @ 2014-09-21 10:22 asdflkj
阅读(167)
评论(0)
推荐(0)
编辑
2014年9月8日
poj 1284 Primitive Roots(原根)
摘要: 定理:假如一个数x有原根,则元根的个数为phi(phi(x)),phi(x)为小于x且与x互质的正整数个数。#include #include using namespace std;int p;int f(int x){ int ans=x; int m=sqrt(x+0.5); ...
阅读全文
posted @ 2014-09-08 17:36 asdflkj
阅读(155)
评论(0)
推荐(0)
编辑
2014年9月7日
UVALive - 3641 Leonardo's Notebook(polya计数)
摘要: 题意:给出26个大写字母的置换B,问是否存在一个置换A,使A*A=B?两个长度为N的相同循环相乘,当N为奇数时结果也是一个长度为N的循环,当N为偶数时分裂为两个长度为N/2的循环。相反,对于一个任意长度为N的奇数循环B,都能找到一个长度为N的循环A使得A*A=B,对于任意两个长度为N(N不一定为偶数...
阅读全文
posted @ 2014-09-07 00:05 asdflkj
阅读(209)
评论(0)
推荐(0)
编辑
2014年9月6日
hdu 3869 Color the Simple Cycle (kmp+polya计数)
摘要: 先把2*n个数字接成一个模式串P,复制两次的P为串T,然后在T上进行KMP找对P匹配的多个终点,然后就是用Polya定理了,需要求逆元。 1 #include 2 #include 3 #include 4 #include 5 #define mod 1000000007 6 using ...
阅读全文
posted @ 2014-09-06 23:49 asdflkj
阅读(210)
评论(0)
推荐(0)
编辑
2014年8月29日
zoj 3794 Greedy Driver
摘要: 给出n个点,m条有向边,Edward驾车要从点1到点n,车的满油量是c,在n个点中有p个点是加油站,Edward每到一个加油站都可以加满油(不用钱),每条边都有个权值L,表示通过这条边至少要有L个单位的油。然后题目给出了Q个点,在这Q个点Edward可以卖掉一些油,第qi个点油价格为vi,但是前提是...
阅读全文
posted @ 2014-08-29 01:29 asdflkj
阅读(230)
评论(0)
推荐(0)
编辑
2014年8月27日
zoj 3795 Grouping
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 const int maxn=111111;10 vectorg[maxn];1...
阅读全文
posted @ 2014-08-27 19:26 asdflkj
阅读(144)
评论(0)
推荐(0)
编辑
上一页
1
2
3
公告