NowCoder -- 牛客小白月赛10
2024-10-18 02:48:56
推下公式 a[i] = a[i-1] + a[i-2] +2
#include<stdio.h> #include<string.h> ]; int main() { long long n; scanf("%lld",&n); a[]=;a[]=;a[]=; ;i<=n;i++) a[i]=(a[i-]+a[i-]+)%; printf("%lld",a[n]); ; }
B 略
找到最大公约数 然后能被最大公约数整除的必然是 a b 的约数
#include<bits/stdc++.h> using namespace std; #define LL long long LL gcd(LL a,LL b){ return b?gcd(b,a%b):a; } int main(){ LL a,b; cin>>a>>b; LL g=gcd(a,b); vector<LL> q; ;i*i<=g;i++){ ){ q.push_back(i); if(i*i!=g) q.push_back(g/i); } } sort(q.begin(),q.end()); ;i<q.size();++i){ cout<<q[i]<<' '; } ; }
最新文章
- 如何利用Github+Appveyor+Nuget打造自己的.net core开源库
- Swift中对C语言接口缓存的使用以及数组、字符串转为指针类型的方法
- R提高篇(五): 描述性统计分析
- Android IOS WebRTC 音视频开发总结(六六)-- 三个角度分析美女视频直播这个行业
- 在iptables防火墙下开启vsftpd的端口
- ucosII移植
- 1) data-options
- HTTP,HTTP2.0,SPDY,HTTPS你应该知道的一些事
- -----------------------------SpringMVC理解-----------------------------
- Linux软件
- Foundation 框架 归档
- 海量数据,大数据处理技术--【Hbase】
- 安装rlwrap 的简单方法
- Object [object Object] has no method 'live'
- 清除 Xcode 项目缓存
- English trip -- VC(情景课) 7 A Shopping 购物
- P1004 方格取数
- MySQL :: MySQL 8.0 Reference Manual :: B.6.4.3 Problems with NULL Values https://dev.mysql.com/doc/refman/8.0/en/problems-with-null.html
- 峰Spring4学习(8)spring对事务的支持
- 「工具」三分钟了解一款在线流程绘制工具:Whimsical