Skip to content

Instantly share code, notes, and snippets.

@MiSawa
MiSawa / dinic_worst.cc
Created April 24, 2021 05:33
Dinic worst case behavior
#include <algorithm>
#include <cassert>
#include <limits>
#include <queue>
#include <vector>
#include <vector>
namespace atcoder {
@MiSawa
MiSawa / main.rs
Created March 27, 2022 15:38
Trying something for `--stream`
use std::sync::mpsc::{sync_channel, SyncSender};
use anyhow::{anyhow, Result};
#[derive(Clone, Debug)]
enum Index {
Array(usize),
Map(String),
}
type Path = Vec<Index>;
@MiSawa
MiSawa / keybase.md
Created November 18, 2022 09:11
Keybase proof

Keybase proof

I hereby claim:

  • I am misawa on github.
  • I am misawa (https://keybase.io/misawa) on keybase.
  • I have a public key whose fingerprint is D5A3 7798 FFE8 F754 5B83 C133 BFFF 4B86 A074 F3D0

To claim this, I am signing this object:

@MiSawa
MiSawa / generate_rust_project.rs
Created April 15, 2023 16:10
Generate rust-project.json for rust-script
#!/usr/bin/env rust-script
//! ```cargo
//! [dependencies]
//! clap = { version = "4.1.8", features = ["derive"] }
//! eyre = "0.6.8"
//! path-absolutize = "3.0.14"
//! serde = { version = "1.0.156", features = ["derive"] }
//! serde_json = "1.0.95"
//!
//! paths = { git = "https://github.com/rust-lang/rust-analyzer.git", tag = "2023-04-10" }
@MiSawa
MiSawa / heap.rs
Created March 5, 2024 14:52
MinHeap and MaxHeap
#!/usr/bin/env rust-script
use std::{
cmp::{Ord, Ordering},
collections::BinaryHeap,
ops::{Deref, DerefMut},
};
pub trait Priority<T: ?Sized> {
fn eq(lhs: &T, rhs: &T) -> bool {