标签:str tps test target font span 题目 ack amp
#include<cstdio> #include<cstring> #include<algorithm> #include<stack> using namespace std; int n,data[1005]; int cal(int x) { int tx=x; int pre=-1; while(tx) { if(pre!=-1&&tx%10-pre!=-1) return -1; pre = tx%10; tx/=10; } return x; } int main() { scanf("%d",&n); for(int i=0;i<n;i++) scanf("%d",&data[i]); int ans = -1; for(int i=0;i<n;i++) for(int j=i+1;j<n;j++) { ans = max(ans,cal(data[i]*data[j])); } printf("%d\n",ans); }
(2016弱校联盟十一专场10.3) A.Best Matched Pair
标签:str tps test target font span 题目 ack amp
原文地址:http://www.cnblogs.com/Ritchie/p/6209304.html