結果

問題 No.1623 三角形の制作
ユーザー titiatitia
提出日時 2021-07-24 06:58:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 554 ms / 2,000 ms
コード長 387 bytes
コンパイル時間 330 ms
コンパイル使用メモリ 87,244 KB
実行使用メモリ 109,328 KB
最終ジャッジ日時 2023-09-26 12:38:23
合計ジャッジ時間 8,659 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
76,668 KB
testcase_01 AC 104 ms
76,952 KB
testcase_02 AC 517 ms
95,976 KB
testcase_03 AC 507 ms
97,796 KB
testcase_04 AC 511 ms
97,216 KB
testcase_05 AC 554 ms
109,304 KB
testcase_06 AC 469 ms
81,436 KB
testcase_07 AC 498 ms
96,420 KB
testcase_08 AC 466 ms
82,372 KB
testcase_09 AC 508 ms
97,800 KB
testcase_10 AC 540 ms
106,000 KB
testcase_11 AC 518 ms
95,672 KB
testcase_12 AC 126 ms
89,896 KB
testcase_13 AC 134 ms
94,676 KB
testcase_14 AC 131 ms
92,452 KB
testcase_15 AC 186 ms
109,144 KB
testcase_16 AC 183 ms
108,848 KB
testcase_17 AC 181 ms
109,096 KB
testcase_18 AC 182 ms
106,116 KB
testcase_19 AC 152 ms
109,328 KB
testcase_20 AC 104 ms
76,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import Counter

n=int(input())
R=Counter(map(int,input().split()))
G=Counter(map(int,input().split()))
B=Counter(map(int,input().split()))

S=[0]*(7*10**3+5)

for r in R:
    S[r]+=R[r]

for i in range(1,6*10**3+5):
    S[i]+=S[i-1]

ANS=0

for g in G:
    for b in B:
        ANS+=G[g]*B[b]*(S[g+b-1]-S[max(g,b)-1])

print(ANS)



0