結果

問題 No.1623 三角形の制作
ユーザー noriocnorioc
提出日時 2022-05-18 19:57:47
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 450 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 81,824 KB
実行使用メモリ 140,844 KB
最終ジャッジ日時 2023-10-16 23:24:22
合計ジャッジ時間 29,050 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
55,624 KB
testcase_01 AC 42 ms
59,872 KB
testcase_02 TLE -
testcase_03 TLE -
testcase_04 TLE -
testcase_05 TLE -
testcase_06 TLE -
testcase_07 TLE -
testcase_08 TLE -
testcase_09 TLE -
testcase_10 TLE -
testcase_11 TLE -
testcase_12 AC 81 ms
96,728 KB
testcase_13 AC 86 ms
98,796 KB
testcase_14 AC 85 ms
95,924 KB
testcase_15 AC 158 ms
140,844 KB
testcase_16 AC 154 ms
140,844 KB
testcase_17 AC 157 ms
140,844 KB
testcase_18 AC 155 ms
137,892 KB
testcase_19 AC 100 ms
108,368 KB
testcase_20 AC 39 ms
55,624 KB
権限があれば一括ダウンロードができます

ソースコード

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