結果

問題 No.1623 三角形の制作
ユーザー c-yanc-yan
提出日時 2021-07-24 13:59:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 296 ms / 2,000 ms
コード長 574 bytes
コンパイル時間 432 ms
コンパイル使用メモリ 87,232 KB
実行使用メモリ 139,220 KB
最終ジャッジ日時 2023-09-27 02:01:11
合計ジャッジ時間 5,485 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
76,048 KB
testcase_01 AC 79 ms
76,020 KB
testcase_02 AC 254 ms
105,472 KB
testcase_03 AC 252 ms
105,376 KB
testcase_04 AC 249 ms
105,240 KB
testcase_05 AC 296 ms
138,532 KB
testcase_06 AC 207 ms
84,068 KB
testcase_07 AC 249 ms
105,256 KB
testcase_08 AC 209 ms
86,584 KB
testcase_09 AC 240 ms
102,888 KB
testcase_10 AC 279 ms
128,192 KB
testcase_11 AC 257 ms
111,184 KB
testcase_12 AC 107 ms
97,896 KB
testcase_13 AC 113 ms
99,744 KB
testcase_14 AC 108 ms
97,496 KB
testcase_15 AC 170 ms
136,064 KB
testcase_16 AC 170 ms
135,996 KB
testcase_17 AC 170 ms
136,024 KB
testcase_18 AC 174 ms
139,220 KB
testcase_19 AC 126 ms
109,488 KB
testcase_20 AC 74 ms
76,008 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[min(i + j - 1, 3000)] - a[max(i, j) - 1]) * (x * y)
print(result)
0