Skip to content

Instantly share code, notes, and snippets.

var ColorScene = cc.Scene.extend({
ctor: function(color) {
cc.Scene.prototype.ctor.call(this);
this.layerColor = color;
},
onEnter:function () {
var color = this.layerColor;
var ColorLayer = cc.Layer.extend({
init:function () {
this._super();
@nise-nabe
nise-nabe / Main.java
Last active August 29, 2015 14:19
Google Code Jam 2015 Qual A
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
try (Scanner s = new Scanner(System.in)) {
for (int t = 1, T = s.nextInt(); t <= T; ++t) {
int shynessLevelMax = s.nextInt();
String line = s.next();
int additionalFriends = 0;
for (int shynessLevel = 0, standingSum = 0; shynessLevel <= shynessLevelMax; ++shynessLevel) {
$ javac Main.java
$ time java Main
java Main  5.91s user 0.29s system 102% cpu 6.053 total
$ go build -o main
$ time ./main
./main  33.44s user 3.35s system 117% cpu 31.391 total
CREATE TABLE follow (
follow_from INT(11) NOT NULL,
follow_to INT(11) NOT NULL,
);
CREATE INDEX follow_from_to_idx ON follow (follow_from, follow_to);
CREATE TABLE tweet (
id INT(11) NOT NULL AUTO_INCREMENT,
user_id INT(11) NOT NULL,
package main
import (
"fmt"
"strings"
)
func main() {
for m := 0; m < 1000; m++ {
fmt.Println("INSERT INTO tweet (`user_id`, `tweet`) VALUES")
package main
import (
"fmt"
"math/rand"
"strings"
)
type Member struct {
Id int
package main
import (
"runtime"
)
func init() {
runtime.GOMAXPROCS(runtime.NumCPU())
}
import java.util.Map;
import java.util.HashMap;
class Main {
public static void main(String[] args){
for (int i = 0; i < 10000; i++) {
Map<Integer, Integer> m = new HashMap<Integer, Integer>();
for (int j = 0; j < 10000; j++) {
if (!m.containsKey(j)) {
m.put(j, i);
package main
import (
"bufio"
"flag"
"fmt"
"github.com/golang/glog"
"io"
"log"
"os"
package main
import (
"log"
"runtime"
"sync"
"time"
)
func f(x int) int64 {