就是求 \(n\) 个点 \(m\) 条边的带标号无向连通图个数。 首先可以用最暴力的 \(O(n^6)\) 做法,直接按城市规划一题的容斥 DP 做法, 记 \(f_{n,m}\) 表示答案,可以枚举 $1$ 号点所在块的情况容斥计算。 \(O(n^4)\) 做法是一个有意思的斯特林反演。 考虑一 ...
分类:
其他好文 时间:
2020-06-05 22:44:04
阅读次数:
137
题目链接:http://codeforces.com/contest/1362 简单讲解:https://www.bilibili.com/video/BV15C4y1a7e5 A - Johnny and Ancient Computer // // main.cpp // CF // // Cr ...
分类:
其他好文 时间:
2020-06-05 12:59:47
阅读次数:
52
//mywidget.cpp#include "mywidget.h" #include <QPushButton> MyWidget::MyWidget(QWidget *parent) : QWidget(parent) { #if 1 //创建第一个按钮 QPushButton *btn = ...
分类:
其他好文 时间:
2020-06-05 00:57:50
阅读次数:
144
在写编译原理实验的时候,遇到了这个错误: [Error] 'strlen' was not declared in this scope 查阅之后得知,<string.h>里没有strlen,<cstring>才有。 #include<cstring> 头头儿加上这行就好了。 ...
分类:
其他好文 时间:
2020-06-04 19:55:43
阅读次数:
74
安装opencv时,在opencv的安装路径下, sources\samples\cpp\ 路径里面提供了好多经典的例子,很值得学习。 这次的例子是利用inpaint函数进行图像修复。 CV_EXPORTS_W void inpaint( InputArray src, InputArray inp ...
分类:
其他好文 时间:
2020-06-04 19:42:04
阅读次数:
56
#include <iostream> #include <algorithm> #include "MnistFile.cpp" #include <cmath> using namespace std; const int synapseNums = 800; class Node { publ ...
分类:
其他好文 时间:
2020-06-03 20:29:31
阅读次数:
53
例一(类初始化错误用法): struct thing { char * pn; int m; }; thing amabob = {"wodget", -23}; // valid initialization Stock hot = {"Sukie's Autos, Inc.", 200, 50. ...
分类:
编程语言 时间:
2020-06-03 13:57:40
阅读次数:
83
首先,我们可以发现一个性质: 每一次交换的前缀,必然是该串由相同字母构成的最长前缀,或者空串。 什么意思呢?比如,对于串 \(aaabb\) ,显然选 \(aa\) 没有 \(aaa\) 划算。 接下来,我们要分两种情况讨论: 1. 两串首字母不同 如: \(aaaaabb\) 与 \(bbbbba ...
分类:
其他好文 时间:
2020-06-03 13:27:30
阅读次数:
55
题目 如何得到一个数据流中的中位数?如果从数据流中读出奇数个数值,那么中位数就是所有数值排序之后位于中间的数值。如果从数据流中读出偶数个数值,那么中位数就是所有数值排序之后中间两个数的平均值。 例如, [2,3,4] 的中位数是 3 [2,3] 的中位数是 (2 + 3) / 2 = 2.5 设计一 ...
分类:
其他好文 时间:
2020-06-03 10:50:10
阅读次数:
59
1、sql文件过大会报异常: (42000): Variable 'sql_mode' can't be set to the value of 'NULL' ................ mysql配置修改:my.cnf: [mysqld] max_allowed_packet = 5000M ...
分类:
数据库 时间:
2020-06-02 11:04:04
阅读次数:
80