結果

問題 No.1623 三角形の制作
ユーザー MineMine
提出日時 2021-09-10 23:46:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 434 ms / 2,000 ms
コード長 430 bytes
コンパイル時間 245 ms
コンパイル使用メモリ 87,020 KB
実行使用メモリ 135,360 KB
最終ジャッジ日時 2023-09-02 23:44:50
合計ジャッジ時間 8,555 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
77,180 KB
testcase_01 AC 91 ms
77,212 KB
testcase_02 AC 404 ms
119,872 KB
testcase_03 AC 393 ms
122,532 KB
testcase_04 AC 377 ms
123,200 KB
testcase_05 AC 434 ms
132,960 KB
testcase_06 AC 346 ms
86,004 KB
testcase_07 AC 397 ms
122,716 KB
testcase_08 AC 344 ms
88,348 KB
testcase_09 AC 389 ms
117,876 KB
testcase_10 AC 431 ms
124,680 KB
testcase_11 AC 409 ms
121,600 KB
testcase_12 AC 120 ms
102,400 KB
testcase_13 AC 132 ms
110,984 KB
testcase_14 AC 132 ms
107,072 KB
testcase_15 AC 192 ms
135,092 KB
testcase_16 AC 183 ms
135,012 KB
testcase_17 AC 189 ms
135,360 KB
testcase_18 AC 202 ms
133,264 KB
testcase_19 AC 148 ms
129,880 KB
testcase_20 AC 90 ms
76,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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()))
r = Counter(r)
g = Counter(g)
b = Counter(b)
acc = [0]*(3*10**3+1)
for i in range(1, 3*10**3+1):
    acc[i] += acc[i-1] + r[i]
ans = 0
for gg, gr in g.items():
    for bb, vb in b.items():
        ans += gr*vb*(acc[min(3*10**3, gg+bb-1)] - acc[max(gg-1, bb-1)])
print(ans)
0