惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

U
Unit 42
S
Securelist
小众软件
小众软件
WordPress大学
WordPress大学
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The GitHub Blog
The GitHub Blog
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 司徒正美
博客园 - Franky
Hugging Face - Blog
Hugging Face - Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
酷 壳 – CoolShell
酷 壳 – CoolShell
O
OpenAI News
Cloudbric
Cloudbric
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
TaoSecurity Blog
TaoSecurity Blog
MongoDB | Blog
MongoDB | Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
V
V2EX
PCI Perspectives
PCI Perspectives
T
Troy Hunt's Blog
Schneier on Security
Schneier on Security
P
Palo Alto Networks Blog
M
MIT News - Artificial intelligence
V2EX - 技术
V2EX - 技术
阮一峰的网络日志
阮一峰的网络日志
Hacker News - Newest:
Hacker News - Newest: "LLM"
G
Google Developers Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
The Last Watchdog
The Last Watchdog
The Register - Security
The Register - Security
腾讯CDC
N
News and Events Feed by Topic
C
Check Point Blog
爱范儿
爱范儿
T
Tailwind CSS Blog
Webroot Blog
Webroot Blog
P
Proofpoint News Feed
S
Schneier on Security
MyScale Blog
MyScale Blog
N
News | PayPal Newsroom
Recorded Future
Recorded Future
T
Tenable Blog
I
InfoQ
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Microsoft Security Blog
Microsoft Security Blog
Simon Willison's Weblog
Simon Willison's Weblog
Engineering at Meta
Engineering at Meta

崎径 其镜

Unity CVE-2025-59489 漏洞修复实践(Google Play 合规) 从零配置 VS Code C++ 环境 一文详解Hexo 博客搭建 Unity 游戏的 Google Play 16 kb页面对齐处理 Unity 升级到 2022 踩坑记录(URP / 黑屏 / HTTP) Android Google Play 16 KB 页面对齐适配指南 iOS 应用开启包外存储访问(文件共享) xlua学习笔记 Lua新知 EFK日志分析系统的搭建 使用贝塞尔曲线实现道具随机飞动效果 震惊,JS不加分号会造成错误!? Linux升级Python Github图床工具 JS使用replace()函数全部替换 JS使用Splice()函数操作数组 当你的程序连接Mysql然后崩溃时 安卓应用闪屏 安卓各渠道SDK接入体验 某微信爬虫工具多开方案 U3D问题总结(七) lua U3D问题总结(六) 优化 U3D问题总结(五) 渲染与光照 U3D问题总结(四) 物理相关 U3D问题总结(三) Unity基础
力扣笔记
Anqi Zhao · 2026-04-06 · via 崎径 其镜

程序模板

#include<iostream>
#include<cstring>
using namespace std;



int main()
{

return 0;
}

数学模板

公约数、公倍数

int gcd(int a,int b)  // 最大公约数
{
if(b==0) return a;
else return gcd(b,a%b);
}

int lcm(int a,int b) // 最小公倍数
{
return a/gcd(a,b)*b;
}

素数

int prime(int b)      // 素数
{
for(int i=2;i<=(int)sqrt(b);i++) {
if(b%i==0) return 0;
}
return 1;
}

排列组合打表

int c[N][N];
void com() {
memset(c,0,sizeof(c));
for(int i=1;i<N;i++) {
c[i][0]=c[i][i]=1;
for(int j=1;j<i;j++) {
c[i][j]=c[i-1][j]+c[i-1][j-1];
}
}
}

快速幂

int Fast(int x,int n) {
int tem=x,ans=1;
while(n) {
if(n%2==1) ans*=tem;
tem*=tem;
n>>=1;
}
return ans;
}

快速幂取模

int pow(int a,int x) {
int ans=1,temp=a%p;
while(x) {
if(x&1) ans=((long long)ans*temp)%p;
temp=((long long)temp*temp)%p;
x>>=1;
}
return ans;
}

十进制转换其他进制

string trans(int num,int base) {
string str;
while(num>0) {
if(num%base<10) {
str+=num%base+'0';
}
else {
str+=num%base-10+'A';
}
num=num/base;
}
reverse(str.begin(),str.end());
return str;
}

常用数学公式

等差数列求和公式:

Sn=n*a1+n(n-1)d/2
Sn=n(a1+an)/2

等比数列求和公式:

Sn=a1(1-q^n)/(1-q)

常用函数

sort(起始地址,终点地址,比较方法);
lower_bound(起始地址,终点地址,查找元素);

版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 崎径 其镜

赞助

  • 微信

    微信

  • 支付宝

    支付宝