結果

問題 No.989 N×Mマス計算(K以上)
ユーザー takakintakakin
提出日時 2020-05-09 20:48:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 162 ms / 2,000 ms
コード長 370 bytes
コンパイル時間 251 ms
コンパイル使用メモリ 10,972 KB
実行使用メモリ 16,704 KB
最終ジャッジ日時 2023-09-20 09:17:52
合計ジャッジ時間 3,096 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,328 KB
testcase_01 AC 17 ms
8,156 KB
testcase_02 AC 17 ms
8,304 KB
testcase_03 AC 17 ms
8,352 KB
testcase_04 AC 17 ms
8,192 KB
testcase_05 AC 17 ms
8,204 KB
testcase_06 AC 17 ms
8,184 KB
testcase_07 AC 17 ms
8,328 KB
testcase_08 AC 17 ms
8,160 KB
testcase_09 AC 17 ms
8,220 KB
testcase_10 AC 107 ms
13,332 KB
testcase_11 AC 116 ms
15,448 KB
testcase_12 AC 122 ms
14,676 KB
testcase_13 AC 74 ms
13,604 KB
testcase_14 AC 162 ms
16,704 KB
testcase_15 AC 54 ms
10,440 KB
testcase_16 AC 87 ms
12,392 KB
testcase_17 AC 74 ms
13,732 KB
testcase_18 AC 59 ms
10,200 KB
testcase_19 AC 110 ms
15,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
n,m,k=map(int,input().split())
B=[str(i) for i in input().split()]
op=B[0]
B=[int(B[i]) for i in range(1,m+1)]
A=[int(input()) for _ in range(n)]
import bisect
A.sort()
ans=0
if op=="+":
  for b in B:
    ans+=n-bisect.bisect_left(A,k-b)
else:
  for b in B:
    ans+=n-bisect.bisect_left(A,(k-1)//b+1)
print(ans)
  
0