唯一难点应该在于怎么转点吧,直接看代码呗。 //#pragma GCC optimize("-Ofast","-funroll-all-loops") //#pragma GCC optimize(2) //freopen("C://std/a.in","r",stdin); //freopen(" ...
分类:
其他好文 时间:
2020-07-29 17:46:49
阅读次数:
81
首先,明显的网络流。那么如何建边,对于每个二次函数在[1,m]里挑n个函数值最小的点, 这样子一共n^2个点,注意还要去重。这n^2个点其实就能使得n个二次函数(a, b, c)完全匹配。 那么流量全部设为1,费用是对应的函数值。超级源点和终点费用为0;但是,跑n次费用流时间不允许,但是你仔细想每次 ...
分类:
其他好文 时间:
2020-07-27 15:49:36
阅读次数:
71
题意: 给定一个序列ai,问序列中其他数中有多少个数是它的约数 思路: 暴力求法会超时。O(n²) 最优解:先储存每个数的个数,遍历x,每个x的倍数加上x的个数 注:最后每个数的答案要-1(减去本身) Code: #pragma GCC optimize(3) #pragma GCC optimiz ...
整个MySQL Server由以下组成 Connection Pool : 连接池组件 Management Services & Utilities : 管理服务和工具组件 SQL Interface : SQL接口组件 Parser : 查询分析器组件 Optimizer : 优化器组件 Cac ...
分类:
数据库 时间:
2020-07-26 23:12:40
阅读次数:
81
Dinic模板 #pragma GCC optimize(2) #include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 10; //const int maxm = 1e3 * 2 + 10; const int in ...
分类:
其他好文 时间:
2020-07-26 01:58:19
阅读次数:
59
StackExchange.Redis client best practices 1. Enabling server GC can optimize the client and provide better performance and throughput.2. Set AbortOnCo ...
分类:
其他好文 时间:
2020-07-25 23:55:39
阅读次数:
84
题目描述 有一个长为 n 的序列 a,以及一个大小为 k 的窗口。现在这个从左边开始向右滑动,每次滑动一个单位,求出每次滑动后窗口中的最大值和最小值。 例如: The array is [1,3,-1,-3,5,3,6,7]] and k=3。 输入格式 输入一共有两行,第一行有两个正整数 n,k。 ...
分类:
其他好文 时间:
2020-07-19 00:33:24
阅读次数:
74
二分图最大匹配: 匈牙利算法 邻接表O(mn): #pragma GCC optimize(2) #include <bits/stdc++.h> using namespace std; const int maxn = 1010; const int maxm = 2e5; int n, m, ...
分类:
其他好文 时间:
2020-07-14 21:42:51
阅读次数:
67
#pragma GCC optimize(2) #include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 1e5 + 100; const int maxm = 1e6 + 100; co ...
分类:
其他好文 时间:
2020-07-11 21:14:46
阅读次数:
65
https://git-scm.com/docs/git-gc NAME git-gc - Cleanup unnecessary files and optimize the local repository SYNOPSIS git gc [--aggressive] [--auto] [--q ...
分类:
其他好文 时间:
2020-07-11 18:56:34
阅读次数:
167