又是一道纯数学的题, 纸上认真研究下就好。 这道题需要Inplace, 所以写了个辅助的reverse.class Solution: # @param {integer[]} nums # @return {void} Do not return anything, modify nu...
分类:
其他好文 时间:
2015-07-09 07:24:10
阅读次数:
88
http://www.wzoi.org/usaco/11%5C302.asppat没太水了没什么好说的。然而感觉如果不计代价的话,先把string reverse再比较是否相同来判断回文,好方便pat#include using namespace std;bool gao(int base, in...
分类:
其他好文 时间:
2015-07-09 06:13:46
阅读次数:
102
http://www.wzoi.org/usaco/12%5C501.asppatpat 学习了一个新的stl函数eg. string poi = "poi"; reverse(poi.begin(), poi.end());就把poi变成了"iop"#include using namespa.....
分类:
其他好文 时间:
2015-07-09 00:45:30
阅读次数:
157
Given a linked list, reverse the nodes of a linked listkat a time and return its modified list.If the number of nodes is not a multiple ofkthen left-o...
分类:
其他好文 时间:
2015-07-08 20:24:43
阅读次数:
112
Given an input string, reverse the string word by word.
For example,
Given s = "the sky is blue",
return "blue is sky the".
Update (2015-02-12):
For C programmers: Try to solve it in-place in...
分类:
其他好文 时间:
2015-07-08 11:10:35
阅读次数:
104
Emag eht htiw Em PlehTime Limit:1000MSMemory Limit:65536KTotal Submissions:2944Accepted:1949DescriptionThis problem is a reverse case of theproblem 29...
分类:
其他好文 时间:
2015-07-08 00:17:46
阅读次数:
101
解题思路:三指针,跟踪算法的过程如下:
代码如下:/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {...
分类:
其他好文 时间:
2015-07-07 19:30:05
阅读次数:
106
Reverse Nodes in k-Group
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
If the number of nodes is not a multiple of k then left-out nodes in the...
分类:
其他好文 时间:
2015-07-07 17:04:14
阅读次数:
170
If we take 47, reverse and add, 47 + 74 = 121, which is palindromic.
Not all numbers produce palindromes so quickly. For example,
349 + 943 = 1292,
1292 + 2921 = 4213
4213 + 3124 = 7337
That is...
分类:
其他好文 时间:
2015-07-07 16:56:48
阅读次数:
113
#ctrl + l- 清屏 。 cLear#ctrl + c- 终止命令。#ctrl + d- 退出 shell,好像也可以表示EOF。#ctrl + z- 将当前进程置于后台,fg还原。#ctrl + r- 从命令历史中找 。 Reverse-i-search#ctrl + a- 光标移到行首 。...
分类:
其他好文 时间:
2015-07-07 16:13:40
阅读次数:
123