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] Seleniumを使ってみる (1)

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

記事を読む

[Python] ABC008 D

問題 D - 金塊ゲーム 回答 80点回答 分割統治法 再帰 分割された区域に再帰的に関数を適用することで問題を解きます。 def rec_get_golds(x_min, y_min, x_max, y_max): ''' ...

記事を読む

[Python] ABC002 D by python

D - 派閥 from itertools import combinations n, m = map(int, input().split()) matrix_relations = * n for _ in range(n)] # matrixに関係を格納する。...

記事を読む

[Python] NLTKを使ってみる (5) Sentiment Analysis 感情分析

以下の続きです。 以下参考にしています。 Python NLTK: Twitter Sentiment Analysis Sentiment Analysis 感情分析 Sentiment analysis(also known as...

記事を読む

[Python] 配列内で同じ整数を探す

正の整数の配列の中に、同じ整数があるかどうか探します。 ただし、整数の最大値は、配列のサイズより小さいものとします。 総当たり 総当たりで同じ整数があるか探します。 時間計算量は\( O(N^2) \) になります。 def find_du...

記事を読む


Public Domain YottaGin No Rights Reserved.