有鱼的声音
来源:互联网 发布:js获取当前元素的位置 编辑:程序博客网 时间:2024/06/11 09:19
1275 有鱼的声音
2012年CCC加拿大高中生信息学奥赛
A fish-finder is a device used by anglers to find fish in a lake. If the fish-finder finds a fish, it will sound an alarm. It uses depth readings to determine whether to sound an alarm. For our purposes, the fish-finder will decide that a fish is swimming past if:
fish-finder是一个神奇的装置供垂钓者使用区在护理钓鱼。如果一个f-f找到了一条鱼,他会响起声音警报。它用鱼的深度来决定是否响警报。我们的目的就是要决定鱼是否通过,具体如下:
• there are four consecutive depth readings which form a strictly increasing sequence (such as 3 4 7 9) (which we will call “Fish Rising”), or
如果连续的四个深度读入是严格递增的序列,我们可以叫它 Fish Rising 。
• there are four consecutive depth readings which form a strictly decreasing sequence (such as 9 6 5 2) (which we will call “Fish Diving”), or
如果连续的四个深度读入是严格递减的序列,我们可以叫它 Fish Diving 。
• there are four consecutive depth readings which are identical (which we will call “Constant Depth”).
All other readings will be considered random noise or debris, which we will call “No Fish.”
Your task is to read a sequence of depth readings and determine if the alarm will sound.
如果连续的四个深度读入是一样的,那就是“Fish At Constant Depth”。如果都不是,就是“No Fish”。
The input will be four positive integers, representing the depth readings. Each integer will be on its own line of input.
输入会是四个正整数,代表深度读入。每个整数会占一行。
The output is one of four possibilities. If the depth readings are increasing, then the output should be Fish Rising. If the depth readings are decreasing, then the output should be Fish Diving. If the depth readings are identical, then the output should be Fish At Constant Depth. Otherwise, the output should be No Fish.
输出就是四种情况。
样例1:
30 10 20 20
样例2:
1 10 12 13
样例1:
No Fish
样例2:
Fish Rising
数据很小
- 有鱼的声音
- 1275 有鱼的声音
- 【基础练习】有鱼的声音
- wikioi 1275 有鱼的声音
- ipad耳机有声音,拔下耳机没声音的解决办法
- ubuntu的音响没有声音,但是耳机播放有声音
- win7有声音,但任务栏右边的声音图标消失
- 实现有声音的电子钟表
- 我的ubuntu 现在有声音了
- 让你的App有声音
- 家乡的快乐声音是有味道有感觉的
- Xcode 真机调试: AVAudioPlayer 模拟器有声音,真机耳机有声音,扬音器没有声音的解决办法
- 显示器黑屏 有声音
- 合适是最好,声音选项里面 声音的硬件加速到底有什么用
- ubuntu 下耳机插上后,扬声器仍有声音,耳机没有声音的情况。
- 电脑前面插孔完好但是插入耳机没有声音,插后面插孔有声音的解决方法
- 解决ubuntu12.04耳机有声音,外放没声音的问题
- ubuntu 11.04解决插入耳机状态下耳机没声音喇叭有声音的问题
- 微软100题(71)数值的整数次方
- Nginx最新解析漏洞
- Python之学习笔记(QT:GUI设计)
- sql数据库varchar和nvarchar坑
- DirectX9.0学习(二):Direct3D基础
- 有鱼的声音
- 防止用户直接访问url
- [LeetCode] 6.8
- mysql 连接url中useUnicode=true&characterEncoding=UTF-8 的作用
- SAT数学核心词汇:基本数学概念
- feof()多读一次的解决方法
- OpenDaylight融合OpenStack架构分析
- Chrome translate plugins install 谷歌翻译插件安装
- 1034. Head of a Gang (30) -string离散化 -map应用 -并查集