码迷,mamicode.com
首页 >  
搜索关键字:pairs    ( 1028个结果
TOJ 1693:Silver Cow Party(最短路+思维)
描述 One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A to ...
分类:其他好文   时间:2018-10-06 00:34:45    阅读次数:161
24. Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head. Example: Note: Your algorithm should use only constant extra space. You may no ...
分类:其他好文   时间:2018-10-05 22:34:58    阅读次数:193
Hometask
Hometask codeforces 155C Sergey attends lessons of the N-ish language. Each lesson he receives a hometask. This time the task is to translate some sen ...
分类:Web程序   时间:2018-10-05 14:01:37    阅读次数:200
[CODE FESTIVAL 2016 Exhibition A]Distance Pairs
题意:有一个未知的边权为$1$的图,给定所有点到$1$的最短路$a_i$和到$2$的最短路$b_i$,问是否存在这样的图,如果存在,问图中最少有多少条边 先考虑$a_i$,有$a_1=0,a_i\neq0(i\neq1)$,对于一条边$(x,y)$有$|a_x-a_y|\leq1$,对于任意$x\n ...
分类:其他好文   时间:2018-10-05 12:27:09    阅读次数:156
LightOJ 1236 Pairs Forming LCM(算数基本定理)
题意:在a,b中(a,b<=n)(1 ≤ n ≤ 1014),有多少组(a,b) (a<b)满足lcm(a,b)==n; 先来看个知识点: 素因子分解:n = p1 ^ e1 * p2 ^ e2 *..........*pn ^ en for i in range(1,n): ei 从0取到ei的所 ...
分类:其他好文   时间:2018-10-04 10:56:03    阅读次数:144
leetcode#24 Swap Nodes in Pairs
给定一个链表,两两交换其中相邻的节点,并返回交换后的链表。 示例: 给定 1 2 3 4, 你应该返回 2 1 4 3. 说明: 你的算法只能使用常数的额外空间。 你不能只是单纯的改变节点内部的值,而是需要实际的进行节点交换。 ...
分类:其他好文   时间:2018-09-29 14:32:33    阅读次数:168
LeetCode算法题python解法:24. Swap Nodes in Pairs
原题: Given a linked list, swap every two adjacent nodes and return its head. Example: Given 1->2->3->4, you should return the list as 2->1->4->3. Note: ...
分类:编程语言   时间:2018-09-26 17:18:36    阅读次数:169
[LeetCode&Python] Problem 561. Array Partition I
Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of ...
分类:编程语言   时间:2018-09-22 16:53:10    阅读次数:199
[LeetCode] 25. Reverse Nodes in k-Group 每k个一组翻转链表
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive integer and is less than or equal to ...
分类:其他好文   时间:2018-09-21 10:51:35    阅读次数:173
[leetcode] Generate Parentheses
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: [ ...
分类:其他好文   时间:2018-09-16 15:27:45    阅读次数:135
1028条   上一页 1 ... 22 23 24 25 26 ... 103 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!