自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(259)
  • 资源 (1)
  • 收藏
  • 关注

原创 Leetcode||25.Reverse Nodes in k-Group

25. Reverse Nodes in k-Group Total Accepted: 76349Total Submissions: 259383Difficulty: HardContributors: Admin Given a linked list, reverse the nodes of a linked list k at

2016-11-26 12:43:05 252

原创 Leetcode||24.Swap Nodes in Pairs

24. Swap Nodes in Pairs Total Accepted: 133469Total Submissions: 361910Difficulty: EasyContributors: Admin Given a linked list, swap every two adjacent nodes and return its hea

2016-11-22 21:04:34 317

原创 Leetcode||23. Merge k Sorted Lists

23. Merge k Sorted Lists Total Accepted: 116272Total Submissions: 455841Difficulty: HardContributors: Admin Merge k sorted linked lists and return it as one sorted list. Analyz

2016-11-20 16:01:42 282

原创 Leetcode||22.Generate Parentheses

22. Generate Parentheses Total Accepted: 116853Total Submissions: 284854Difficulty: MediumContributors: Admin Given n pairs of parentheses, write a function to generate all c

2016-11-20 11:47:51 338

原创 Leetcode||21.Merge Two Sorted Lists

21. Merge Two Sorted Lists Total Accepted: 171824Total Submissions: 457798Difficulty: EasyContributors: Admin Merge two sorted linked lists and return it as a new list. The new

2016-11-20 10:35:33 262

原创 Leetcode||20.Valid Parentheses

20. Valid Parentheses Total Accepted: 149046Total Submissions: 471508Difficulty: EasyContributors: Admin Given a string containing just the characters '(', ')','{', '}',

2016-11-20 09:57:37 292

原创 Leetcode||19.Remove Nth Node From End of List

19. Remove Nth Node From End of List Total Accepted: 143705Total Submissions: 452926Difficulty: EasyContributors: Admin Given a linked list, remove the nth node from the end of

2016-11-16 21:41:50 282

原创 Leetcode||18. 4Sum

18. 4Sum Total Accepted: 94146Total Submissions: 371949Difficulty: MediumContributors: Admin Given an array S of n integers, are there elements a,b, c, and d in S such that a

2016-11-12 16:57:05 337

原创 Leetcode||17.Letter Combinations of a Phone Number

17. Letter Combinations of a Phone Number Total Accepted: 110517Total Submissions: 349102Difficulty: MediumContributors: Admin Given a digit string, return all possible letter

2016-11-12 12:31:55 341

原创 Leetcode||16.3Sum Closest

16. 3Sum Closest Total Accepted: 101121Total Submissions: 333507Difficulty: MediumContributors: Admin Given an array S of n integers, find three integers in S such that the sum

2016-11-08 21:37:04 323

原创 Leetcode||15.3Sum

15. 3Sum Total Accepted: 158805Total Submissions: 777436Difficulty: MediumContributors: Admin Given an array S of n integers, are there elements a,b, c in S such that a + b +

2016-11-06 16:27:00 334

原创 Leetcode||14.Longest Common Prefix

4. Longest Common Prefix Total Accepted: 132475Total Submissions: 440240Difficulty: EasyContributors: Admin Write a function to find the longest common prefix string amongs

2016-11-05 19:29:07 438

原创 Leetcode||13.Roman to Integer

13. Roman to Integer Total Accepted: 113581Total Submissions: 266090Difficulty: EasyContributors: Admin Given a roman numeral, convert it to an integer.Input is guaranteed to

2016-11-05 12:38:51 293

原创 Leetcode||12.Integer to Roman

12. Integer to Roman Total Accepted: 82704Total Submissions: 196713Difficulty: MediumContributors: Admin Given an integer, convert it to a roman numeral.Input is guaranteed t

2016-11-01 21:39:47 285

原创 Leetcode||11.Container With Most Water

11. Container With Most Water Total Accepted: 101382Total Submissions: 283131Difficulty: MediumContributors: Admin Given n non-negative integers a1, a2, ...,an, where each re

2016-10-29 16:20:05 339

原创 Leetcode||10.Regular Expression Matching

10. Regular Expression Matching Total Accepted: 104860Total Submissions: 452500Difficulty: HardContributors: Admin Implement regular expression matching with support for '.' an

2016-10-27 22:48:38 347

原创 Leetcode||9. Palindrome Number

9. Palindrome Number Total Accepted: 159681Total Submissions: 475665Difficulty: EasyContributors: Admin Determine whether an integer is a palindrome. Do this without extra spac

2016-10-26 21:57:32 286

原创 Leetcode||8.String to Integer (atoi)

8. String to Integer (atoi) Total Accepted: 131207Total Submissions: 951920Difficulty: EasyContributors: Admin Implement atoi to convert a string to an integer.Hint: Carefull

2016-10-23 18:25:37 272

原创 Leetcode||7. Reverse Integer

