上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页
摘要: 并查集 #include<iostream> #include<string.h> #include<algorithm> #include<cmath> #include<map> #include<string> #include<stdio.h> #include<vector> #inclu 阅读全文
posted @ 2020-03-14 23:12 SunCY 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 注意set的交集和并集的写法 #include<bits/stdc++.h> using namespace std; map< set<int>,int > Map; vector< set<int> > Setcache; stack<int> sta; int ID( set<int> x) 阅读全文
posted @ 2020-03-13 22:24 SunCY 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 带标记的并查集 ,原来加速后也不见得就很快了 #include<cstdio> #include<iostream> #define endl '\n' #define _for(i,a,b) for(int i=a;i<b;i++) using namespace std; const int N 阅读全文
posted @ 2020-03-13 22:11 SunCY 阅读(276) 评论(0) 推荐(0) 编辑
摘要: https://vjudge.net/contest/360957#problem/F 题解 https://blog.csdn.net/niushuai666/article/details/6981689 #include<iostream> #include<cstdio> #include< 阅读全文
posted @ 2020-03-13 20:56 SunCY 阅读(127) 评论(0) 推荐(0) 编辑
摘要: https://vjudge.net/contest/360957#problem/E m行n列的一个矩阵 求:每行选一个数,求前n个最小的sum是多少。 思路用优先队列维护前i行的结果,再根据这个遍历求出前i+1行的,以此类推。 #include <iostream> #include <cstd 阅读全文
posted @ 2020-03-13 20:49 SunCY 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 不能用线段树开4N空间,因为深度并不确定,最差情况肯定爆内存 解决办法就是反过来建树,根节点->右子树->左子树,建树的过程用stack把结果存下来 #include<bits/stdc++.h> #define endl '\n' #define _for(i,a,b) for(int i=a;i 阅读全文
posted @ 2020-03-13 20:26 SunCY 阅读(404) 评论(0) 推荐(0) 编辑
摘要: https://vjudge.net/contest/360957#problem/B #include<bits/stdc++.h> #define endl '\n' #define _for(i,a,b) for(int i=a;i<b;i++) using namespace std; co 阅读全文
posted @ 2020-03-13 20:21 SunCY 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 上代码 import numpy as np import matplotlib.pyplot as plt def f(x): return x*x*x+2*x+1.2**x; def plot_f(): x = np.linspace(1,100,1000) y = f(x) # plt.fig 阅读全文
posted @ 2020-03-12 15:11 SunCY 阅读(614) 评论(0) 推荐(0) 编辑
摘要: http://121down.com/soft/softview-27651.html#downaddress 下载,里边有教程 阅读全文
posted @ 2020-03-11 15:00 SunCY 阅读(81) 评论(0) 推荐(0) 编辑
摘要: 进制转换 package ch2; import java.util.Scanner; public class CG0311_2 { public static void main(String [] args) { Scanner sc = new Scanner(System.in); lon 阅读全文
posted @ 2020-03-11 14:18 SunCY 阅读(380) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页