結果

問題 No.1623 三角形の制作
ユーザー yosakayosaka
提出日時 2021-07-30 19:43:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 511 ms / 2,000 ms
コード長 570 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 87,328 KB
実行使用メモリ 135,452 KB
最終ジャッジ日時 2023-10-13 23:35:43
合計ジャッジ時間 7,929 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
76,384 KB
testcase_01 AC 86 ms
76,552 KB
testcase_02 AC 465 ms
119,960 KB
testcase_03 AC 469 ms
122,644 KB
testcase_04 AC 467 ms
123,256 KB
testcase_05 AC 511 ms
132,900 KB
testcase_06 AC 422 ms
84,500 KB
testcase_07 AC 463 ms
122,816 KB
testcase_08 AC 415 ms
86,900 KB
testcase_09 AC 467 ms
117,564 KB
testcase_10 AC 486 ms
125,064 KB
testcase_11 AC 492 ms
121,696 KB
testcase_12 AC 124 ms
102,568 KB
testcase_13 AC 132 ms
110,844 KB
testcase_14 AC 130 ms
107,316 KB
testcase_15 AC 189 ms
135,268 KB
testcase_16 AC 197 ms
135,328 KB
testcase_17 AC 198 ms
135,452 KB
testcase_18 AC 217 ms
133,520 KB
testcase_19 AC 151 ms
130,012 KB
testcase_20 AC 90 ms
76,564 KB
権限があれば一括ダウンロードができます

ソースコード

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)


main()
0