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
from sys import argv | |
from DictionaryServices import DCSCopyTextDefinition | |
def main(word): | |
result = DCSCopyTextDefinition(None, word, (0, len(word))) | |
result = result.split('.') | |
for row in result: | |
print(row) | |
if __name__ == '__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 subprocess as sp | |
package_list = [row.split()[0] for row in sp.getoutput('pip3 list -o --format=columns').split('\n')[2:]] | |
if package_list == []: | |
print('All packages are already up-to-data!!') | |
else: | |
if 'pip' in package_list: | |
p_list.remove('pip') | |
p_list.insert(0,'pip') |
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
from functools import lru_cache | |
@lru_cache(maxsize=None) | |
def fib(num): | |
if num == 1 or num == 2: | |
return 1 | |
else: | |
return fib(num-1) + fib(num-2) | |
print(fib(int(input()))) |
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
bord = [[-1 for _ in range(8)] for __ in range(8)] | |
#初期配置 | |
bord[3][3] = bord[4][4] = 1 | |
bord[3][4] = bord[4][3] = 0 | |
def is_all(_list, BorW): | |
for i in _list: |
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
# ------------------------------------ | |
# yukicoder | |
# No.458 異なる素数の和 | |
# http://yukicoder.me/problems/no/458 | |
# ------------------------------------ | |
from math import sqrt, ceil | |
N = int(input()) |
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
from sys import stdin | |
data = [row.strip() for row in stdin.readlines()] | |
for elm in data[::-1]: | |
print(elm) |
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
# pip3(pip) install sh で shをインストールしておく必要がある | |
from sh import pip3 | |
package_list = [row.split()[0] for row in list(pip3('list', '-o', '--format=columns'))[2:]] | |
if len(package_list) == 0: | |
print('All package are already up-to-date!') | |
else: | |
if 'pip' in package_list: | |
package_list.remove('pip') | |
package_list.insert(0,'pip') |
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
# ----------------------------------- | |
# yukicoder | |
# No.455 冬の大三角 | |
# http://yukicoder.me/problems/no/455 | |
# ------------------------------------ | |
# データ入力 | |
h, w = map(int, input().split()) |
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
# ----------- | |
# yukicoder | |
# No.457 (^^*) | |
# http://yukicoder.me/problems/no/457 | |
# ------- | |
# TLE もっと早い実装はできないのか........ |
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
# ----------------------------------- | |
# yukicoder | |
# No.460 裏表ちわーわ | |
# http://yukicoder.me/problems/no/460 | |
# ----------------------------------- | |
# 幅優先探索では遅い! | |
import copy |
OlderNewer