結果

問題 No.989 N×Mマス計算(K以上)
ユーザー GrayCoderGrayCoder
提出日時 2020-02-14 22:30:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 226 ms / 2,000 ms
コード長 455 bytes
コンパイル時間 189 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 21,468 KB
最終ジャッジ日時 2024-04-16 02:39:20
合計ジャッジ時間 2,582 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,752 KB
testcase_01 AC 32 ms
10,752 KB
testcase_02 AC 32 ms
10,752 KB
testcase_03 AC 32 ms
10,880 KB
testcase_04 AC 31 ms
10,752 KB
testcase_05 AC 31 ms
10,752 KB
testcase_06 AC 31 ms
10,752 KB
testcase_07 AC 32 ms
10,752 KB
testcase_08 AC 32 ms
10,752 KB
testcase_09 AC 31 ms
10,752 KB
testcase_10 AC 124 ms
16,940 KB
testcase_11 AC 114 ms
18,648 KB
testcase_12 AC 166 ms
19,024 KB
testcase_13 AC 70 ms
16,040 KB
testcase_14 AC 226 ms
21,468 KB
testcase_15 AC 84 ms
13,184 KB
testcase_16 AC 138 ms
15,600 KB
testcase_17 AC 68 ms
15,780 KB
testcase_18 AC 99 ms
13,312 KB
testcase_19 AC 102 ms
19,172 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    N, M, K = map(int, input().split())
    B = input().split()
    A = [int(input()) for _ in [0] * N]

    b = sorted(map(int, B[1:]))
    A.sort()
    ans = 0
    if B[0] == '+':
        for a in A:
            ans += M - bisect_left(b, K - a)
    else:
        for a in A:
            ans += M - bisect_left(b, K / a)
    print(ans)


main()
0