剑指Offer-11 旋转数组的最小数字

旋转数组的最小数字(剑指Offer-11) 题面 把一个数组最开始的若干个元素搬到数组的末尾,我们称之为数组的旋转。输入一个递增排序的数组的一个旋转,输出旋转数组的最小元素。例如,数组[3,4,5,1,2] 为[1,2,3,4,5] 的一个旋转,该数组的最小值为1。 ...

2021-03-24 · Lordash

PATA-1010 Radix

Radix(PATA-1010) 题面 Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is yes, if 6 is a decimal number and 110 is a binary number. Now for any pair of positive integers N1 and N2, your task is to find the radix of one number while that of the other is given. 输入 Each input file contains one test case. Each case occupies a line which contains 4 positive integers: ...

2020-09-02 · Lordash

POJ-3273 Monthly Expense

Monthly Expense (POJ - 3273) 题面 Farmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤ moneyi ≤ 10,000) that he will need to spend each day over the next N (1 ≤ N ≤ 100,000) days. FJ wants to create a budget for a sequential set of exactly M (1 ≤ M ≤ N) fiscal periods called “fajomonths”. Each of these fajomonths contains a set of 1 or more consecutive days. Every day is contained in exactly one fajomonth. ...

2018-04-22 · Lordash

POJ-3122 Pie

Pie (POJ - 3122) 题面 My birthday is coming up and traditionally I’m serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my party and each of them gets a piece of pie. This should be one piece of one pie, not several small pieces since that looks messy. This piece can be one whole pie though. ...

2018-04-22 · Lordash