結果

問題 No.989 N×Mマス計算(K以上)
ユーザー komkompikomkompi
提出日時 2020-03-08 15:13:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 305 ms / 2,000 ms
コード長 330 bytes
コンパイル時間 256 ms
コンパイル使用メモリ 10,572 KB
実行使用メモリ 19,696 KB
最終ジャッジ日時 2023-08-07 02:32:40
合計ジャッジ時間 3,009 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,100 KB
testcase_01 AC 17 ms
7,952 KB
testcase_02 AC 16 ms
8,040 KB
testcase_03 AC 17 ms
7,968 KB
testcase_04 AC 16 ms
7,956 KB
testcase_05 AC 17 ms
7,940 KB
testcase_06 AC 17 ms
7,852 KB
testcase_07 AC 16 ms
7,968 KB
testcase_08 AC 17 ms
7,952 KB
testcase_09 AC 16 ms
7,916 KB
testcase_10 AC 196 ms
14,740 KB
testcase_11 AC 168 ms
16,336 KB
testcase_12 AC 217 ms
16,252 KB
testcase_13 AC 96 ms
14,036 KB
testcase_14 AC 305 ms
19,696 KB
testcase_15 AC 94 ms
10,604 KB
testcase_16 AC 170 ms
13,448 KB
testcase_17 AC 91 ms
13,964 KB
testcase_18 AC 136 ms
10,564 KB
testcase_19 AC 159 ms
16,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect

N,M,K=map(int,input().split())
temp=list(input().split())
col=list(map(int,temp[1:]))
data=[]
for i in range(N):
    data.append(int(input()))

col.sort()
data.sort()

ans=N*M
for item in col:
    index=bisect.bisect_left(data,K-item if temp[0]=="+" else -int(-K//item))
    ans-=index
    #print(index)

print(ans)
0