結果

問題 No.989 N×Mマス計算(K以上)
ユーザー _matumo__matumo_
提出日時 2020-02-25 11:58:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 755 ms / 2,000 ms
コード長 337 bytes
コンパイル時間 257 ms
コンパイル使用メモリ 10,980 KB
実行使用メモリ 16,792 KB
最終ジャッジ日時 2023-08-03 14:53:57
合計ジャッジ時間 5,449 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,796 KB
testcase_01 AC 16 ms
7,832 KB
testcase_02 AC 16 ms
7,916 KB
testcase_03 AC 15 ms
7,852 KB
testcase_04 AC 16 ms
7,852 KB
testcase_05 AC 16 ms
7,904 KB
testcase_06 AC 15 ms
7,836 KB
testcase_07 AC 16 ms
7,808 KB
testcase_08 AC 16 ms
7,748 KB
testcase_09 AC 16 ms
7,920 KB
testcase_10 AC 498 ms
12,940 KB
testcase_11 AC 247 ms
15,200 KB
testcase_12 AC 529 ms
14,600 KB
testcase_13 AC 100 ms
13,540 KB
testcase_14 AC 755 ms
16,792 KB
testcase_15 AC 228 ms
10,064 KB
testcase_16 AC 436 ms
11,576 KB
testcase_17 AC 84 ms
13,500 KB
testcase_18 AC 439 ms
8,716 KB
testcase_19 AC 258 ms
15,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,K=map(int,input().split())
F,*pB=input().split()
pb=sorted(int(s) for s in pB)

if F=='+' :fn=lambda x,y:x+y
else      :fn=lambda x,y:x*y

cn=0
for _ in range(N):
    A=int(input())
    ns=-1
    ne= M
    while ne-ns>1:
        n=(ns+ne)//2
        if fn(A,pb[n])<K:   ns=n
        else:               ne=n
    cn += M-ne

print(cn)
0