結果

問題 No.989 N×Mマス計算(K以上)
ユーザー mkawa2mkawa2
提出日時 2021-05-13 12:36:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 182 ms / 2,000 ms
コード長 959 bytes
コンパイル時間 114 ms
コンパイル使用メモリ 12,080 KB
実行使用メモリ 18,096 KB
最終ジャッジ日時 2023-10-25 06:36:58
合計ジャッジ時間 3,040 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
10,148 KB
testcase_01 AC 33 ms
10,148 KB
testcase_02 AC 31 ms
10,212 KB
testcase_03 AC 30 ms
10,216 KB
testcase_04 AC 30 ms
10,148 KB
testcase_05 AC 30 ms
10,148 KB
testcase_06 AC 30 ms
10,152 KB
testcase_07 AC 29 ms
10,148 KB
testcase_08 AC 29 ms
10,212 KB
testcase_09 AC 30 ms
10,152 KB
testcase_10 AC 131 ms
14,740 KB
testcase_11 AC 101 ms
17,004 KB
testcase_12 AC 136 ms
16,220 KB
testcase_13 AC 67 ms
15,056 KB
testcase_14 AC 182 ms
18,096 KB
testcase_15 AC 71 ms
11,756 KB
testcase_16 AC 111 ms
13,316 KB
testcase_17 AC 66 ms
15,048 KB
testcase_18 AC 97 ms
10,792 KB
testcase_19 AC 101 ms
17,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10**6)
int1 = lambda x: int(x)-1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.buffer.readline())
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def LI1(): return list(map(int1, sys.stdin.buffer.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def BI(): return sys.stdin.buffer.readline().rstrip()
def SI(): return sys.stdin.buffer.readline().rstrip().decode()
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
dij = [(0, 1), (1, 0), (1, 1), (1, -1)]
inf = 10**16
# md = 998244353
md = 10**9+7

from bisect import *

n,m,k=LI()
op,*bb=SI().split()
bb=list(map(int,bb))
bb.sort()

ans=0
for _ in range(n):
    a=II()
    if op=="+":t=k-a
    else:t=(k+a-1)//a
    i=bisect_left(bb,t)
    ans+=m-i

print(ans)
0