Skip to content

Instantly share code, notes, and snippets.

View matsu7874's full-sized avatar

Kentaro Matsumoto matsu7874

View GitHub Profile
@matsu7874
matsu7874 / run.py
Created December 12, 2021 13:30
AHCで手元で複数ケース実行するためのスクリプト
import subprocess
import pipes
import multiprocessing
CASE = 150
TL = 2.0
def execute_case(seed):
input_file_path = f'tools/in/{seed:04}.txt'
output_file_path = f'tools/out/{seed:04}.txt'
with open(input_file_path) as fin:
@matsu7874
matsu7874 / index.html
Created June 15, 2019 16:32
名札作成用CSS
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="print.css">
@matsu7874
matsu7874 / knj.py
Created September 9, 2017 05:34
Project KNJ
import collections
import random
import bisect
BOL = '\\^'
EOL = '\\$'
def main():
word_word_cnt = collections.defaultdict(lambda: collections.defaultdict(int))
reversed_word_word_cnt = collections.defaultdict(lambda: collections.defaultdict(int))
@matsu7874
matsu7874 / gist:02fae79dd109b899299390c701b14001
Created April 16, 2017 01:02
Markdownのヘッダーをリストに変換して目次にする
import sys
def header_to_list(s):
header_level = 0
for c in s:
if c == '#':
header_level += 1
else:
break
ret = []