自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 欧拉计划--C++编程突破10

欧拉计划–C++编程突破10Problem 19You are given the following information, but you may prefer to do some research for yourself.1 Jan 1900 was a Monday.Thirty days has September,April, June and November.All the rest have thirty-one,Saving February alone,Which

2020-12-04 21:15:57 129

原创 欧拉计划--C++编程突破9

欧拉计划–C++编程突破9Problem 17If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total. If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how man

2020-12-03 10:47:28 180

原创 欧拉计划--C++编程突破8

欧拉计划–C++编程突破8Problem 15Starting in the top left corner of a 2×2 grid, and only being able to move to the right and down, there are exactly 6 routes to the bottom right corner.How many such routes are there through a 20×20 grid?问题15从一个2×2网格的左上角开始,只能向右

2020-12-02 16:21:36 190

原创 欧拉计划--C++编程突破7

欧拉计划–C++编程突破7欧拉计划:https://projecteuler.net/problem=13Problem 13Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.问题13求出下列100个50位数字之和的前十位数字。其余略,具体请到网站查看。思路分析:简单来说,看到这个题,第一个想法你要是想用大整数,那我劝这位年轻人耗子尾汁,这道题已知要处理的各项数字,就不

2020-11-30 16:31:36 155

原创 欧拉计划--C++编程突破6

欧拉计划–C++编程突破6Problem 11In the 20×20 grid below, four numbers along a diagonal line have been marked in red.The product of these numbers is 26 × 63 × 78 × 14 = 1788696.What is the greatest product of four adjacent numbers in the same direction (up, down

2020-11-29 13:10:07 175

原创 欧拉计划--C++编程突破5

欧拉计划–C++编程突破5Problem 9A Pythagorean triplet is a set of three natural numbers, a < b < c, for which,a2 + b2 = c2 For example,32 + 42=9 + 16 = 25 = 52。There exists exactly one Pythagorean triplet for which a + b + c = 1000.Find the product abc.问

2020-11-28 20:43:32 110

原创 欧拉计划--C++编程突破4

欧拉计划–C++编程突破4Problem 7By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.What is the 10 001st prime number?问题7通过列出前六个素数:2,3,5,7,11和13,我们可以看到第6个素数是13。 第10001素数是多少?解题思路:通过打印素数表来直接找到对应素数就好,使用一个长数组,每次发现一个素

2020-11-27 17:02:23 99

原创 欧拉计划--C++编程突破3

Problem 52520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?问题52520是一个最小的数,它可以被从1到10的每个数除以,没有任何余数。 什

2020-11-26 20:05:55 226

原创 牛客网错题整理--C++篇4

能够在字符串“aabaaabaaaab”中匹配“aab”,而不能匹配“aaab”和“aaaab"的正则表达式包括()A. “a*?b”B. “a{,2}b”C. “aa??b”D. “aaa??b”正确答案: C 我的答案: B C错误原因:{,}在使用的时候必须要明确上下界,题中没有固定上下界。逐项分析:A. *表示前面的表达式出现0次或者任意次,?表示出现0次或者1次,有可能匹配到"aaab"或者"aaaab"B. 详见错误原因C. ?表示出现0次或者1次,因此不可能会出现".

2020-11-26 14:37:39 729

原创 欧拉计划--C++编程突破2

欧拉计划–C++编程突破2Problem 3The prime factors of 13195 are 5, 7, 13 and 29.What is the largest prime factor of the number 600851475143 ?13195的质因数是5、7、13和29。 数600851475143的最大质因数是多少?解题思路:与其思考最大质因数是多少,不如去思考怎么将非质因数剔除,首先这个数挺大,但是LL能放下,那就直接用LL类型解决,但是还是要压缩数据范围,首先,不

2020-11-25 19:54:04 545

原创 欧拉计划--C++编程突破1

欧拉计划–C++编程突破1Problem 1Multiples of 3 and 5If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.Find the sum of all the multiples of 3 or 5 below 1000.3或5的倍数在小于10的自然数中,3或5的倍数有3、

2020-11-25 17:29:13 233

原创 牛客网错题整理--C++篇3

牛客网错题整理–C++篇3下面对一维数组 a 进行正确的初始化的语句是():A. int a[10] = (0, 0, 0, 0, 0); //注:这里是小括号B. int a[10] = {};C. int a[10] = {10};D. int a[10] = {10, 0, -1};正确答案: BCD 我的答案: C错误原因: 没看到是多选,不好意思。。。虽然明知道BCD都是对的[捂脸哭]逐项分析:A. 数组初始化没有用小括号的,全是大括号。B. 默认初始化,

2020-11-24 20:04:46 3293 1

原创 牛客网错题整理--操作系统篇1

牛客网错题整理–操作系统篇1为使进程由活动就绪变为静止就绪,应利用()原语?A. SuspendB. ActiveC. BlockD. Wakeup正确答案: A 我的答案:C错误原因: 把挂起和阻塞搞混了,不该犯错的啊。分析:A是挂起,也就是活动和静止之间的切换B是活动,也可以理解为恢复,就是将静止的进程恢复成活动态C是阻塞,阻塞是将进程调出就绪进程队列,等待再被内存调用。D是唤醒,可以理解为是把被阻塞的进程唤醒,当被阻塞的进程执行wakeup时,进入就

2020-11-23 19:42:27 1274

原创 牛客网错题整理--C++篇2

牛客网错题整理–C++篇232位编译器下,sizeof(void)的值是多少?A. 0B. 4C. 这取决于主机的字的大小。D. 8E. 编译错误或者为1正确答案: E 我的答案: C错误原因:理论上说,不能够创建void类型的变量,因为那没有意义,在C++中不能够直接sizeof void类型 。做题的时候没注意,这个知识点忽略了。分析:如上,如果改为sizeof(void *)则为4,32位机器中指针大小为4字节。设 x,y,t 均为 int 型变量,执行下列

2020-11-23 18:55:50 362

原创 牛客网错题整理--C++篇1

牛客网错题整理--C++篇1 1.下列程序的运行结果是PP 10003,请为横线处选择合适的程序(): #include<stdio.h> #include<string.h> struct STU { char name[10]; int num; }; void f(char_____, int num) { struct STU s[2]={{"SS",10001},{"PP",10002}}; num = s[1]

2020-11-22 13:46:56 637 1

空空如也

空空如也

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

TA关注的人

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