码迷,mamicode.com
首页 >  
搜索关键字:awk sort    ( 17174个结果)
C++-POJ3349-Snowflake Snow Snowflakes[STL][set][hash未写]
错误AC解法,sort+set判重,为考虑异构! 比较坑的一点是读入时scanf一定要一次读6个数,不然会TLE #include <set> #include <map> #include <cmath> #include <queue> #include <vector> #include <c ...
分类:编程语言   时间:2020-02-13 19:03:12    阅读次数:93
Linux学习1
1.man -ls 查看目录下的东西 2.sort 进行排序 用--help 查看 3.netstat -ntpl 系统当做那些端口处于监听的状态 4. cd /etc/ssh/sshd_config/ port 端口 listenAddress 监听的iP 可以配置多个 0.0.0.0 代表所有的 ...
分类:系统相关   时间:2020-02-13 15:05:21    阅读次数:78
PAT T1021 Safe Fruit
暴力搜索加剪枝~ #include<bits/stdc++.h> using namespace std; const int maxn=1014; const int inf=1e9; int g[maxn][maxn]; int c[maxn]; int N,M; int mincost=1e9 ...
分类:其他好文   时间:2020-02-13 13:09:45    阅读次数:72
合理使用Order by 重要性
案例场景 表数据量7000+万,其中满足如下条件的数据量约为:1200条 #表索引说明 分别查看sql的执行计划 1、无limit 、无order by 2、limit 2000 3、order by id,add_time limit 2000 4、order by id limit 2000 从 ...
分类:其他好文   时间:2020-02-13 13:00:59    阅读次数:78
刷题记录--UVa815 Flooded!
这道题放在紫书最后一道,我以为挺难的,没想到挺简单的。 怎么一直不给结果,不等了,先睡了,明天再起来看。 #include<cstdio> #include<iostream> #include<algorithm> using namespace std; int main(){ int m,n, ...
分类:其他好文   时间:2020-02-13 09:50:31    阅读次数:66
PAT A1034 Head Of Gang
用并查集分割团伙,判断输出~ #include<bits/stdc++.h> using namespace std; const int maxn=10010; int father[maxn],isRoot[maxn]={0},weight[maxn]; unordered_map<string ...
分类:其他好文   时间:2020-02-13 00:04:46    阅读次数:54
数组(Array)
(1)数组排序及插入元素 1 package JavaEE.JavaBaseExampleTest.Array; 2 3 import java.util.Arrays; 4 /** 5 * 使用sort()方法对Java数组进行排序,及使用 insertElement () 方法向数组插入元素 6 ...
分类:编程语言   时间:2020-02-12 16:15:53    阅读次数:81
二分问题总结
二分问题可以按循环条件总结为两个模板: 循环条件为(left <= right): while(left <= right) { int mid = (right + left) / 2; if(nums[mid] == target) return mid; else if (nums[mid] ...
分类:其他好文   时间:2020-02-12 13:18:50    阅读次数:85
赫夫曼树
给定N个权值作为N个叶子节点,构造一棵二叉树,若该树的带权路径长度达到最小,称这样的二叉树为最优二叉树,也称为赫夫曼树 赫夫曼树是带权路径长度最短的树,权值较大的结点离根较近 节点的带权路径长度为:从根节点到该节点之间的路径长度与该节点的权的乘机 树的带权路径长度(WPL):所有叶子节点的带权路径长 ...
分类:其他好文   时间:2020-02-12 12:30:55    阅读次数:62
简单的dfs
DFS 翰翰和达达饲养了N只小猫,这天,小猫们要去爬山。 经历了千辛万苦,小猫们终于爬上了山顶,但是疲倦的它们再也不想徒步走下山了(呜咕 _ include include using namespace std; int cab[20],c[20],w,ans,n; void dfs(int no ...
分类:其他好文   时间:2020-02-12 10:34:35    阅读次数:64
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!