自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(7)
  • 收藏
  • 关注

原创 mac idea java web tomcat 解决中文乱码问题

打开配置 在红色框里添加-Dfile.encoding=UTF-8

2018-07-20 22:52:55 591

原创 PAT甲级 1029 Median(25 分)AC 解决内存超限

1029 Median(25 分)Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1 = { 11, 12, 13, 14 } is 12, and the median of S2 = { 9, ...

2018-07-05 12:31:54 4650 7

原创 1052 Linked List Sorting (25)(25 分)

1052 Linked List Sorting (25)(25 分)A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an integer key and a Next po...

2018-07-03 15:32:27 724

原创 排列组合

排列组合从n种情况选m个选择,有多少中可能:C n m边乘边除法int C(int n, int m) { int ans = 1; for(int i = 1; i <= m; i++) ans = ans * (n - m + i) / i; return ans;}...

2018-07-03 08:31:54 203

原创 计算质因子个数

计算质因子个数计算数字 n 中有因子 a 的个数普通计算int f(int n, int a) { int ans = 0; while(n % a == 0) { ans++; n /= a; } return ans;}进阶:计算数字 !n 中有因子 a 的个数普通计算有一个公式:利用这个公式可以把时间复杂度降...

2018-07-02 15:56:56 2484 1

原创 素数筛子

素数筛子打印出1-100000内所有的素数假定所有数都是素数,然后从头遍历把素数的所有倍数(2,3,4…n倍)筛掉,则剩下的为真素数。维护一个bool类型数组,false表示没被筛掉,true表示被筛掉了。#include<stdio.h>int main() { bool num[100001] = {false}; for(int i = 2; i &...

2018-07-02 11:21:09 981

原创 快速幂

快速幂基于二分思想,时间复杂度为O(logb);当b奇数,ans = ans * (a ^ (b - 1) % m);当b偶数,ans = (a ^ (b / 2) % m) * (a ^ (b / 2) % m);当b为零,退出。#include <iostream>#include <bitset>using namespace std;lon...

2018-07-02 08:38:31 127

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除