結果

問題 No.1623 三角形の制作
ユーザー 👑 rin204rin204
提出日時 2022-01-18 02:47:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 172 ms / 2,000 ms
コード長 444 bytes
コンパイル時間 357 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 135,428 KB
最終ジャッジ日時 2024-05-02 19:12:52
合計ジャッジ時間 4,588 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
57,856 KB
testcase_01 AC 41 ms
58,752 KB
testcase_02 AC 129 ms
106,112 KB
testcase_03 AC 122 ms
105,472 KB
testcase_04 AC 126 ms
105,856 KB
testcase_05 AC 172 ms
135,428 KB
testcase_06 AC 83 ms
80,000 KB
testcase_07 AC 122 ms
105,728 KB
testcase_08 AC 86 ms
82,560 KB
testcase_09 AC 119 ms
102,784 KB
testcase_10 AC 157 ms
120,464 KB
testcase_11 AC 137 ms
107,720 KB
testcase_12 AC 87 ms
100,224 KB
testcase_13 AC 97 ms
102,016 KB
testcase_14 AC 94 ms
100,992 KB
testcase_15 AC 143 ms
134,832 KB
testcase_16 AC 140 ms
134,544 KB
testcase_17 AC 141 ms
134,444 KB
testcase_18 AC 149 ms
135,348 KB
testcase_19 AC 100 ms
109,312 KB
testcase_20 AC 39 ms
57,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
R = list(map(int, input().split()))
G = list(map(int, input().split()))
B = list(map(int, input().split()))

cr = [0] * 3001
cg = [0] * 3001
cb = [0] * 3001
for r in R: cr[r] += 1
for g in G: cg[g] += 1
for b in B: cb[b] += 1

for i in range(1, 3001):
    cb[i] += cb[i - 1]
ans = 0
for i in range(1, 3001):
    if cr[i] == 0: continue
    for j in range(1, i + 1):
        ans += cr[i] * cg[j] * (cb[i] - cb[i - j])
print(ans)
0