This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <numeric> | |
#include <string> | |
using namespace std; | |
int main(){ | |
vector<string> A = {"I", "have", "a", "pen."}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
NewerOlder