Skip to content

Instantly share code, notes, and snippets.

View monhime's full-sized avatar
:octocat:
進捗ダメです

charter monhime

:octocat:
進捗ダメです
  • EEIS, The University of Tokyo.
  • Japan
View GitHub Profile
@monhime
monhime / ABC215_D.py
Created August 21, 2021 14:00
ABC215_D.py
import sys, math, copy
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations
from operator import itemgetter
# sys.setrecursionlimit(1000000)
def input(): return sys.stdin.readline().rstrip()
class Sieve: #区間[2,n]の値の素因数分解 O(nloglogn+logn)
@monhime
monhime / ABC215_C.py
Created August 21, 2021 13:59
ABC215_C
import sys, math, copy
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations
from operator import itemgetter
from typing import Container
# sys.setrecursionlimit(1000000)
def input(): return sys.stdin.readline().rstrip()
@monhime
monhime / ABC215_B.py
Created August 21, 2021 13:59
ABC215_B
import sys, math, copy
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations
from operator import itemgetter
# sys.setrecursionlimit(1000000)
def input(): return sys.stdin.readline().rstrip()
def main():
@monhime
monhime / ABC215_A.py
Created August 21, 2021 13:58
ABC215_A
import sys, math, copy
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations
from operator import itemgetter
# sys.setrecursionlimit(1000000)
def input(): return sys.stdin.readline().rstrip()
def main():
@monhime
monhime / ABC214_C.py
Last active August 15, 2021 00:31
ABC214_C
import sys
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations
from operator import itemgetter
import math # math.inf
import copy
def input(): return sys.stdin.readline().rstrip()
@monhime
monhime / ABC214_B.py
Last active August 15, 2021 00:31
ABC214_B
import sys
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations
from operator import itemgetter
import math # math.inf
def input(): return sys.stdin.readline().rstrip()
def main():
@monhime
monhime / ABC214_A.py
Last active August 15, 2021 00:31
ABC214_A
import sys
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations
from operator import itemgetter
import math # math.inf
def input(): return sys.stdin.readline().rstrip()
def main():
@monhime
monhime / accum_string.cpp
Last active January 18, 2021 23:45
vector<string>を全結合
#include <iostream>
#include <vector>
#include <numeric>
#include <string>
using namespace std;
int main(){
vector<string> A = {"I", "have", "a", "pen."};
@monhime
monhime / accum_pair.cpp
Last active January 18, 2021 13:56
pair型のベクタのfirst, secondそれぞれの和
#include <iostream>
#include <vector>
#include <numeric>
using namespace std;
int main(){
vector<int> A = {1, 2, 3, 3, 2};
int sum = accumulate(A.begin(), A.end(), 0, [](int init, int v){ return init + v; });
cout << sum << "\n";
@monhime
monhime / ABC187_D.py
Created January 3, 2021 01:15
ABC187 D問題 解答
import sys
def input(): return sys.stdin.readline().rstrip()
from bisect import bisect_left,bisect
from itertools import accumulate
def main():
n = int(input())
AB = [tuple(map(int,input().split())) for i in range(n)]
C = [0]*n
sum_a = 0
for i, (a, b) in enumerate(AB):