Submission #59403148


Source Code Expand

Copy
"""
<>
- `lsColor`
- `A` `lsColor`
- `lsColor` `2`
"""
#
A1234 = list(map(int, input().split()))
#
lsColor = [0]*5
# A1~A4
for A in A1234:
#
lsColor[A] += 1
#
ans = 0
for color in lsColor:
# 2
ans += (color//2)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
"""
<方針>
- 何色のボールが何個あるかを管理するリスト `lsColor` を作成する.
- `A` の入力に対して, `lsColor` を更新していく.
- それぞれの `lsColor` を `2` で割った時の商の合計値が捨てられる操作の最大値.
"""
# 入力
A1234 = list(map(int, input().split()))

# ボールを管理するリスト
lsColor = [0]*5
# A1~A4に対して処理を行う.
for A in A1234:
  # ボールを新しく登録する.
  lsColor[A] += 1

# 答え
ans = 0
for color in lsColor:
  # 2で割った時の商を答えに追加
  ans += (color//2)

# 出力
print(ans)

Submission Info

Submission Time
Task A - Pairing
User mattsunkun
Language Python (PyPy 3.10-v7.3.12)
Score 100
Code Size 647 Byte
Status AC
Exec Time 55 ms
Memory 76828 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 22
Set Name Test Cases
Sample 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt, 01_test_16.txt, 01_test_17.txt, 01_test_18.txt, 01_test_19.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 54 ms 76316 KB
00_sample_02.txt AC 55 ms 76392 KB
00_sample_03.txt AC 53 ms 76432 KB
01_test_01.txt AC 54 ms 76720 KB
01_test_02.txt AC 54 ms 76524 KB
01_test_03.txt AC 53 ms 76436 KB
01_test_04.txt AC 53 ms 76532 KB
01_test_05.txt AC 54 ms 76528 KB
01_test_06.txt AC 54 ms 76724 KB
01_test_07.txt AC 54 ms 76548 KB
01_test_08.txt AC 55 ms 76544 KB
01_test_09.txt AC 54 ms 76648 KB
01_test_10.txt AC 53 ms 76700 KB
01_test_11.txt AC 54 ms 76536 KB
01_test_12.txt AC 54 ms 76668 KB
01_test_13.txt AC 54 ms 76828 KB
01_test_14.txt AC 54 ms 76712 KB
01_test_15.txt AC 54 ms 76640 KB
01_test_16.txt AC 53 ms 76440 KB
01_test_17.txt AC 53 ms 76508 KB
01_test_18.txt AC 53 ms 76536 KB
01_test_19.txt AC 54 ms 76516 KB


2025-04-05 (Sat)
11:00:37 +00:00