题目链接:http://acm.hnu.cn/online/?action=problem&type=show&id=12812

一直弄错了一个题意,教训啊,比赛最怕的就是弄错题意了

 #include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<cstdlib>
using namespace std;
const int maxn = +;
int num[maxn],X[maxn],flag[maxn]; int main()
{
// freopen("A2.out","w",stdout);
// freopen("A.in","r",stdin);
int n;
char str[];
while(scanf("%d",&n),n)
{
memset(flag,,sizeof(flag));
int num_x = ,end = ;
for(int i = ;i <= n;++i)
{
scanf("%s",str);
if(str[] == 'X' || str[] == 'x')
{
flag[i] = ;
X[num_x++] = i;
}
else num[i] = atoi(str);
if(i > && flag[i] == && flag[i-] == )
end = ;
}
if(num_x >= n || end) /////全是x无法判断,超过两个x在一起也是无解
{
printf("none\n");
continue;
}
for(int i = ;i < n;++i)
if(flag[i] == && flag[i+] == )
{
if(((i & ) && num[i] >= num[i+]) || (!(i & ) && num[i] <= num[i+]))
{
end = ;
break;
}
}
if(end) /////出现不符合规则的情况
{
printf("none\n");
continue;
}
int l = -0x7fffffff,r = 0x7fffffff;
for(int i = ;i < num_x;++i)
if(X[i] & )
{
if(X[i] > && flag[X[i]-] == )
r = min(r,num[X[i]-] - );
if(X[i] < n && flag[X[i]-] == )
r = min(r,num[X[i]+] - );
}
else
{
if(X[i] > && flag[X[i]-] == )
l = max(l,num[X[i]-] + );
if(X[i] < n && flag[X[i]+] == )
l = max(l,num[X[i]+] + );
}
if(l == r)
printf("%d\n",l);
else if(l > r)
printf("none\n");
else printf("ambiguous\n");
}
return ;
}

HNU 12812 Broken Audio Signal的更多相关文章

  1. Building a Radio Listening Station to Decode Digital Audio & Police Dispatches

    On April 7, 2017, residents in Dallas, Texas, woke to the sound of emergency sirens blaring all over ...

  2. linux音频 DAPM之二:audio paths与dapm kcontrol

    转:https://blog.csdn.net/wh_19910525/article/details/12749293 在用alsa_amixer controls时,除了我们之前提到的snd_so ...

  3. RTP Payload Format for Opus Speech and Audio Codec

    [Docs] [txt|pdf] [Tracker] [WG] [Email] [Diff1] [Diff2] [Nits] Versions: (draft-spittka-payload-rtp- ...

  4. 《The challenge of realistic music generation: modelling raw audio at scale》论文阅读笔记

    The challenge of realistic music generation: modelling raw audio at scale 作者:Deep  mind三位大神 出处:NIPS ...

  5. A Tutorial on Using the ALSA Audio API

    A Tutorial on Using the ALSA Audio API This document attempts to provide an introduction to the ALSA ...

  6. Introduction to Parallel Computing

    Copied From:https://computing.llnl.gov/tutorials/parallel_comp/ Author: Blaise Barney, Lawrence Live ...

  7. Video for Linux Two API Specification Revision 2.6.32【转】

    转自:https://www.linuxtv.org/downloads/legacy/video4linux/API/V4L2_API/spec-single/v4l2.html Video for ...

  8. Video for Linux Two API Specification revision0.24【转】

    转自:http://blog.csdn.net/jmq_0000/article/details/7536805#t136 Video for Linux Two API Specification ...

  9. Dynamic range compression

    这段时间终于把手头的东西都搞完了,还剩下一个AEC这个模块,这个模块跟整个系统机制有很大关系,单独的模块意义不大. 另外,刚写完一个分类器,希望能大幅提升音乐流派分类的准确率. 下周正式开搞AEC,把 ...

随机推荐

  1. 微信小程序开发:Flex布局

    微信小程序页面布局方式采用的是Flex布局.Flex布局,是W3c在2009年提出的一种新的方案,可以简便,完整,响应式的实现各种页面布局.Flex布局提供了元素在容器中的对齐,方向以及顺序,甚至他们 ...

  2. openwrt的路由器重置root密码

    家里路由器刷了openwrt,结果长期没登录,忘了root密码. 很容易就找到了这里介绍的办法  http://www.openwrt.org.cn/bbs/thread-12327-1-1.html ...

  3. u11-nav02

    header:before, header:after ,.navigation:before, .navigation:after,.nav-row:before, .nav-row:after,. ...

  4. Html-Css-div标签嵌套浮动div标签时无法撑开外部div的解决

    当DIV1里面嵌套有一个DIV2,当DIV2设置了浮动,那么DIV1是无法被撑开的 当DIV1里面嵌套有一个DIV2,当DIV2设置了浮动,那么DIV1是无法被撑开的,也就是说DIV2在这里相当于浮在 ...

  5. 【POJ 1035】Spell checker

    题 题意 每个单词,如果字典里存在,输出”该单词 is correct“:如果字典里不存在,但是可以通过删除.添加.替换一个字母得到字典里存在的单词,那就输出“该单词:修正的单词”,并按字典里的顺序输 ...

  6. BZOJ-3227 红黑树(tree) 树形DP

    个人认为比较好的(高端)树形DP,也有可能是人傻 3227: [Sdoi2008]红黑树(tree) Time Limit: 10 Sec Memory Limit: 128 MB Submit: 1 ...

  7. 洛谷1352 CODEVS1380 没有上司的舞会

    洛谷的测试数据貌似有问题,4个点RE不可避 CODEVS可AC —————— 10分钟后追记:在洛谷把数组范围开到10000+就过了 —————— 题目描述 Description Ural大学有N个 ...

  8. Linux System Log Collection、Log Integration、Log Analysis System Building Learning

    目录 . 为什么要构建日志系统 . 通用日志系统的总体架构 . 日志系统的元数据来源:data source . 日志系统的子安全域日志收集系统:client Agent . 日志系统的中心日志整合系 ...

  9. JAVA中的数组是对象吗?

    public class Main{ public static void main(String[] args) { int a[]={1,9}; //Object obj=new int[10]; ...

  10. GNUPLOT画图工具

    http://blog.csdn.net/codingkid/article/details/7211492 不得不说这个工具实在是太强大了. 1.首先命令简单,不会有那么多的语法问题. 2.其次画图 ...