結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,752 KB
testcase_01 AC 32 ms
10,752 KB
testcase_02 AC 32 ms
10,880 KB
testcase_03 AC 33 ms
10,752 KB
testcase_04 AC 32 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 33 ms
10,752 KB
testcase_10 AC 122 ms
19,928 KB
testcase_11 AC 110 ms
18,880 KB
testcase_12 AC 131 ms
20,752 KB
testcase_13 AC 76 ms
16,260 KB
testcase_14 AC 172 ms
24,632 KB
testcase_15 AC 70 ms
14,536 KB
testcase_16 AC 104 ms
18,312 KB
testcase_17 AC 75 ms
15,968 KB
testcase_18 AC 89 ms
15,904 KB
testcase_19 AC 109 ms
19,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!

import sys
readline = sys.stdin.readline
read = sys.stdin.read

n,m,k = [int(i) for i in readline().split()]

x = read().split()
op = x[0]

b = list(map(lambda x: int(x),x[1:m+1]))
a = list(map(lambda x: int(x),x[m+1:]))

#a.sort()
b.sort()



"""
if op == "+":
    from itertools import Counter
    C = Counter(b)
    ans = 0
    for ai in a:
        if a == 0:
            ans += C[0]
        else:
            ans += C[k-a]
    print(ans)

else:
    ans = 0
    for ai in a:
        ans += m - bis(b,k//ai)

    print(ans)



"""

#print(op,b,a)
if op == "+":
    from bisect import bisect_left as bis
    ans = 0
    for ai in a:
        ans += m - bis(b,k-ai)
    print(ans)

else:
    from bisect import bisect_right as bis
    ans = 0
    for ai in a:
        ans += m - bis(b,(k-1)//ai)
    print(ans)













0