- 博客(10)
- 收藏
- 关注
原创 Speed Limit C++
题目描述Bill and Ted are taking a road trip. But the odometer in their car is broken, so they don't know how many miles they have driven. Fortunately, Bill has a working stopwatch, so they can record th...
2018-05-30 17:47:56 441
原创 Humidex C++
题目描述Adapted from Wikipedia, the free encyclopediaThe humidex is a measurement used by Canadian meteorologists to reflect the combined effect of heat and humidity. It differs from the heat index us...
2018-05-30 17:46:49 463
原创 Hangover
题目描述How far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We're assuming that the cards must be perpendicular to the t...
2018-05-30 17:45:52 289
原创 I Think I Need a Houseboat C++
题目描述Fred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the land, he learned that the state of Louisiana is actually shrinking by 50 squ...
2018-05-30 17:44:40 254
原创 Sum of Consecutive Prime Numbers C++
题目描述Some positive integers can be represented by a sum of one or more consecutive prime numbers. How many such representations does a given positive integer have? For example, the integer 53 has two r...
2018-05-30 17:43:34 470
原创 Doubles C++
题目描述As part of an arithmetic competency program, your students will be given randomly generated lists of from 2 to 15 unique positive integers and asked to determine how many items in each list are tw...
2018-05-30 17:42:08 277
原创 Financial Management C++
题目描述Larry graduated this year and finally has a job. He's making a lot of money, but somehow never seems to have enough. Larry has decided that he needs to grab hold of his financial portfolio and sol...
2018-05-30 17:41:09 288
原创 小孩报数问题(循环链表)
题目描述有N个小孩围成一圈,给他们从1开始依次编号,现指定从第W个开始报数,报到第S个时,该小孩出列,然后从下一个小孩开始报数,仍是报到S个出列,如此重复下去,直到所有的小孩都出列(总人数不足S个时将循环报数),求小孩出列的顺序。输入第一行输入小孩的人数N(N<=64) 接下来每行输入一个小孩的名字(人名不超过15个字符) 最后一行输入W,S (W < N),用逗号","间隔输出按人名...
2018-05-30 17:39:57 1930 1
原创 下一个最大元素
题目描述给定一个数组, 找到每个元素右边第一个比它大的元素。输入第一行一个整数n,表示数组大小,接下来一行n个正整数,表示数组中的元素值。数据范围:n<=100000, 数组中元素值不超过1000000000。输出输出一行n个整数表示每个元素右边第一个比它大的元素,如果没有输出-1。样例输入42 1 3 4样例输出3 3 4 -1#include<iostream>using...
2018-05-30 17:38:40 288
原创 最小栈
题目描述设计一个支持 push,pop,top 操作,并能在常数时间内检索到最小元素的栈。push(x) -- 将元素x推入栈中。pop() -- 删除栈顶的元素。top() -- 获取栈顶元素。getMin() -- 检索栈中的最小元素。输入第一行一个整数q,表示操作数量。接下来q行,每行为题目四中操作的一种。分别为push xpop topgetMin数据范围:q<=100000, |x...
2018-05-30 17:36:48 246
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人