03 2018 档案
摘要:Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the pr...
阅读全文
摘要:Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be...
阅读全文
摘要:Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3...
阅读全文
摘要:The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern ...
阅读全文
摘要:CoinsTime Limit: 3000MS Memory Limit: 30000KTotal Submissions: 40853 Accepted: 13835DescriptionPeople in Silverland use coins.They hav...
阅读全文
摘要:Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example:Input: "bab...
阅读全文
摘要:There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run tim...
阅读全文
摘要:SumsetsTime Limit: 2000MS Memory Limit: 200000KTotal Submissions: 21492 Accepted: 8355DescriptionFarmer John commanded his cows to sea...
阅读全文
摘要:Milking TimeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 12004 Accepted: 5067DescriptionBessie is such a hard-working cow...
阅读全文
摘要:Apple CatchingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 14130 Accepted: 6905DescriptionIt is a little known fact that ...
阅读全文
摘要:Cow BowlingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 21242 Accepted: 14046DescriptionThe cows don't use actual bowling...
阅读全文
摘要:0-1 背包问题:给定 n 种物品和一个容量为 C 的背包,物品 i 的重量是 wi,其价值为 vi 。问:应该如何选择装入背包的物品,使得装入背包中的物品的总价值最大?递归解法,对每个物品是否装入背包进行搜索:int n,w;int w[maxn],v[maxn];...
阅读全文
摘要:Fence RepairTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 56309 Accepted: 18537DescriptionFarmer John wants to repair a sm...
阅读全文
摘要:Saruman's ArmyTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 12700 Accepted: 6390DescriptionSaruman the White must lead his...
阅读全文
摘要:Best Cow LineTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 29339 Accepted: 7861DescriptionFJ is about to take his N (1 ≤ N...
阅读全文
摘要:问题主题:区间调度问题问题描述:有n项工作,每项工作分别在si开始,ti结束。对每项工作,你都可以选择参加或不参加,但选择了参加某项工作就必须至始至终参加全程参与,即参与工作的时间段不能有重叠(即使开始的时间和结束的时间重叠都不行)。限制条件:1#include#in...
阅读全文
摘要:给定一个大小为N*M的迷宫,由通道('.')和墙壁('#')组成,其中通道S表示起点,通道G表示终点,每一步移动可以达到上下左右中不是墙壁的位置。试求出起点到终点的最小步数。(本题假定迷宫是有解的)(N,M#include#includeusing namespace...
阅读全文
摘要:总时间限制: 1000ms内存限制: 65536kB描述Due to recent rains, water has pooled in various places in Farmer John's field, which is represented by a ...
阅读全文
摘要:部分和问题时间限制:1000 ms | 内存限制:65535 KB难度:2描述给定整数a1、a2、.......an,判断是否可以从中选出若干数,使它们的和恰好为K。输入首先,n和k,n表示数的个数,k表示数的和。接着一行n个数。(1using namespace...
阅读全文
摘要:试题描述你的朋友提议玩一个游戏:将写有数字的n 个纸片放入口袋中,你可以从口袋中抽取4 次纸片,每次记下纸片上的数字后都将其放回口袋中。如果这4 个数字的和是m,就是你赢,否则就是你的朋友赢。你挑战了好几回,结果一次也没赢过,于是怒而撕破口袋,取出所有纸片,检查自己是...
阅读全文
摘要:总时间限制: 1000ms内存限制: 65536kB描述An army of ants walk on a horizontal pole of length l cm, each with a constant speed of 1 cm/s. When a wal...
阅读全文
摘要:Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", ...
阅读全文
摘要:11-散列1 电话聊天狂人(25 分)给定大量手机用户通话记录,找出其中通话次数最多的聊天狂人。输入格式:输入首先给出正整数N(≤105),为通话记录条数。随后N行,每行给出一条通话记录。简单起见,这里只列出拨出方和接收方的11位数字构成的手机号码,其中以空格分...
阅读全文
摘要:You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of th...
阅读全文
摘要:Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each inpu...
阅读全文
摘要:10-排序6 Sort with Swap(0, i)(25 分)Given any permutation of the numbers {0, 1, 2,..., N−1}, it is easy to sort them in increasing order....
阅读全文
摘要:10-排序5 PAT Judge(25 分)The ranklist of PAT is generated from the status list, which shows the scores of the submissions. This time you ...
阅读全文
摘要:10-排序4 统计工龄(20 分)给定公司N名员工的工龄,要求按工龄增序输出每个工龄段有多少员工。输入格式:输入首先给出正整数N(≤105),即员工总人数;随后给出N个整数,即每个员工的工龄,范围在[0, 50]。输出格式:按工龄的递增顺序输出每个工龄的员工个数...
阅读全文
摘要:09-排序3 Insertion or Heap Sort(25 分)According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and gr...
阅读全文
摘要:09-排序2 Insert or Merge(25 分)According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growing a...
阅读全文
摘要:09-排序1 排序(25 分)给定N个(长整型范围内的)整数,要求输出从小到大排序后的结果。本题旨在测试各种不同的排序算法在各种数据情况下的表现。各组测试数据特点如下:数据1:只有1个元素;数据2:11个不相同的整数,测试基本正确性;数据3:103个随机整数;数据4:...
阅读全文

浙公网安备 33010602011771号