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 pprint import pprint | |
| import itertools | |
| import random | |
| def print_fwd(fwd): | |
| x = len(fwd[0]) | |
| y = len(fwd) | |
| print("x " + " ".join(map(str, range(1, x+1)))) | |
| print("y " + "-"*(2*x)) |
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 math | |
| import numpy as np | |
| def sieve_of_eratosthenes_by_np(x): | |
| primes = np.full(x, True, dtype=bool) | |
| primes[0:2] = False |
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 math | |
| def sieve_of_eratosthenes(n): | |
| primes = [True] * (n+1) | |
| primes[0] = primes[1] = False | |
| stop = int(math.sqrt(n)) + 1 | |
| for i in range(2, stop): | |
| if primes[i]: | |
| for j in range(i ** 2, n+1, 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
| import sys | |
| def solve(A, N, cost, idx, max_hight, num_can_pass): | |
| if idx >= N: | |
| return cost | |
| tmp = sys.maxsize | |
| if max_hight < A[idx]: |
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 itertools import product | |
| def solve(): | |
| R, C = map(int, input().split()) | |
| A = [list(map(int, input().split())) for _ in range(R)] | |
| ans = 0 | |
| for cur_r_list in product([False, True], repeat=R): |
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 itertools import product | |
| def solve(): | |
| N, M = map(int, input().split()) | |
| K = [] | |
| S = [] | |
| xy = set() | |
| for _ in range(M): |
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 itertools import product | |
| def solve(): | |
| N, M = map(int, input().split()) | |
| K = [] | |
| S = [] | |
| for _ in range(M): | |
| tmp = list(map(int, input().split())) |
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 os | |
| import shutil | |
| import argparse | |
| import glob | |
| import cv2 | |
| INPUT_FOLDER_PATH = 'input' | |
| OUTPUT_FOLDER_PATH = 'output' |
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
| /** | |
| * 日付文字列がtimestampのフォーマットとして有効であるかを判断する | |
| * | |
| * @param date 確認したい日付文字列 | |
| * @param format 日付フォーマット | |
| * @return 有効であるか | |
| */ | |
| public static Boolean isValidFormat(String date, String format){ | |
| DateFormat dataFormat = new SimpleDateFormat(format); |
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 _iter_collatz_problem_solver(): | |
| cnt = 3 | |
| while True: | |
| yield cnt | |
| cnt += 2 | |
| def collatz_problem_solver(): | |
| for i in _iter_collatz_problem_solver(): | |
| tmp = i |
NewerOlder