結果

問題 No.892 タピオカ
ユーザー KazukiNagaoKazukiNagao
提出日時 2021-03-11 08:46:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 1,272 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-21 00:42:17
合計ジャッジ時間 945 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import copy
CONTAINER_NUMBER = 3    # タピオカミルクティの本数


def check_divide_even(bottoms):
    """ タピオカを均等に分けられるか判定"""

    # タピオカの個数の底のぐう数の数を計算
    evenCount = 0
    for bottom in bottoms:
        if is_even(bottom):
            evenCount = evenCount + 1

    # タピオカの個数の底の奇数の数を計算
    oddCount = CONTAINER_NUMBER - evenCount

    # 底が奇数のタピオカの数が奇数ならタピオカの合計は奇数
    # 底が奇数のタピオカの数が偶数ならタピオカの合計は偶数
    if is_even(oddCount):
        return True
    else:
        return False


def is_even(number):
    """引数で与えられた数値が偶数か判定"""
    if number % 2 == 0:
        return True
    else:
        return False


if __name__ == "__main__":
    bottoms = []
    # 1をはじめとしてタピオカミルクティの本数分ループ
    for i in range(1, CONTAINER_NUMBER+1):
        bottom = int(input())
        index = int(input())
        bottoms.append(copy.deepcopy(bottom))

    # 底の値より均等に分けられるかどうか判定
    if check_divide_even(bottoms):
        print(":-)")
    else:
        print(":-(")
0