Testing Round #8 A. IQ Test 水题
题目链接: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 水题的更多相关文章
- Educational Codeforces Round 7 B. The Time 水题
B. The Time 题目连接: http://www.codeforces.com/contest/622/problem/B Description You are given the curr ...
- Educational Codeforces Round 7 A. Infinite Sequence 水题
A. Infinite Sequence 题目连接: http://www.codeforces.com/contest/622/problem/A Description Consider the ...
- BestCoder Round #36 (hdu5199)Gunner(水题)
转载请注明出处: http://www.cnblogs.com/fraud/ ——by fraud Gunner Time Limit: 8000/4000 MS (Java/Oth ...
- 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 ...
- 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 ...
- Codeforces Round #300 A. Cutting Banner 水题
A. Cutting Banner Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/538/pro ...
- Codeforces Beta Round #51 A. Flea travel 水题
A. Flea travel Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/55/problem ...
- 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 ...
- 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 ...
随机推荐
- Deep Learning 初识
实际生活中,人们为了解决一个问题,如对象的分类(对象可是是文档.图像等),首先必须做的事情是如何来表达一个对象,即必须抽取一些特征来表示一个对象,如文本的处理中,常常用词**来表示一个文档,或把文档表 ...
- hdu 1035 (usage of sentinel, proper utilization of switch and goto to make code neat) 分类: hdoj 2015-06-16 12:33 28人阅读 评论(0) 收藏
as Scott Meyers said in his book Effective STL, "My advice on choosing among the sorting algori ...
- Tomcat的安装(一)
一.Tomcat文件下载类型 1.tar.gz 文件是linux的安装包 2.exe文件是Windows系统的安装包 3.zip文件是Windows系统下压缩版(解压缩即可,免安装) 二.下面使用zi ...
- IIS 发布后文件拒绝访问
今天遇到一个很小的问题,代码中写XML文件,本地运行没有问题,一发布到服务器上就出现 代码如下: XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load ...
- poj1014 dp 多重背包
//Accepted 624 KB 16 ms //dp 背包 多重背包 #include <cstdio> #include <cstring> #include <i ...
- struts调用的几种方法
在Struts2中方法调用概括起来主要有三种形式 第一种方式:指定method属性 <action name="student" class="com.itmyho ...
- ResultSet结果集判断是否为空
目前亲测过能用的一个方法是: if(rs.next())//当前行有内容 { msg2 = "有这个活动!"; } else //rs对象为空表示查无此活动 { msg2 = &q ...
- 2016 - 1- 22 NSURLConnetction --- POST请求
一:与上一篇博客中的GET方法类似 只不过需要多注意,如果要改变请求的类型,需要生成NSMutableURLRequest对象才可以设置请求的类型. NSURL *url = [NSURL URLW ...
- 不能使用weak修饰进行声明的类
These classes include NSTextView, NSFont and NSColorSpace; for the full list, see Transitioning to A ...
- R函数是对A方法的封装
$user = new UserController; === $user=A("User"); $user = new UserController; $user-& ...