結果

問題 No.989 N×Mマス計算(K以上)
ユーザー stngstng
提出日時 2022-08-17 11:03:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 166 ms / 2,000 ms
コード長 381 bytes
コンパイル時間 200 ms
コンパイル使用メモリ 82,540 KB
実行使用メモリ 91,008 KB
最終ジャッジ日時 2024-04-15 02:22:38
合計ジャッジ時間 3,173 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,096 KB
testcase_01 AC 40 ms
52,224 KB
testcase_02 AC 40 ms
52,352 KB
testcase_03 AC 40 ms
52,608 KB
testcase_04 AC 40 ms
51,968 KB
testcase_05 AC 40 ms
52,608 KB
testcase_06 AC 39 ms
52,480 KB
testcase_07 AC 41 ms
52,224 KB
testcase_08 AC 45 ms
53,092 KB
testcase_09 AC 40 ms
52,736 KB
testcase_10 AC 140 ms
84,908 KB
testcase_11 AC 126 ms
88,880 KB
testcase_12 AC 139 ms
87,424 KB
testcase_13 AC 102 ms
85,888 KB
testcase_14 AC 166 ms
91,008 KB
testcase_15 AC 105 ms
78,056 KB
testcase_16 AC 121 ms
81,792 KB
testcase_17 AC 103 ms
85,888 KB
testcase_18 AC 124 ms
77,568 KB
testcase_19 AC 127 ms
88,960 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
n,m,k = map(int,input().split())
opb = input().split()
op = opb[0]
b = []
for i in range(1,m+1):
    b.append(int(opb[i]))

a = [int(input()) for i in range(n)]
a.sort()
b.sort()

ans = 0

for i in range(n):
    if op == "+":
        ans += m-bisect.bisect_left(b,k-a[i])
    else:
        ans += m-bisect.bisect_left(b,(k+a[i]-1)//a[i])
    #print(n,ans)

print(ans)
0