返回顶部
摘要: 打了个表看了看,好像没什么算法能搞出来啊 直接python吧( num = 2 ** 1000 res = 0 while num != 0: res = res + num % 10 num //= 10 print(res) 阅读全文
posted @ 2022-04-21 00:29 Rayotaku 阅读(54) 评论(0) 推荐(0) 编辑
摘要: 每次向下或者向右走,问从(1,1)到(n,m)的不同路线数 经典dp入门题 #include <bits/stdc++.h> using namespace std; long long dp[50][50]; int main(){ dp[1][1]=1; for(int i=1;i<=21;++ 阅读全文
posted @ 2022-04-21 00:17 Rayotaku 阅读(27) 评论(0) 推荐(0) 编辑
摘要: 不难发现在过程中有很多出现过的数,直接记忆化一下就好。。。 #include <bits/stdc++.h> using namespace std; int main(){ int _=1000000; map<long long,long long> mp; int mx=0; int ans= 阅读全文
posted @ 2022-04-21 00:09 Rayotaku 阅读(29) 评论(0) 推荐(0) 编辑