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] ABC008 A

問題 A - アルバム 回答 S, T = map(int, input().split()) nums_pics = T - S + 1 print(nums_pics)

記事を読む

[Python] N桁のビット列を全て求める

問題 N桁のビット列を全て求めなさい。 回答 その1 def apped_zero_one_front(x, L): return def bit_strings(n): if n == 0: return [] ...

記事を読む

[Python] multiprocessingを試す (2)

以下の記事の続きです。 Python の multiprocessing で lock を使ってみます。 multiprocessing の際にリソースを共有した場合、lock をしておかないと変なことになるという話です。 lock lock...

記事を読む

[Python] 2分探索 平方根以下の最大の整数

2分探索 2分探索の練習をします。 2分探索を使って、ある自然数の平方根以下で最大となる整数を求めてます。 例えば、500であれば\( \sqrt 500 = 22.360679774...\)で、求めたい数字は22になります。 de...

記事を読む

[Python] multiprocessingを試す (4)

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

記事を読む


Public Domain YottaGin No Rights Reserved.