Skip to content

Instantly share code, notes, and snippets.

# -*- coding: utf-8 -*-
import re
def find_greedy(plans):
if len(plans)==0: return []
plans.sort(key=lambda x: x[3]) # 終了時間でソート
next_plan = plans[0] # (残った中で)一番早く終わるチケットを選択
result = [next_plan]
"use strict";
/*
PlayerName="permil"
【感想・作戦・工夫した点など】
勝率が下がる一方なので諦めて戻しました・・・(~_~;)
調整の可能性があるためコピペが多いままですがご容赦ください。
基本ロジックは過去の戦歴から統計を取り、直近数手と同じ進行が過去にあった場合には、
「相手がその次に出していた手に勝てそうな手」を出す、です。
eval(q="a='';q='eval(q=%p.split
* %p)'%[q,a];c=-1;('%b'%'wa u
m 9l enj gzg 3 3y f0ueor ru n
t wf bk of oc 5z9v kn8s4l 7
j im7 '. to_i( 3 6 )) .c h
a rs{|s |a+=s =='1' ? q [c += 1
] :32.ch r} ;0.up t o (7 ){ |
o|puts(a[o*31,31])};".split*"")
p ; e
@ / * 1
; r ; m ;
0 $ l ;
i ; /
@permil
permil / dvorak_Left_JP.keymap
Created August 21, 2017 12:55
WeatherTyping用左手Dvorak配列
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<InputMethod Version="1">
<Version>1</Version>
<Name>Dvorak_Left_JP</Name>
<Author>August Dvorak</Author>
<Language>ja-JP</Language>
<Memo>左手用Dvorak配列</Memo>
<Weight Language="ja-JP">1.0</Weight>
<Signature>07B46AF590BDD9AD1A85660B5A2E8FEFDEB9D26E9DA0FF4C1E818CA34E7B1180BE42FC26213A0A92195BACA9F4EA95F6B5B46AF8BF4124914D2F8362D6CA9AA98F89A64F7B5A5A3D4CE120EE3A10BF619A07D27841238691D364CB363B7E07BF6444203E6A69CA5F9B3942EDDB311542F0943648F4FB415DBA67338FB5ADE6EA</Signature>
<KeyFilter>
@permil
permil / main.rs
Last active February 6, 2018 15:20
bf interpreter written in Rust (https://github.com/rust-lang/rust)
fn main() {
let prog = ">+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++
++>-]<.>+++++++++++[<+++++>-]<.>++++++++[<+++>-]<.+++.------.--------.[-]>
++++++++[<++++>-]<+.[-]++++++++++.";
let mut inst = 0;
let mut tape = [0; 30000];
let mut ptr = 0;
while inst < prog.len() {
@permil
permil / main.lua
Last active February 6, 2018 15:21
bf interpreter written in Lua
prog = ">+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-]<.>+++++++++++[<+++++>-]<.>++++++++[<+++>-]<.+++.------.--------.[-]>++++++++[<++++>-]<+.[-]++++++++++."
p_ptr = 1
tape = {}
ptr = 0
insts = {
['>'] = function() ptr = ptr + 1 end,
['<'] = function() ptr = ptr - 1 end,
['+'] = function() if tape[ptr] == nil then tape[ptr] = 1 else tape[ptr] = tape[ptr] + 1 end end,
@permil
permil / life.rs
Last active February 6, 2018 15:22
Conway's Game of Life written in Rust
extern crate rand;
use std::thread;
use std::time::Duration;
use rand::Rng;
struct Field {
width: usize,
height: usize,
grids: Vec<Vec<bool>>
K(S(SI
(K(SS(SS(S(SSS)(SS(SS(SS)(SS(KI))))))(S(KS)K))))
(K(S(SI
(K(SS(S(SS(KI))(SS(SS(SS)(SS(KI)))))(S(KS)K))))
(K(S(SI
(K(SS(SS(SS(SS(S(SSS)(SS(SS(SS)(SS(KI))))))))(S(KS)K))))
(K(S(SI
(K(SS(S(SI(SS(SS(KI))))(SS(S(SSS))(SS(KI))))(S(KS)K))))
(K(S(SI
(K(S(SI(SS(SSI(SS(KI)))))(SS(S(SSS)(SSI(SS(KI)))))(S(KS)K))))
@permil
permil / config.h
Last active March 27, 2018 17:03
Let's Split keymap for JIS keyboard
/*
This is the c configuration file for the keymap
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.