上一页 1 2 3 4 5 6 ··· 24 下一页
摘要: 直接贴模板:#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 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 题库链接: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 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 题目链接: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 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 链接:https://ac.nowcoder.com/acm/contest/368/B来源:牛客网 题目描述有一棵n个节点的二叉树,1为根节点,每个节点有一个值wi。现在要选出尽量多的点。对于任意一棵子树,都要满足:如果选了根节点的话,在这棵子树内选的其他的点都要比... 阅读全文
posted @ 2019-02-08 21:45 erge1998 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 直接上代码:#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 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 1700 首尾排序法有一个长度为n的数组 p1, p2, p3, ⋯, pnp1, p2, p3, ⋯, pn ,里面只包含1到n的整数,且每个数字都不一样。现在要对这个数组进行从小到大排序,排序的时候只能是把一个数字拿过来放到数组末尾或者开头,问最少要操作几次才能使... 阅读全文
posted @ 2019-01-31 09:48 erge1998 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 1701 最后的机会给定一字符串S,S非空,由小写字母组成,设v为S中元音字母的个数,c为辅音字母的个数。"a", "e", "i", "o", "u"为元音字母。其余为辅音字母。如果元音字母没有超过辅音字母的2倍,即v≤2c则称S是好的字符串。现在给定S,找出其中最... 阅读全文
posted @ 2019-01-30 11:07 erge1998 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(323) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(155) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 24 下一页