結果

問題 No.989 N×Mマス計算(K以上)
ユーザー hiragnhiragn
提出日時 2022-12-02 15:32:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 277 ms / 2,000 ms
コード長 427 bytes
コンパイル時間 155 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 18,416 KB
最終ジャッジ日時 2024-04-17 23:39:34
合計ジャッジ時間 2,950 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
10,880 KB
testcase_01 AC 25 ms
10,752 KB
testcase_02 AC 26 ms
10,880 KB
testcase_03 AC 25 ms
10,880 KB
testcase_04 AC 26 ms
10,752 KB
testcase_05 AC 27 ms
10,880 KB
testcase_06 AC 26 ms
10,880 KB
testcase_07 AC 26 ms
10,752 KB
testcase_08 AC 27 ms
10,752 KB
testcase_09 AC 26 ms
10,752 KB
testcase_10 AC 164 ms
16,624 KB
testcase_11 AC 115 ms
17,292 KB
testcase_12 AC 206 ms
16,688 KB
testcase_13 AC 65 ms
15,532 KB
testcase_14 AC 277 ms
18,416 KB
testcase_15 AC 101 ms
12,588 KB
testcase_16 AC 178 ms
15,232 KB
testcase_17 AC 65 ms
15,784 KB
testcase_18 AC 142 ms
14,336 KB
testcase_19 AC 117 ms
17,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left


def main():
    n, m, k = map(int, input().split())
    op, *b = input().split()
    b = list(map(int, b))
    b.sort()
    arr = [int(input()) for _ in range(n)]

    ans = n * m
    if op == "+":
        ans -= sum([bisect_left(b, k - a) for a in arr])
    elif op == "*":
        ans -= sum([bisect_left(b, float(k / a)) for a in arr])
    print(ans)


if __name__ == "__main__":
    main()
0