题目链接

#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的更多相关文章

  1. 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 ...

  2. 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 ...

  3. (2016弱校联盟十一专场10.3) D Parentheses

    题目链接 把左括号看成A右括号看成B,推一下就行了.好久之前写的,推到最后发现是一个有规律的序列. #include <bits/stdc++.h> using namespace std ...

  4. (2016弱校联盟十一专场10.3) B.Help the Princess!

    题目链接 宽搜一下就行. #include <iostream> #include<cstdio> #include<cstring> #include<qu ...

  5. 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> # ...

  6. 2016弱校联盟十一专场10.2---Around the World(深搜+组合数、逆元)

    题目链接 https://acm.bnu.edu.cn/v3/problem_show.php?pid=52305 problem  description In ICPCCamp, there ar ...

  7. (2016弱校联盟十一专场10.2) A.Nearest Neighbor Search

    题目链接 水题,算一下就行. #include <bits/stdc++.h> using namespace std; typedef long long ll; ll x[],y[], ...

  8. (2016弱校联盟十一专场10.2) E.Coins

    题目链接 很久之前写的了,好像是对拍打表过的,推一下就行了. #include <bits/stdc++.h> using namespace std; typedef long long ...

  9. (2016弱校联盟十一专场10.5) F. Fibonacci of Fibonacci

    题目链接 题目大意就是这个,先找出下标的循环节,再快速幂对20160519取余就行了. 找出下标循环节: #include <cstdio> #include <iostream&g ...

随机推荐

  1. 如何在Excel中通过VBA快速查找多列重复的值

    今天项目组的一个同事问我如何快速的找到一个Excel中第3列和第5列的值完全重复的值,我想了想虽然Excel中自带查找重复值的功能,但是好像只能对同一列进行比较,所以就写了一个VBA进行处理,VBA非 ...

  2. SharpPcap网络包捕获框架的使用--实例代码在vs2005调试通过

    转自:http://hi.baidu.com/boyxgb/blog/item/89ac86fbdff5f82c4e4aea2e.html 由于项目的需要,要从终端与服务器的通讯数据中获取终端硬件状态 ...

  3. 【抓包工具】wireshark

    wireshark下载地址:http://download.csdn.net/detail/victoria_vicky/8819777 一.wireshark优劣势 wireshark劣势:只能查看 ...

  4. 移动web开发—页面头部 META 总结

    meta指元素可提供有关页面的元信息(meta-information),比如针对搜索引擎和更新频度的描述和关键词. 标签位于文档的头部,不包含任何内容. 标签的属性定义了与文档相关联的名称/值对. ...

  5. css实现了hover显示title的效果

    <div data-title="hello, world">hello...</div> <style> div { position: re ...

  6. Beta阶段第二次Scrum Meeting

    此文章已于 2:51:42 2016/12/8 重新发布到 buaa_overwatch Beta阶段第二次Scrum Meeting 情况简述 BETA阶段第二次Scrum Meeting 敏捷开发 ...

  7. BZOJ1598: [Usaco2008 Mar]牛跑步

    传送门 K短路,普遍的算法是采用AStar求解,先建立反向边跑一遍dij,或者spfa什么的.跑出反向边的距离就可以看为估价函数中的$h()$.设$dist$为当前已经走过的距离,那么$f(node) ...

  8. BZOJ1026: [SCOI2009]windy数

    传送门 md直接wa了78次,身败名裂 没学过数位DP硬搞了一道数位DP的模板题,感觉非常的愉(sha)悦(cha). 二分转化枚举思想.首先DP预处理出来$f[i][j]$表示有$i$位且第$i$位 ...

  9. centos6 install mcrypt

    Download the latest epel-release rpm from http://dl.fedoraproject.org/pub/epel/6/x86_64/ Install epe ...

  10. 浅谈 jQuery 事件源码定位问题

    该方法已过期,chrome 48还是49开始,自带各种流行框架的事件绑定解析. 勾上这个选项即可. 昨天群里有人问了个事件源码定位的问题,简单描述下是这样的. 在一个不是自己写的页面上,如何快速定位到 ...