結果

問題 No.1623 三角形の制作
ユーザー vwxyz
提出日時 2024-07-17 06:25:30
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 400 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 37,320 KB
最終ジャッジ日時 2024-07-17 06:25:35
合計ジャッジ時間 5,010 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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