結果

問題 No.1623 三角形の制作
ユーザー noriocnorioc
提出日時 2022-05-18 19:57:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 450 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 11,928 KB
実行使用メモリ 10,160 KB
最終ジャッジ日時 2023-10-16 23:23:17
合計ジャッジ時間 6,041 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,160 KB
testcase_01 AC 30 ms
10,160 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
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 bisect import bisect_left, bisect_right
from collections import Counter

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

rs = Counter(R)
gs = Counter(G)
B.sort()
ans = 0
for r in rs:
    for g in range(1, r+1):
        if gs[g] == 0: continue
        lo = bisect_left(B, r - g + 1)
        hi = bisect_right(B, r)
        ans += (hi - lo) * rs[r] * gs[g]

print(ans)
0