結果

問題 No.1623 三角形の制作
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2021-07-23 21:54:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 218 ms / 2,000 ms
コード長 476 bytes
コンパイル時間 2,446 ms
コンパイル使用メモリ 86,696 KB
実行使用メモリ 142,452 KB
最終ジャッジ日時 2023-09-25 21:53:03
合計ジャッジ時間 6,962 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
76,080 KB
testcase_01 AC 105 ms
76,120 KB
testcase_02 AC 172 ms
105,572 KB
testcase_03 AC 168 ms
104,692 KB
testcase_04 AC 169 ms
104,852 KB
testcase_05 AC 218 ms
138,768 KB
testcase_06 AC 124 ms
84,080 KB
testcase_07 AC 169 ms
104,820 KB
testcase_08 AC 129 ms
86,348 KB
testcase_09 AC 164 ms
101,776 KB
testcase_10 AC 195 ms
123,528 KB
testcase_11 AC 177 ms
110,904 KB
testcase_12 AC 142 ms
96,168 KB
testcase_13 AC 148 ms
99,308 KB
testcase_14 AC 142 ms
96,820 KB
testcase_15 AC 209 ms
142,452 KB
testcase_16 AC 210 ms
142,304 KB
testcase_17 AC 212 ms
142,256 KB
testcase_18 AC 209 ms
138,912 KB
testcase_19 AC 163 ms
109,148 KB
testcase_20 AC 106 ms
76,232 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""


"""

import bisect
n = int(input())

r = list(map(int,input().split()))
g = list(map(int,input().split()))
b = list(map(int,input().split()))

MM = 3001
rx = [0] * MM
gx = [0] * MM
bx = [0] * MM

for i in r:
    rx[i] += 1
for i in g:
    gx[i] += 1
for i in b:
    bx[i] += 1

for i in range(MM-1):
    bx[i+1] += bx[i]

ans = 0
for i in range(MM):
    for j in range(i+1):

        minlen = i - j
        ans += (bx[i] - bx[minlen]) * rx[i] * gx[j]

print (ans)
    
0