Skip to content

Instantly share code, notes, and snippets.

@ashiato45
ashiato45 / notify_aws_cost2.py
Created May 18, 2020 13:35
AWSの値段をslackに送るやつ
#!/usr/bin/env python
# encoding: utf-8
# https://qiita.com/isobecky74/items/88e8e0dcb0ee224a31e4
import json
import datetime
# import requests
import urllib
import boto3
@ashiato45
ashiato45 / get_highest_tag.py
Created May 18, 2020 12:29
boto3で一番高額のタグをとってくる
#!/usr/bin/env python
# coding: utf-8
import boto3
import datetime
import pprint
pp = pprint.PrettyPrinter(indent=4)
ce = boto3.client('ce')
@ashiato45
ashiato45 / aoj_dsl_2_h.cpp
Created April 25, 2020 12:20
delayed fenwick tree, RMQ and RAQ
#include <bits/stdc++.h>
#define REP(i, n) for(int i=0; i < (int)(n); i++)
using namespace std;
typedef long long ll; // -9,223,372,036,854,775,808 から 9,223,372,036,854,775,807
template <class T> using vec = std::vector<T>;
template <class T> using vec2 = vec<vec<T>>;
template <class T> using vec3 = vec<vec<vec<T>>>;
@ashiato45
ashiato45 / aoj_dsl_2_f.cpp
Created April 25, 2020 07:40
delayed fenwick tree, RMQ and RUQ
#include <bits/stdc++.h>
#define REP(i, n) for(int i=0; i < (int)(n); i++)
using namespace std;
typedef long long ll; // -9,223,372,036,854,775,808 から 9,223,372,036,854,775,807
template <class T> using vec = std::vector<T>;
template <class T> using vec2 = vec<vec<T>>;
template <class T> using vec3 = vec<vec<vec<T>>>;
@ashiato45
ashiato45 / aoj_dsl_2_b.cpp
Created April 24, 2020 14:42
range sum query (RMQ), segment tree, fenwick tree
#include <bits/stdc++.h>
#define REP(i, n) for(int i=0; i < (int)(n); i++)
using namespace std;
typedef long long ll; // -9,223,372,036,854,775,808 から 9,223,372,036,854,775,807
template <class T> using vec = std::vector<T>;
template <class T> using vec2 = vec<vec<T>>;
template <class T> using vec3 = vec<vec<vec<T>>>;
@ashiato45
ashiato45 / aoj_grl_5_c.cpp
Created April 24, 2020 13:52
least common ancestor (doubling)
#include <bits/stdc++.h>
#define REP(i, n) for(int i=0; i < (int)(n); i++)
using namespace std;
typedef long long ll; // -9,223,372,036,854,775,808 から 9,223,372,036,854,775,807
template <class T> using vec = std::vector<T>;
template <class T> using vec2 = vec<vec<T>>;
template <class T> using vec3 = vec<vec<vec<T>>>;
@ashiato45
ashiato45 / main.cpp
Last active April 4, 2020 06:01
Traffic Tree
#include <bits/stdc++.h>
#define REP(i, n) for(int i=0; i < (int)(n); i++)
using namespace std;
typedef long long ll; // -9,223,372,036,854,775,808 から 9,223,372,036,854,775,807
template <class T> using vec = std::vector<T>;
template <class T> using vec2 = vec<vec<T>>;
template <class T> using vec3 = vec<vec<vec<T>>>;
#include <bits/stdc++.h>
#define REP(i, n) for(int i=0; i < (int)(n); i++)
using namespace std;
typedef long long ll; // -9,223,372,036,854,775,808 から 9,223,372,036,854,775,807
template <class T> using vec = std::vector<T>;
template <class T> using vec2 = vec<vec<T>>;
template <class T> using vec3 = vec<vec<vec<T>>>;
@ashiato45
ashiato45 / main.cpp
Created March 20, 2020 10:33
薄氷渡り。DFS。一筆書き。
#include <bits/stdc++.h>
#define REP(i, n) for(int i=0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
#define DEBUG
ll sentinel(const vector<int>& table, int i, ll def=0){
if(!(0 <= i && i < table.size())){
@ashiato45
ashiato45 / main.cpp
Created March 20, 2020 10:04
エイトクイーン問題
#include <bits/stdc++.h>
#define REP(i, n) for(int i=0; i < (int)(n); i++)
using namespace std;
bool is_conflicting(complex<int> p, complex<int> q){
if(p.real() == q.real()){
return true;
}
if(p.imag() == q.imag()){