题目传送门

 /*
水题:判断前后的差值是否为1,b[i]记录差值,若没有找到,则是第一个出错
*/
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
using namespace std; const int MAXN = 1e5 + ;
const int INF = 0x3f3f3f3f;
int a[MAXN];
int b[MAXN]; int main(void) //HDOJ 4727 The Number Off of FFF
{
//freopen ("L.in", "r", stdin); int t, cas = ;
int n;
scanf ("%d", &t);
while (t--)
{
scanf ("%d", &n); a[] = b[] = ;
for (int i=; i<=n; ++i)
{
scanf ("%d", &a[i]);
b[i] = a[i] - a[i-];
} int ans = -;
for (int i=; i<=n; ++i)
{
if (b[i] != )
{
ans = i; break;
}
}
if (ans == -) ans = ; printf ("Case #%d: %d\n", ++cas, ans);
} return ;
} /*
Case #1: 3
Case #2: 3
*/

水题 HDOJ 4727 The Number Off of FFF的更多相关文章

  1. HDU 4727 The Number Off of FFF (水题)

    The Number Off of FFF Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Ot ...

  2. 水题 HDOJ 4716 A Computer Graphics Problem

    题目传送门 /* 水题:看见x是十的倍数就简单了 */ #include <cstdio> #include <iostream> #include <algorithm ...

  3. HDU 4727 The Number Off of FFF

    The Number Off of FFF Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Other ...

  4. HDU 4727 The Number Off of FFF 2013年四川省赛题

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4727 题目大意:队列里所有人进行报数,要找出报错的那个人 思路:,只要找出序列中与钱一个人的数字差不是 ...

  5. HDOJ 2317. Nasty Hacks 模拟水题

    Nasty Hacks Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Tota ...

  6. hdu 1005:Number Sequence(水题)

    Number Sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)T ...

  7. hdu 1018:Big Number(水题)

    Big Number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total ...

  8. HDU-4727 The Number Off of FFF 水题

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4727 水题.. //STATUS:C++_AC_187MS_288KB #include <fu ...

  9. HDOJ/HDU 1328 IBM Minus One(水题一个,试试手)

    Problem Description You may have heard of the book '2001 - A Space Odyssey' by Arthur C. Clarke, or ...

随机推荐

  1. jvm内存模型和内存分配

    1.什么是jvm? (1)jvm是一种用于计算设备的规范,它是一个虚构出来的机器,是通过在实际的计算机上仿真模拟各种功能实现的. (2)jvm包含一套字节码指令集,一组寄存器,一个栈,一个垃圾回收堆和 ...

  2. 【Android代码片段之六】Toast工具类(实现带图片的Toast消息提示)

    转载请注明出处,原文网址:http://blog.csdn.net/m_changgong/article/details/6841266  作者:张燕广 实现的Toast工具类ToastUtil封装 ...

  3. 如何修改git的当前登录信息

    (文章是从我的个人主页上粘贴过来的,大家也可以访问我的主页 www.iwangzheng.com) 之前用的大师的git登录名,后来开通了自己的,需要换成自己的,其实修改方式很简单. $vim .gi ...

  4. python的类变量与实例变量

    python的类内部定义的变量 ,形式上没有区分实例变量和类变量(java的静态变量),测试结果如下: 

  5. linux下统计当前目录下文件个数

    ls | wc -l 转自:http://bbs.csdn.net/topics/60387132

  6. 追溯ASP.NET发展史

    2000年全新平台的ASP.NET 1.0正式发布,发展速度异常惊人,2003年升级为1.1版本.ASP.NET 1.1发布之后,更加激发了Web应用程序开发人员对ASP.NET的兴趣,并且对网络技术 ...

  7. Segment Tree Build I & II

    Segment Tree Build I The structure of Segment Tree is a binary tree which each node has two attribut ...

  8. k Sum | & ||

    k Sum Given n distinct positive integers, integer k (k <= n) and a number target. Find k numbers ...

  9. codeforces 468A. 24 Game 解题报告

    题目链接:http://codeforces.com/problemset/problem/468/A 题目意思:给出一个数n,利用 1 - n 这 n 个数,每个数只能用一次,能否通过3种运算: + ...

  10. iframe并排横着显示

    由于工作需要,两个iframe需要并排横着显示: 效果如下: