题目链接: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. DataGridView绑定数据库,取得的数据插入到DataGridView指定列(一)

    实现: 点击button1,从数据库中获得数据,指定数据库的某列数据插入到DataGridView指定列 一.双击button1进入事件代码 private void button1_Click(ob ...

  2. jquery判断多选框是否选中

    if($("#xieyi").is(":checked")){ alert('选中'); }else{ alert('没有选中') }

  3. MyEclipse取消验证Js的两种方法

    MyEclipse取消验证Js的两种方法 作者: 字体:[增加 减小] 类型:转载 通过js写一个web工程的相关页面时感觉很卡,修改内存也不行下面有两种解决方法,大家可以尝试下 前言:有时我们通过j ...

  4. 动态加载DLL函数GetProcAddress错误

    GetLastError获取错误代码127,指代“找不到指定程序”. 解决: 转自:http://hi.baidu.com/violetwangy/item/c35b3b95ecf5374cf0421 ...

  5. 2016-1-9 Quartz框架的学习,剪裁图片并设置边框

    #import "ViewController.h" @interface ViewController () @end @implementation ViewControlle ...

  6. android中string.xml引起的常见编译错误

    1.遇到如下错误的时候说明你需要在单引号签名加转义字符(\): 1 Description Resource Path Location Type error: Apostrophe not prec ...

  7. 深入分析:Fragment与Activity交互的几种方式(一,使用Handler)

    这里我不再详细介绍那写比较常规的方式,例如静态变量,静态方法,持久化,application全局变量,收发广播等等. 首先我们来介绍使用Handler来实现Fragment与Activity 的交互. ...

  8. 查看ubuntu文件目录的大小和文件夹包含的文件数 zT

    查看ubuntu文件目录的大小和文件夹包含的文件数 查看linux文件目录的大小和文件夹包含的文件数 统计总数大小 du -sh xmldb/ du -sm * | sort -n //统计当前目录大 ...

  9. C# INotifyPropertyChanged

    INotifyPropertyChanged 向客户端发出某一属性值已更改的通知. namespace System.ComponentModel{ // Summary: // Notifies c ...

  10. C#_控件——DropDownList

    1.html <asp:CheckBox ID="CheckBox11" runat="server" onclick="changecheck ...