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 (≤10​5​​), 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 [难]的更多相关文章

  1. PAT 1117 Eddington Number

    British astronomer Eddington liked to ride a bike. It is said that in order to show off his skill, h ...

  2. 1117 Eddington Number (25 分)

    1117 Eddington Number (25 分) British astronomer Eddington liked to ride a bike. It is said that in o ...

  3. PAT 甲级 1117 Eddington Number

    https://pintia.cn/problem-sets/994805342720868352/problems/994805354762715136 British astronomer Edd ...

  4. 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 ...

  5. 1117. Eddington Number(25)

    British astronomer Eddington liked to ride a bike. It is said that in order to show off his skill, h ...

  6. PAT甲题题解-1117. Eddington Number(25)-(大么个大水题~)

    如题,大水题...贴个代码完事,就这么任性~~ #include <iostream> #include <cstdio> #include <algorithm> ...

  7. 【PAT甲级】1117 Eddington Number (25分)

    题意: 输入一个正整数N(<=100000),接着输入N个非负整数.输出最大的整数E使得有至少E个整数大于E. AAAAAccepted code: #define HAVE_STRUCT_TI ...

  8. PAT 1024 Palindromic Number[难]

    A number that will be the same when it is written forwards or backwards is known as a Palindromic Nu ...

  9. 1117 Eddington Number

    题意:给出了N个数字,确定一个尽可能大的数字E,要求这N个数字中大于E的数字有E个. 思路: 乍一看不知道题目在说啥.静下心来多读几遍题目,在草稿纸上比划比划,发现是个大水题.解释一下样例,原始序列为 ...

随机推荐

  1. 【zookeeper】 zookeeper 集群搭建

    集群搭建环境: 发行版:CentOS-6.6 64bit 内核:2.6.32-504.el6.x86_64 CPU:intel-i7 3.6G 内存:2G 集群搭建步骤: 1. 确保机器安装了jdk ...

  2. [spring] org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljav 解决

    严重: Exception sending context initialized event to listener instance of class org.springframework.we ...

  3. diff命令的参数详解和实例

    diff命令参数: diff - 找出两个文件的不同点 总览 diff [选项] 源文件 目标文件 描述 在最简单的情况是, diff 比较两个文件的内容 (源文件 和 目标文件). 文件名可以是 - ...

  4. K-mean和k-mean++

    (1)k-mean聚类 k-mean聚类比较容易理解就是一个计算距离,找中心点,计算距离,找中心点反复迭代的过程, 给定样本集D={x1,x2,...,xm},k均值算法针对聚类所得簇划分C={C1, ...

  5. 【BZOJ4424】Cf19E Fairy DFS树

    [BZOJ4424]Cf19E Fairy Description 给定 n 个点,m 条边的无向图,可以从图中删除一条边,问删除哪些边可以使图变成一个二分图. Input 第 1 行包含两个整数 n ...

  6. 【BZOJ4523】[Cqoi2016]路由表 Trie树模拟

    [BZOJ4523][Cqoi2016]路由表 Description 路由表查找是路由器在转发IP报文时的重要环节.通常路由表中的表项由目的地址.掩码.下一跳(Next Hop)地址和其他辅助信息组 ...

  7. iOS UITextField输入后隐藏键盘

    1.首先在Interface Builder中选择TextFields,然后在Text Field Attributes中找到Text Input Traits,选择Return Key为done. ...

  8. IIS7的HTTP到HTTPS的重定向

    方法一设置IIS 从HTTP到HTTPS的IIS7中的所有流量重定向,将确保用户始终安全地访问该网站.有许多不同的方法来设置一个IIS7从HTTP重定向到HTTPS和一些比别人更好.理想的HTTP到H ...

  9. jdbc将数据库连接信息放置配置文件中

    目录如下: jdbcConnection.java: package jdbc01; import java.io.InputStream; import java.sql.Connection; i ...

  10. INSERT高级应用

    INSERT INTO departments VALUES (departments_seq.nextval, 'Entertainment', 162, 1400); INSERT INTO em ...