问题描述
Oh Jesus! The Minecraft Server of XadillaX's came across a bug!
There's one way to solve this bug in game. That is to get a bucket of water and a bucket of lava and mix them to obsidian. But ...
分类:
其他好文 时间:
2014-05-10 10:13:22
阅读次数:
307
1、函数是一种 “第一类值”
a = {p = print};
a.p("hello");
a = print;
a("Hi");
2、 table 提供的函数 table.sort
network = {
{name = "lua", IP = "192.168.1.1"},
{name = "CPP", IP = "192.168.1.2"}
};
f...
分类:
其他好文 时间:
2014-05-10 09:21:02
阅读次数:
273
题意:
给你ABCD四个集合,集合中数的个数都为N(N
当然你可以尝试枚举所有的组合,绝对可以计算出结果,大概有N^4种吧,如果你有足够的时间还是可以算出来的,哈哈。
当然我不是用上面一种方法计算的,那样算肯定超时。 我的做法是求出所有a+b 到ab数组中, 和所有 c+d到cd数组中,然后排序,枚举每个ab,用二分在cd中查找有没有可能组成0。 有个问题就...
分类:
其他好文 时间:
2014-05-10 08:40:14
阅读次数:
278
环境:vs2012 win7 c++1 #include2
写一个比较函数,体现对象间是按照哪些key值来排序的。3 使用std::sort函数。例子如下:#include
/*排序规律:星级最大的排前面,其次等级越大排前面,再其次是经验越大排前面,最后是其次是ID值越大排越后面。*/bool my...
分类:
其他好文 时间:
2014-05-08 19:54:37
阅读次数:
226
java实现排序的一些方法,来自:http://www.javaeye.com/topic/548520 1
package sort; 2 3 import java.util.Random; 4 5 /** 6 * 排序测试类 7 * 8 *...
分类:
编程语言 时间:
2014-05-07 19:13:32
阅读次数:
448
Given an array with n objects colored red,
white or blue, sort them so that objects of the same color are adjacent, with
the colors in the order red, ...
分类:
其他好文 时间:
2014-05-07 18:01:05
阅读次数:
412
private static void sort1(int x[], int off, int len) {
// Insertion sort on smallest arrays //长度小于7,采用冒泡排序
if (len < 7) {
for (int i=off; ioff && x[j-1]>x[j];...
分类:
其他好文 时间:
2014-05-07 05:14:35
阅读次数:
279
最近在学scala语言,scala代码如下:
import scala.collection.JavaConversions._
object Solution {
def solution(A: Array[Int]): Int = {
// write your code in Scala 2.10
// sort
scala.uti...
分类:
其他好文 时间:
2014-05-07 04:20:38
阅读次数:
352
插入排序(Insertion Sort),选择排序(Selection
Sort),冒泡排序和快速排序是我们经常会用到的排序算法。下面是这几种算法的基本思想和相对应的PHP实现代码。插入排序(Insertion
Sort)的基本思想是:每次将一个待排序的记录,按其关键字大小插入到前面已经排好序的子文...
分类:
Web程序 时间:
2014-05-05 12:48:01
阅读次数:
478
最近在学scala语言,scala代码如下:
import scala.collection.JavaConversions._
object Solution {
def solution(A: Array[Int]): Int = {
// write your code in Scala 2.10
// using quick sort to so...
分类:
其他好文 时间:
2014-05-04 09:22:37
阅读次数:
341