(2016弱校联盟十一专场10.3) A.Best Matched Pair
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<stack>
using namespace std;
int n,data[];
int cal(int x) {
int tx=x;
int pre=-;
while(tx) {
if(pre!=-&&tx%-pre!=-) return -;
pre = tx%;
tx/=;
}
return x;
}
int main() {
scanf("%d",&n);
for(int i=;i<n;i++) scanf("%d",&data[i]);
int ans = -;
for(int i=;i<n;i++)
for(int j=i+;j<n;j++) {
ans = max(ans,cal(data[i]*data[j]));
}
printf("%d\n",ans);
}
(2016弱校联盟十一专场10.3) A.Best Matched Pair的更多相关文章
- 2016弱校联盟十一专场10.5---As Easy As Possible(倍增)
题目链接 https://acm.bnu.edu.cn/v3/contest_show.php?cid=8506#problem/A problem description As we know, t ...
- 2016弱校联盟十一专场10.3---Similarity of Subtrees(深搜+hash、映射)
题目链接 https://acm.bnu.edu.cn/v3/problem_show.php?pid=52310 problem description Define the depth of a ...
- (2016弱校联盟十一专场10.3) D Parentheses
题目链接 把左括号看成A右括号看成B,推一下就行了.好久之前写的,推到最后发现是一个有规律的序列. #include <bits/stdc++.h> using namespace std ...
- (2016弱校联盟十一专场10.3) B.Help the Princess!
题目链接 宽搜一下就行. #include <iostream> #include<cstdio> #include<cstring> #include<qu ...
- 2016弱校联盟十一专场10.3---We don't wanna work!(STL--set的使用)
题目链接 https://acm.bnu.edu.cn/v3/contest_show.php?cid=8504#problem/C 代码如下: #include <iostream> # ...
- 2016弱校联盟十一专场10.2---Around the World(深搜+组合数、逆元)
题目链接 https://acm.bnu.edu.cn/v3/problem_show.php?pid=52305 problem description In ICPCCamp, there ar ...
- (2016弱校联盟十一专场10.2) A.Nearest Neighbor Search
题目链接 水题,算一下就行. #include <bits/stdc++.h> using namespace std; typedef long long ll; ll x[],y[], ...
- (2016弱校联盟十一专场10.2) E.Coins
题目链接 很久之前写的了,好像是对拍打表过的,推一下就行了. #include <bits/stdc++.h> using namespace std; typedef long long ...
- (2016弱校联盟十一专场10.5) F. Fibonacci of Fibonacci
题目链接 题目大意就是这个,先找出下标的循环节,再快速幂对20160519取余就行了. 找出下标循环节: #include <cstdio> #include <iostream&g ...
随机推荐
- Caliburn.Micro学习笔记(五)----协同IResult
Caliburn.Micro学习笔记目录 今天说一下协同IResult 看一下IResult接口 /// <summary> /// Allows custom code to execu ...
- phpstorm 激活服务器
phpstorm 激活服务器 http://jetbrains.tencent.click/ (2016-09-19 可用) webstorm 激活服务器 http://owo.help(2016-0 ...
- 【IIS】IIS6.1配置 *.config 文件 的MIME类型用于升级程序
参考:http://blog.csdn.net 1. 2. 请求筛选中允许config文件下载, 3. 添加.config到 MIME类型. 3.注意:筛选项.
- Charles 从入门到精通
特别说明:原文来自唐巧大神的博客 http://blog.devtang.com/2015/11/14/charles-introduction/ Charles 从入门到精通 文章目录 1. 目录及 ...
- awk 用法(使用入门)
转自:http://www.cnblogs.com/emanlee/p/3327576.html awk 用法:awk ' pattern {action} ' 变量名 含义 ARGC 命 ...
- 光盘刻录 CD刻录软件 Ashampoo Burning Studio特别版 刻录CD就这么简单
著名的刻录软件Nero,其近上百M体积实在太大,而且安装之后的文件体积也有上G多.这么大的体积安装使用都不方便,好在现在很多都做得很不错,比如阿香婆的光盘刻录软件Ashampoo® Burning S ...
- python 2.6 与 2.4 区别
class 要把 class config(): 改成 class config: except Exception as e # only works in python 2.4 to 2.7 tr ...
- Codeforces Round #373 (Div. 2)
A,B,C傻逼题,就不说了. E题: #include <iostream> #include <cstdio> #include <cstring> #inclu ...
- Theano: CNMeM is disabled, CuDNN not available
Problem Theano: CNMeM is disabled, CuDNN not available Solution cnmem package: https://github.com/NV ...
- C# 面试知识点总结
1,事件是对象,委托时类型.事件内部其实就是一个private 的委托和add,remove两个方法. 2.override 和overload的区别: override是对基类中方法的重写,是会覆盖 ...