整理上次写的题目:A:For a positive integernlet's define a functionf:f(n)?= -?1?+?2?-?3?+?..?+?(?-?1)nnYour task is to calculatef(n)for a given integern.InputT....
分类:
其他好文 时间:
2014-11-13 22:28:30
阅读次数:
174
Given an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Your algorithm should ru...
分类:
其他好文 时间:
2014-11-13 22:11:38
阅读次数:
141
DescriptionFor a positive integer N , the digit-sum of N is defined as the sum of N itself and its digits. When M is the digitsum of N , we call N a g...
分类:
其他好文 时间:
2014-11-13 12:48:57
阅读次数:
172
Crossed MatchingsTime Limit: 2 Seconds Memory Limit: 65536 KBThere are two rows of positive integer numbers. We can draw one line segment between any....
分类:
其他好文 时间:
2014-11-11 18:49:49
阅读次数:
199
Problem DescriptionYou just need to calculate the sum of the formula: 1^2+3^2+5^2+……+ n ^2.InputIn each case, there is an odd positive integer n.Outpu...
分类:
其他好文 时间:
2014-11-10 23:09:21
阅读次数:
271
An Easy ProblemDescriptionAs we known, data stored in the computers is in binary form. The problem we discuss now is about the positive integers and i...
分类:
其他好文 时间:
2014-11-10 17:39:08
阅读次数:
196
Maximum Sum
Time Limit:500MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u
Submit Status
Description
Given a 2-dimensional array of positive and negative integers, find the sub-rect...
分类:
其他好文 时间:
2014-11-10 10:04:21
阅读次数:
119
Given a string and a positive integer d. Some characters may be repeated in the given string. Rearrange characters of the given string such that the s...
分类:
其他好文 时间:
2014-11-08 16:27:57
阅读次数:
186
Number SequenceDescriptionA single positive integer i is given. Write a program to find the digit located in the position i in the sequence of number ...
分类:
其他好文 时间:
2014-11-08 10:25:14
阅读次数:
209
sum = sigma num[i] (1
s[i] = sigam num[j] (1
找到所有满足s[i]*2 =sum-s[i] ,s[i] = 2*(sum-s[i])。然后枚举累加一下。
卧槽,可是题意里明明说每个 piece 里 都要有positive interge。
可是去了这个限制就过了啊。
#include
#include
#include
#include...
分类:
其他好文 时间:
2014-11-06 21:59:33
阅读次数:
231