結果

問題 No.989 N×Mマス計算(K以上)
ユーザー hirakuhiraku
提出日時 2020-02-14 22:07:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 298 ms / 2,000 ms
コード長 336 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 18,516 KB
最終ジャッジ日時 2024-04-16 02:07:44
合計ジャッジ時間 2,949 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,880 KB
testcase_01 AC 31 ms
10,880 KB
testcase_02 AC 30 ms
10,752 KB
testcase_03 AC 31 ms
10,752 KB
testcase_04 AC 30 ms
10,880 KB
testcase_05 AC 30 ms
10,880 KB
testcase_06 AC 31 ms
10,880 KB
testcase_07 AC 30 ms
10,880 KB
testcase_08 AC 31 ms
10,880 KB
testcase_09 AC 31 ms
10,880 KB
testcase_10 AC 212 ms
15,368 KB
testcase_11 AC 135 ms
17,348 KB
testcase_12 AC 210 ms
16,544 KB
testcase_13 AC 80 ms
15,780 KB
testcase_14 AC 298 ms
18,516 KB
testcase_15 AC 110 ms
12,672 KB
testcase_16 AC 186 ms
14,964 KB
testcase_17 AC 78 ms
15,556 KB
testcase_18 AC 183 ms
12,672 KB
testcase_19 AC 138 ms
17,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left
n, m, k = map(int, input().split())
op, *B = input().split()
B = [int(b) for b in B]
A = [int(input()) for _ in range(n)]

B.sort()

ans = 0

if op == "+":
  for a in A:
    t = k - a
    ans += m - bisect_left(B, t)
else:
  for a in A:
    t = (k - 1) // a + 1
    ans += m - bisect_left(B, t)
print(ans)
0