码迷,mamicode.com
首页 >  
搜索关键字:reverse integer    ( 19410个结果
字符串反转
java实现的字符串翻转,能想到的这几种方法 如果有其他方法,欢迎交流 //字符串反转 public class ReverseString { public String reverse1(String str){ StringBuffer sb = new StringBuffer(str); str = sb.reverse().toString(); return str...
分类:其他好文   时间:2014-07-27 11:09:12    阅读次数:211
N-Queens leetcode java
题目:The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.Given an integer n, return a....
分类:编程语言   时间:2014-07-27 11:00:22    阅读次数:262
spoj cot: Count on a tree 主席树
10628. Count on a treeProblem code: COTYou are given a tree with N nodes.The tree nodes are numbered from 1 to N.Each node has an integer weight.We wi...
分类:其他好文   时间:2014-07-27 10:31:42    阅读次数:304
[LeetCode] Spiral Matrix II
Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.For example, Given n = 3,You should return the followin...
分类:其他好文   时间:2014-07-27 10:21:02    阅读次数:219
HDU 1062 Text Reverse(水题,字符串处理)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1062解题报告:注意一行的末尾可能是空格,还有记得getchar()吃回车符。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #incl...
分类:其他好文   时间:2014-07-27 10:12:02    阅读次数:149
LeetCode题解
Reverse Words in a String考虑几个特殊的情况1.若字符窜s=" "2.字符窜s=“a b d e”3.字符窜s=“ a”class Solution {public: void reverseWords(string &s) { int i; int c...
分类:其他好文   时间:2014-07-26 17:03:01    阅读次数:360
c++ vector反转reverse
[cpp] view plaincopytemplatevoidreverse(BidirectionalIteratorfirst,BidirectionalIteratorlast);[cpp] view plaincopy如果不是改变原来的容器,而是翻转之后放在新容器里面,直接用reverse...
分类:编程语言   时间:2014-07-26 16:59:21    阅读次数:394
XTU 二分图和网络流 练习题 C. 方格取数(1)
C. 方格取数(1)Time Limit: 5000msMemory Limit: 32768KB64-bit integer IO format:%I64d Java class name:Main给你一个n*n的格子的棋盘,每个格子里面有一个非负数。从中取出若干个数,使得任意的两个数所在的格子没...
分类:其他好文   时间:2014-07-26 16:57:11    阅读次数:361
python 中 sorted() 和 list.sort() 的用法
今天用python自带的sorted对一个列表进行排序, 在这里总结一下只要是可迭代对象都可以用sorted 。sorted(itrearble, cmp=None, key=None, reverse=False)=号后面是默认值 默认是升序排序的, 如果想让结果降序排列,用reverse=Tru...
分类:编程语言   时间:2014-07-26 14:49:40    阅读次数:284
Evaluate Reverse Polish Notation leetcode java
题目:Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or anothe....
分类:编程语言   时间:2014-07-26 14:14:35    阅读次数:225
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!