Skip to content

Instantly share code, notes, and snippets.

{"query":{},"broadcast":{"system":{},"status":{"submissionID":4,"result":"Accept\n","time":"2013/12/28_23:58:54","UID":6787860},"UID":6787860,"type":"status"},"login":{},"submission":{"info":{}},"type":"broadcast"}
package nthu.cs.henryyang42.canvas;
public class CanvasPoint {
public float x;
public float y;
public int action;
public int color;
public CanvasPoint(float x,float y,int a, int color){
this.x = x;
this.y = y;
#include<iostream>
using namespace std;
int main(){
int count=0;
cin >> count;
for(int i=1;i<=count;i++){
int *array = new int[5];
for(int integer=0;integer<4;integer++){
int hold = 0;
cin >> hold;
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
#include <math.h>
#include <string.h>
int N ,Test,i,avg,sum ,total,n_num,num[2000000];
double x ,y;
int main()
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <cctype>
#include <vector>
#include <queue>
#define MAX 1000000000000000LL
using namespace std;
<?php
$db_server = "localhost";
$db_user = "henryyang42";
$db_passwd = "gg";
$db_name = "henryyang42";
if(!@mysql_connect($db_server, $db_user, $db_passwd)){
die("無法對資料庫連線");
}
#!/bin/bash
clear
read -p "Which to test? [1:open 2:hidden(not yet used) 3:student]: " sel
if [ "$sel" = "1" ]; then
place="open_testcase/"
array=(fib_r error pipeline1 pipeline2 pipeline3)
fi
if [ "$sel" = "2" ]; then

#JMJ SPEC

##data structure

  • Japanese Mahjong has 34 different kinds of tiles plus 3 read doras, 4 for each, 136 tiles in total. Therefore, for simpilicity, all different tiles are labled from 0 to 33 as below.

alt text

  • Note that for each tile there are 4 same ones, in our algorithm, we use 0 to 135 to represent each tile. And they are easily convert back into 0 ~ 34 using folling code.
[{
"type": "ronResult",
"result": {
"point": 8000,
"fu": 40,
"yaku": 13,
"yakuman": 0,
"yakuType": [
["断么", 1, "voice/y01.mp3"],
["立直,リーチ", 1, "voice/y44.mp3"],
#include <Stepper.h>
// number of steps on your motor
#define STEPS 64
char cmd;
//Stepper cw(STEPS, 8, 9, 10, 11);//clockwise
//Stepper ccw(STEPS, 8, 11, 10, 9);//counterclockwise
int delayTime = 1;
void setup()