結果
問題 |
No.1623 三角形の制作
|
ユーザー |
|
提出日時 | 2021-07-30 19:43:16 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 561 bytes |
コンパイル時間 | 269 ms |
コンパイル使用メモリ | 81,792 KB |
実行使用メモリ | 53,888 KB |
最終ジャッジ日時 | 2024-09-15 19:27:07 |
合計ジャッジ時間 | 2,405 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | WA * 19 |
ソースコード
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)