上一页 1 ··· 47 48 49 50 51 52 53 54 55 ··· 63 下一页
摘要: #include <iostream> #include <algorithm> using namespace std; const int N = 100010; int n, m; int h[N], size; void down(int u) { int t = u; //u这个点的做儿子 阅读全文
posted @ 2019-11-07 20:14 晴屿 阅读(138) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; const int N = 100010; int p[N]; int find(int x) {//返回祖宗节点,同时进行路径压缩 if (p[x] != x) p[x] = find(p[x]); return p 阅读全文
posted @ 2019-11-07 20:13 晴屿 阅读(128) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; const int N = 100010; int n, m; int p[N], size[N]; int find(int x) { if (p[x] != x) p[x] = find(p[x]); return 阅读全文
posted @ 2019-11-07 20:13 晴屿 阅读(108) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; const int N = 100010; int idx;//下标 int son[N][26], cnt[N];//因为英文字母只有26个,所以二维开26个 char str[N]; void insert(cha 阅读全文
posted @ 2019-11-07 20:12 晴屿 阅读(112) 评论(0) 推荐(0)
摘要: You are given two strings ss and tt both of length nn and both consisting of lowercase Latin letters. In one move, you can choose any length lenlen fr 阅读全文
posted @ 2019-11-06 19:07 晴屿 阅读(131) 评论(0) 推荐(0)
摘要: There are nn students at your university. The programming skill of the ii-th student is aiai. As a coach, you want to divide them into teams to prepar 阅读全文
posted @ 2019-11-06 11:37 晴屿 阅读(196) 评论(0) 推荐(0)
摘要: You are given a binary string of length nn (i. e. a string consisting of nn characters '0' and '1'). In one move you can swap two adjacent characters 阅读全文
posted @ 2019-11-06 02:15 晴屿 阅读(218) 评论(0) 推荐(0)
摘要: There is a river of width nn. The left bank of the river is cell 00 and the right bank is cell n+1n+1 (more formally, the river can be represented as 阅读全文
posted @ 2019-11-06 01:43 晴屿 阅读(561) 评论(0) 推荐(1)
摘要: B. Minimize the Permutation You are given a permutation of length nn. Recall that the permutation is an array consisting of nn distinct integers from  阅读全文
posted @ 2019-11-05 17:56 晴屿 阅读(431) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; const int N = 10010, M = 100010; int n, m; int ne[N];//ne[i] : 以i为结尾的部分匹配的值 char s[M], p[N]; int main() { cin 阅读全文
posted @ 2019-11-04 01:01 晴屿 阅读(155) 评论(0) 推荐(0)
上一页 1 ··· 47 48 49 50 51 52 53 54 55 ··· 63 下一页