题目链接:http://codeforces.com/problemset/problem/328/A

这道题目wa了一次,注意这句话:

You should also print 42 if the next element of progression is not integer. So answer is always integer.

然后就可以了。

 /*
ID: zypz4571
LANG: C++
TASK: iqtest.cpp
*/ #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include <algorithm>
#include <queue>
#include <set>
#include <queue>
#include <list>
#include <map>
#define INF 0x3f3f3f3f
#define mid int m=(l+r)/2
using namespace std;
int main ( int argc, char *argv[] )
{
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
#endif
int a, b, c, d; scanf("%d%d%d%d", &a,&b,&c,&d);
if(b-a==c-b&&c-b==d-c) printf("%d\n",*d-c);
else if (b*b==a*c&&b*d==c*c&&(d*d%c==)) printf("%d\n",d*d/c);
else printf("42\n");
return EXIT_SUCCESS;
} /* ---------- end of function main ---------- */

==

Testing Round #8 A. IQ Test 水题的更多相关文章

  1. Educational Codeforces Round 7 B. The Time 水题

    B. The Time 题目连接: http://www.codeforces.com/contest/622/problem/B Description You are given the curr ...

  2. Educational Codeforces Round 7 A. Infinite Sequence 水题

    A. Infinite Sequence 题目连接: http://www.codeforces.com/contest/622/problem/A Description Consider the ...

  3. BestCoder Round #36 (hdu5199)Gunner(水题)

    转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud Gunner Time Limit: 8000/4000 MS (Java/Oth ...

  4. VK Cup 2016 - Qualification Round 2 A. Home Numbers 水题

    A. Home Numbers 题目连接: http://www.codeforces.com/contest/638/problem/A Description The main street of ...

  5. Codeforces Round #336 (Div. 2)-608A.水题 608B.前缀和

    A题和B题...   A. Saitama Destroys Hotel time limit per test 1 second memory limit per test 256 megabyte ...

  6. Codeforces Round #300 A. Cutting Banner 水题

    A. Cutting Banner Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/538/pro ...

  7. Codeforces Beta Round #51 A. Flea travel 水题

    A. Flea travel Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/55/problem ...

  8. Codeforces Round #345(Div. 2)-651A.水题 651B.。。。 651C.去重操作 真是让人头大

    A. Joysticks time limit per test 1 second memory limit per test 256 megabytes input standard input o ...

  9. Educational Codeforces Round 11 A. Co-prime Array 水题

    A. Co-prime Array 题目连接: http://www.codeforces.com/contest/660/problem/A Description You are given an ...

随机推荐

  1. limit 百万级数据分页优化方法

    mysql教程 这个数据库教程绝对是适合dba级的高手去玩的,一般做一点1万 篇新闻的小型系统怎么写都可以,用xx框架可以实现快速开发.可是数据量到了10万,百万至千万,他的性能还能那么高吗? 一点小 ...

  2. [转载]Android 异步加载解决方案

    2013-12-25 11:15:47 Android 异步加载解决方案,转载自: http://www.open-open.com/lib/view/open1345017746897.html 请 ...

  3. WebBrowers & HtmlViewers collection

    WebBrowers & HtmlViewers collection 浏览: 加入我的收藏 楼主: THtmlViewerhttps://github.com/BerndGabriel/Ht ...

  4. 启动BPM的5个步骤

    在大部分业务中,我们通常认为:一个主要的业务流程管理项目从设计时间开始会比较好.我们知道很多方式来提高效率,增加生产力以及简化我们员工的工 作 - 这正是业务流程管理所做的.不幸的是,不管我们意图多好 ...

  5. Linux摄像头驱动学习之:(二)通过虚拟驱动vivi分析摄像头驱动

    一.通过指令 "strace -o xawtv.log xawtv" 得到以下调用信息:// 1~7都是在v4l2_open里调用1. open2. ioctl(4, VIDIOC ...

  6. IntelliLock托管代码保护和许可授权管理系统软件详细介绍及下载

    IntelliLock是一个能用于控件与应用程序许可授权的100%托管的先进解决方案.与.NET Reactor提供的基于源代码保护的授权许可系统不同,IntelliLock选择了以100%托管的方式 ...

  7. Javascript 基础--JS函数(三)

    一.基本概念:未完成某一个功能的代码(语句,指令)的集合. 二.函数的调用方式: 2.1.函数名(传递参数1,传递参数2)   基本语法 function 函数名(参数列表){ //代码; retur ...

  8. 关于resolve非泛型方法不能与类型实参一起使用

    今天mvc新建三层时,写到bll层中一直报下面的错误,检查了几遍赶脚并没有什么错.最后发现缺少一些引用. 如下面的图,少添加了下面的两个引用.Unity是微软模式与实践团队开发的一个轻量级.可扩展的依 ...

  9. 如何由Height Map生成Normal Map

    转自:http://www.cnblogs.com/cxrs/archive/2009/11/01/1594155.html Nvidia和ATI都有相应的工具把Heightmap转成NormalMa ...

  10. bistu新生-1004

    #include "stdio.h"#include "stdlib.h"#include "math.h"int cmp(const vo ...