PAT 1117 Eddington Number [难]
1117 Eddington Number (25 分)
British astronomer Eddington liked to ride a bike. It is said that in order to show off his skill, he has even defined an "Eddington number", E -- that is, the maximum integer E such that it is for E days that one rides more than E miles. Eddington's own E was 87.
Now given everyday's distances that one rides for N days, you are supposed to find the corresponding E (≤N).
Input Specification:
Each input file contains one test case. For each case, the first line gives a positive integer N (≤105), the days of continuous riding. Then N non-negative integers are given in the next line, being the riding distances of everyday.
Output Specification:
For each case, print in a line the Eddington number for these N days.
Sample Input:
10
6 7 6 9 3 10 8 2 7 8
Sample Output:
6
题目大意:E是有E天骑行超过E的最大整数。
对于本题输出6,有7 9 10 8 7 8这6天是超过6的,等于6的不算,所以得出了6.
//发现自己并不会写,不会写啊!!好难啊!这个逻辑!!!
柳神的解答:
//虽然题干挺短,但是逻辑挺难的,
PAT 1117 Eddington Number [难]的更多相关文章
- PAT 1117 Eddington Number
British astronomer Eddington liked to ride a bike. It is said that in order to show off his skill, h ...
- 1117 Eddington Number (25 分)
1117 Eddington Number (25 分) British astronomer Eddington liked to ride a bike. It is said that in o ...
- PAT 甲级 1117 Eddington Number
https://pintia.cn/problem-sets/994805342720868352/problems/994805354762715136 British astronomer Edd ...
- PAT A1117 Eddington Number (25 分)——数学题
British astronomer Eddington liked to ride a bike. It is said that in order to show off his skill, h ...
- 1117. Eddington Number(25)
British astronomer Eddington liked to ride a bike. It is said that in order to show off his skill, h ...
- PAT甲题题解-1117. Eddington Number(25)-(大么个大水题~)
如题,大水题...贴个代码完事,就这么任性~~ #include <iostream> #include <cstdio> #include <algorithm> ...
- 【PAT甲级】1117 Eddington Number (25分)
题意: 输入一个正整数N(<=100000),接着输入N个非负整数.输出最大的整数E使得有至少E个整数大于E. AAAAAccepted code: #define HAVE_STRUCT_TI ...
- PAT 1024 Palindromic Number[难]
A number that will be the same when it is written forwards or backwards is known as a Palindromic Nu ...
- 1117 Eddington Number
题意:给出了N个数字,确定一个尽可能大的数字E,要求这N个数字中大于E的数字有E个. 思路: 乍一看不知道题目在说啥.静下心来多读几遍题目,在草稿纸上比划比划,发现是个大水题.解释一下样例,原始序列为 ...
随机推荐
- makefile--变量的使用(二)
原创博文,转载请标明出处--周学伟http://www.cnblogs.com/zxouxuewei/ 仔细研究我们的之前Makefile发现,我们还有改进的地方,就是此处: target_bin : ...
- Messages: No result defined for action cn.itcast.oa.test.TestAction and result SUCCESS
Struts Problem Report Struts has detected an unhandled exception: Messages: No result defined for ac ...
- python 协程(单线程中的异步调用)(转廖雪峰老师python教程)
协程,又称微线程,纤程.英文名Coroutine. 协程的概念很早就提出来了,但直到最近几年才在某些语言(如Lua)中得到广泛应用. 子程序,或者称为函数,在所有语言中都是层级调用,比如A调用B,B在 ...
- 多进程模块:multiprocessing
多进程: (1) 前面我们学习的多线程,其实算不上真正的多线程,即使你开了很多个线程,在同一时间内只能有一个CPU核数来处理一个线程(2) 在 python 中,多进程算得上是真正的多线程,假设你的C ...
- Linux同步网络时间
1.date '+%Y%M%D' 按照格式显示当前日期,结果如下: [root@LAMP ~]# date "+%Y-%m-%d %H:%M:%S" -- :: 2.date -s ...
- Swift-Swift的Singleton三种写法
第一种: import Foundation class SingletonA : NSObject { static let sharedInstance: SingletonA = Singlet ...
- img-图片二进制流 64位前端显示
碰到的场景:因为使用iframe子窗口打开,多张的二维码图片创建方法调用,导致页面打开缓慢, 所以将调取方式转换成<img src="data:image/png;base64,@it ...
- 学习C++服务端一:MySql与C++
mysql学习: http://www.cnblogs.com/cy163/archive/2008/10/16/1312277.html http://developer.51cto.com/art ...
- 【Android N 7.1.1】 ActivityManagerService 获取cpu状态
void updateCpuStatsNow() { synchronized (mProcessCpuTracker) { mProcessCpuMutexFree.set(false); fina ...
- Xcode里修改工程名、类名、批量修改变量名
转:http://blog.csdn.net/yuedong56/article/details/13767001 一.修改工程名: 1.点击工程,右键,选择如图选项. 2.右侧如图位置,修改工程名. ...