
ACM&PAT
mapw1993
工作之余来搞搞。
展开
-
[PAT (Advanced Level) ]1008. Elevator 解题文档
1008. Elevator (20)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueThe highest building in our city has only one ele原创 2015-10-14 22:43:29 · 460 阅读 · 0 评论 -
[PAT (Advanced Level) ]1027. Colors in Mars 解题文档
1027. Colors in Mars (20)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YuePeople in Mars represent the colors in thei原创 2015-10-14 16:25:59 · 399 阅读 · 0 评论 -
[PAT (Advanced Level) ]1035. Password 解题文档
1035. Password (20)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueTo prepare for PAT, the judge sometimes has to ge原创 2015-10-13 22:54:19 · 495 阅读 · 0 评论 -
[PAT (Advanced Level) ]1006. Sign In and Sign Out解题文档
1006. Sign In and Sign Out (25)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueAt the beginning of every day, the原创 2015-10-14 17:58:09 · 397 阅读 · 0 评论 -
[PAT (Advanced Level) ]1009. Product of Polynomials 解题文档
1009. Product of Polynomials (25)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueThis time, you are supposed to find原创 2015-10-15 00:49:41 · 477 阅读 · 0 评论 -
[OJ]24点游戏之递归实现(JAVA)
题目描述问题描述:给出4个1-10的数字,通过加减乘除,得到数字为24就算胜利 输入: 4个1-10的数字。[数字允许重复,测试用例保证无异常数字] 输出: true or false输入描述: 输入4个int整数 输出描述: 返回能否得到24点,能输出true,不能输出false 输入例子: 7 2 1 10输出例子: trueimport java.util.Ar原创 2016-04-12 19:59:55 · 3443 阅读 · 0 评论 -
[Leetcode]解题文档-Longest Substring Without Repeating Characters
[这个问题之前面试中有问到过,还是值得学习下的~]3. Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters.Examples:Given “abcabcbb”, the answer is原创 2016-05-05 02:25:50 · 677 阅读 · 0 评论 -
[Leetcode]解题文档-Median of Two Sorted Arrays
4. Median of Two Sorted ArraysThere are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).原创 2016-05-05 12:04:45 · 717 阅读 · 0 评论 -
[Leetcode]解题文档-Longest Palindromic Substring
5. Longest Palindromic SubstringGiven a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic subst原创 2016-05-05 22:19:16 · 661 阅读 · 0 评论 -
[Leetcode]解题文档-ZigZag Conversion
题目: The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P A H N A原创 2016-05-07 13:41:00 · 983 阅读 · 2 评论 -
[Leetcode]解题文档- Reverse Integer
题目: Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321题目意思很简单,但是需要考虑溢出。 尝试了字符串的解法和纯int数字解,发现后者效率更高,那么笔者是如何判断是否溢出的呢?比如1234567899,正序不溢出,逆序溢出。 做法:先判断位数,原创 2016-05-07 19:55:18 · 1097 阅读 · 0 评论 -
[PAT (Advanced Level) ]1081. Rational Sum 解题文档
1081. Rational Sum (20)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueGiven N rational numbers in the form "numerat原创 2015-10-14 14:47:20 · 534 阅读 · 0 评论 -
[PAT (Advanced Level) ]1007. Maximum Subsequence Sum 解题文档
1007. Maximum Subsequence Sum (25)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueGiven a sequence of K integers { N原创 2015-10-14 20:29:21 · 527 阅读 · 1 评论 -
[PAT (Advanced Level) ]1011. World Cup Betting 解题文档
1011. World Cup Betting (20)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueWith the 2010 FIFA World Cup running, fo原创 2015-10-17 14:09:00 · 380 阅读 · 0 评论 -
[PAT (Advanced Level) ]1012. The Best Rank 解题文档
1012. The Best Rank (25)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueTo evaluate the performance of our first yea原创 2015-10-17 16:31:12 · 427 阅读 · 0 评论 -
[PAT (Advanced Level) ]1013.Battle Over Cities 解题文档
1013. Battle Over Cities (25)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueIt is vitally important to have all the原创 2015-10-21 22:35:22 · 469 阅读 · 0 评论 -
[PAT (Advanced Level) ]1014.Waiting in Line 解题文档
1014. Waiting in Line (30)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueSuppose a bank has N windows open for serv原创 2015-10-23 23:21:25 · 539 阅读 · 0 评论 -
[PAT (Advanced Level) ]1005. Spell It Right解题文档
1005. Spell It Right (20)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueGiven a non-negative integer N, your task i原创 2015-10-12 18:12:03 · 710 阅读 · 1 评论 -
[PAT (Advanced Level) ]1004. Counting Leaves解题文档
1004. Counting Leaves (30)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueA family hierarchy is usually presented by a原创 2015-10-12 16:59:23 · 563 阅读 · 0 评论 -
[PAT (Advanced Level) ]1031.Hello World for U 解题文档
1031. Hello World for U (20)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueGiven any string of N (>=5) characters,原创 2015-10-12 22:51:05 · 478 阅读 · 0 评论 -
[PAT (Advanced Level) ]1015. Reversible Primes 解题文档
1015. Reversible Primes (20)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueA reversible prime in any number system原创 2015-10-12 20:32:37 · 529 阅读 · 0 评论 -
[PAT (Advanced Level) ]1003. Emergency 解题文档
题目链接:http://www.patest.cn/contests/pat-a-practise/10031003. Emergency (25)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, Y原创 2015-10-11 22:58:26 · 515 阅读 · 0 评论 -
[PAT (Advanced Level) ]1023. Have Fun with Numbers 解题文档
1023. Have Fun with Numbers (20)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueNotice that the number 123456789 is原创 2015-10-14 17:03:41 · 616 阅读 · 0 评论 -
[Leetcode]解题文档-String to Integer (atoi)
Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cas原创 2016-05-07 22:19:17 · 861 阅读 · 1 评论