【日常】2025年10月复盘&11月规划 - AI科研 编程 读书笔记 - 小竹の笔记本
【C++】小竹的C++学习笔记分享 | 78篇体系化文档×4.7 万字(PDF 可下载) - AI科研 编程 读书笔记 - 小竹の笔记本
【人工智能】修改翻译和LaTex论文&遥感模型改进-2025年7月22日人工智能组会总结 - AI科研 编程 读书笔记 - 小竹の笔记本
订阅本站更新 - AI科研 编程 读书笔记 - 小竹の笔记本
最新发布第38页
【递归】快速幂 - AI科研 编程 读书笔记 - 小竹の笔记本

【递归】快速幂

class Solution:    def myPow(self, x: float, n: int) -> float:        if n==0:            return 1        if n==1:            return x        if n==-1:  ...
SmallBamboo的头像 - AI科研 编程 读书笔记 - 小竹の笔记本SmallBamboo1年前
01509
【递归】2的幂 - AI科研 编程 读书笔记 - 小竹の笔记本

【递归】2的幂

递归法: class Solution:    def isPowerOfTwo(self, n: int) -> bool:        if n==1:            return True        if n<=0 or n%2!=0:            return Fals...
SmallBamboo的头像 - AI科研 编程 读书笔记 - 小竹の笔记本SmallBamboo1年前
016711
【递归】斐波那契数 - AI科研 编程 读书笔记 - 小竹の笔记本

【递归】斐波那契数

我探讨了斐波那契数的求解方法。虽然直接使用递归是直观的,但它会因大量重复计算子问题而导致效率低下,在数据量大时容易超时。为了优化,我提出了两种基于“备忘录”思想的方法来避免重复计算...
SmallBamboo的头像 - AI科研 编程 读书笔记 - 小竹の笔记本SmallBamboo1年前
016015

【模拟】旋转矩阵

#include<stdio.h> int main(){ int n; scanf('%d',&n); int a[n][n]; int top=0,down=n-1,left=0,right=n-1,count=1; while(count<=n*n){ for (int i=left;i<=right;i++){ a[top]...
SmallBamboo的头像 - AI科研 编程 读书笔记 - 小竹の笔记本SmallBamboo1年前
06010
【模拟】各位相加 - AI科研 编程 读书笔记 - 小竹の笔记本

【模拟】各位相加

#include<iostream> using namespace std; int main(){ int num; cin >> num; while(num>9){ int total=0; while(num!=0){ total+=num%10; num/=10; } num = total; total = 0; } cout <&...
SmallBamboo的头像 - AI科研 编程 读书笔记 - 小竹の笔记本SmallBamboo1年前
01656

【模拟】二进制求和

#include <iostream> using namespace std; string addBinary(string a, string b){ string res; int carry = 0;  // 进位 int i = a.size() - 1; int j = b.size() - 1; while(i >= 0 || j...
SmallBamboo的头像 - AI科研 编程 读书笔记 - 小竹の笔记本SmallBamboo1年前
014514
高质量付费干货文章