結果

問題 No.989 N×Mマス計算(K以上)
ユーザー tter4tter4
提出日時 2020-02-15 00:24:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 166 ms / 2,000 ms
コード長 401 bytes
コンパイル時間 190 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 92,544 KB
最終ジャッジ日時 2024-04-16 03:03:02
合計ジャッジ時間 2,712 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
52,480 KB
testcase_01 AC 42 ms
52,608 KB
testcase_02 AC 43 ms
52,736 KB
testcase_03 AC 44 ms
52,736 KB
testcase_04 AC 44 ms
52,352 KB
testcase_05 AC 43 ms
52,480 KB
testcase_06 AC 42 ms
52,480 KB
testcase_07 AC 43 ms
52,352 KB
testcase_08 AC 44 ms
52,608 KB
testcase_09 AC 46 ms
52,480 KB
testcase_10 AC 144 ms
85,504 KB
testcase_11 AC 135 ms
90,496 KB
testcase_12 AC 145 ms
88,448 KB
testcase_13 AC 112 ms
86,912 KB
testcase_14 AC 166 ms
92,544 KB
testcase_15 AC 112 ms
78,848 KB
testcase_16 AC 126 ms
82,816 KB
testcase_17 AC 113 ms
87,040 KB
testcase_18 AC 123 ms
77,568 KB
testcase_19 AC 133 ms
90,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
import math

n, m, k = map(int, input().split())
opb = list(map(str, input().split()))
op = opb[0]
b = [int(x) for x in opb[1:]]
a = [int(input()) for _ in range(n)]

b.sort()

if op == '+':
    ans = 0
    for i in range(n):
        ans += m - bisect.bisect_left(b, k-a[i])
else:
    ans = 0
    for i in range(n):
        ans += m - bisect.bisect_left(b, math.ceil(k/a[i]))

print(ans)
0