This file contains hidden or 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 <algorithm> | |
| #include <array> | |
| #include <bitset> | |
| #include <cassert> | |
| #include <climits> | |
| #include <cmath> | |
| #include <complex> | |
| #include <cstdio> | |
| #include <cstdlib> | |
| #include <ctime> |
This file contains hidden or 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 <algorithm> | |
| #include <bitset> | |
| #include <cassert> | |
| #include <climits> | |
| #include <cmath> | |
| #include <complex> | |
| #include <cstdio> | |
| #include <cstdlib> | |
| #include <ctime> | |
| #include <deque> |
This file contains hidden or 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 <vector> | |
| #include <list> | |
| #include <map> | |
| #include <set> | |
| #include <queue> | |
| #include <deque> | |
| #include <stack> | |
| #include <bitset> | |
| #include <algorithm> | |
| #include <functional> |
This file contains hidden or 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
| from multiprocessing import Pool | |
| def make_ans(s, N): | |
| if N == 0: | |
| return s | |
| if s == 'R': | |
| s1 = 'R' | |
| s2 = 'S' | |
| if s == 'S': | |
| s1 = 'P' |
This file contains hidden or 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
| def Shift(ch, i): | |
| return str((int(ch) + i + 10) % 10) | |
| def compare(a, b): | |
| if a[0] < b[0]: | |
| return True | |
| if a[0] == b[0] and a[1] < b[1]: | |
| return True | |
| if a[0] == b[0] and a[1] == b[1] and a[2] < b[2]: | |
| return True |
This file contains hidden or 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
| def solve(): | |
| N = int(raw_input()) | |
| count = 1 | |
| while N > 1: | |
| while N % 10 != 1: | |
| N -= 1 | |
| count += 1 | |
| if N == 1: | |
| continue | |
| if N == int(str(N)[::-1]): |
This file contains hidden or 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
| def solve(): | |
| B, N = map(int, raw_input().split()) | |
| M = map(int, raw_input().split()) | |
| def f(n): | |
| sum = 0 | |
| for m in M: | |
| sum += n / m + 1 | |
| return sum | |
| l = 0 |
This file contains hidden or 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 itertools | |
| class Trie: | |
| class Node: | |
| def __init__(self, x, bros = None, child = None): | |
| self.data = x | |
| self.bros = bros | |
| self.child = child | |
| # 子を求める |
This file contains hidden or 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 itertools | |
| import math | |
| def compress(s): | |
| s2 = [] | |
| i = 0 | |
| while i < len(s): | |
| while i + 1 < len(s) and s[i] == s[i + 1]: | |
| i += 1 | |
| s2.append(s[i]) |
This file contains hidden or 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 <algorithm> | |
| #include <array> | |
| #include <climits> | |
| #include <cmath> | |
| #include <iterator> | |
| #include <list> | |
| #include <map> | |
| #include <numeric> | |
| #include <queue> |
NewerOlder