結果

問題 No.1623 三角形の制作
ユーザー moshi777moshi777
提出日時 2021-07-23 23:04:31
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 597 bytes
コンパイル時間 397 ms
コンパイル使用メモリ 87,220 KB
実行使用メモリ 119,960 KB
最終ジャッジ日時 2023-09-26 01:02:31
合計ジャッジ時間 4,901 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
76,248 KB
testcase_01 AC 84 ms
71,764 KB
testcase_02 TLE -
testcase_03 TLE -
testcase_04 TLE -
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
from bisect import bisect_right, bisect_left
N = int(input())

R = list(map(int, input().split()))
G = list(map(int, input().split()))
B = list(map(int, input().split()))

B.sort()

rdd = defaultdict(int)
gdd = defaultdict(int)

for i in range(N):
    rdd[R[i]] += 1
    gdd[G[i]] += 1

#print(rdd, gdd)

ans = 0
for r, rv in rdd.items():
    for g, gv in gdd.items():
        #print(r, rv, g, gv)
        if r < g:
            continue
        add = rv*gv*(bisect_right(B, r) - bisect_right(B, r-g))
        # print(add)
        ans += max(0, add)

print(ans)
0