結果

問題 No.1623 三角形の制作
ユーザー 👑 H20H20
提出日時 2021-07-23 22:05:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 235 ms / 2,000 ms
コード長 470 bytes
コンパイル時間 489 ms
コンパイル使用メモリ 86,728 KB
実行使用メモリ 142,292 KB
最終ジャッジ日時 2023-09-25 22:09:54
合計ジャッジ時間 5,768 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
76,208 KB
testcase_01 AC 120 ms
76,276 KB
testcase_02 AC 181 ms
105,040 KB
testcase_03 AC 181 ms
104,848 KB
testcase_04 AC 177 ms
105,028 KB
testcase_05 AC 235 ms
138,412 KB
testcase_06 AC 135 ms
83,692 KB
testcase_07 AC 183 ms
105,252 KB
testcase_08 AC 136 ms
86,432 KB
testcase_09 AC 168 ms
102,872 KB
testcase_10 AC 205 ms
123,332 KB
testcase_11 AC 189 ms
110,800 KB
testcase_12 AC 150 ms
97,784 KB
testcase_13 AC 157 ms
99,768 KB
testcase_14 AC 151 ms
97,264 KB
testcase_15 AC 225 ms
142,232 KB
testcase_16 AC 223 ms
142,192 KB
testcase_17 AC 226 ms
142,292 KB
testcase_18 AC 219 ms
139,124 KB
testcase_19 AC 170 ms
109,444 KB
testcase_20 AC 111 ms
76,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
n = int(input())
R = list(map(int,input().split()))
G = list(map(int,input().split()))
B = list(map(int,input().split()))
RL = [0]*(3*10**3+10)
GL = [0]*(3*10**3+10)
BL = [0]*(3*10**3+10)
for r in R:
    RL[r]+=1
for g in G:
    GL[g]+=1
for b in B:
    BL[b]+=1
BLAC = list(itertools.accumulate(BL)) + [0]
ans = 0
for i in range(1,3001):
    for j in range(1,i+1):
        l = i-j+1
        r = i
        ans+=RL[i]*GL[j]*(BLAC[r]-BLAC[l-1])
print(ans)
0