7. Reverse Integer Total Accepted: 178306Total Submissions: 751845Difficulty: EasyContributors: Admin Reverse digits of an integer.Example1: x = 123, return 321Example2: x

2016-10-23 14:28:04 385

原创 Leetcode||6. ZigZag Conversion

6. ZigZag Conversion Total Accepted: 116139Total Submissions: 455261Difficulty: EasyContributors: Admin The string "PAYPALISHIRING" is written in a zigzag pattern on a given nu

2016-10-22 15:56:17 243

原创 Leetcode||5.Longest Palindromic Substring

5. Longest Palindromic Substring Total Accepted: 140882Total Submissions: 588176Difficulty: MediumContributors: Admin Given a string S, find the longest palindromic substring i

2016-10-18 23:07:25 299

原创 Leetcode||4.Median of Two Sorted Arrays

4. Median of Two Sorted Arrays Total Accepted: 122172Total Submissions: 604583Difficulty: HardContributors: Admin There are two sorted arrays nums1 and nums2 of size m and n re

2016-10-16 18:49:43 363

原创 LeetCode||3. Longest Substring Without Repeating Characters

3. Longest Substring Without Repeating Characters Total Accepted: 200515Total Submissions: 860059Difficulty: MediumContributors: Admin Given a string, find the length of the lo

2016-10-15 21:00:52 265

原创 LeetCode||2.Add Two Numbers

2. Add Two NumbersTotal Accepted: 193274Total Submissions: 763487Difficulty: MediumYou are given two linked lists representing two non-negative numbers. The digits are stored i

2016-10-11 21:44:16 486

原创 LeetCode||1.Two Sum

1. Two SumTotal Accepted: 317935Total Submissions: 1163044Difficulty: EasyGiven an array of integers, return indices of the two numbers such that they add up to a specific targ

2016-10-07 18:13:46 331

原创 一些数值类型的取值范围

关于int,long等数值范围,原来以为很小,其实还是挺大的。unsigned   int   0~4294967295   int   -2147483648~2147483647 unsigned long 0~4294967295long   -2147483648~2147483647long long的最大值:9223372036854775807long l

2016-09-05 10:13:21 644

原创 1020. 月饼 (25)

月饼是中国人在中秋佳节时吃的一种传统食品,不同地区有许多不同风味的月饼。现给定所有种类月饼的库存量、总售价、以及市场的最大需求量,请你计算可以获得的最大收益是多少。注意:销售时允许取出一部分库存。样例给出的情形是这样的:假如我们有3种月饼,其库存量分别为18、15、10万吨,总售价分别为75、72、45亿元。如果市场的最大需求量只有20万吨,那么我们最大收益策略应该是卖出全部15万吨第2种月饼

2015-11-25 20:39:39 587

原创 1019. 数字黑洞 (20)

给定任一个各位数字不完全相同的4位正整数,如果我们先把4个数字按非递增排序,再按非递减排序,然后用第1个数字减第2个数字,将得到一个新的数字。一直重复这样做,我们很快会停在有“数字黑洞”之称的6174,这个神奇的数字也叫Kaprekar常数。例如,我们从6767开始,将得到7766 - 6677 = 10899810 - 0189 = 96219621 - 1269 = 8352

2015-11-25 20:37:56 346

原创 1018. 锤子剪刀布 (20)

大家应该都会玩“锤子剪刀布”的游戏:两人同时给出手势,胜负规则如图所示:现给出两人的交锋记录,请统计双方的胜、平、负次数,并且给出双方分别出什么手势的胜算最大。输入格式:输入第1行给出正整数N(5),即双方交锋的次数。随后N行,每行给出一次交锋的信息,即甲、乙双方同时给出的的手势。C代表“锤子”、J代表“剪刀”、B代表“布”,第1个字母代表甲方,第2个代表乙方,中间有1个空格。

2015-11-25 20:36:04 394

原创 1017. A除以B (20)

本题要求计算A/B,其中A是不超过1000位的正整数,B是1位正整数。你需要输出商数Q和余数R,使得A = B * Q + R成立。输入格式:输入在1行中依次给出A和B,中间以1空格分隔。输出格式:在1行中依次输出Q和R,中间以1空格分隔。输入样例:123456789050987654321 7输出样例:17636684150141093474 3

2015-11-25 20:34:16 333

原创 1016. 部分A+B (15)

正整数A的“DA(为1位整数)部分”定义为由A中所有DA组成的新整数PA。例如:给定A = 3862767,DA = 6,则A的“6部分”PA是66,因为A中有2个6。现给定A、DA、B、DB,请编写程序计算PA + PB。输入格式:输入在一行中依次给出A、DA、B、DB,中间以空格分隔,其中0 10。输出格式:在一行中输出PA + PB的值。输入样例1:3862767

2015-11-25 20:32:03 314

原创 1015. 德才论 (25)

