結果

問題 No.989 N×Mマス計算(K以上)
ユーザー 👑 tamatotamato
提出日時 2020-02-14 22:11:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 571 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 82,552 KB
実行使用メモリ 91,520 KB
最終ジャッジ日時 2024-04-16 02:19:02
合計ジャッジ時間 2,575 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
51,968 KB
testcase_01 AC 58 ms
51,712 KB
testcase_02 AC 43 ms
52,096 KB
testcase_03 AC 43 ms
52,224 KB
testcase_04 AC 44 ms
51,712 KB
testcase_05 AC 43 ms
52,224 KB
testcase_06 AC 42 ms
51,968 KB
testcase_07 AC 44 ms
52,480 KB
testcase_08 AC 42 ms
52,096 KB
testcase_09 AC 41 ms
52,608 KB
testcase_10 AC 116 ms
84,480 KB
testcase_11 AC 106 ms
89,728 KB
testcase_12 AC 115 ms
87,296 KB
testcase_13 AC 78 ms
81,408 KB
testcase_14 AC 132 ms
91,520 KB
testcase_15 AC 85 ms
77,696 KB
testcase_16 AC 96 ms
81,356 KB
testcase_17 AC 81 ms
81,536 KB
testcase_18 AC 96 ms
76,800 KB
testcase_19 AC 107 ms
89,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    import sys
    from bisect import bisect_left
    input = sys.stdin.readline

    N, M, K = map(int, input().split())
    line = input().split()
    op = line[0]
    B = list(map(int, line[1:]))
    A = [0] * N
    for i in range(N):
        A[i] = int(input())
    A.sort()
    B.sort()

    ans = 0
    if op == '+':
        for a in A:
            i = bisect_left(B, K-a)
            ans += M - i
    else:
        for a in A:
            i = bisect_left(B, (K-1)//a + 1)
            ans += M - i
    print(ans)


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