Codeoforces 558 B. Duff in Love
//
2 seconds
256 megabytes
standard input
standard output
Duff is in love with lovely numbers! A positive integer x is called lovely if and only if there is no such positive integer a > 1 such that a2 is a divisor of x.
Malek has a number store! In his store, he has only divisors of positive integer n (and he has all of them). As a birthday present, Malek wants to give her a lovely number from his store. He wants this number to be as big as possible.
Malek always had issues in math, so he asked for your help. Please tell him what is the biggest lovely number in his store.
The first and only line of input contains one integer, n (1 ≤ n ≤ 1012).
Print the answer in one line.
10
10
12
6
In first sample case, there are numbers 1, 2, 5 and 10 in the shop. 10 isn't divisible by any perfect square, so 10 is lovely.
In second sample case, there are numbers 1, 2, 3, 4, 6 and 12 in the shop. 12 is divisible by 4 = 22, so 12 is not lovely, while 6 is indeedlovely.
#include <stdio.h> #define ll __int64 ll f(ll n) { ll i, t; ;i*i<=n;i++) ) { t = i; break; } if(i*i>n) return n; else return f(n/t); } int main() { ll n; scanf("%I64d", &n); printf("%I64d\n", f(n)); ; }
Codeoforces 558 B. Duff in Love的更多相关文章
- Codeforces Round #326 (Div. 2) B. Pasha and Phone C. Duff and Weight Lifting
B. Pasha and PhonePasha has recently bought a new phone jPager and started adding his friends' phone ...
- 【转】Duff's Device
在看strcpy.memcpy等的实现发现用了内存对齐,每一个word拷贝一次的办法大大提高了实现效率,参加该blog(http://totoxian.iteye.com/blog/1220273). ...
- UVA 558 判定负环,spfa模板题
1.UVA 558 Wormholes 2.总结:第一个spfa,好气的是用next[]数组判定Compilation error,改成nexte[]就过了..难道next还是特殊词吗 题意:科学家, ...
- Codeforces Round #326 (Div. 2)-Duff and Meat
题意: Duff每天要吃ai千克肉,这天肉的价格为pi(这天可以买好多好多肉),现在给你一个数值n为Duff吃肉的天数,求出用最少的钱满足Duff的条件. 思路: 只要判断相邻两天中,今天的总花费 = ...
- 【LCA】CodeForce #326 Div.2 E:Duff in the Army
C. Duff in the Army Recently Duff has been a soldier in the army. Malek is her commander. Their coun ...
- uva 558 - Wormholes(Bellman Ford判断负环)
题目链接:558 - Wormholes 题目大意:给出n和m,表示有n个点,然后给出m条边,然后判断给出的有向图中是否存在负环. 解题思路:利用Bellman Ford算法,若进行第n次松弛时,还能 ...
- Codeforces Round #326 (Div. 2) D. Duff in Beach dp
D. Duff in Beach Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/588/probl ...
- Codeforces Round #326 (Div. 2) C. Duff and Weight Lifting 水题
C. Duff and Weight Lifting Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest ...
- Codeforces Round #326 (Div. 2) B. Duff in Love 分解质因数
B. Duff in Love Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/588/proble ...
随机推荐
- oracle的用户
1:创建用户 create user zhaoyb identified by zhaoyb default tablespace HUAPUSALEDB create user 用户名 identi ...
- jquery中的json操作
$(function() { var json = [ { "id" : "1", "tagName" : "apple" ...
- React的一个简单示例
首发:个人博客,更新&纠错&回复 React的核心是定义组件类,组件有三个要素:状态.行为.界面. 1.渲染状态到界面:状态由组件对象的state属性持有,从状态到界面的渲染工作由组件 ...
- bug的约束
1.bug的标题:主模块-子模块-页面-功能描述-bug的描述
- Oracle DB SQL 性能分析器
• 确定使用SQL 性能分析器的优点 • 描述SQL 性能分析器工作流阶段 • 使用SQL 性能分析器确定数据库更改所带来的性能改进 SQL 性能分析器:概览 • 11g 的新增功能 • 目标用户:D ...
- Delphi xe 下快捷使用 FastMM 的内存泄露检测功能
Delphi xe 集成了FastMM,调试程序是的时候可以方便地检查内存泄露了. 使用方法:在project中,添加一行: ReportMemoryLeaksOnShutdown := Debug ...
- Linux kernel的 Makefile和Kconfig以及Make menuconfig的关系【转】
本文转载自:http://blog.sina.com.cn/s/blog_4ba5b45e0102e6vp.html 熟悉内核的Makefile对开发设备驱动.理解内核代码结构都是非常重要的linux ...
- JProfiler入门笔记
看链接:http://blog.csdn.net/chendc201/article/details/22897999 收集一下.
- Apache服务器访问过慢分析及解决
起因:线上的一台服务器,最近总是出现 访问 很慢的情况发生,点击一个链接要2秒钟以上才能打开,按照我们对于访问人数的估计,服务器应该不至于响应这么慢,从而需要针对这个问题进行分析,来解决网站访问过慢. ...
- Install DBD::mysql for Perl in XAMPP in Mac , solving errors
我不知道 why,在 Mac 安装 DBI::mysql 总会报错 我为了给 cgi-bin 添加 mysql-perl 数据库支持,也是够麻烦的 make sure that mysql and m ...