This file contains hidden or 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
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] | |
struct Cell<T: Clone + Copy> { | |
x: usize, | |
y: usize, | |
value: T, | |
} | |
#[derive(Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] | |
struct Grid<T> { | |
h: usize, | |
w: usize, |
This file contains hidden or 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
class UnionFind | |
def initialize(elements) | |
@parent = {} | |
elements.each { |e| @parent[e] = e } | |
@rank = Hash.new(0) | |
end | |
def find(x) | |
return x if @parent[x] == x | |
@parent[x] = find(@parent[x]) |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Rust始めてみた</title> | |
<script src="https://cdn.tailwindcss.com"></script> | |
<link rel="preconnect" href="https://fonts.googleapis.com"> | |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&family=Noto+Sans+JP:wght@400;500;700&display=swap" rel="stylesheet"> |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Rust始めてみた</title> | |
<script src="https://cdn.tailwindcss.com"></script> | |
<link rel="preconnect" href="https://fonts.googleapis.com"> | |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&family=Noto+Sans+JP:wght@400;500;700&display=swap" rel="stylesheet"> |
This file contains hidden or 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
use ac_library::*; | |
use itertools::Itertools; | |
use proconio::{input, derive_readable,marker::*}; | |
use std::{cmp::*, collections::*}; | |
pub struct MemoizedDFS; | |
impl MemoizedDFS { | |
pub fn search<T, A, FTrans, FGoal, FCollect>( | |
start: T, | |
trans: FTrans, |
This file contains hidden or 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
/** | |
* 指定されたURLまたは現在のページの全要素のComputed Styleを取得するスクリプト | |
*/ | |
// メイン関数 | |
async function extractComputedStyles(url = null) { | |
try { | |
// URLが指定されている場合の処理(同一オリジンのみ可能) | |
if (url) { | |
// 新しいiframeを作成してURLを読み込む |
This file contains hidden or 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
import sys | |
def read_and_border_grid(h, w): | |
grid = [['^'] * (w + 2)] | |
for _ in range(h): | |
line = '^' + sys.stdin.readline().strip() + '^' | |
grid.append(list(line)[:w + 2]) | |
grid.append(['^'] * (w + 2)) | |
return grid |
This file contains hidden or 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
#Set a wallpaper | |
count=$(find /home/$USER/.wallpaper -type f | wc -l) | |
rand_num=$((RANDOM % count + 1)) | |
rand_wallpaper=$(find /home/$USER/.wallpaper -type f | sed -n "${rand_num}p") | |
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s $rand_wallpaper | |
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitorHDMI-0/workspace0/last-image -s $rand_wallpaper |