摘要: Tree Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://poj.org/problem?id=1741 Description Give a tree with n vertices,each edge has a length(positi 阅读全文
posted @ 2018-08-18 18:13 Draymonder 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 题目让O(1)预处理出来 类三角形边界及内部的和 根据这个图 就是一个大矩形-左边的绿色的矩形 - 蓝色的大三角形 + 右上角突出的蓝色的小三角形 #include<bits/stdc++.h> using namespace std; typedef long long ll; #define r 阅读全文
posted @ 2018-08-18 16:05 Draymonder 阅读(287) 评论(0) 推荐(0) 编辑
摘要: 小zc现在有三个字符串,他想知道前两个字符串能不能生成第三个字符串,生成规则如下:第一个串的每个字符都可以往第二个串的任意位置插入(包括首尾位置),但必须保证来源于第一个串中的字符在生成后的串中的相对顺序不可以改变。 举个例子: String A: cu String B: mt 那么,A和B可以生 阅读全文
posted @ 2018-08-18 11:22 Draymonder 阅读(271) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; const int N = 2000000+10; struct node{ node *next[26]; int num; bool ok; node() { for(int i=0;i<26;i++) { 阅读全文
posted @ 2018-08-18 11:19 Draymonder 阅读(194) 评论(0) 推荐(0) 编辑