自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 section 1.5 sprime

-这道题和section 1.5 pprime思路几乎一模一样 -质数验证函数分了两类,num<=10000和num>=10000"YOUR PROGRAM ('sprime') WORKED FIRST TIME! That's fantastic and a rare thing. Please accept these special automated congratulations.

2016-07-08 20:05:09 308

原创 section 1.5 pprime

-先生成回文数 -生成回文数的迭代函数比较复杂,因为是新手,这里处理应该没那么好 -质数判定,先列出sqrt(b)以内的质数表(100,000,000最多只需要列10,000以内),用待测数N依次除以这些质数,求余 -生成质数表的函数很通用 -没有必要用Miller-Rabin算法/* ID: penglin3 PROG: pprime LANG: C++11 */ #include <io

2016-07-08 18:42:31 263

转载 快排算法

快排算法目前最为广泛的排序算法#include <iostream> #include<stdlib.h> using namespace std;void Qsort(int a[], int low, int high) { if (low >= high) { return; } int first = low; int last = h

2016-07-06 23:43:55 285

原创 section 1.5 numtri

-首先想到的这个方法太笨了 -还是需要递归算法/* ID: penglin3 PROG: numtri LANG: C++11 */ #include <iostream> #include <fstream> #include <vector> #include <math.h> using namespace std;//fstream 需要std合法范围#define max(a,b) (a

2016-07-06 19:51:50 237

原创 section 1.4 milk3

首次做的错误-首次做思路是先试图分析倒牛奶过程的数学原理,找到合适的公式。 -其实完全不需要,一次不过六种倒的方案,只需要递归遍历就好了。 -递归判结束的标志是,倒完后的ABC情况前面出现过了。用一个bool数组liter[A][B][C]记录是否已经出现对应情况。程序答案/* ID: penglin3 PROG: milk3 LANG: C++11 */ #include <iostream>

2016-07-06 16:48:26 258

原创 Section 1.4-ariprog

problem: take too much time /* ID: penglin3 PROG: ariprog LANG: C++11 */ #include//sort 所在头文件,sort是C++的快排函数比qsort好用 #include #include #include using namespace std; struct arithprog { int a; int b

2016-07-04 09:49:02 203

空空如也

空空如也

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

TA关注的人

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