- 博客(16)
- 收藏
- 关注
原创 JS 函数的执行时机
首先讲讲JS函数的几大要素:调用时机:JS函数的不同执行时机,会影响到函数运行的输出结果,不能通过代码本身百分百判断函数输出什么,而是要根据函数具体的执行时机。 作用域:每个函数都会默认创建一个作用域 闭包:JS函数会就近寻找最近的变量 形式参数 返回值 调用栈:进入一个函数的时候,要先把环境存下来,才能进去,有的东西越多,需要一个数组来保存,那保存的环境所在的数组叫做调用栈 函数提升 arguments(除了箭头函数) this(除了箭头函数)而一个函数的调用时机会影响其调用的结果。
2021-07-17 23:48:51
256
原创 POJ1317-取余的运算规则
题目链接:http://poj.org/problem?id=1317对题目所给运算规则的逆运算,注意取余的运算规则。#include<cstdio>#include<cstring>#include<map>using namespace std;char dic[]="_abcdefghijklmnopqrstuvwxyz.";char ...
2018-09-03 20:13:59
353
原创 POJ1230-贪心
题目链接:http://poj.org/problem?id=1230贪心策略是遍历每列,把不合格的列中往右延申最长的墙去掉。但是做完这道题发现自己总是需要比较大的空间复杂度呀,不太好。。#include<cstdio>#include<cstring>#include<vector>using namespace std;struct W...
2018-09-03 20:07:07
327
原创 POJ1218-根的意义?
题目链接:http://poj.org/problem?id=1218这道题的原理貌似之前在哪里看过。#include<cstdio>#include<cmath>using namespace std;int main(){ int m; scanf("%d",&m); while(m--) { int n; scanf("%d"...
2018-09-03 20:04:02
193
原创 POJ1163-递归动态规划?
题目链接:http://poj.org/problem?id=1163其实个人感觉这道题可以算是记忆化深度优先搜索,也可以算是动态规划。如果认识上有错误请轻喷。。和之前的某道题很相似,能做出这道题也算是自己的学习成果吧!#include<cstdio>#include<cstring>using namespace std;int s[101][101]...
2018-09-03 19:59:58
158
原创 POJ1161-最短路径
题目链接:http://poj.org/problem?id=1161先以区域为结点建图,用floyd算法计算区域间相隔的墙壁数,再遍历每个区域找到给定点能到达的最短区域。但是感觉自己的代码太难懂了
2018-09-03 19:55:20
184
原创 POJ1157-动态规划
题目链接:http://poj.org/problem?id=1157由于花有摆放顺序的限制,即后一种花只能放在前一种花所放的花盆的后面的花盆,所以动态规划的状态转移就比较容易写出来了。状态dp[i][j]表示的是前i种花放入前j个花盆中时的最大权值。则dp[i][j]=max{dp[i][j-1],dp[i-1][j-1]+a[i][j]}。代码如下:#include<...
2018-09-03 17:25:29
239
原创 POJ1107解题心得-注意除零问题
W's CipherTime Limit: 1000MS Memory Limit: 10000K Total Submissions: 5759 Accepted: 2883 DescriptionWeird Wally's Wireless Widgets, Inc. manufactures an eclectic assortment of ...
2018-08-25 20:52:58
195
原创 POJ1065-dilworth定理?
Wooden SticksTime Limit: 1000MS Memory Limit: 10000K Total Submissions: 25985 Accepted: 11248 DescriptionThere is a pile of n wooden sticks. The length and weight of each stick...
2018-08-23 11:00:10
185
原创 POJ1050-矩阵压缩
To the MaxTime Limit: 1000MS Memory Limit: 10000K Total Submissions: 52454 Accepted: 27741 DescriptionGiven a two-dimensional array of positive and negative integers, a sub-rec...
2018-08-22 11:18:58
140
原创 POJ1032学习-数论
ParliamentTime Limit: 1000MS Memory Limit: 10000K Total Submissions: 19708 Accepted: 8334 DescriptionNew convocation of The Fool Land's Parliament consists of N delegates. Acco...
2018-08-21 21:29:56
196
原创 POJ1017
PacketsTime Limit: 1000MS Memory Limit: 10000K Total Submissions: 61851 Accepted: 20957 DescriptionA factory produces products packed in square packets of the same height h and...
2018-08-21 21:26:50
363
原创 POJ1012
JosephTime Limit: 1000MS Memory Limit: 10000K Total Submissions: 57612 Accepted: 21938 DescriptionThe Joseph's problem is notoriously known. For those who are not familiar with...
2018-08-21 21:13:42
614
原创 POJ1006
DescriptionSome people believe that there are three cycles in a person's life that start the day he or she is born. These three cycles are the physical, emotional, and intellectual cycles, and they ...
2018-04-29 21:41:51
410
原创 POJ1005
DescriptionFred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the land, he learned that the state of Louisiana is actually shrinking ...
2018-04-29 16:34:40
212
原创 POJ1002
DescriptionBusinesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or phrase. For example, you can call the University ...
2018-04-28 23:30:46
299
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人