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

感觉快要受不了了。。。

#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. cad中关于点样式点的绘制

    点样式 从0开始, 默认的就是0 0= 一个小点; 1= 空的, 什么都不显示; 2= +加号; 3= X 叉号 设置点样式的命令是: pdmode: 可以假设认为是: point default m ...

  2. [译]git add

    git add git add命令把工作目录下面的有修改的文件添加的index(staging)里面去. git add告诉Git你想在下次commit的时候把什么文件包含进去. 但是, git ad ...

  3. 点击自动显示/隐藏DIV代码。(简单实用)

    注:本文由Colin撰写,版权所有!转载请注明原文地址,谢谢合作! 很多时候我们需要将DIV的信息默认为隐藏状态,只有当用户点击时才显示DIV中包含的提示文字.这类效果在互联网上应用得很多,但实现的方 ...

  4. VPN添加静态路由表(指定程序或资源走VPN)

    在某此情况下,我们希望为VPN客户端指定线路,比如只有公司的资源或网站才使用VPN连接,其它的网络请求依然走他们自己的默认网关. 这种情况下,我们就需要给VPN客户端添加静态路由规则并取消VPN连接的 ...

  5. Android应用如何监听自己是否被卸载及卸载反馈功能的实现

    一个应用被用户卸载肯定是有理由的,而开发者却未必能得知这一重要的理由,毕竟用户很少会主动反馈建议,多半就是用得不爽就卸,如果能在被卸载后获取到用户的一些反馈,那对开发者进一步改进应用是非常有利的.目前 ...

  6. PHP基础之 重载 的实现方式

    ===================PHP中的伪重载Overloading================== PHP中没有像C#或java中的重载,但可以通其它方法实现重载 重载:属性重载与方法重 ...

  7. 【C语言入门教程】5.5 实现问题(效率)

    在设计函数时需要遵循一些基本原则,因为影响到函数的执行效率和可用性.函数是代码复用的基础,一个健壮的函数或由函数组成的函数集可以在多个程序中使用.C语言标准库里存放的就是这样的函数,这些函数被放置在头 ...

  8. 如何使用Android中hide的类和方法进行开发?

    1.获取Android源码并进行编译. 2.编译完毕后,取出out\target\common\obj\JAVA_LIBRARIES\framework_intermediates路径下的classe ...

  9. android ListView嵌套GridView显示不全问题

    只需重写GridView即可:public class MyGridView extends GridView{ public MyGridView(android.content.Context c ...

  10. 顺序栈的c++实现及利用其实现括号的匹配

    #include<iostream>#include<cassert>#include<cstring>#include<string>using na ...