結果

問題 No.989 N×Mマス計算(K以上)
ユーザー hedwig100hedwig100
提出日時 2020-04-06 17:09:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 676 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 10,816 KB
実行使用メモリ 18,888 KB
最終ジャッジ日時 2023-09-20 18:39:57
合計ジャッジ時間 2,114 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,016 KB
testcase_01 AC 16 ms
8,108 KB
testcase_02 AC 16 ms
8,016 KB
testcase_03 AC 16 ms
7,964 KB
testcase_04 AC 16 ms
8,000 KB
testcase_05 AC 16 ms
7,984 KB
testcase_06 AC 16 ms
7,984 KB
testcase_07 AC 16 ms
8,112 KB
testcase_08 AC 16 ms
8,064 KB
testcase_09 AC 17 ms
8,104 KB
testcase_10 AC 87 ms
14,728 KB
testcase_11 AC 98 ms
15,980 KB
testcase_12 AC 102 ms
16,052 KB
testcase_13 AC 60 ms
13,876 KB
testcase_14 AC 135 ms
18,888 KB
testcase_15 AC 45 ms
10,924 KB
testcase_16 AC 72 ms
13,272 KB
testcase_17 AC 59 ms
13,640 KB
testcase_18 AC 51 ms
10,728 KB
testcase_19 AC 91 ms
16,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10 ** 9 + 7
INF = 10 ** 10
import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000000)
dy = (-1,0,1,0)
dx = (0,1,0,-1)
from bisect import bisect_left,bisect_right

def main():
    n,m,k = map(int,input().split())
    li = input().split()
    op = li[0]
    b = [int(li[i]) for i in range(1,len(li))]
    a = [int(input()) for i in range(n)]
    a.sort()

    if op == '+':
        cnt = 0
        for i in range(m):
            cnt += n - bisect_left(a,k - b[i])
        print(cnt)
    
    elif op ==  '*':
        cnt = 0
        for i in range(m):
            cnt += n - bisect_left(a,-(-k//b[i]))
        print(cnt)

if __name__ =='__main__':
    main()  
0