- 博客(47)
- 资源 (2)
- 收藏
- 关注
原创 CSU1513 Kick the ball!
Kick the ball!Time Limit:1000MS Memory Limit:131072KB 64bit IO Format:%lld & %lluDescription"A penalty shoot-out (officially kicks from the penalty mark) is a method of determini
2016-08-23 11:12:14
569
原创 uva455 Periodic Strings & hdu3746 Cyclic Nacklace
两道题类似,uva455是求最小周期,hdu3746是求最少插入多少字符可以使得字符串最少有两个周期。类似于kmp算法,使用一个next数组, 对字符串进行处理,标记所有的前缀, 时间复杂度是O(n)。如: 字符串: a b c a b c d a b e f next数组: 0 0 0 1 2
2016-08-16 20:26:49
442
原创 fzu1479 字符串编码
Problem 1479 字符串编码 Accept: 143 Submit: 513Time Limit: 1000 mSec Memory Limit : 32768 KB Problem Description在数据加密和数据压缩中常需要对特殊的字符串进行编码。给定的字母表A 由26 个小写英文字母组成A={a,b,…,z}。该字母表产生的升序字
2016-08-16 18:13:52
415
原创 hdu1068 Ignatius's puzzle
Ignatius's puzzleTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8929 Accepted Submission(s): 6204Problem DescriptionIgnatius is
2016-08-16 18:00:38
300
原创 hdu1087 Super Jumping! Jumping! Jumping!
Super Jumping! Jumping! Jumping!Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 32741 Accepted Submission(s): 14782Problem Descri
2016-07-10 15:38:15
356
原创 leetcode338 Counting Bits
338. Counting BitsTotal Accepted: 4609 Total Submissions: 8391 Difficulty: MediumGiven a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the
2016-03-22 16:47:21
507
原创 leetcode12 Integer to Roman
12. Integer to RomanTotal Accepted: 58657 Total Submissions: 154412 Difficulty: MediumGiven an integer, convert it to a roman numeral.Input is guaranteed to be within the range fro
2016-03-15 22:33:47
301
原创 leetcode287 Find the Duplicate Number
287. Find the Duplicate NumberTotal Accepted: 21710 Total Submissions: 57132 Difficulty: HardGiven an array nums containing n + 1 integers where each integer is between 1 andn (inc
2016-03-07 23:00:02
344
原创 leetcode13 Roman to Integer
13. Roman to IntegerTotal Accepted: 75285 Total Submissions: 196334 Difficulty: EasyGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from
2016-03-07 13:06:14
370
原创 leetcode52 N-Queens II
52. N-Queens IITotal Accepted: 41407 Total Submissions: 107148 Difficulty: HardFollow up for N-Queens problem.Now, instead outputting board configurations, return the total numbe
2016-03-06 19:42:00
307
原创 leetcode50 Pow(x, n)
50. Pow(x, n)Total Accepted: 83619 Total Submissions: 299730 Difficulty: MediumImplement pow(x, n).二分法求快速幂,时间复杂度为O(logn)。class Solution {public: double myPow(double x, int n
2016-03-06 03:22:25
448
原创 leetcode206 Reverse Linked List
206. Reverse Linked ListTotal Accepted: 89431 Total Submissions: 232505 Difficulty: EasyReverse a singly linked list.click to show more hints.Hint:A linked list can be reversed
2016-03-06 02:54:39
252
转载 sqrt函数的实现
看到好文章,转载保存一下。我们平时经常会有一些数据运算的操作,需要调用sqrt,exp,abs等函数,那么时候你有没有想过:这个些函数系统是如何实现的?就拿最常用的sqrt函数来说吧,系统怎么来实现这个经常调用的函数呢?虽然有可能你平时没有想过这个问题,不过正所谓是“临阵磨枪,不快也光”,你“眉头一皱,计上心来”,这个不是太简单了嘛,用二分的方法,在一个区间中,每次拿中间数的平方来试验
2016-03-05 17:18:14
784
原创 hdu2047 阿牛的EOF牛肉串
阿牛的EOF牛肉串Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 28877 Accepted Submission(s): 13543Problem Description今年的ACM暑期集训队一共有18人,
2016-03-05 11:51:05
331
原创 leetcode94 Binary Tree Inorder Traversal
94. Binary Tree Inorder TraversalTotal Accepted: 113147 Total Submissions: 290357 Difficulty: MediumGiven a binary tree, return the inorder traversal of its nodes' values.For examp
2016-03-05 11:25:03
282
原创 leetcode144 Binary Tree Preorder Traversal
144. Binary Tree Preorder TraversalTotal Accepted: 110604 Total Submissions: 282561 Difficulty: MediumGiven a binary tree, return the preorder traversal of its nodes' values.For ex
2016-03-05 11:22:03
268
原创 leetcode268 Missing Number
268. Missing NumberTotal Accepted: 41297 Total Submissions: 104911 Difficulty: MediumGiven an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is mis
2016-03-05 11:20:27
264
原创 leetcode319 Bulb Switcher
319. Bulb SwitcherTotal Accepted: 12416 Total Submissions: 31335 Difficulty: MediumThere are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every
2016-03-05 11:19:16
286
原创 leetcode169 Majority Element
169. Majority ElementTotal Accepted: 97734 Total Submissions: 242819 Difficulty: EasyGiven an array of size n, find the majority element. The majority element is the element that app
2016-03-05 11:17:54
277
原创 leetcode217 Contains Duplicate
217. Contains DuplicateTotal Accepted: 73841 Total Submissions: 182346 Difficulty: EasyGiven an array of integers, find if the array contains any duplicates. Your function should ret
2016-03-05 11:16:38
327
原创 leetcode171 Excel Sheet Column Number
171. Excel Sheet Column NumberTotal Accepted: 68083 Total Submissions: 167730 Difficulty: EasyRelated to question Excel Sheet Column TitleGiven a column title as appear in an Exc
2016-03-05 11:15:17
270
原创 leetcode122 Best Time to Buy and Sell Stock II
122. Best Time to Buy and Sell Stock IITotal Accepted: 79414 Total Submissions: 190920 Difficulty: MediumSay you have an array for which the ith element is the price of a given stock
2016-03-05 11:12:05
323
原创 leetcode238 Product of Array Except Self
238. Product of Array Except SelfTotal Accepted: 36710 Total Submissions: 87934 Difficulty: MediumGiven an array of n integers where n > 1, nums, return an arrayoutput such that ou
2016-03-05 11:10:29
253
原创 leetcode100 Same Tree
100. Same TreeTotal Accepted: 114518 Total Submissions: 267060 Difficulty: EasyGiven two binary trees, write a function to check if they are equal or not.Two binary trees are consi
2016-03-05 11:09:14
279
原创 leetcode283 Move Zeroes
283. Move ZeroesTotal Accepted: 61066 Total Submissions: 140284 Difficulty: EasyGiven an array nums, write a function to move all 0's to the end of it while maintaining the relative
2016-03-05 11:08:10
298
原创 leetcode237 Delete Node in a Linked List
237. Delete Node in a Linked ListTotal Accepted: 66681 Total Submissions: 152654 Difficulty: EasyWrite a function to delete a node (except the tail) in a singly linked list, given on
2016-03-05 11:06:49
294
原创 leetcode226 Invert Binary Tree
226. Invert Binary TreeTotal Accepted: 73962 Total Submissions: 167537 Difficulty: EasyInvert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 /
2016-03-05 11:05:35
359
原创 leetcode104 Maximum Depth of Binary Tree
104. Maximum Depth of Binary TreeTotal Accepted: 126996 Total Submissions: 268431 Difficulty: EasyGiven a binary tree, find its maximum depth.The maximum depth is the number of nod
2016-03-05 11:03:51
337
原创 leetcode258 Add Digits
258. Add DigitsTotal Accepted: 74723 Total Submissions: 155249 Difficulty: EasyGiven a non-negative integer num, repeatedly add all its digits until the result has only one digit.
2016-03-05 11:02:01
292
原创 leetcode292 Nim Game
292. Nim GameTotal Accepted: 50767 Total Submissions: 98218 Difficulty: EasyYou are playing the following Nim Game with your friend: There is a heap of stones on the table, eac
2016-03-05 11:00:13
291
原创 hdu1710 Binary Tree Traversals
Binary Tree TraversalsTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4995 Accepted Submission(s): 2278Problem DescriptionA binar
2016-03-04 21:30:21
434
原创 hdu5616 Jam's balance
Jam's balanceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 386 Accepted Submission(s): 182Problem DescriptionJim has a balance
2016-02-01 01:02:42
718
原创 hihocoder1040 矩形判断
#1040 : 矩形判断时间限制:1000ms单点时限:1000ms内存限制:256MB描述给出平面上4条线段,判断这4条线段是否恰好围成一个面积大于0的矩形。输入输入第一行是一个整数T(1每组数据包含4行,每行包含4个整数x1, y1, x2, y2 (0 输出每组数据输出一行YES或者NO,表示输入的4条线段是否恰好围
2016-01-29 00:51:58
348
原创 hdu2095 find your present(2)
find your present (2)Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 19885 Accepted Submission(s): 7739Problem DescriptionIn the
2016-01-27 00:36:54
324
原创 hdu2084
数塔Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 31867 Accepted Submission(s): 19036Problem Description在讲述DP算法的时候,一个经典的例子就是数塔问题,
2016-01-27 00:17:16
492
原创 hdu1166 敌兵布阵
敌兵布阵Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 65392 Accepted Submission(s): 27540Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以
2016-01-26 21:57:59
331
原创 hdu1143 Tri Tiling
Tri TilingTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3056 Accepted Submission(s): 1720Problem DescriptionIn how many ways ca
2016-01-24 00:59:35
414
原创 hdu2068 RPG的错排
RPG的错排Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9816 Accepted Submission(s): 4020Problem Description今年暑假杭电ACM集训队第一次组成女生队,其中
2016-01-23 19:59:30
1423
原创 C++ string大小写转换以及transform,tolower,toupper,用法
C++中没有提供string类型的大小写转换,今天写了一下,方法很多。当然可以s[i]+32 or s[i]-32 #include <iostream>#include <string>#include <cctype>#include <algorithm>using namespace std;int main()...
2016-01-20 00:11:12
38846
3
转载 codeblocks快捷键(转)
==日常编辑==• 按住Ctrl滚滚轮,代码的字体会随你心意变大变小。• 在编辑区按住右键可拖动代码,省去拉(尤其是横向)滚动条之麻烦;相关设置:Mouse Drag Scrolling。• Ctrl+D可复制当前行或选中块。• Ctrl+Shift+C注释掉当前行或选中块,Ctrl+Shift+X则解除注释。• Tab缩进当前行或选中块,Shift+Tab减少缩进。•
2016-01-16 21:43:24
624
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人