Skip to content

Instantly share code, notes, and snippets.

View NachiaVivias's full-sized avatar

NachiaVivias

  • Osaka Metropolian University College of Technology
  • Japan
  • X @NachiaVivias
View GitHub Profile
@NachiaVivias
NachiaVivias / a.cpp
Created September 28, 2022 12:22
trash
#line 1 "Main.cpp"
#line 2 "nachia\\misc\\sorting.hpp"
#include <vector>
#include <cassert>
#include <algorithm>
namespace nachia{
@NachiaVivias
NachiaVivias / Main.cpp
Created February 26, 2023 15:02
アルゴリズムと数学演習問題集103のビジュアライズ例で、虚無で遊びたい場合に使うとよいです
# include <Siv3D.hpp> // OpenSiv3D v0.6.5
class IdenticalCirclePackingInCircle {
Array<Vec2> m_circleCenters;
Array<double> m_circleRadius;
Array<int> m_limitBy;
int m_smallCircleCount;
double m_possibleRadius;
Optional<int> m_mouseCapture;
@NachiaVivias
NachiaVivias / procon33movie1.cpp
Last active May 3, 2023 14:04
BB 素材(永続セグメント木)
# include <Siv3D.hpp> // OpenSiv3D v0.6.5
using Mat = std::array<std::array<double, 4>, 2>;
Vec2 TransformByMat(Mat m, Vec3 v) {
Vec2 res;
res.x = m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z + m[0][3];
res.y = m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z + m[1][3];
return res;
}
@NachiaVivias
NachiaVivias / procon33movie2.cpp
Created May 3, 2023 14:04
BB 素材(バタフライ演算)
# include <Siv3D.hpp> // OpenSiv3D v0.6.5
using Mat = std::array<std::array<double, 4>, 2>;
Vec2 TransformByMat(Mat m, Vec3 v) {
Vec2 res;
res.x = m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z + m[0][3];
res.y = m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z + m[1][3];
return res;
}
@NachiaVivias
NachiaVivias / LICENSE
Last active January 6, 2024 09:42
分割統治法によるドロネー三角形分割 , Siv3D
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@NachiaVivias
NachiaVivias / main.rs
Last active June 30, 2023 07:00
入力
pub trait IStr {
fn sc(&mut self) -> u8;
fn gc(&mut self) -> u8;
fn end(&mut self) -> bool;
fn skipwc(&mut self){ while self.sc().is_ascii_whitespace() { self.gc(); } }
}
use std::io::Read;
pub trait FromIStr<T> { fn rd<Str : IStr>(s : &mut Str) -> T; }
@NachiaVivias
NachiaVivias / vec.hpp
Created July 8, 2023 15:13
ABC309 でやけに活躍した、 std::vector のラッパ vec
#include <vector>
#include <iterator>
#include <algorithm>
#include <functional>
template<class Elem> struct vec;
struct iotai;
template<class Iter>
@NachiaVivias
NachiaVivias / Main.cpp
Last active August 16, 2023 07:02
Z algorithm visualizer
#include <Siv3D.hpp>
struct AnimationEnvironment {
RectF rect = RectF(-1.0, -1.0, 2.0, 2.0);
};
struct AnimationEntryRegularOption {
double z = 0.0;
double startTime = 0.0;
double duration = 1.0;
#include <Siv3D.hpp>
/*
バケット法
適当な個数ずつブロックとして分割し、 2 層構造で管理する。
ブロックのサイズが 2 * B 以上になったら半分に分ける。
@NachiaVivias
NachiaVivias / 00_explanation.md
Last active November 7, 2023 04:14
「ドミノタイリングの数え上げ」の半分全列挙 / Meet-in-the-Middle Search for a Domino Tiling Enumeration Task https://tatt61880.github.io/domino-counting/