码迷,mamicode.com
首页 >  
搜索关键字:unique paths    ( 5916个结果
F. Triangular Paths 思维
F. Triangular Paths 思维 题目大意: 给你一个由层叠加起来的三角形。 然后对于第 \(r\) 层,第 \(c\) 个,如果 \((r+c)\) 是一个偶数,那么连向 \((r+1,c)\) ,否则连向 \((r+1,c+1)\) 然后,你可以花费1 的代价改变这个,也就是如果 \ ...
分类:其他好文   时间:2021-03-30 12:49:25    阅读次数:0
C++实现简单的线程安全队列
/* 实现一个线程安全的队列 */ template <class T> class SafeQueue { public: SafeQueue(void):q(),m(),c() {} ~SafeQueue(void) {} // Add an element to the queue. void ...
分类:编程语言   时间:2021-03-18 14:12:09    阅读次数:0
0823. Binary Trees With Factors (M)
Binary Trees With Factors (M) 题目 Given an array of unique integers, arr, where each integer arr[i] is strictly greater than 1. We make a binary tree u ...
分类:其他好文   时间:2021-03-15 11:24:45    阅读次数:0
E - Number of Simple Paths
一个图,n个点,n条边,没有重边和自环。 那么多出的一条边必定使他成为基环树。 要求去计算简单路径的个数。 简单路径:与方向无关的路径。 又因为在树上,两点的路径唯一确定,那么路径仅仅与起点与终点有关。 也就是C(2,n)这样。 但是如果路径经过环,那么中间经过环的部分就可以有两种走法。 也就是说答 ...
分类:其他好文   时间:2021-03-15 10:49:05    阅读次数:0
C++内存管理之unique_ptr
一个unique_ptr"拥有“他所指向的对象。与shared_ptr不同,某个时刻只能有一个unique_ptr指向一个给定的对象。当unique_ptr被销毁时,它所指向的对象也被销毁。uniptr_ptr表达的是一种独占的思想。 初始化 #include <iostream> #include ...
分类:编程语言   时间:2021-03-10 13:24:43    阅读次数:0
[CF1486F] Pairs of Paths
Problem 给定一棵树和若干个点对 \((u,v)\) 给出的树上最短路径,求满足 路径交仅有一个点 的 无序 路径对(即 \((a,b)\) 和 \((b,a)\) 算一次)。 Sol & Code 交仅为一个点只有两种情况:两条路径 LCA 在同一个点或不在同一个点。 分别计算。第一种使用容 ...
分类:其他好文   时间:2021-03-06 15:03:23    阅读次数:0
python 3 解决 ERROR: Could not find a version that satisfies the requirement xxx 的问题
问题:pyhton 3安装module报错ERROR: Could not find a version that satisfies the requirement config.paths % pip install config.paths ERROR: Could not find a ve ...
分类:编程语言   时间:2021-03-03 11:48:53    阅读次数:0
LeetCode - Unique Binary Search Trees
Given an integer n, return the number of structurally unique BST's (binary search trees) which has exactly n nodes of unique values from 1 to n. Examp ...
分类:其他好文   时间:2021-02-20 12:13:36    阅读次数:0
算法图解——组合求和( Combination Sum)
组合求和( Combination Sum) 1. 题目描述 Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of ...
分类:编程语言   时间:2021-02-18 13:37:18    阅读次数:0
PAT A1119 Pre- and Post-order Traversals (30 分)
Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and ino ...
分类:其他好文   时间:2021-02-16 12:28:45    阅读次数:0
5916条   上一页 1 2 3 4 5 6 ... 592 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!