結果

問題 No.1623 三角形の制作
ユーザー yosakayosaka
提出日時 2021-07-30 19:43:16
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 561 bytes
コンパイル時間 266 ms
コンパイル使用メモリ 87,136 KB
実行使用メモリ 71,984 KB
最終ジャッジ日時 2023-10-13 23:34:48
合計ジャッジ時間 3,579 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter


def main():
    n = int(input())
    R = list(map(int, input().split()))
    G = list(map(int, input().split()))
    B = list(map(int, input().split()))
    # R.sort()
    # G.sort()
    # B.sort()
    Rc = Counter(R)
    Gc = Counter(G)
    Bc = Counter(B)
    S = [0] * 10 ** 4
    for r in Rc.keys():
        S[r] += Rc[r]
    for i in range(len(S)):
        S[i] += S[i - 1]
    ans = 0
    for g in Gc.keys():
        for b in Bc.keys():
            ans += Gc[g] * Bc[b] * (S[g + b - 1] - S[max(g, b) - 1])
    print(ans)
0