結果
| 問題 |
No.892 タピオカ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-11 08:46:28 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,272 bytes |
| コンパイル時間 | 87 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-10-12 23:02:21 |
| 合計ジャッジ時間 | 949 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 6 |
ソースコード
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(":-(")