結果

問題 No.989 N×Mマス計算(K以上)
ユーザー syunsukesyunsuke
提出日時 2020-09-16 19:36:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 225 ms / 2,000 ms
コード長 446 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 87,320 KB
実行使用メモリ 87,348 KB
最終ジャッジ日時 2023-09-04 03:48:51
合計ジャッジ時間 3,726 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
70,656 KB
testcase_01 AC 72 ms
70,908 KB
testcase_02 AC 73 ms
70,776 KB
testcase_03 AC 75 ms
70,628 KB
testcase_04 AC 74 ms
70,620 KB
testcase_05 AC 74 ms
70,776 KB
testcase_06 AC 73 ms
70,644 KB
testcase_07 AC 74 ms
70,740 KB
testcase_08 AC 73 ms
70,916 KB
testcase_09 AC 75 ms
70,644 KB
testcase_10 AC 186 ms
82,568 KB
testcase_11 AC 190 ms
86,188 KB
testcase_12 AC 192 ms
84,572 KB
testcase_13 AC 156 ms
83,720 KB
testcase_14 AC 225 ms
87,348 KB
testcase_15 AC 135 ms
79,428 KB
testcase_16 AC 157 ms
81,588 KB
testcase_17 AC 155 ms
83,356 KB
testcase_18 AC 140 ms
76,944 KB
testcase_19 AC 189 ms
86,340 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H,W,K=map(int,input().split())

B=list(input().split())
OP=B[0]
B=B[1:]
#print(B)
for i in range(len(B)):
    B[i]=int(B[i])
B.sort()
B=B+[10**10]
#print(B)

import bisect

ans=0
if OP=="+":
    for i in range(H):
        A=int(input())
        x=bisect.bisect_left(B,K-0.1-A)
        ans+=(W-x)
    print(ans)
else:
    for i in range(H):
        A=int(input())
        x=bisect.bisect_left(B,K/A)
        ans+=(W-x)
    print(ans)
        
    
0