上面是AC代码基本没写啥东西全靠STL里的东西 max_element(): 对数组a[n]求其中最大值得到指针位置int *p=max_element(a,a+n); 位置为p-a; distance(): distance主要是用来求两个迭代器之间的元素个数。变换一下,就成了求某个点的位置了,比 ...
分类:
其他好文 时间:
2018-12-12 21:05:36
阅读次数:
194
function Dijkstra(Graph, source): 2 3 create vertex set Q 4 5 for each vertex v in Graph: // Initialization 6 dist[v] ← INFINITY // Unknown distance f ...
分类:
编程语言 时间:
2018-12-12 13:24:00
阅读次数:
247
统计在一个root下的两个子树,每个子树都和前面的运算一下再加进去对于这种需要排序的运算很麻烦,所以考虑先不去同子树内点对的算出合法点对个数,然后减去每一棵子树内的合法点对(它们实际上是不合法的,相当于一个容斥) 算点对用排序+双指针即可 cpp include include include us ...
分类:
其他好文 时间:
2018-12-12 00:23:29
阅读次数:
122
Difficulty: Medium More:【目录】LeetCode Java实现 Description Given two strings S and T, determine if they are both one edit distance apart. Intuition 同时遍历比 ...
分类:
其他好文 时间:
2018-12-12 00:16:19
阅读次数:
212
今天小编给大家带来了一篇,主要运用Python_docx模块处理word文档的基本技巧来介绍,其中最主要的是如何对图片进行提取和写入。 今天小编给大家带来了一篇,主要运用Python_docx模块处理word文档的基本技巧来介绍,其中最主要的是如何对图片进行提取和写入。 python已有几个模块可处 ...
分类:
编程语言 时间:
2018-12-10 20:51:35
阅读次数:
214
1 #include "lcd.h" //调用LCD.h函数 2 #include "stdlib.h" 3 #include "font.h" 4 #include "usart.h" //调用usart.h函数 5 #include "delay.h" //调用delay.h函数 6 ... ...
分类:
其他好文 时间:
2018-12-06 20:29:04
阅读次数:
434
Given n points in the plane that are all pairwise distinct, a “boomerang” is a tuple of points (i, j, k) such that the distance between iand j equals ...
分类:
其他好文 时间:
2018-12-04 22:40:17
阅读次数:
421
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), r... ...
分类:
其他好文 时间:
2018-12-04 17:08:43
阅读次数:
180
Given a Binary Search Tree (BST) with the root node root, return the minimum difference between the values of any two different nodes in the tree. Exa ...
分类:
其他好文 时间:
2018-12-04 13:23:24
阅读次数:
199