The Little Elephant likes permutations. This time he has a permutation A[1], A[2], ..., A[N] of numbers 1, 2, ...,N.
He calls a permutation A good, if the number of its inversions is equal to the n...
分类:
其他好文 时间:
2014-05-07 07:20:50
阅读次数:
356
大意:每个测试用例是一个数组。找出xi和xj,(xi>xj),做运算令xi=xi-xj。可以做若干组这样的运算,使得最后的数组和最小。输出此和。
分析:用优先队列,每次找出最大的和次大的,处理后再加入此队列。注意多个相同的xi这种情况!...
分类:
其他好文 时间:
2014-05-07 07:19:27
阅读次数:
301
The number of steps
Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^
题目描述
Mary stands in a strange maze, the maze looks like a triangle(the first layer have one room,the seco...
分类:
其他好文 时间:
2014-05-07 06:15:59
阅读次数:
427
The gray code is a binary numeral system where two successive values differ in only one bit.
Given a non-negative integer n representing the total number of bits in the code, print the sequence of gr...
分类:
其他好文 时间:
2014-05-07 06:10:17
阅读次数:
370
Description
Farmer John has purchased a lush new rectangular pasture composed of M by
N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of square...
分类:
其他好文 时间:
2014-05-07 05:46:43
阅读次数:
323
[Question]
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to t...
分类:
其他好文 时间:
2014-05-07 05:37:44
阅读次数:
278
请不要随便指点别人该怎么做、每个人的人生都应该自己掌握、你给不了别人一切、你也不懂别人的忧伤、
微笑不代表快乐、哭泣不一定悲伤
不努力怎么让那些关心你的人幸福、不努...
分类:
其他好文 时间:
2014-05-07 05:02:04
阅读次数:
263
转载请注明 本文出自:http://blog.csdn.net/nancle
首先说==和===
首先说明一个很特殊的值NaN, typeof(Nav)得到'number',但是NaN不等于任何一个值(包括它本身),判断一个值是不是NaN只能使用isNaNNaN == NaN //得到 false
NaN === NaN //得到false
isNaN(NaN) //得到true
然...
分类:
编程语言 时间:
2014-05-07 03:58:30
阅读次数:
363
#! /usr/bin/env racket
#lang racket
#|
NAME:
getModelNumber.rkt
This program is used to get model number based on the
input model file name.
USAGE:
./getModelNumber.rkt modelfi...
分类:
其他好文 时间:
2014-05-07 03:17:09
阅读次数:
323
五一中间断了几天,开始继续。。。
1、
??
Copy List with Random Pointer
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.
Return a...
分类:
其他好文 时间:
2014-05-06 18:54:59
阅读次数:
386