結果

問題 No.1623 三角形の制作
ユーザー vwxyz
提出日時 2024-07-17 06:26:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 392 ms / 2,000 ms
コード長 412 bytes
コンパイル時間 188 ms
コンパイル使用メモリ 81,888 KB
実行使用メモリ 141,096 KB
最終ジャッジ日時 2024-07-17 06:26:33
合計ジャッジ時間 5,794 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

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()))
le=max(max(G)+max(B),max(R))+1
cnt=[0]*le
for r in R:
    cnt[r]+=1
cnt=[0]+cnt
for r in range(1,le+1):
    cnt[r]+=cnt[r-1]
ans=0
CG=Counter(G)
CB=Counter(B)
for g,cg in CG.items():
    for b,cb in CB.items():
        ans+=(cnt[g+b]-cnt[max(g,b)])*cg*cb
print(ans)
0