結果

問題 No.989 N×Mマス計算(K以上)
ユーザー hedwig100hedwig100
提出日時 2020-04-06 17:01:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 672 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 10,868 KB
実行使用メモリ 19,016 KB
最終ジャッジ日時 2023-09-20 18:27:49
合計ジャッジ時間 2,213 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,024 KB
testcase_01 AC 17 ms
8,028 KB
testcase_02 AC 17 ms
8,084 KB
testcase_03 AC 16 ms
8,036 KB
testcase_04 AC 17 ms
8,020 KB
testcase_05 AC 17 ms
7,948 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 17 ms
7,956 KB
testcase_10 AC 89 ms
14,752 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 61 ms
13,792 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 70 ms
13,312 KB
testcase_17 AC 60 ms
13,764 KB
testcase_18 AC 51 ms
10,708 KB
testcase_19 AC 91 ms
16,208 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