Skip to content

Instantly share code, notes, and snippets.

@fushime2
fushime2 / get_images.py
Created May 16, 2016 08:01
三者三葉の公式アイコンをダウンロードする
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
三者三葉の公式アイコン
http://sansyasanyou.com/special/twitter.html
を全部(333個)ダウンロードする.
"""
from urllib.request import urlretrieve
@fushime2
fushime2 / anime.md
Last active June 18, 2016 16:56
見たいアニメ

見たいアニメ

  • SIROBAKO
  • プリティーリズムシリーズ
  • マイリトルポニー
  • あいうら
  • GJ部
  • ゆゆ式

また見たいアニメ

  • まどか☆マギカ
@fushime2
fushime2 / getcsv.py
Last active January 22, 2017 03:43
getcsv.py
import re
import urllib.request
import csv
from bs4 import BeautifulSoup
# page = 1,2,...
# prefnum = 01,02,...,47
BASE_URL = "http://www.aikatsu.com/stars/playshop/list.php?p={page:d}&pref={prefnum:02d}"
rows = [["店名", "住所"]]
@fushime2
fushime2 / LCA.cpp
Last active March 28, 2017 04:28
Lowest Common Ancestor
struct LCA {
typedef vector<vector<int>> Graph;
Graph G;
vector<int> depth;
vector<vector<int>> parent;
int n, root, MAXLOG;
LCA(int _n) {
root = 0;
n = _n;
@fushime2
fushime2 / daia.cpp
Created November 13, 2016 18:53
OpenGLでトランプのダイヤの3を表示
//
// トランプのダイヤの3を作成する。
// ポリゴン1,2,3を作り、ポリゴン1,3をそれぞれy軸側に-0.5, +0.5 移動させる。
// 全体を45度回転させる。
//
#include <cstdlib>
#include <cstdio>
#include "GL/glut.h"
@fushime2
fushime2 / color.cpp
Last active April 30, 2017 00:45
Color House
#include <cstdio>
#include <cstdlib>
#include "GL/glut.h"
using namespace std;
// 直方体の表面
int face[][4] = {
{0, 3, 2, 1},
{1, 2, 6, 5},
@fushime2
fushime2 / 0retweet.py
Last active August 25, 2017 07:34
TweetIDを指定してReTweetする
#
# ツイートは 2014/04/01 まで取得済み
#
import tweepy
import random
import time
def get_api():
//
// $ dmd margesort.d -main -unittest
//
import std.stdio;
T[] margesort(T)(T[] a) {
int n = a.length;
if (n <= 1) return a;
T[] left = a[0..n/2].margesort;
@fushime2
fushime2 / shadow.cpp
Last active April 13, 2018 06:54
家に影をつける
//
// 家に影を付ける
//
#include <cstdlib>
#include <cmath>
#include "GL/glut.h"
using namespace std;
@fushime2
fushime2 / bipartite_matching.d
Last active April 16, 2018 04:49
Calculate bipartite matching by using Ford-Fulkerson algorithm
// 二部マッチング
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_7_A
// https://beta.atcoder.jp/contests/abc091/tasks/arc092_a
import std.stdio, std.algorithm, std.string, std.conv, std.array, std.range, std.math;
void main() {
auto bm = new BipartiteMatching();
int X, Y, E;
readf("%d %d %d\n", &X, &Y, &E);