w1s2x35
码龄5年
关注
提问 私信
  • 博客:37,025
    问答:252
    37,277
    总访问量
  • 69
    原创
  • 1,130,088
    排名
  • 8
    粉丝
  • 0
    铁粉
IP属地以运营商信息为准,境内显示到省(区、市),境外显示到国家(地区)
IP 属地:北京市
  • 加入CSDN时间: 2020-02-11
博客简介:

w1s2x35的博客

查看详细资料
个人成就
  • 获得14次点赞
  • 内容获得9次评论
  • 获得47次收藏
  • 代码片获得131次分享
创作历程
  • 69篇
    2020年
成就勋章
兴趣领域 设置
  • 数据结构与算法
    推荐算法
  • 最近
  • 文章
  • 代码仓
  • 资源
  • 问答
  • 帖子
  • 视频
  • 课程
  • 关注/订阅/互动
  • 收藏
搜TA的内容
搜索 取消

css中为什么margin-right不管用?

发布问题 2021.05.07 ·
5 回答

不太懂这个代码中return的意义

答:

调用函数,你在主函数里写出max(a,b);

就得到了最大值,这个最大值就是从写的max函数返回的。

回答问题 2020.11.08

kmp算法

Given two strings a and b we define ab to be their concatenation. For example, if a = “abc” and b = “def” then ab = “abcdef”. If we think of concatenation as multiplication, exponentiation by a non-negative integer is defined in the normal way: a^0 = “” (t
原创
发布博客 2020.08.09 ·
199 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

马拉车算法

给出一个只由小写英文字符a,b,c…y,z组成的字符串S,求S中最长回文串的长度.回文就是正反读都是一样的字符串,如aba, abba等Input输入有多组case,不超过120组,每组输入为一行小写英文字符a,b,c…y,z组成的字符串S两组case之间由空行隔开(该空行不用处理)字符串长度len <= 110000Output每一行一个整数x,对应一组case,表示该组case的字符串中所包含的最长回文长度.Sample InputaaaaababSample Output
原创
发布博客 2020.08.09 ·
243 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

哈密顿绕行世界问题

一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。Input前20行的第i行有3个数,表示与第i个城市相邻的3个城市.第20行以后每行有1个数m,m<=20,m>=1.m=0退出.Output输出从第m个城市出发经过每个城市1次又回到m的所有路线,如有多条路线,按字典序输出,每行1条路线.每行首先输出是第几条路线.然后个一个: 后列出经过的城市.参看Sample outputSample Input2 5 201
原创
发布博客 2020.07.25 ·
189 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

大学食堂

电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。某天,食堂中有n种菜出售,每种菜可购买一次。已知每种菜的价格以及卡上的余额,问最少可使卡上的余额为多少。Input多组数据。对于每组数据:第一行为正整数n,表示菜的数量。n<=1000。第二行包括n个正整数,表示每种菜的价格。价格不超过50。第三行包括一个正整数m,
原创
发布博客 2020.06.10 ·
233 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

求数列最大和

给定K个整数的序列{ N1, N2, …, NK },其任意连续子序列可表示为{ Ni, Ni+1, …,Nj },其中 1 <= i <= j <= K。最大连续子序列是所有连续子序列中元素和最大的一个,例如给定序列{ -2, 11, -4, 13, -5, -2 },其最大连续子序列为{ 11, -4, 13 },最大和为20。在今年的数据结构考卷中,要求编写程序得到最大和,现在增加一个要求,即还需要输出该子序列的第一个和最后一个元素。Input测试输入包含若干测试用例,
原创
发布博客 2020.06.10 ·
389 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

数塔游戏

在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的:有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少?已经告诉你了,这是个DP的题目,你能AC吗?Input输入数据首先包括一个整数C,表示测试实例的个数,每个测试实例的第一行是一个整数N(1 <= N <= 100),表示数塔的高度,接下来用N行数字表示数塔,其中第i行有个i个整数,且所有的整数均在区间[0,99]内。Output对于每个测试实例,输出可能得到的最大和,每
原创
发布博客 2020.06.10 ·
935 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

本周总结

判断字符串中是否有别的字符,for循环判断上一个字符串中含有下一个字符串中所有元素,输出yes否则输出no。做了第六周训练题的A题,没做出来,看别人的题解,输入一些单词作为字典,再输入一些单词查找:若某个单词能在字典中找到,则输出correct。若某个单词能通过 变换 或 删除 或 添加一个字符后,在字典中找得到,则输出这些单词,输出顺序根据 输入的字典的字典序。某个单词无论操作与否都无法在字典中找得到,则输出空。明天再做。做了H题求n个字符串的最长公共串枚举第一个字符串的不同长度子串,判断她是否为下
原创
发布博客 2020.06.07 ·
100 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

素数筛

Bamboo Pole-vault is a massively popular sport in Xzhiland. And Master Phi-shoe is a very popular coach for his success. He needs some bamboos for his students, so he asked his assistant Bi-Shoe to go to the market and buy them. Plenty of Bamboos of all po
原创
发布博客 2020.06.07 ·
128 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

数学论

I was trying to solve problem ‘1234 - Harmonic Number’, I wrote the following codelong long H( int n ) {long long res = 0;for( int i = 1; i <= n; i++ )res = res + n / i;return res;}Yes, my error was that I was using the integer divisions only. Ho
原创
发布博客 2020.06.07 ·
286 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

剪花布条

一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢?Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。花纹条和小饰条不会超过1000个字符长。如果遇见#字符,则不再进行工作。Output输出能从花纹布中剪出的最多小饰条个数,如果一块都没有,那就老老实实输出0,每个结果之间应换行。Sample Input
原创
发布博客 2020.06.07 ·
185 阅读 ·
0 点赞 ·
1 评论 ·
0 收藏

割栅栏

Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,000) planks of wood, each having some integer length Li (1 ≤ Li ≤ 50,000) units. He then purchases a single long board j
原创
发布博客 2020.06.03 ·
102 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

