結果
問題 |
No.989 N×Mマス計算(K以上)
|
ユーザー |
|
提出日時 | 2020-04-06 17:09:47 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 140 ms / 2,000 ms |
コード長 | 676 bytes |
コンパイル時間 | 94 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 20,732 KB |
最終ジャッジ日時 | 2024-07-06 13:33:26 |
合計ジャッジ時間 | 2,089 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
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()