注意只有一个素因子的情况。

 #include <cstdio>
#include <algorithm>
#include <cstring> using namespace std; typedef long long ll;
const int INF = 0x3f3f3f3f;
const int maxn = 4e3+;
struct cake
{
int w,l;
cake(){}
bool operator < (const cake &b) const
{
return l > b.l;
}
}ck[maxn]; int N,len[maxn]; int main()
{
scanf("%d",&N); for(int i=;i<N;i++)
{
scanf("%d%d",&ck[i].w,&ck[i].l);
if(ck[i].w > ck[i].l) swap(ck[i].w,ck[i].l);
} sort(ck,ck+N); int m;
int answ,ansl;
ll ans = -INF; for(int i=;i<N;i++)
{
m = ;
for(int j=;j<N;j++)
{
if(ck[j].w >= ck[i].w)
{
len[m++] = ck[j].l;
}
}
for(int j=;j<m;j++)
{
ll res = (ll)ck[i].w*len[j]*(j+);
if(res > ans)
{
ans = res;
answ = ck[i].w;
ansl = len[j];
}
}
}
printf("%I64d\n%d %d\n",ans,answ,ansl); }

HDU 4344-Mark the Rope-大数素因子分解的更多相关文章

  1. Miller&&Pollard HDOJ 4344 Mark the Rope

    题目传送门 题意:一个长为n(n<2^63)的管子,在管子上做标记,每隔L个长度单位做一个标记,从管子头端开始,保证最后一次标记恰好在管子的尾端.让你找出有多少个这样的L(L<n),且他们 ...

  2. 【HDU - 4344】Mark the Rope(大整数分解)

    BUPT2017 wintertraining(15) #8E 题意 长度为n(\(n<2^{63}\))的绳子,每隔长度L(1<L<n)做一次标记,标记值就是L,L是n的约数. 每 ...

  3. HDU 4344 大数分解大素数判定

    这里贴个模板吧.反正是不太理解 看原题就可以理解用法!! #include <cstdio> #include <iostream> #include <algorith ...

  4. HDU 1041 Computer Transformation (简单大数)

    Computer Transformation http://acm.hdu.edu.cn/showproblem.php?pid=1041 Problem Description A sequenc ...

  5. hdu 4873 ZCC Loves Intersection(大数+概率)

    pid=4873" target="_blank" style="">题目链接:hdu 4873 ZCC Loves Intersection ...

  6. HDU高精度总结(java大数类)

      HDU1002   A + B Problem II [题意]大数相加 [链接]http://acm.hdu.edu.cn/showproblem.php?pid=1002 Sample Inpu ...

  7. HDU 1314 Numerically Speaking(大数加减乘除+另类二十六进制互相转换)

    原题代号:HDU 1314 原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1314 Numerically Speaking Time Limit: 2 ...

  8. HDU 1131 Count the Trees 大数计算

    题目是说给出一个数字,然后以1到这个数为序号当做二叉树的结点,问总共有几种组成二叉树的方式.这个题就是用卡特兰数算出个数,然后因为有编号,不同的编号对应不同的方式,所以结果是卡特兰数乘这个数的阶乘种方 ...

  9. HDU 5568 sequence2 区间dp+大数

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5568 题意: 求所有长度为k的严格升序子序列的个数. 题解: 令dp[i][k]表示以i结尾的长度为 ...

  10. hdu 4099 Revenge of Fibonacci 大数+压位+trie

    最近手感有点差,所以做点水题来锻炼一下信心. 下周的南京区域赛估计就是我的退役赛了,bless all. Revenge of Fibonacci Time Limit: 10000/5000 MS ...

随机推荐

  1. 《React Native 精解与实战》书籍连载「React Native 底层原理」

    此文是我的出版书籍<React Native 精解与实战>连载分享,此书由机械工业出版社出版,书中详解了 React Native 框架底层原理.React Native 组件布局.组件与 ...

  2. Python全栈开发之路 【第四篇】:Python基础之函数

    本节内容 函数def: 1.位置参数,默认参数 2.位置参数,关键参数 3.如果参数中出现 *users,传递的参数就可以不再是固定的个数, 传过来的所有元素进行打包成元组 *args,**kwarg ...

  3. H5 27-优先级之important

    27-优先级之important 我是段落 <!DOCTYPE html> <html lang="en"> <head> <meta c ...

  4. Redis集群之Jedis的使用

    maven依赖 <!-- Redis客户端 --> <dependency> <groupId>redis.clients</groupId> < ...

  5. scrapy之持久化存储

    scrapy之持久化存储 scrapy持久化存储一般有三种,分别是基于终端指令保存到磁盘本地,存储到MySQL,以及存储到Redis. 基于终端指令的持久化存储 scrapy crawl xxoo - ...

  6. 福州大学软件工程1816 | W班 第6次作业WordCount成绩排名

    作业链接 WordCount进阶需求 评分细则 本次个人项目分数由两部分组成(博客分满分40分+程序得分满分60分) 博客评分细则(满分60,最终折算为40分) 在文章开头给出结对同学的博客链接.本作 ...

  7. 解决只能root权限登陆mysql的问题

    一.问题描述 在用sqoop连接mysql时,会报错如下图所示,原因是mysql在默认情况下是使用了auth_socket plugin进行认证,即每次登陆都需要sudo mysql -u local ...

  8. IdentityServer4【Topic】之登出

    Sign-out 登出 IdentityServer的登出就像删除认证cookie一样简单,但是为了完成一个完整的联合签名,我们必须考虑将用户从客户端应用程序中(甚至可能是上游的Identity提供者 ...

  9. [转帖]CentOS 6 服务器安全配置指南(通用)

    CentOS 6 服务器安全配置指南(通用) http://seanlook.com/2014/09/07/linux-security-general-settings/  发表于 2014-09- ...

  10. CentOS7安装Jenkins,使用war方式直接运行或用yum方式安装运行

    jenkins最简单的安装方式呢,就是直接去官网下载jenkins的war包,把war丢到tomcat里运行,直接就能打开了. Jenkins官网:https://jenkins.io/downloa ...