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个. 思路: 乍一看不知道题目在说啥.静下心来多读几遍题目,在草稿纸上比划比划,发现是个大水题.解释一下样例,原始序列为 ...
随机推荐
- opencascade读取iges并用vtk离散的一些问题
近期抽时间在弄iges文件内容读取的工作.然后将其离散化在vtk中能够显示处理以及兴许的一些工作.主要目的是识别CAD文件导出的模型,然后进行离散处理.方便兴许的处理.离散工作比較简单.opencas ...
- [Android系列—] 4. 加入操作栏(Action Bar)
前言 操作栏是最重要的设计元素之中的一个,使用它来实现你的应用程序活动.通过提供多种用户界面功能, 使应用程序高速和其它的Andorid应用程序一致, 以便被用户熟悉和接受. 主要功能包括: 1. 标 ...
- HTML&CSS精选笔记_HTML入门
HTML入门 什么是HTML HTML基本文档格式 HTML文档的基本格式,其中主要包括<!DOCTYPE>文档类型声明.<html>根标记.<head>头部标记. ...
- 告别C#,进入了下一个阶段的学习啦
嘿嘿,今天我们结束了C#的基础的学习,开始啦第二个阶段的学习,就是对SQL Server的学习.今天又是一个周一,又是一个新的开始,感觉我们都是一周一周的计算,而不是每天到这个点就是告别了今天的生活啦 ...
- mysql的介绍和安装
本节内容 1.数据库介绍 2.mysql管理 3.mysql数据类型 4.常用mysql命令 创建数据库 外键 增删改查表 5.事务 6.索引 1.数据库介绍 什么是数据库? 数据库(Database ...
- JS-【同页面多次调用】tab选项卡封装
这两天遇到一个页面,同一个页面中同一个特效会用好多次,比如tab,比如轮播等.我又不想很不负责任的复制一遍代码,那样页面臃肿,自己心里也堵得慌.于是就想着把代码封装起来多次调用. 对于封装,只在公开课 ...
- Linux性能监控——CPU,Memory,IO,Network
版权声明:本文由刘爽原创文章,转载请注明出处: 文章原文链接:https://www.qcloud.com/community/article/107 来源:腾云阁 https://www.qclou ...
- glassfish任意文件读取漏洞解析
一.背景: glassfish是一款java编写的跨平台的开源的应用服务器. 二.漏洞原理: 与宽字节SQL注入一致,都是由于unicode编码歧义导致的.具体payload如下构造: http:// ...
- saltstack之syndic的配置
author: headsen chen date: 2018-08-04 22:22:09 1,架构 2,配置 2.1,配置master: yum -y install epel-relea ...
- Egret5.2.2 微信小游戏行的示例排行榜
Egret5.2.2版本发布微信小游戏后,在开放数据域有一个默认排行榜.这个文件夹代码+图大小就22kb. 排行榜的效果就是示范用的,很丑...带翻页. 代码如下,基本就是使用canvas渲染了一个排 ...