会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
erge
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
···
24
下一页
2019年2月16日
后缀数组与字符串匹配
摘要: 直接贴模板:#includeusing namespace std;const int MAX_N=1000005;int n,k;int Rank[MAX_N+1];int tmp[MAX_N+1];int sa[MAX_N+1];bool compare_sa(i...
阅读全文
posted @ 2019-02-16 09:52 erge1998
阅读(166)
评论(0)
推荐(0)
2019年2月9日
牛客小白月赛11 Rinne Loves Edges
摘要: 题库链接:https://ac.nowcoder.com/acm/contest/370/Fcode:#includeusing namespace std;int n,m,s;struct edge{ int to;int cost;};vector e[11...
阅读全文
posted @ 2019-02-09 21:27 erge1998
阅读(133)
评论(0)
推荐(0)
牛客小白月赛11 Rinne Loves Xor
摘要: 题目链接:https://ac.nowcoder.com/acm/contest/370/Icode:#includeusing namespace std;typedef unsigned long long ll;ll mod=1e9+7;ll pow(ll x,...
阅读全文
posted @ 2019-02-09 21:22 erge1998
阅读(135)
评论(0)
推荐(0)
2019年2月8日
牛客练习赛39 B.选点
摘要: 链接:https://ac.nowcoder.com/acm/contest/368/B来源:牛客网 题目描述有一棵n个节点的二叉树,1为根节点,每个节点有一个值wi。现在要选出尽量多的点。对于任意一棵子树,都要满足:如果选了根节点的话,在这棵子树内选的其他的点都要比...
阅读全文
posted @ 2019-02-08 21:45 erge1998
阅读(273)
评论(0)
推荐(0)
2019年1月31日
欧拉函数
摘要: 直接上代码:#include using namespace std;int euler(int n) { int res = n; for (int i = 2; i > n; cout 1) res -= res/a;//存在大于sqrt(a)...
阅读全文
posted @ 2019-01-31 23:39 erge1998
阅读(174)
评论(0)
推荐(0)
51 Nod 1700 首尾排序法
摘要: 1700 首尾排序法有一个长度为n的数组 p1, p2, p3, ⋯, pnp1, p2, p3, ⋯, pn ,里面只包含1到n的整数,且每个数字都不一样。现在要对这个数组进行从小到大排序,排序的时候只能是把一个数字拿过来放到数组末尾或者开头,问最少要操作几次才能使...
阅读全文
posted @ 2019-01-31 09:48 erge1998
阅读(302)
评论(0)
推荐(0)
2019年1月30日
51Nod 1701 最后的机会
摘要: 1701 最后的机会给定一字符串S,S非空,由小写字母组成,设v为S中元音字母的个数,c为辅音字母的个数。"a", "e", "i", "o", "u"为元音字母。其余为辅音字母。如果元音字母没有超过辅音字母的2倍,即v≤2c则称S是好的字符串。现在给定S,找出其中最...
阅读全文
posted @ 2019-01-30 11:07 erge1998
阅读(239)
评论(0)
推荐(0)
2019年1月29日
快速模幂,大数模小数
摘要: https://ac.nowcoder.com/acm/contest/330/E链接:https://ac.nowcoder.com/acm/contest/330/E来源:牛客网 精通程序设计的 Applese 叕写了一个游戏。在这个游戏中,有一个 n 行 m 列...
阅读全文
posted @ 2019-01-29 22:44 erge1998
阅读(245)
评论(0)
推荐(0)
2018年12月8日
pat 甲级 1064 ( Complete Binary Search Tree ) (数据结构)
摘要: 1064 Complete Binary Search Tree (30 分)A Binary Search Tree (BST) is recursively defined as a binary tree which has the following prop...
阅读全文
posted @ 2018-12-08 15:33 erge1998
阅读(329)
评论(0)
推荐(0)
pat 甲级 1057 Stack(30) (树状数组+二分)
摘要: 1057 Stack (30 分)Stack is one of the most fundamental data structures, which is based on the principle of Last In First Out (LIFO). Th...
阅读全文
posted @ 2018-12-08 10:41 erge1998
阅读(158)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
···
24
下一页
公告