All in All

You have devised a new encryption technique which encodes a message by inserting between its characters randomly generated strings in a clever way. Because of pending patent issues we will not discuss in detail how the strings are generated and inserted in
原创
发布博客 2020.06.03 ·
113 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

求中位数

FJ is surveying his herd to find the most average cow. He wants to know how much milk this ‘median’ cow gives: half of the cows give as much or more than the median; half give as much or less.Given an odd number of cows N (1 <= N < 10,000) and their
原创
发布博客 2020.06.03 ·
220 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

本周总结

做了十五周训练题的D题,因为N=40,结果为245,N=41时,结果为24541=10045%2009=0了训练题的B题,题目的意思是寻找丑数的约数的个数一共有多少个,不包括自己,所谓丑数,就是约数只包含2,3,5,7设2,3,5,7的指数分别为a, b, c, d,则题目给定一个数n,就会有2^a * 3^b * 5^c * 7^d = n, 然后就可以知道了,这个n是由a个2,b个3,c个5以及d个7乘出来的,接下来就可以组合出n的所有因数了,2最少有0个,最多有a个,同理,3,5,7也一样,这样a个
原创
发布博客 2020.05.31 ·
105 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

The number of divisors(约数) about Humble Numbers HDU - 1492 (唯一分解定理)

A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, … shows the first 20 humble numbers.Now given a humble number, please write a program to calcul
原创
发布博客 2020.05.31 ·
146 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

求大阶乘

WhereIsHeroFrom: Zty, what are you doing ?Zty: I want to calculate N!..WhereIsHeroFrom: So easy! How big N is ?Zty: 1 <=N <=1000000000000000000000000000
原创
发布博客 2020.05.31 ·
130 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

素数筛

We know what a base of a number is and what the properties are. For example, we use decimal number system, where the base is 10 and we use the symbols - {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}. But in different bases we use different symbols. For example in binary
原创
发布博客 2020.05.31 ·
130 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

log前三位和快速幂取模求后三位

You are given two integers: n and k, your task is to find the most significant three digits, and least significant three digits of nk.InputInput starts with an integer T (≤ 1000), denoting the number of test cases.Each case starts with a line containing
原创
发布博客 2020.05.27 ·
215 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏
加载更多