結果

問題 No.3295 Buying Bottled Water
コンテスト
ユーザー 13d0ccc0-b63b-11f0-9490-db448702d40f
提出日時 2025-10-31 18:41:47
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 644 bytes
コンパイル時間 378 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 10,368 KB
最終ジャッジ日時 2025-10-31 18:41:50
合計ジャッジ時間 2,223 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(999999999)


def count_element_numbers(int_list: list[int]) -> dict[int, int]:
    """
    Counts the occurrences of each integer in the input list.
    Example: count_element_numbers([1, 1, 3, 2, 2, 2, 4, 4, 4, 4]) => {1: 2, 2: 3, 3: 1, 4: 4}
    """
    from itertools import groupby

    result = {}
    for key, group in groupby(sorted(int_list)):
        count = len(list(group))
        result[key] = count
    return result


def solve():
    n = int(input())
    r1 = n // 500
    if n <= 500:
        print(1)
    elif n - r1 * 500 <= 100:
        print(r1)
    else:
        print(r1 + 1)



solve()
0