new 和 delete 的执行过程 new 的执行过程 通过 operator new 申请内存 调用构造函数(简单类型忽略此步) 返回内存指针 delete 的执行过程 调用析构函数(简单类型忽略此步) 释放内存 using namespace std; class T { public: T( ...
分类:
其他好文 时间:
2021-05-24 05:50:59
阅读次数:
0
#include <string> // 头文件包含 using namespace std; // 使用名字空间 构造函数 string(const char *s); string(int n, char c); string(const string& rhs); // 拷贝构造 运算符重载 ...
分类:
编程语言 时间:
2021-05-24 04:57:59
阅读次数:
0
浮点数二分 模板 假如求平方根 #include<bits/stdc++.h> //万能头文件 using namespace std; int main() { double x; cin>>x; double l = 0, r = max(1, x); while (r - l > 1e-8) ...
分类:
其他好文 时间:
2021-05-24 04:47:23
阅读次数:
0
给定一棵$n$个点的树,每个点有一个颜色(黑或白)。你可以任选一个点出发,能执行两种操作:走到一个相邻点并翻转其颜色;翻转当前点颜色。求使得所有节点颜色为黑的最少操作次数。 ...
分类:
其他好文 时间:
2021-05-24 04:12:00
阅读次数:
0
##AC代码 #include<stdio.h> #include<string.h> #include<iostream> #include<queue> using namespace std; #define inf 0x3f3f3f3f const int N=1020; int e[N][ ...
分类:
其他好文 时间:
2021-05-24 03:46:14
阅读次数:
0
新建一个Qt Widgets Application项目,不添加UI文件,如下图: 建立工程后,在**.pro**文件中添加: QT += charts 然后在**.h**文件中添加: #include "QChart" using namespace QtCharts; 在**.cpp**中,先添 ...
分类:
其他好文 时间:
2021-05-24 02:40:25
阅读次数:
0
有向图强连通分量SCC P3387【模板】缩点 注释放代码里啦 时间复杂度O(n+m) #include<iostream> #include<cstdio> #include<cstdlib> #define maxn 100010 #define maxm 1000010 using names ...
分类:
其他好文 时间:
2021-05-24 02:15:52
阅读次数:
0
using System;using System.Collections;using System.Collections.Specialized;using System.Data;using System.Configuration;using System.Data.Common;using ...
分类:
数据库 时间:
2021-05-24 02:07:55
阅读次数:
0
Dapper的多表查询实现打开链接 using (var conn = new SqlConnection(myConnectionString)) { conn.Open(); .... } 单表查询 public class Account { public int? Id {get;set;} ...
分类:
移动开发 时间:
2021-05-24 02:03:08
阅读次数:
0
整理压缩代码 using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using Syste ...