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

問題 A - 豆まき 回答 A = int(input()) B = int(input()) C = int(input()) l = l_sorted = sorted(l) for num in l: print(l_sorted.in...

記事を読む

[Python] Educational DP Contest C – Vacation

問題 C - Vacation 回答 動的計画法を使って解く。 貰うDP ノード i への遷移方法を考える。 つまり、 dp の値がわかっているときに、dp の値を更新する。 ただし、i - 1日に取った行動が i 日に取れる...

記事を読む

[Python] multiprocessingを試す (3)

前回からの続きです。 multiprocessing の log 記録の方法です。 ログ記録 multiprocessing.get_logger() と multiprocessing.log_to_stderr() を使うことで、プロセスごとの...

記事を読む

[Python] トポロジカルソート

トポロジカルソートを Python で書きます。 以下の続きです。 トポロジカルソート トポロジカルソート(英:topological sort)とは、グラフ理論において、有向非巡回グラフ(英:directed acyclic graph, DA...

記事を読む

[Python] Seleniumを使ってみる (1)

Selenium Seleniumは、webアプリケーションのテストのためのフレームワークですが、スクレイピングでも良く使われます。Seleniumを使うことで、webブラウザを操作することができます。 公式サイト 今回はPythonでSeleniumを使うこ...

記事を読む


Public Domain YottaGin No Rights Reserved.