結果

問題 No.989 N×Mマス計算(K以上)
ユーザー rythem00359rythem00359
提出日時 2020-08-27 17:37:15
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 256 ms / 2,000 ms
コード長 331 bytes
コンパイル時間 637 ms
コンパイル使用メモリ 10,656 KB
実行使用メモリ 17,500 KB
最終ジャッジ日時 2023-08-07 17:08:19
合計ジャッジ時間 2,856 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,936 KB
testcase_01 AC 15 ms
8,060 KB
testcase_02 AC 15 ms
7,944 KB
testcase_03 AC 15 ms
7,968 KB
testcase_04 AC 15 ms
7,884 KB
testcase_05 AC 16 ms
8,036 KB
testcase_06 AC 16 ms
7,860 KB
testcase_07 AC 15 ms
7,964 KB
testcase_08 AC 15 ms
7,916 KB
testcase_09 AC 15 ms
7,908 KB
testcase_10 AC 189 ms
13,704 KB
testcase_11 AC 104 ms
15,956 KB
testcase_12 AC 177 ms
15,440 KB
testcase_13 AC 59 ms
14,136 KB
testcase_14 AC 256 ms
17,500 KB
testcase_15 AC 85 ms
10,656 KB
testcase_16 AC 158 ms
12,316 KB
testcase_17 AC 55 ms
14,104 KB
testcase_18 AC 167 ms
10,844 KB
testcase_19 AC 113 ms
16,508 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left
from math import ceil
n,m,k=map(int,input().split())
op,*b=input().split()
b=sorted(list(map(int,b)))
a=sorted(list(int(input()) for _ in range(n)))
ans=0
if op=='+':
    for an in a:
        ans+=m-bisect_left(b,max(k-an,0))
else:
    for an in a:
        ans+=m-bisect_left(b,ceil(k/an))
print(ans)
0