結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
10,496 KB
testcase_01 AC 33 ms
10,752 KB
testcase_02 AC 31 ms
10,496 KB
testcase_03 AC 32 ms
10,496 KB
testcase_04 AC 31 ms
10,624 KB
testcase_05 AC 31 ms
10,624 KB
testcase_06 WA -
testcase_07 AC 32 ms
10,624 KB
testcase_08 WA -
testcase_09 AC 32 ms
10,752 KB
testcase_10 AC 125 ms
19,800 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 77 ms
16,004 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 106 ms
18,100 KB
testcase_17 AC 75 ms
15,756 KB
testcase_18 AC 90 ms
15,904 KB
testcase_19 AC 113 ms
19,164 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_left as bis
    ans = 0
    for ai in a:
        ans += m - bis(b,(k-1)//ai)
    print(ans)













0