- 博客(8)
- 收藏
- 关注
原创 [Leetcode]Sliding Window Maximum
题目描述:Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding w...
2019-01-29 21:02:24 156
原创 cin和scanf
今天刷着PTA的数据结构与算法题目集,遇到一道题如下: 7-19 求链式线性表的倒数第K项(20 分)给定一系列正整数,请设计一个尽可能高效的算法,查找倒数第K个位置上的数字。输入格式:输入首先给出一个正整数K,随后是若干正整数,最后以一个负整数表示结尾(该负数不算在序列内,不要处理)。输出格式:输出倒数第K个位置上的数据。如果这个位置不存在,输出错误信息NULL。...
2018-07-31 22:18:36 701
原创 Project Euler 96 Sudoku
Su DokuProblem 96 Su Doku (Japanese meaning number place) is the name given to a popular puzzle concept. Its origin is unclear, but credit must be attributed to Leonhard Euler who invented a similar, ...
2018-03-11 21:37:12 220
原创 Project Euler 83
Path sum: two waysProblem 81 In the 5 by 5 matrix below, the minimal path sum from the top left to the bottom right, by only moving to the right and down, is indicated in bold red and is equal to 2427...
2018-02-24 22:50:05 267
原创 Project Euler 80
Square root digital expansionProblem 80 It is well known that if the square root of a natural number is not an integer, then it is irrational. The decimal expansion of such square roots is infinite wi...
2018-02-19 23:02:23 208
原创 Project Euler 78
Let p(n) represent the number of different ways in which n coins can be separated into piles. For example, five coins can be separated into piles in exactly seven different ways, so p(5)=7.OOOOOOOOO ...
2018-02-18 15:18:31 370
原创 Project Euler Problem 66
Problem 66 Consider quadratic Diophantine equations of the form:x2 – Dy2 = 1For example, when D=13, the minimal solution in x is 6492 – 13×1802 = 1.It can be assumed that there are no solutions in pos...
2018-02-13 21:50:51 247
原创 Project Euler 1-50小结
本人大一菜狗,趁着寒假没什么事可做,兴致勃勃的刷起了ProjectEuler。Project Euler上的编程题大部分都是数学题,只需要提交一个答案就好(这有别于其它OJ,我喜欢这一点,因为这样在程序里就不用考虑特殊的输入输出),当然你也可以选择用数学知识来笔算得出答案,不管用什么方法,提高能力才是根本的目的。刷完前50题,对某些题还是有所收获有所感触的,记录下来,以便日后翻看。Proble
2018-02-04 15:44:24 2940
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人