宋代史学家司马光在《资治通鉴》中有一段著名的“德才论”:“是故才德全尽谓之圣人,才德兼亡谓之愚人,德胜才谓之君子,才胜德谓之小人。凡取人之术,苟不得圣人,君子而与之,与其得小人,不若得愚人。”现给出一批考生的德才分数,请根据司马光的理论给出录取排名。输入格式:输入第1行给出3个正整数,分别为:N(5),即考生总数;L(>=60),为录取最低分数线,即德分和才分均不低于L的考生才有资格被

2015-11-22 19:49:32 318

原创 1014. 福尔摩斯的约会 (20)

大侦探福尔摩斯接到一张奇怪的字条:“我们约会吧!3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm”。大侦探很快就明白了,字条上奇怪的乱码实际上就是约会的时间“星期四 14:04”,因为前面两字符串中第1对相同的大写英文字母(大小写有区分)是第4个字母'D',代表星期四;第2对相同的字符是'E',那是第5个英文字母,代表一天里的第14个钟头(

2015-11-22 19:44:59 361

原创 1013. 数素数 (20)

令Pi表示第i个素数。现任给两个正整数M 4,请输出PM到PN的所有素数。输入格式:输入在一行中给出M和N,其间以空格分隔。输出格式:输出从PM到PN的所有素数,每10个数字占1行,其间以空格分隔,但行末不得有多余空格。输入样例:5 27输出样例:11 13 17 19 23 29 31 37 41 4347 53 59 61 67 71 73 79 83 89

2015-11-22 19:42:19 952 1

原创 1012. 数字分类 (20)

给定一系列正整数,请按要求对数字进行分类,并输出以下5个数字:A1 = 能被5整除的数字中所有偶数的和;A2 = 将被5除后余1的数字按给出顺序进行交错求和,即计算n1-n2+n3-n4...;A3 = 被5除后余2的数字的个数;A4 = 被5除后余3的数字的平均数,精确到小数点后1位;A5 = 被5除后余4的数字中最大数字。输入格式:每个输入包含1个测试用例。每个测试用例先给出一个不

2015-11-22 19:37:59 525

原创 1011. A+B和C (15)

给定区间[-231, 231]内的3个整数A、B和C,请判断A+B是否大于C。输入格式:输入第1行给出正整数T(输出格式:对每组测试用例,在一行中输出“Case #X: true”如果A+B>C,否则输出“Case #X: false”,其中X是测试用例的编号(从1开始)。输入样例:41 2 32 3 42147483647 0 21474836460 -21474

2015-11-22 19:33:36 382

原创 1010. 一元多项式求导 (25)

设计函数求一元多项式的导数。(注:xn(n为整数)的一阶导数为n*xn-1。)输入格式:以指数递降方式输入多项式非零项系数和指数(绝对值均为不超过1000的整数)。数字间以空格分隔。输出格式:以与输入相同的格式输出导数多项式非零项的系数和指数。数字间以空格分隔,但结尾不能有多余空格。注意“零多项式”的指数和系数都是0,但是表示为“0 0”。输入样例:3 4 -5 2 6 1 -2

2015-11-19 20:35:19 450

原创 1009. 说反话 (20)

给定一句英语,要求你编写程序,将句中所有单词的顺序颠倒输出。输入格式:测试输入包含一个测试用例,在一行内给出总长度不超过80的字符串。字符串由若干单词和若干空格组成,其中单词是由英文字母(大小写有区分)组成的字符串,单词之间用1个空格分开,输入保证句子末尾没有多余的空格。输出格式:每个测试用例的输出占一行,输出倒序后的句子。输入样例:Hello World Here I Come

2015-11-19 20:25:13 301

原创 1008. 数组元素循环右移问题 (20)

一个数组A中存有N(N>0)个整数,在不允许使用另外数组的前提下,将每个整数循环向右移M(M>=0)个位置,即将A中的数据由(A0 A1……AN-1)变换为(AN-M …… AN-1 A0 A1……AN-M-1)(最后M个数循环移至最前面的M个位置)。如果需要考虑程序移动数据的次数尽量少,要如何设计移动的方法?输入格式:每个输入包含一个测试用例,第1行输入N ( 1=0);第2行输入N个整数,

2015-11-19 20:21:10 322

原创 1007. 素数对猜想 (20)

让我们定义 dn 为:dn = pn+1 - pn,其中 pi 是第i个素数。显然有 d1=1 且对于n>1有 dn 是偶数。“素数对猜想”认为“存在无穷多对相邻且差为2的素数”。现给定任意正整数N (5),请计算不超过N的满足猜想的素数对的个数。输入格式:每个测试输入包含1个测试用例,给出正整数N。输出格式:每个测试用例的输出占一行,不超过N的满足猜想的素数对的个数。输入样例:

2015-11-19 20:18:07 381

cffi-1.4.1.tar.gz资源Linux版本

cffi-1.4.1.tar.gz资源Linux版本,主要方便各位开发人员的下载

2018-07-06

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除