当前位置:网站首页>【SSL集训DAY2】Sequence【数学】
【SSL集训DAY2】Sequence【数学】
2022-08-09 22:35:00 【VL——MOESR】

思路:
浅推一波我们发现就是把2n分成一个奇数*偶数,我们只需要把2的质因子全部除掉,然后把剩下的分解质因数
c o d e code code
#include<iostream>
#include<cstdio>
#define ll long long
using namespace std;
unsigned ll n;
int main() {
cin>>n;
if(n <= 2) {
printf("-1"); return 0; }
n *= 2;
unsigned ll k = 1;
while(n % 2 == 0) {
n /= 2;
k *= 2;
}
if(n == 1) {
printf("-1");
return 0;
}
for(unsigned ll i = 3; i * i <= n; i ++) {
if(n % i == 0) {
cout<<min(i, (k < n ? k : n));
return 0;
}
}
cout<<(k < n ? k : n);
return 0;
}
边栏推荐
- Explore the TiDB Lightning source code to solve the found bugs
- Comprehensive analysis of FPGA basics
- A summary of 6 common tools for cross-border e-commerce
- MVC与MVVM模式的区别
- 【诗歌】爱你就像爱生命
- LiveData : Transformations.map and Transformations.switchMap usage
- Sqlserver restricts the ip under which accounts can access the database
- 测试2年,当时身边一起入行的朋友已经月薪20k了,自己还没过万,到底差在了哪里?
- 了解什么是架构基本概念和架构本质
- Leetcode 530. 二叉搜索树的最小绝对差
猜你喜欢

matplotlib散点图颜色分组图例

k8s部署mysql

巴比特 | 元宇宙每日必读:国内首个数字人产业专项支持政策发布,2025年北京数字人产业规模将破500亿元...

测试2年,当时身边一起入行的朋友已经月薪20k了,自己还没过万,到底差在了哪里?

三:OpenCV图片颜色通道数据转换

Live Preview | ICML 2022 11 first-author scholars share online neural network, graph learning and other cutting-edge research

2022-08-09 mysql/stonedb-慢SQL-Q16分析

《GB5084-2021》PDF下载

YGG 经理人杯总决赛已圆满结束,来看看这份文字版总结!

Mysql集群 ShardingSphere
随机推荐
如何正则匹配乱码?
力扣:518. 零钱兑换 II
集群的基础形式
【AtomicInteger】常规用法
68.qt quick-qml多级折叠下拉导航菜单 支持动态添加/卸载 支持qml/widget加载等
Leetcode 701. 二叉搜索树中的插入操作
2020年度SaaS TOP100企业名单
力扣:474.一和零
离散选择模型之Gumbel分布
【励志】名言警句
探索TiDB Lightning源码来解决发现的bug
[Interface Test] Decoding the request body string of the requests library
tiup cluster scale-out
【诗歌】枕上诗书
Redis集群
tiup cluster start
The latest "Grain Academy Development Tutorial" in 2022: 10 - Front-end payment module
用哈希简单封装unordered_map和unordered_set
多线程是同时执行多个线程的吗
后台管理实现导入导出