結果

問題 No.1623 三角形の制作
コンテスト
ユーザー vwxyz
提出日時 2024-07-17 06:26:17
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
TLE  
実行時間 -
コード長 412 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 330 ms
コンパイル使用メモリ 20,696 KB
実行使用メモリ 39,712 KB
最終ジャッジ日時 2026-03-31 19:03:32
合計ジャッジ時間 4,089 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other TLE * 1 -- * 18
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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