Skip to content

Instantly share code, notes, and snippets.

View threepipes's full-sized avatar

Shogo Tsutsumi threepipes

View GitHub Profile
@threepipes
threepipes / GifWriter.java
Last active April 22, 2018 11:58
(主にTopCoderMMで)アニメーションgifを書き出すためのクラス
import javax.imageio.*;
import javax.imageio.stream.ImageOutputStream;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
public class GifWriter {
ImageWriter iw = ImageIO.getImageWritersByFormatName("gif").next();
BufferedImage buffer;
boolean finish = false;
@threepipes
threepipes / PoisonedWine.java
Last active July 20, 2017 22:15
TCO17MM Round3 最終提出ソースコード
import java.io.*;
import java.math.BigDecimal;
import java.math.MathContext;
import java.util.*;
// -------8<------- start of solution submitted to the website -----8<-------
public class PoisonedWine {
// params
static double LOG_COEF = 0.3 + 0.002 * 50; // 0.30-0.50:0.002*100
static double TEST_SUB = 0.0 + 0.05 * 66; // 0-5:0.05*100
@threepipes
threepipes / majongg_recog.java
Created May 11, 2017 13:11
麻雀牌画像から牌の輪郭を切り出す
import java.util.ArrayList;
import java.util.List;
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.Scalar;
import org.opencv.core.Size;
import org.opencv.imgcodecs.Imgcodecs;
import org.opencv.imgproc.Imgproc;
@threepipes
threepipes / circle_line_intersection.py
Created April 25, 2017 17:57
pythonによる円と線分の交差判定テスト
# -*- coding: utf-8 -*-
import pygame
import sys
import random
import shapely.geometry as sg
class Pos:
def __init__(self, x, y):
self.x = x