1275 有鱼的声音

2012年CCC加拿大高中生信息学奥赛

 时间限制: 1 s
 空间限制: 128000 KB
 题目等级 : 青铜 Bronze
 查看运行结果
 
 
题目描述 Description

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”。

输入描述 Input Description

The input will be four positive integers, representing the depth readings. Each integer will be on its own line of input.

输入会是四个正整数,代表深度读入。每个整数会占一行。

输出描述 Output Description

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.

输出就是四种情况。

样例输入 Sample Input

样例1:

30 10 20 20

样例2:

1 10 12 13

样例输出 Sample Output

样例1:

No Fish

样例2:

Fish Rising

数据范围及提示 Data Size & Hint

数据很小

活跃一下身心

代码‘:

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
;
],b[];
int read()
{
    ,f=; char ch=getchar();
    ; ch=getchar();}
    +ch-';  ch=getchar();}
    return x*f;
}
int main()
{
    ;i<=n;i++)
     a[i]=read(),b[i]=a[i];
    sort(b+,b++n);
    ;i<=n;i++)
    {
        ]) a1++;
        ]) a2++;
        ]) a3++;
    }
    ) {printf(;}
    ;}
    ) {printf(;}
    printf(;
}

codevs——1275 有鱼的声音的更多相关文章

  1. 菜鸡谈OO 第二单元总结

    “欢迎来到(玄学)多线程的新世界” Homework1 单部傻瓜电梯调度 Part1 多线程设计策略 第一次学到了线程这个概念,与之前的编程体验大有不同.最大的区别在于从原本的线性发生程序变成了多个行 ...

  2. 【python游戏编程之旅】第五篇---嗷大喵爱吃鱼小游戏开发实例

    本系列博客介绍以python+pygame库进行小游戏的开发.有写的不对之处还望各位海涵. 我们一同在前几期的博客中已经学到了很多pygame的基本知识了,现在该做个小游戏实战一下了. 前几期博客链接 ...

  3. CODEVS——T2744 养鱼喂妹纸

    http://codevs.cn/problem/2744/ 时间限制: 1 s  空间限制: 64000 KB 题目等级 : 钻石 Diamond 题解  查看运行结果     题目描述 Descr ...

  4. Scratch编程:游来游去的鱼(二)

    “ Scratch编程学习环境搭建好了吗?让我们一起来进行游戏吧!” 01 — 游戏介绍 这是一款简单的小游戏,实现了一条小鱼在池塘里游来游去. 02 — 设计思路 1,这个游戏主要由一个池塘背景和一 ...

  5. 5 秒克隆声音「GitHub 热点速览 v.21.34」

    作者:HelloGitHub-小鱼干 本周特推的 2 个项目都很好用,Realtime-Voice-Clone-Chinese 能让你无需开启变声音,即可获得一个特定声音的语音.这个声音可以是你朋友的 ...

  6. 声音分贝的概念,dBSPL.dBm,dBu,dBV,dBFS

    需要做个音频的PPM表,看着一堆的音频术语真是懵了,苦苦在网上扒了几天的文档,终于有了点收获,下面关于声音的分贝做个总结. 分贝 Decibel 分贝(dB)是一个对数单位(logarithmic u ...

  7. codevs 3289 花匠

    题目:codevs 3289 花匠 链接:http://codevs.cn/problem/3289/ 这道题有点像最长上升序列,但这里不是上升,是最长"波浪"子序列.用动态规划可 ...

  8. AlloyTouch 0.2.0发布--鱼和熊掌兼得

    原文链接:https://github.com/AlloyTeam/AlloyTouch/wiki/AlloyTouch-0.2.0 背景 公司师姐昨日在KM发了篇长文,主要结论RAF+transfo ...

  9. ubuntu声音系统

    查看声卡:cat /proc/asound/cards 显示所有ALSA的组件:cat /proc/asound/device aplay -l ubuntu使用pulseaudio,是ALSA(先进 ...

随机推荐

  1. Spring Mvc相关随笔

    web.xml部分 1.欢迎界面 <welcome-file-list> <welcome-file>/views/login.jsp</welcome-file> ...

  2. ReactJS-0-React介绍

    React介绍: React是一个库而不是一个MVC框架,因为React只负责解决MVC框架中V(View)层面的问题,React致力于创建可重用的UI组件.(React is a library f ...

  3. js实现元素水平垂直居中

    之前有写过css/css3实现元素的水平和垂直居中的几种方法点我,但是css3属性不是所有浏览器都能兼容的,今天写下js实现未知宽高的元素的水平和垂直居中. <!DOCTYPE html> ...

  4. 安卓(Android )软键盘的控制(显示和隐藏)

    Activity 启动时软键盘默认状态 在清单文件(manifest .xml)中可以通过在 Activity 标签中增加属性控制软键盘的默认状态: android:windowSoftInputMo ...

  5. 基于ANGULAR.JS的下一代WEB应用开发-01-yeoman

    Angularjs 个人认为这是一款很好的框架!它将我们从AJAX应用的开发中解救了出来!嗯....废话就说道这里下面我们开始把! 首先我们必须了解一些核心的概念: 客户端模版 MVC 数据绑定 依赖 ...

  6. org.springframework.orm.hibernate4.support.OpenSessionInViewFilter

    ---恢复内容开始--- /* * Copyright 2002-2014 the original author or authors. * * Licensed under the Apache ...

  7. [转帖]4412开发板/4418开发板Android4.4.4实现ble功能

    本文转自迅为论坛:http://bbs.topeetboard.com ①.4418开发板实现ble功能方法: 在4418/android/device/nexell/drone2/device.mk ...

  8. 取消input聚焦时的边框,去除ios点击时,自动添加的底色效果

    /*去除ios点击时,自动添加的底色效果*/ -webkit-tap-highlight-color: rgba(, , , ); /*去除焦点框*/ outline:none;

  9. spring cloud Bug之was unable to refresh its cache! status = Cannot execute request on any known server

    可能原因: 1.application.yml server: port: 10001spring: application: name: microservice-consumer-movieeur ...

  10. Java A

    4.在ORACLE大数据量下的分页解决方法.一般用截取ID方法,还有是三层嵌套方法. 答:一种分页方法 <% int i=1; int numPages=14; String pages = r ...