Skip to content

Instantly share code, notes, and snippets.

@kenkoooo
kenkoooo / ChangingChange.java
Last active August 29, 2015 14:25
O(N^3)のDP
public class ChangingChange {
private final long MOD = 1000000007;
private final int MAX = 1003000;
private long[] fact, factInv;
public int[] countWays(int[] ways, int[] valueRemoved, int[] numRemoved) {
fact = Mod.factorialArray(MAX, MOD);
factInv = Mod.factorialInverseArray(MAX, MOD,
Mod.inverseArray(MAX, MOD));
public class ChangingChange {
private final long MOD = 1000000007;
private final int MAX = 1003000;
private long[] fact, factInv;
public int[] countWays(int[] ways, int[] valueRemoved, int[] numRemoved) {
fact = Mod.factorialArray(MAX, MOD);
factInv = Mod.factorialInverseArray(MAX, MOD,
Mod.inverseArray(MAX, MOD));
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Sample {
@kenkoooo
kenkoooo / CompanyInfo.java
Created December 12, 2015 08:51
CODE RUNNER 2015 決勝で出したコードです。
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.PriorityQueue;
#!/usr/bin/env python
# coding: UTF-8
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import statsmodels.api as sm
import seaborn as sns
import json
import sys
@kenkoooo
kenkoooo / api_document.md
Last active March 7, 2021 17:33
AtCoder 非公式 API ドキュメント
@kenkoooo
kenkoooo / Takezo.java
Created July 2, 2016 16:49
某氏の Ruby スクリプトを撃墜するためのランダムケースジェネレーター
import java.io.*;
import java.util.ArrayList;
import java.util.Random;
public class Takezo {
public static void main(String[] args) throws IOException {
Random random = new Random();
File dir = new File("/Users/um003282/Desktop");
while (true) {
@kenkoooo
kenkoooo / PokeVisioner.py
Last active July 30, 2016 13:55
ハッカソンの素材
import json
import time
import urllib.request
def download_json(url):
user_agent = "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A403 Safari/8536.25"
headers = {'User-Agent': user_agent}
req = urllib.request.Request(url, None, headers)
with urllib.request.urlopen(req) as response:
@kenkoooo
kenkoooo / .zshrc.sh
Last active September 15, 2016 03:53
# 環境変数
export LANG=ja_JP.UTF-8
# 色を使用出来るようにする
autoload -Uz colors
colors
# ヒストリの設定
HISTFILE=~/.zsh_history
HISTSIZE=1000000
<html>
<head>
<meta name="twitter:card" content="summary" />
<meta property="og:title" content="A Twitter for My Sister" />
<meta property="og:description" content="" />
<meta property="og:image" content="http://graphics8.nytimes.com/images/2011/12/08/technology/bits-newtwitter/bits-newtwitter-tmagArticle.jpg" />
</head>
<body></body>
</html>