結果

問題 No.989 N×Mマス計算(K以上)
ユーザー freecss00freecss00
提出日時 2020-02-14 22:15:40
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 304 ms / 2,000 ms
コード長 384 bytes
コンパイル時間 110 ms
コンパイル使用メモリ 10,840 KB
実行使用メモリ 19,164 KB
最終ジャッジ日時 2023-07-28 18:26:17
合計ジャッジ時間 2,791 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
7,996 KB
testcase_01 AC 17 ms
7,960 KB
testcase_02 AC 16 ms
7,988 KB
testcase_03 AC 16 ms
7,976 KB
testcase_04 AC 16 ms
8,064 KB
testcase_05 AC 17 ms
8,000 KB
testcase_06 AC 17 ms
8,096 KB
testcase_07 AC 16 ms
7,984 KB
testcase_08 AC 17 ms
8,064 KB
testcase_09 AC 17 ms
7,952 KB
testcase_10 AC 185 ms
14,992 KB
testcase_11 AC 125 ms
16,456 KB
testcase_12 AC 213 ms
16,132 KB
testcase_13 AC 64 ms
13,956 KB
testcase_14 AC 304 ms
19,164 KB
testcase_15 AC 100 ms
10,868 KB
testcase_16 AC 179 ms
13,432 KB
testcase_17 AC 60 ms
13,912 KB
testcase_18 AC 161 ms
10,532 KB
testcase_19 AC 118 ms
16,284 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect

n, m, k = map(int, input().split())
line = input().split()
op = line[0]
B = list(map(int, line[1:]))
A = [int(input()) for _ in range(n)]
B.sort()

f = (lambda a,b: a+b) if op == '+' else (lambda a,b: a*b)
rf = (lambda a,b: a-b) if op == '+' else (lambda a,b: a/b)
ans = 0
for i in range(n):
    a = A[i]
    x = bisect.bisect_left(B, rf(k,a))
    ans += m-x
print(ans)
0