YottaGin

Freedom is a responsible choice.

[Python] ABC018 A

2019/12/28 2019/12/28 プログラミング

問題

A – 豆まき

回答

A = int(input())
B = int(input())
C = int(input())

l = [A, B, C]
l_sorted = sorted(l)[::-1]

for num in l:
    print(l_sorted.index(num) + 1)

Atcoder, Python GinO

関連記事

[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] pnadasの基本的な使いかた

pandas の基本的な使い方、備忘録です。 公式 pandas: powerful Python data analysis toolkit jupyter notebook を使っている時は、メソッドにカーソルを置いて、Shift + Tab でそのメソッ...

記事を読む

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

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

記事を読む

[グラフ] 深さ優先探索をPythonで実装

Python で深さ優先探索を実装します。 ノードクラス 幅優先探索と同じです。 各ノードは自身の名前、隣接リスト、訪問済みかどうかのフラグを持ちます。 class Node(object): def __init__(s...

記事を読む

[Python] 2分ヒープ (2)

前回からの続きです。 Python では、heapq によりheapがモジュールとして提供されているので、普段はこちらを使います。 heapq--- ヒープキューアルゴリズム ここでは、学習のため、前回の内容に沿って、Python で heap を...

記事を読む


Public Domain YottaGin No Rights Reserved.