結果

問題 No.1623 三角形の制作
ユーザー vwxyz
提出日時 2024-07-17 06:25:40
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 400 bytes
コンパイル時間 218 ms
コンパイル使用メモリ 82,916 KB
実行使用メモリ 113,016 KB
最終ジャッジ日時 2024-07-17 06:25:44
合計ジャッジ時間 4,196 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other TLE * 1 -- * 18
権限があれば一括ダウンロードができます

ソースコード

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