This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def qsort(nums) | |
execute(nums, 0, nums.size - 1) | |
end | |
def execute(nums, left, right) | |
while left < right | |
pivot = partition(nums, left, right) | |
if pivot - left <= right - pivot | |
execute(nums, left, pivot - 1) | |
left = pivot + 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// rustc 1.48.0 (7eac88abb 2020-11-16) | |
struct PermutationIterator<T> { | |
v: Vec<(usize, T)>, | |
k: usize, | |
finished: bool, | |
} | |
impl<T> PermutationIterator<T> { | |
fn new<I: Iterator<Item = T>>(iter: I, k: usize) -> PermutationIterator<T> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$latex = 'platex'; | |
$bibtex = 'pbibtex'; | |
$dvipdf = 'dvipdfmx %O -o %D %S'; | |
$makeindex = 'mendex -U %O -o %D %S'; | |
$pdf_mode = 3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <bits/stdc++.h> | |
using namespace std; | |
#define REP(i,n) for(int i=0;i<(n);i++) | |
#define ALL(a) (a).begin(),(a).end() | |
using ld = long double; | |
// ref: https://mieruca-ai.com/ai/viterbi_algorithm/ |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
## Description: | |
## Author : fhiyo | |
## Email : fhiyo1201@gmail.com | |
set -u | |
declare -r SCRIPT_NAME=$( basename ${BASH_SOURCE[0]} ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import cv2 | |
import numpy as np | |
def main(): | |
gray = cv2.imread('lena_std.png', 0) # 入力画像をグレースケールで読み込み | |
# gray = np.asarray([[0, 0, 1, 1], [0, 0, 1, 7], [1, 0, 8, 8], [0, 1, 8, 9]], dtype=np.uint8) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder