// 内存分配器 Allocator #include <vector> #include <iostream> using namespace std; template<typename _Ty> struct Allocator_base { using value_type = _Ty; } ...
分类:
其他好文 时间:
2020-01-11 00:11:50
阅读次数:
80
1. 直推式的PCA 基本步骤: 对样本数据进行中心化处理(这步操作比较重要,特别是对推导公式) 求样本的协方差矩阵; 对样本的协方差矩阵进行特征值分解,并通过前k个特征值对应的特征向量进行映射: PCA的优化目标是: X = D + N,即低秩矩阵D和独立同分布的Gaussian噪声; 1 def ...
分类:
编程语言 时间:
2020-01-10 22:12:25
阅读次数:
95
都是链接(自己懒的写): 1. "vector resize和reserve" 2. "swap复杂度问题" 3. "bitset操作" ...
分类:
编程语言 时间:
2020-01-10 15:35:10
阅读次数:
69
数数题还是要多练啊 code: #include <cstdio> #include <cstring> #include <string> #include <vector> #include <algorithm> #define N 3004 #define ll long long #def ...
分类:
其他好文 时间:
2020-01-10 11:00:23
阅读次数:
79
Markdown在线编辑器 - www.MdEditor.com 1.方法一:借助辅助数组存储k个最小的数 思想 存着最小k个数的数组,内部有序,遍历所有元素,和辅助数组中最大的比,只要小就替换辅助数组中的最大元素,然后再排序 代码 // 使用辅助数组来实现 vector<int> FuZhu(ve ...
分类:
其他好文 时间:
2020-01-09 20:57:34
阅读次数:
91
Code: 1 #include <vector> 2 using namespace std; 3 4 struct NPC 5 { 6 char * name; 7 int age; 8 float high; 9 }; 10 int main(){ 11 12 //练习使用vector数组 1 ...
分类:
编程语言 时间:
2020-01-09 18:57:32
阅读次数:
66
1 import pygame 2 from pygame.locals import * 3 from pygame.math import * 4 import sys 5 6 pygame.init() 7 size = width, height = 1600, 900 8 screen = ...
分类:
移动开发 时间:
2020-01-09 17:23:36
阅读次数:
154
之前在代码中使用map::erase函数时,误搬了vector::erase的用法,导致Server down掉了,好在在测试环境就及时发现了问题,在上线前进行了补救==。以下总结一下map::erase的正确用法。首先看一下在循环中使用vector::erase时我习惯的用法: for(vecto ...
分类:
其他好文 时间:
2020-01-09 10:31:48
阅读次数:
86
A: 直接打表所有可以到达的点就可以了 1 #include <math.h> 2 #include <stdio.h> 3 #include <stdlib.h> 4 #include <iostream> 5 #include <algorithm> 6 #include <string> 7 ...
分类:
其他好文 时间:
2020-01-09 01:31:54
阅读次数:
142
在Java中Stack类表示后进先出(LIFO)的对象堆栈。栈是一种非常常见的数据结构,它采用典型的先进后出的操作方式完成的。每一个栈都包含一个栈顶,每次出栈是将栈顶的数据取出,如下: Stack通过五个操作对Vector进行扩展,允许将向量视为堆栈。这个五个操作如下: 操作 说明 empty() ...
分类:
其他好文 时间:
2020-01-07 18:29:06
阅读次数:
98