原题地址:http://oj.leetcode.com/problems/reorder-list/题意:Given
a singly linked listL:L0→L1→…→Ln-1→Ln,reorder it to:L0→Ln→L1→Ln-1→L2→Ln-2→…You
must do this...
分类:
编程语言 时间:
2014-05-01 15:37:03
阅读次数:
441
原题地址:http://oj.leetcode.com/problems/remove-nth-node-from-end-of-list/题意:Given
a linked list, remove thenthnode from the end of list and return its he...
分类:
编程语言 时间:
2014-05-01 06:42:15
阅读次数:
332
题目链接Given a list, rotate the list to the right
bykplaces, wherekis non-negative.For
example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3->NULL.首...
分类:
其他好文 时间:
2014-05-01 04:52:19
阅读次数:
288
IIUPC2006Problem G: Going in Cycle!!Input:
standard inputOutput: standard outputYou are given a weighted directed graph
withnvertices andmedges. Each ...
分类:
其他好文 时间:
2014-05-01 04:32:53
阅读次数:
271
这道题挺简单的,但是需要细心。最好的方法是先对string做预处理,然后再判断是否是回文。下面是AC代码:
1 /** 2 * Given a string, determine if it is a palindrome, considering only
alphanumeric ch...
分类:
其他好文 时间:
2014-05-01 01:45:34
阅读次数:
375
Pat1063代码
题目描述:
Given two sets of integers, the similarity of the sets is defined to be Nc/Nt*100%, where Nc is the number of distinct common numbers shared by the two sets,
and Nt is the to...
分类:
其他好文 时间:
2014-04-29 13:44:20
阅读次数:
325
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.
Note: You can only move either down or right at...
分类:
其他好文 时间:
2014-04-28 10:46:41
阅读次数:
311
Problem Description
Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N!
Input
One N in one line, process to the end of file.
Output
For each N, output N! i...
分类:
其他好文 时间:
2014-04-28 10:36:41
阅读次数:
341
A Simple Problem with Integers
Time Limit: 5000MS
Memory Limit: 131072K
Total Submissions: 55626
Accepted: 16755
Case Time Limit: 2000MS
Description
You have N...
分类:
其他好文 时间:
2014-04-28 10:23:41
阅读次数:
282
关键是通过预处理吧每个区间内的一移动到一起的最少步骤算出来....
1411: Longest Consecutive Ones
Time Limit: 1 Sec Memory Limit: 128 MB
Submit: 185 Solved: 40
[Submit][Status][Web
Board]
Description
Given a...
分类:
其他好文 时间:
2014-04-27 21:21:05
阅读次数:
305