結果

問題 No.1623 三角形の制作
ユーザー c-yanc-yan
提出日時 2021-07-24 13:58:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 574 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 10,832 KB
実行使用メモリ 46,676 KB
最終ジャッジ日時 2023-09-27 02:00:02
合計ジャッジ時間 4,165 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 AC 85 ms
21,352 KB
testcase_13 AC 104 ms
24,036 KB
testcase_14 AC 97 ms
24,056 KB
testcase_15 AC 229 ms
46,676 KB
testcase_16 AC 230 ms
46,668 KB
testcase_17 AC 217 ms
27,736 KB
testcase_18 AC 234 ms
46,664 KB
testcase_19 AC 108 ms
12,432 KB
testcase_20 AC 19 ms
8,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import accumulate

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

rr = [0] * 3001
for i in r:
    rr[i] += 1

gg = [0] * 3001
for i in g:
    gg[i] += 1

bb = [0] * 3001
for i in b:
    bb[i] += 1

a = list(accumulate(rr))

result = 0
for i in range(1, 3001):
    x = gg[i]
    if x == 0:
        continue
    for j in range(1, 3001):
        y = bb[j]
        if y == 0:
            continue
        result += (a[max(i + j - 1, 3000)] - a[max(i, j) - 1]) * (x * y)
print(result)
0