上一页 1 ··· 29 30 31 32 33 34 35 36 37 ··· 109 下一页

2020年1月15日

树形dp——2020-camp-day3-G

摘要: /* 以某个K点为根,建立一棵包含K个点的最小树, 处理出这棵树内每个点到最远点的距离dis[i] 处理出树外点到这棵树的最近的点pa[i] 树内点:Sum-dis[i] 树外点:Sum-dis[pa[i]]+deep[i]-deep[pa[i]] */ #include<bits/stdc++.h 阅读全文

posted @ 2020-01-15 16:41 zsben 阅读(143) 评论(0) 推荐(0) 编辑

欧拉回路/路径——2020-camp-day2-H

摘要: #include<bits/stdc++.h> using namespace std; typedef long long ll; const int M =2e6+7; int head[M],cnt; struct EDGE{int to,nxt;}ee[M*2]; void add(int 阅读全文

posted @ 2020-01-15 16:40 zsben 阅读(161) 评论(0) 推荐(0) 编辑

dsu on tree——2020-camp-day2-E

摘要: /* 每个结点维护一个set存储该节点内的结点个数 然后找到最大的子树maxv,Smaxv拷贝给Su,再把u加入集合 然后遍历剩下子树,依次加进Su即可 */ #include<bits/stdc++.h> using namespace std; #define N 100005 #define 阅读全文

posted @ 2020-01-15 16:39 zsben 阅读(160) 评论(0) 推荐(0) 编辑

Nim博弈,异或性质——2020-camp-day2-C

摘要: #include<bits/stdc++.h> using namespace std; const int M =1e5+7; typedef long long ll; ll a[M],ct[M]; int main() { int n; scanf("%d",&n); for(int i=1; 阅读全文

posted @ 2020-01-15 16:37 zsben 阅读(196) 评论(0) 推荐(0) 编辑

思维,数论,大数——2020-camp-day1-H

摘要: import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { int[] a=new int[] {2,3,5,7,11,13,1 阅读全文

posted @ 2020-01-15 16:35 zsben 阅读(164) 评论(0) 推荐(0) 编辑

数论分块——2020-camp-day1-C

摘要: 对一个向下整除的式子快速求和 #include <bits/stdc++.h> using namespace std; typedef long long ll; //typedef __int128 LL; //typedef unsigned long long ull; //#define 阅读全文

posted @ 2020-01-15 16:34 zsben 阅读(155) 评论(0) 推荐(0) 编辑

树上差分,换根dp——2020-camp-day1-E

摘要: #include<bits/stdc++.h> #include<vector> using namespace std; #define N 300005 #define ll long long vector<int>G[N]; ll n,m; pair<int,int>p[N]; ll fa[ 阅读全文

posted @ 2020-01-15 16:31 zsben 阅读(122) 评论(0) 推荐(0) 编辑

2020年1月10日

java8新特性——函数式接口,方法,构造器,数组引用

摘要: package functional; /* 定义:如果一个接口里面只声明了一个函数,就称为函数式接口 lambda表达式的本质:作为函数式接口的实例,必须依赖一类特别的对象类型——函数式接口 所以用匿名实现类表示的都可以用lambda表达式来写 Java.util.function 下也定义了Ja 阅读全文

posted @ 2020-01-10 23:20 zsben 阅读(435) 评论(0) 推荐(0) 编辑

2020年1月9日

java基础——网络编程基础TCP,URL

摘要: TCP部分 new socket对象 package ip; /* 1.通过IP地址和域名new InetAddress对象 2.本地回路地址:127.0.0.1 对应localhost,表示本地主机 3.IP地址和端口号接在一起组成一个socket,类似于网络节点 @author zsben @c 阅读全文

posted @ 2020-01-09 00:21 zsben 阅读(191) 评论(0) 推荐(0) 编辑

2020年1月7日

java基础——标准输入输出重定向,数据流

摘要: 感觉这两个流挺实用的 第一个是重定system.in/out的 /* * 1.标准输入输出流 * System.in :标准的输入流,默认从键盘输入 * System.out 标准的输出流,默认从控制台输出 * System类的setIn(InputStream is) / setOut(Print 阅读全文

posted @ 2020-01-07 13:57 zsben 阅读(307) 评论(0) 推荐(0) 编辑

上一页 1 ··· 29 30 31 32 33 34 35 36 37 ··· 109 下一页

导航