結果

問題 No.2043 Ohuton and Makura
ユーザー ShirotsumeShirotsume
提出日時 2022-08-19 21:51:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 1,079 bytes
コンパイル時間 194 ms
コンパイル使用メモリ 82,568 KB
実行使用メモリ 80,256 KB
最終ジャッジ日時 2024-04-17 00:32:51
合計ジャッジ時間 2,181 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
51,968 KB
testcase_01 AC 40 ms
52,224 KB
testcase_02 AC 57 ms
66,560 KB
testcase_03 AC 52 ms
64,768 KB
testcase_04 AC 68 ms
76,800 KB
testcase_05 AC 65 ms
72,960 KB
testcase_06 AC 58 ms
68,992 KB
testcase_07 AC 66 ms
68,480 KB
testcase_08 AC 55 ms
64,768 KB
testcase_09 AC 58 ms
71,168 KB
testcase_10 AC 60 ms
70,656 KB
testcase_11 AC 68 ms
75,008 KB
testcase_12 AC 39 ms
52,224 KB
testcase_13 AC 38 ms
51,968 KB
testcase_14 AC 52 ms
69,760 KB
testcase_15 AC 59 ms
67,376 KB
testcase_16 AC 71 ms
80,128 KB
testcase_17 AC 66 ms
69,120 KB
testcase_18 AC 51 ms
69,632 KB
testcase_19 AC 71 ms
79,872 KB
testcase_20 AC 71 ms
80,256 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
rec = False #再帰を使うときはこれをTrueにする
if rec:
    sys.setrecursionlimit(5 * 10 ** 5)
    from pypyjit import set_param
    set_param('max_unroll_recursion=-1')
inf = 2 ** 63 - 1
mod = 998244353

class Cumsum1d():
    def __init__(self, A):
        self.n = len(A)
        self.Suma = [0] * (self.n + 1)
        for i in range(self.n):
            self.Suma[i + 1] += self.Suma[i] + A[i]

    def query(self, l, r):
        #0-indexed
        return self.Suma[r] - self.Suma[l]

    def get(self, i):
        return self.Suma[i + 1] - self.Suma[i]

    def __getitem__(self, p):
        if isinstance(p, int):
            return self.get(p)
        else:
            return self.query(p.start, p.stop)


a, b, s = mi()

A = [a - i for i in range(a)]
B = [b - i for i in range(b)]
A = [0] + A
B = [0] + B


B = Cumsum1d(B)
ans = 0
for i in range(1, a + 1):
    ans += A[i] * B[0:min(s // i + 1, b + 1)]
print(ans)
0