- 博客(105)
- 收藏
- 关注
原创 关于add(2)(3)(4)的记录
最近在读汤姆大叔的系列博文,看到这样一道题,记录下解题过程 题目:实现如下语法的功能:var a = add(2)(3)(4); //9 很显然,要通过闭包来保存中间计算的结果,并通过返回函数进行级联操作,这个返回的函数还应该是一个自引用函数。 由于之前在别的地方看到过类似的题目,记得同时要求满足add(2,3)(4)这样的调用,于是做了下处理。Ilet ad
2017-09-25 20:45:00 545
原创 __proto__和prototype
提到javascript,不得不说到原型链:当在自身找不到某个属性时,则会到上一层原型查找,通过此机制可以实现继承。 1,表面的prototype,隐藏的__proto__先看简单的原型链: 这里的a自身没有定义toString方法,但是通过到Object.prototype(原型链的顶层)上找到toString方法,从而正确的输出了。那a是通过哪个属性追查到Object....
2017-05-06 17:35:07 595
翻译 js里面的Timer
一、Timer在js里面提供了两个用来定时执行代码的函数:setTimeout和setInerval,统称为Timer. 二、初级印象setTimeout( func|string, time )在一定时间后执行代码setInterval( func|string, time)每隔一段时间后执行代码 三,参数解析(一)、func | string1,这两个计时器
2016-04-26 20:58:03 4012
原创 js的函数作用域跟块级作用域
一,js中的作用域 js中除了全局作用域,还有函数作用域。 嗯,还有块级作用域。二,函数作用域跟块级作用域的区别 当将代码看成一个IIFE时,全局作用域其实就是一个函数作用域。 那么函数作用域跟块级作用域的区别是什么呢? 函数作用域:变量在定义的函数内及嵌套的子函数内处处可见; 块级函数域:变量在离开定义的块级
2016-04-07 14:34:40 9922 3
原创 初识commonjs
一,为什么要用commonjs 在大型项目中,需要根据需求和功能将程序划分为不同的模块。第一有利于多人开发,提高开发效率;第二提高了模块的复用率,清晰明确的框架也能提高程序的可维护性和健壮性。 但是多人开发也会带来一些问题。 依赖问题: 不同的模块之间可能存在依赖问题,如果需要手动指定其加载次序,不仅浪费人力物力,也不利于修改
2016-04-05 19:10:16 4423
原创 sicily 1205. brainf*ck
1205. brainf*ckConstraintsTime Limit: 1 secs, Memory Limit: 32 MB Descriptionbrainf*ck is the ungodly creation of Urban Mller, whose goal was apparently to create a Turing-complete language
2015-11-27 23:23:59 488
原创 sicily 1202. The Bank of Kalii
1202. The Bank of KaliiConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionCustomers of the Bank of Kalii handle their banking transactions similar to the way they handle their tax
2015-11-26 00:16:13 1230
原创 sicily 1187. Laserbox
1187. LaserboxConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionA laserbox is a game involving some optical equipment. The game board is a square n×n grid. On each grid point,
2015-11-25 14:19:39 562
原创 归并排序查找逆序对
DescriptionLet A(1), ..., A(n) be a sequence of n numbers. If iA(j), then the pair (i,j) is called an inversion pair.The inversion number of a sequence is one common measure of its sortedness.
2015-11-23 12:21:39 674
原创 sicily 1210. 二叉树
1210. 二叉树ConstraintsTime Limit: 1 secs, Memory Limit: 32 MB Description在众多的数据结构中,二叉树是一种特殊而重要的结构,有着广泛的应用。二叉树或者是一个结点,或者有且仅有一个结点为二叉树的根,其余结点被分成两个互不相交的子集,一个作为左子集,另一个作为右子集,每个子集又是一个二叉树。遍历一棵二叉树就
2015-11-22 19:42:46 1256
原创 sicily 1132. ROUTES
1132. ROUTESConstraintsTime Limit: 10 secs, Memory Limit: 32 MB DescriptionThe Truckee Freight Company has a network consisting of a number ofterminal stations and transfer stations. ¨
2015-11-22 12:42:12 363
原创 sicily 1308. Dependencies among J
1308. Dependencies among JConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionAs everybody knows, our staffs need to do a lot of jobs to prepare for GDCPC’2003 (ZSUCPC’2003). But
2015-11-20 20:58:18 396
原创 sicily 1321. Robot
1321. RobotConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionKarell Incorporated has designed a new exploration robot that has the ability to explore new terrains, this new robot
2015-11-19 21:22:20 1031
原创 sicily 1190. Reduced ID Numbers
1190. Reduced ID NumbersConstraintsTime Limit: 2 secs, Memory Limit: 32 MB DescriptionT. Chur teaches various groups of students at university U. Every U-student has a unique Student Identif
2015-11-19 17:11:16 390
原创 sicily 1239. Smallest Differencev
1239. Smallest DifferencevConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionGiven a number of distinct decimal digits, you can form one integer by choosing a non-empty subset of
2015-11-19 16:56:29 399
原创 sicily 1047. Super Snooker
1047. Super SnookerConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionOn one of my many interplanetary travels I landed on a beautiful little planet called Crucible. It was inhabi
2015-11-19 15:45:50 520
原创 sicily 2501. 算算式
2501. 算算式ConstraintsTime Limit: 1 secs, Memory Limit: 256 MB Description_gXX遇到一个麻烦的式子:S = n1 + n2 + n3 + ...... + nk,已知n、k,求S的值。因为_gXX数学很差,希望你能告诉他答案。但是由于他的数学实在太差了,所以你只需要告诉他S除以9901的余数即可
2015-11-19 14:38:51 440
原创 sicily 1059. Exocenter of a Trian
1059. Exocenter of a TrianConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionGiven a triangle ABC, the Extriangles of ABC are constructed as follows:On each side of ABC, constru
2015-11-19 13:15:39 401
原创 sicily 1231. The Embarrassed Cryptography
1231. The Embarrassed CryptographyConstraintsTime Limit: 2 secs, Memory Limit: 32 MB DescriptionThe young and very promising cryptographer Odd Even has implemented the security module of a l
2015-11-19 13:00:58 335
原创 sicily 1381. a*b
1381. a*bConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionGive two positive integers a and b, please help us calculate a*b.InputThe first line of the input is a positive i
2015-11-18 20:07:30 659
原创 sicily 1201. 01000001
1201. 01000001ConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionAdding binary numbers is a very simple task, and very similar to the longhand addition of decimal numbers. As with
2015-11-18 19:51:32 413
原创 sicily 1083. Networking
1083. NetworkingConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionYou are assigned to design network connections between certain points in a wide area. You are given a set of poi
2015-11-18 19:20:28 378
原创 中序表达式转后序表达式(带括号)
要求 将中缀表达式(infix expression)转换为后缀表达式(postfix expression)。假设中缀表达式中的操作数均以单个英文字母表示,且其中只包含左括号'(',右括号‘)’和双目算术操作符+,-,*,/。做法: 操作数直接输出 ( * / :直接压栈 ) :出栈并打印栈顶元素,直到遇到'(',注意'('
2015-11-17 20:57:23 1159
原创 sicily 1034. Forest
1034. ForestConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionIn the field of computer science, forest is important and deeply researched , it is a model for many data structur
2015-11-17 20:48:04 508
原创 sicily 1310. Right-Heavy Tree
1310. Right-Heavy TreeConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionA right-heavy tree is a binary tree where the value of a node is greater than or equal to the values of
2015-11-17 17:15:03 515
原创 sicily 1424. 奖金
1424. 奖金ConstraintsTime Limit: 1 secs, Memory Limit: 32 MB Description 由于无敌的凡凡在2005年世界英俊帅气男总决选中胜出,Yali Company总经理Mr.Z心情好,决定给每位员工发奖金。公司决定以每个人本年在公司的贡献为标准来计算他们得到奖金的多少。 于是Mr.Z下令召开m方会谈。每位
2015-11-17 17:06:54 544
原创 sicily 1500. Prime Gap
1500. Prime GapConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionThe sequence of n ? 1 consecutive composite numbers (positive integers that are not prime and not equal to
2015-11-17 16:38:12 455
原创 sicily 1119. Factstone Benchmark
1119. Factstone BenchmarkConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionAmtel has announced that it will release a 128-bit computer chip by 2010, a 256-bit computer by 2020, a
2015-11-17 16:33:53 355
原创 sicily 1099. Packing Passengers
1099. Packing PassengersConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionPTA, Pack ‘em Tight Airlines is attempting the seemingly impossible—to fly with only full planes and sti
2015-11-17 16:20:48 485
原创 sicily 1028. Hanoi Tower Sequence
1028. Hanoi Tower SequenceConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionHanoi Tower is a famous game invented by the French mathematician Edourard Lucas in 1883. We are giv
2015-11-17 16:07:19 365
原创 sicily 1020. Big Integer
1020. Big IntegerConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionLong long ago, there was a super computer that could deal with VeryLongIntegers(no VeryLongInteger will be nega
2015-11-17 16:00:56 348
原创 sicily 1017. Rate of Return
1017. Rate of ReturnConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionJill has been investing in a mutual fund for a while. Since her income has varied, the amount of money she h
2015-11-17 15:57:20 408
原创 sicily 1009. Mersenne Composite N
1009. Mersenne Composite NConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionOne of the world-wide cooperative computing tasks is the "Grand Internet Mersenne Prime Search" -- GIM
2015-11-17 15:50:28 382
原创 sicily 1107. Simple Puzzle
1107. Simple PuzzleConstraintsTime Limit: 10 secs, Memory Limit: 32 MB DescriptionHere is a simple puzzle on numbers. There are n numbers, each of which is of k (kn) distinct and signifi
2015-11-17 15:23:29 1198
原创 sicily 1063. Who's the Boss
1063. Who's the BossConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionSeveral surveys indicate that the taller you are, the higher you can climb the corporate ladder. At TALL Ent
2015-11-16 14:32:20 442
原创 sicily 1018. A Card Trick
1018. A Card TrickConstraintsTime Limit: 1 secs, Memory Limit: 32 MB , Special Judge DescriptionThe following card trick is performed by a Magician and her Assistant. The Assistant asks a me
2015-11-16 13:59:34 407
原创 sicily 1006. Team Rankings
1006. Team RankingsConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionIt's preseason and the local newspaper wants to publish a preseason ranking of the teams in the local amateur
2015-11-16 13:52:03 428
原创 next_permutation
这是一个求一个排序的下一个排列的函数,可以遍历全排列(在while中最大返回假,单独执行会循环)要包含头文件与之完全相反的函数还有prev_permutation (1) int 类型的next_permutationint main() { int a[3]; a[0]=1;a[1]=2;a[2]=3; do { cout } while (
2015-11-16 13:07:30 445
原创 sicily 1003. Hit or Miss
1003. Hit or MissConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionOne very simple type of solitaire game known as "Hit or Miss" (also known as "Frustration," "Harvest," "Roll-Ca
2015-11-16 12:35:53 751
原创 sicily 1082. MANAGER
1082. MANAGERConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionOne of the programming paradigm in parallel processing is the producer/consumer paradigm that can be implemented us
2015-11-15 21:46:12 412
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人