题意:编写程序求出最长连续因子的个数,并输出最小的连续因子序列。 思路:找到n中(开平方后)的所有因子,逐个判断它的最长连续因子个数。 1 #include <iostream> 2 #include<math.h> 3 using namespace std; 4 5 int main() 6 { ...
分类:
其他好文 时间:
2020-09-17 12:07:27
阅读次数:
41
""" Django settings for swiper project. Generated by 'django-admin startproject' using Django 1.11.15. For more information on this file, see https:// ...
分类:
其他好文 时间:
2020-09-16 12:28:25
阅读次数:
36
#include <iostream> using namespace std; const int N = 60; long long dp[N]; int n; void show(){ dp[0]=0;dp[1]=1; dp[2]=2;dp[3]=3;dp[4]=4; for(int i=5; ...
分类:
其他好文 时间:
2020-09-16 12:27:08
阅读次数:
34
动态规划相关代码实现: 1、孩子有多像爸爸——最长的公共子序列 //program 4-1 #include <iostream> #include<cstring> using namespace std; const int N=1002; int c[N][N],b[N][N]; char s ...
分类:
编程语言 时间:
2020-09-16 12:22:41
阅读次数:
30
分治法代码实现 1、猜数游戏——二分搜索技术 //program 3-1 #include<iostream> #include<cstdlib> #include<algorithm> using namespace std; const int M=10000; int x,n,i; int s ...
分类:
编程语言 时间:
2020-09-16 12:21:41
阅读次数:
37
贪心算法相关代码实现 以下代码搬运自《趣学算法》实战演练 1、加勒比海盗船——最优装载问题 #include <iostream> #include <algorithm> const int N=1000005; using namespace std; double w[N]; //古董的重量数 ...
分类:
编程语言 时间:
2020-09-16 12:17:10
阅读次数:
30
在登录mysql输入密码后出现如下问题: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 一般是密码错误引起,解决的办法是重置密码, 重置密码的第一步就是跳过MySQL的密码认证过 ...
分类:
数据库 时间:
2020-09-16 12:13:32
阅读次数:
52
项目中,需要实现字体相关操作,收集了一些相关参数,可以引用的。 using System.Collections.Generic; using System.Drawing; using System.Drawing.Text; using System.Linq; using System.Net ...
分类:
其他好文 时间:
2020-09-15 21:20:52
阅读次数:
53
尝试使用set记录幂次,实际边界问题较多,下次谨慎使用, set不太适用递减输出!! 最后一个点输出错误,这是因为得到的最后结果为0,需要只输出一个0(后面没有空格)。 #include<cstdio> #include<set> #include<string.h> using namespace ...
分类:
其他好文 时间:
2020-09-15 21:04:11
阅读次数:
35
先用数组记录前缀和,然后减去两者的差值。 由于数组形成的是个环,所以累加和是固定的,反方向的距离实际就等于总长度减去正向的长度 注意distan的实际含义 #include<cstdio> #include<algorithm> using namespace std; const int N = ...
分类:
其他好文 时间:
2020-09-15 21:02:52
阅读次数:
34