結果
| 問題 | No.1623 三角形の制作 | 
| コンテスト | |
| ユーザー |  H20 | 
| 提出日時 | 2021-07-23 22:05:57 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 202 ms / 2,000 ms | 
| コード長 | 470 bytes | 
| コンパイル時間 | 272 ms | 
| コンパイル使用メモリ | 81,792 KB | 
| 実行使用メモリ | 142,392 KB | 
| 最終ジャッジ日時 | 2024-07-18 17:50:25 | 
| 合計ジャッジ時間 | 4,661 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 19 | 
ソースコード
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)
            
            
            
        