- 博客(4)
- 收藏
- 关注
原创 将无限循环小数转化为分数
题干Every (positive) rational number can be expressed as a ratio of two (positive) integers.However, in decimal form, rational numbers often have an infinitely repeating pattern, e.g., 1/7=0.1428571428...
2020-04-30 20:59:34
541
原创 约数的个数
一.求1-n所有数的约数个数的和思路: 前n个数约数有1的个数为n/1,约数有2的个数为n/2,约数有3的个数为n/3,以此类推……时间复杂度O(n)代码#include<bits/stdc++.h>using namespace std;typedef long long ll;int main(){ int n; ll sum=0; scanf...
2020-04-28 20:37:10
197
原创 将整数n分为k份
POJ3080#include<iostream>#include<stdio.h>#include<string.h>#include<algorithm>#include<math.h>#include<vector>using namespace std;int n,t;string s[11];in...
2020-04-23 20:17:00
6523
2
原创 Floyd多源最短路优化+传递闭包
仅用于无向图一 利用矩阵的对称性void floyd(){ for(int k=1;k<=N;k++) for(int i=1;i<=N;i++) { int t=e[i][k]; for(int j=1;j<=i;j++) ...
2020-03-08 15:31:17
164
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人