結果

問題 No.989 N×Mマス計算(K以上)
ユーザー yuly3yuly3
提出日時 2020-04-21 16:50:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 500 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 82,420 KB
実行使用メモリ 85,560 KB
最終ジャッジ日時 2024-04-17 05:13:10
合計ジャッジ時間 2,643 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,744 KB
testcase_01 AC 38 ms
52,708 KB
testcase_02 AC 37 ms
53,296 KB
testcase_03 AC 39 ms
52,996 KB
testcase_04 AC 38 ms
52,944 KB
testcase_05 AC 37 ms
52,136 KB
testcase_06 AC 38 ms
53,632 KB
testcase_07 AC 37 ms
53,072 KB
testcase_08 AC 38 ms
53,928 KB
testcase_09 AC 38 ms
53,356 KB
testcase_10 AC 99 ms
81,456 KB
testcase_11 AC 94 ms
83,908 KB
testcase_12 AC 97 ms
83,388 KB
testcase_13 AC 71 ms
79,588 KB
testcase_14 AC 113 ms
85,560 KB
testcase_15 AC 74 ms
77,152 KB
testcase_16 AC 80 ms
79,732 KB
testcase_17 AC 72 ms
79,744 KB
testcase_18 AC 84 ms
76,000 KB
testcase_19 AC 94 ms
83,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from bisect import bisect_left

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    N, M, K = map(int, rl().split())
    op, *B = input().split()
    B = [int(bi) for bi in B]
    A = [int(rl()) for _ in range(N)]
    
    B.sort()
    ans = 0
    if op == '+':
        for ai in A:
            ans += M - bisect_left(B, K - ai)
    else:
        for ai in A:
            ans += M - bisect_left(B, -(-K // ai))
    print(ans)


if __name__ == '__main__':
    solve()
0