Skip to content

Instantly share code, notes, and snippets.

.PHONY: help
help:
@awk -F ':|##' '/^[^\t].+?:.*?##/ { printf "\033[36m%-22s\033[0m %s\n", $$1, $$NF }' $(MAKEFILE_LIST)
### global
CYAN := \033[96m
RED := \033[95m
NC := \033[0m
@kooooohe
kooooohe / binary_search.cpp
Last active June 14, 2021 05:48
blog-binary_search_2
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
@kooooohe
kooooohe / binary_search.cpp
Last active June 14, 2021 15:46
blog-binary_search
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
const long long INF = 1LL << 60;
int main() {
int N, M;
@kooooohe
kooooohe / BIT.go
Created April 27, 2021 16:42
ap blog
package main
import "fmt"
type BIT struct {
n int
bit []int
}
func (b *BIT) Sum(a int) int {
@kooooohe
kooooohe / BIT.go
Created April 27, 2021 16:06
blog ap
package main
import "fmt"
type BIT struct {
n int
bit []int
}
func (b *BIT) Sum(a int) int {
@kooooohe
kooooohe / dp-blog.cpp
Last active March 15, 2021 15:42
ap-blog-cpp
#include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
template <class T> void chmax(T &a, T b) {
if (a < b) {
a = b;
}
}
<template>
<div class="about">
<div class="p-text-left p-grid start">
<div class="p-col-12 p-md-6 p-lg-3" style="text-aligh:center">
<p>dp[0][j] = 0</p>
<p>dp[i+1][j] = dp[i][j] (j &lt; w[i])</p>
<p>dp[i+1][j] = max(dp[i][j], dp[i][j-対象の重さw[i]] + value)</p>
</div>
</div>
package main
import (
"fmt"
"math/big"
"math/rand"
"time"
)
func main() {
package main
import (
"fmt"
"math/big"
)
type fibNum struct {
num *big.Rat
numMultipliedBySR *big.Rat