結果
| 問題 | No.1623 三角形の制作 |
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2022-05-18 19:57:18 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 450 bytes |
| 記録 | |
| コンパイル時間 | 103 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 35,884 KB |
| 最終ジャッジ日時 | 2024-09-16 23:06:18 |
| 合計ジャッジ時間 | 4,880 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | TLE * 1 -- * 18 |
ソースコード
from bisect import bisect_left, bisect_right
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()))
rs = Counter(R)
gs = Counter(G)
B.sort()
ans = 0
for r in rs:
for g in range(1, r+1):
if gs[g] == 0: continue
lo = bisect_left(B, r - g + 1)
hi = bisect_right(B, r)
ans += (hi - lo) * rs[r] * gs[g]
print(ans)
norioc