https://tdpc.contest.atcoder.jp/assignments N 简单的树形DP,把加边转化成加点,组合数简单算一下。 Q 为了不重复只能加01字符。 为了知道是否成段需要记录结束位置。 但是这样没法转移。可以再存一个AC自动机状态,也可以再存末7位的数。可以发现结束位置需 ...
分类:
其他好文 时间:
2020-02-25 17:58:53
阅读次数:
78
'''''''''面向对象三大特性:封装,继承,多态1.封装: 类中以_或者__的属性,都是私有属性,禁止外部调用。'''class Student(object): def __init__(self,name,age,sex): self.__name = name self.__age = a ...
分类:
编程语言 时间:
2020-02-25 17:57:53
阅读次数:
72
malloc的全称是memory allocation,中文叫动态内存分配,用于申请一块连续的指定大小的内存块区域以void*类型返回分配的内存区域地址,当无法知道内存具体位置的时候,想要绑定真正的内存空间,就需要用到动态的分配内存,且分配的大小就是程序要求的大小。 函数定义 其函数原型为void ...
分类:
编程语言 时间:
2020-02-25 17:52:14
阅读次数:
83
function sleep(numberMillis) { var now = new Date(); var exitTime = now.getTime() + numberMillis; while (true) { now = new Date(); if (now.getTime() > ...
分类:
Web程序 时间:
2020-02-25 14:59:32
阅读次数:
62
研究了一达通XML读取,发现博主 “方倍工作室”的举例很好, 但是 修改部分 会报错。 报错: “System.IO.IOException”类型的未经处理的异常在 mscorlib.dll 中发生 其他信息: 文件“d:\config.xml”正由另一进程使用,因此该进程无法访问此文件。 再学习一 ...
int c[50005]; //对应原数组和树状数组 int lowbit(int x){ return x&(-x); } void updata(int i,int k){ //在i位置加上k while(i <= n){ c[i] += k; i += lowbit(i); } } int g ...
分类:
编程语言 时间:
2020-02-25 09:54:54
阅读次数:
81
NC月赛补题 B 树上子链: 题目描述 给定一棵树 T ,树 T 上每个点都有一个权值。 定义一颗树的子链的大小为:这个子链上所有结点的权值和 。 请在树 T 中找出一条最大的子链并输出。 输入描述: 第一行输入一个 n,1≤n≤10^5。 接下来一行包含n个数,对于每个数ai, 10^5 2 5 ...
分类:
其他好文 时间:
2020-02-25 09:36:06
阅读次数:
119
class Solution { public: TreeNode* reConstructBinaryTree(vector<int> pre,vector<int> vin) { int vinlen=vin.size(); if(vinlen==0) return NULL; vector<i ...
分类:
其他好文 时间:
2020-02-25 09:24:17
阅读次数:
52
Given an m x n matrix of non-negative integers representing the height of each unit cell in a continent, the "Pacific ocean" touches the left and top ...
分类:
其他好文 时间:
2020-02-25 00:29:46
阅读次数:
84
图的存储 邻接表 无结构体 结构体 邻接矩阵 图的遍历 DFS 邻接表 ...
分类:
其他好文 时间:
2020-02-25 00:25:05
阅读次数:
67