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] ABC015 D メモ化再帰 100点

問題 D – 高橋くんの苦悩 回答 defaultdict defaultdict を使ってみましたが、残念ながらTLEでした。 import collections W = int(input()) N, K = map(int, ...

記事を読む

[Python] Educational DP Contest H – Grid 1

問題 H - Grid 1 DP、数え上げ問題。 回答 import sys # input処理を高速化する input = sys.stdin.readline def main(): # input H, W = map(int,...

記事を読む

[Python] ラビン-カープ法

ラビン-カープ法 テキストの中からパターンを探すときに、パターンのハッシュと検索箇所のハッシュが一致するかどうかを比較して検索を行います。 ハッシュの時間計算量が \(O(m)\) の場合は、アルゴリズム全体の計算量が \(O(m \times n) \) ...

記事を読む

多クラス分類の GridSearchCV で multiclass_log_loss を使う

lightgbm の多クラス分類のパラメータチューニングで GridSearchCV を使うときに、multiclass_log_loss を scoring として使う方法です。 ググってもなかなか見つからなかったので、今後のためにメモしておきます。 Custom...

記事を読む

condaコマンド

windows、Anaconda Command Prompt上でanacondaを使う際のcondaコマンドについて、備忘録的にまとめます。 公式コマンドレファレンス Command reference ライブラリ一覧 インストールしたライブラリ一覧を...

記事を読む


Public Domain YottaGin No Rights Reserved.