結果
問題 | No.1623 三角形の制作 |
ユーザー | yosaka |
提出日時 | 2021-07-30 19:42:29 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 432 bytes |
コンパイル時間 | 1,766 ms |
コンパイル使用メモリ | 87,076 KB |
実行使用メモリ | 76,728 KB |
最終ジャッジ日時 | 2023-10-13 23:32:36 |
合計ジャッジ時間 | 6,310 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 95 ms
76,728 KB |
testcase_01 | AC | 95 ms
76,708 KB |
testcase_02 | TLE | - |
testcase_03 | -- | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
ソースコード
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())) R.sort() G.sort() B.sort() Rc = Counter(R) Gc = Counter(G) Bc = Counter(B) S = [0] * 10 ** 4 for r in R: S[r] += Rc[r] for i in range(len(S)): S[i] += S[i-1] ans = 0 for g in G: for b in B: ans += Gc[g] * Bc[b] * (S[g+b-1] - S[max(g, b) - 1]) print(ans)