YottaGin

Freedom is a responsible choice.

[Python] ABC006 A

2019/4/17 プログラミング

問題

A – 世界のFizzBuzz

回答

import sys
# input処理を高速化する
input = sys.stdin.readline

def main():
    N = int(input())
    if N % 3 == 0:
        print('YES')
    else:
        print('NO')
    
main()

Atcoder, Python GinO

関連記事

[Python] multiprocessingを試す (4)

前回からの続きです。 pool python で mulitprocessing を行う方法として、process 以外に pool があります。 プロセスプール process と pool の違い Python Multiproce...

記事を読む

[Python] ABC007 B

問題 B - 辞書式順序 入力例/出力例と同じ値になるようにしてみる。 組み込み関数の chr(i) と ord(c) を使う。 回答 A = input() lst_a = list(A) if len(lst_a) >=2: pr...

記事を読む

[Python] multiprocessingを試す (1)

multiprocessing multiprocessing とは、プロセスベースで並列処理を行う python の bulid-in モジュールです。 処理を並列に行えるので、処理が速くなります。 multiprocessing--- プロセスベースの並列...

記事を読む

[Python] 数値と数字の変換

数字→数値 組み込み関数intを使います。 組み込み関数intを使わないで書いてみます。 def str_to_int(str_num): # 正と負で変換の開始位置が異なる。 if str_num == '-': s...

記事を読む

[Python] ABC001 B

B - 視程の通報 m = int(input()) if m < 100: vv = 0 elif m>=100 and m<=5000: vv = m//100 elif m>=6000 and m<=30000: vv =...

記事を読む


Public Domain YottaGin No Rights Reserved.