結果

問題 No.989 N×Mマス計算(K以上)
ユーザー rkyiolklorkyiolklo
提出日時 2020-04-21 10:11:07
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 293 ms / 2,000 ms
コード長 410 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 10,956 KB
実行使用メモリ 19,120 KB
最終ジャッジ日時 2023-07-29 11:11:40
合計ジャッジ時間 3,068 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
8,244 KB
testcase_01 AC 13 ms
8,132 KB
testcase_02 AC 13 ms
8,244 KB
testcase_03 AC 14 ms
8,096 KB
testcase_04 AC 14 ms
8,244 KB
testcase_05 AC 13 ms
8,260 KB
testcase_06 AC 13 ms
8,168 KB
testcase_07 AC 13 ms
8,164 KB
testcase_08 AC 13 ms
8,172 KB
testcase_09 AC 13 ms
8,168 KB
testcase_10 AC 183 ms
14,792 KB
testcase_11 AC 127 ms
16,228 KB
testcase_12 AC 207 ms
16,304 KB
testcase_13 AC 68 ms
13,696 KB
testcase_14 AC 293 ms
19,120 KB
testcase_15 AC 94 ms
10,816 KB
testcase_16 AC 176 ms
13,168 KB
testcase_17 AC 67 ms
13,788 KB
testcase_18 AC 148 ms
10,480 KB
testcase_19 AC 121 ms
16,132 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,k=map(int,input().split())
c=list(map(str,input().split()))
a=[0]*(n)
for i in range(n):
    a[i]=int(input())
op=c[0]
b=[0]*m
for i in range(m):
    b[i]=int(c[i+1])
a.sort()
b.sort()
from bisect import bisect_left
if op=='+':
    cnt=n*m
    for i in range(n):
        cnt-=bisect_left(b,k-a[i])
    print(cnt)
else:
    cnt=n*m
    for i in range(n):
        cnt-=bisect_left(b,k/a[i])
    print(cnt)   
0