今天的模拟赛,被虐的不行。。。。英文太差,弄不懂题意,弄懂题意了还不会。。。

感觉快要受不了了。。。

#include <iostream>
#include <cstdio>
#include <cstring> using namespace std; int judge(int t){
int intge[];
int cou=;
while(t>=){
int p=t%;
t/=;
intge[cou++]=p;
}
intge[cou++]=t;
for(int i=;i<cou-;i++){
if(intge[i]<=intge[i+]||(intge[i]-intge[i+])!=){
return ;
}
} return ;
} int main()
{
int n;
int a[];
int b=;
while(scanf("%d",&n)!=EOF){
b=;
for(int i=;i<n;i++){
scanf("%d",&a[i]);
}
for(int i=;i<n;i++){
for(int j=;j<n;j++){
if(j!=i){
int t=a[j]*a[i];
if(judge(t)&&b<t){
b=t;
}
}
}
}
if(b==){
printf("-1\n");
}else{
printf("%d\n",b);
}
}
return ;
}

best matched pair的更多相关文章

  1. (2016弱校联盟十一专场10.3) A.Best Matched Pair

    题目链接 #include<cstdio> #include<cstring> #include<algorithm> #include<stack> ...

  2. Transistor 晶体管 场效应 双极型 达林顿 CMOS PMOS BJT FET

    Transistor Tutorial Summary Transistor Tutorial Summary Bipolar Junction Transistor Tutorial We can ...

  3. POJ #1141 - Brackets Sequence - TODO: POJ website issue

    A bottom-up DP. To be honest, it is not easy to relate DP to this problem. Maybe, all "most&quo ...

  4. 打造自己个性的notepad ++

    对coder来说,notepad ++ 是一个很不错的文本编辑器.平时用来看看代码.xml文件,都比系统自带的记事本舒服得多.不过,对于像我这种每天用notepad ++写代码的人,一个原装的note ...

  5. A Game of Thrones(13) - Tyrion

    The north went on forever. Tyrion Lannister knew the maps as well as anyone, but a fortnight on the ...

  6. [ACM International Collegiate Programming Contest, Amman Collegiate Programming Contest (2018)]

    https://codeforces.com/gym/101810 A. Careful Thief time limit per test 2.5 s memory limit per test 2 ...

  7. Everything You Always Wanted to Know About SDRAM (Memory): But Were Afraid to Ask

    It’s coming up on a year since we published our last memory review; possibly the longest hiatus this ...

  8. Labeled Faces in the Wild 人脸识别数据集

    http://blog.csdn.net/garfielder007/article/details/51480525 New (draft) survey paper: Labeled Faces ...

  9. McNemar test麦克尼马尔检验

    sklearn实战-乳腺癌细胞数据挖掘(博主亲自录视频) https://study.163.com/course/introduction.htm?courseId=1005269003&u ...

随机推荐

  1. linux下vim如何配置markdown插件

    在vim中设置markdown语法高亮是一个不错的选择,但是在google中搜索到的很多都是比较老的设置方式,甚至vim插件下载页面都是一个旧的版本.这里总结下我的修改过程,以帮助像我一样纠结的人. ...

  2. [译]git clean

    git clean命令用来从你的工作目录中删除所有没有tracked过的文件. git clean经常和git reset --hard一起结合使用. 记住reset只影响被track过的文件, 所以 ...

  3. EF-Linq将查询结果转换为List<string>

    List<int> id_list = new List<int>() { 1 };//测试数据...List<string> guid_list = (from ...

  4. 关于SVN代码提交粒度和频率的思考

    今天组内新来的一个同事问我代码提交频率的问题,他在上家公司是一个模块功能开发自测完成后再提交.而我这边采用的是最少一天提交一次,提倡粒度较小的提交, 而且是基于主干开发.采用这种方式是出于以下几点考虑 ...

  5. Thank you for your resubmission. Performance - 2.3.10 We noticed that your app or its metadata includes irrelevant third-party platform information. Specifically, Android logo is mentioned in the

    被拒很多次,各种修改,最后发现是提交的时候,含有安卓的图标!欲哭无泪呀! Thank you for your resubmission. Performance - 2.3.10 We notice ...

  6. Ubuntu 14 安装Java(JRE、JDK)

    JRE vs OpenJDK vs Oracle JDK JRE(Java Runtime Environment),它是你运行一个基于Java语言应用程序的所正常需要的环境.如果你不是一个程序员的话 ...

  7. Ajax前台调用后台方法、AJAX Pro2(回调函数)

    //获取分店 function cityResult() { if (cityName != "") { $("#ddlcity_").find("o ...

  8. ducument.ready不生效的问题 ruby on rails

    rails web app页面之间的跳转的时候使用ducument.ready只有在再次加载的时候才生效, 因为rails用了turbolinks, https://github.com/turbol ...

  9. Android学习笔记(十八)——再谈升级数据库

    //此系列博文是<第一行Android代码>的学习笔记,如有错漏,欢迎指正! 之前我们为了保证数据库中的表是最新的,只是简单地在 onUpgrade()方法中删除掉了当前所有的表,然后强制 ...

  10. php中0," ",null和false的区别

    php中很多还不懂php中0,"",null和false之间的区别,这些区别有时会影响到数据判断的正确性和安全性,给程序的测试运行造成很多麻烦.先看一个例子: <? $str ...