結果

問題 No.1623 三角形の制作
ユーザー mkawa2mkawa2
提出日時 2022-11-28 16:29:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 432 ms / 2,000 ms
コード長 1,037 bytes
コンパイル時間 256 ms
コンパイル使用メモリ 82,312 KB
実行使用メモリ 122,384 KB
最終ジャッジ日時 2024-04-15 15:54:26
合計ジャッジ時間 7,278 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
60,032 KB
testcase_01 AC 53 ms
60,160 KB
testcase_02 AC 397 ms
107,044 KB
testcase_03 AC 395 ms
106,416 KB
testcase_04 AC 367 ms
106,652 KB
testcase_05 AC 432 ms
115,224 KB
testcase_06 AC 337 ms
82,944 KB
testcase_07 AC 397 ms
106,716 KB
testcase_08 AC 357 ms
84,940 KB
testcase_09 AC 388 ms
102,496 KB
testcase_10 AC 393 ms
120,812 KB
testcase_11 AC 406 ms
110,820 KB
testcase_12 AC 88 ms
92,800 KB
testcase_13 AC 94 ms
97,780 KB
testcase_14 AC 93 ms
95,168 KB
testcase_15 AC 157 ms
122,168 KB
testcase_16 AC 155 ms
122,384 KB
testcase_17 AC 161 ms
122,124 KB
testcase_18 AC 156 ms
116,672 KB
testcase_19 AC 120 ms
106,968 KB
testcase_20 AC 47 ms
60,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(200005)
int1 = lambda x: int(x)-1
pDB = lambda *x: print(*x, end="\n", file=sys.stderr)
p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr)
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()

dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
inf = (1 << 63)-1
# inf = (1 << 31)-1
# md = 10**9+7
md = 998244353

from collections import Counter

m = 3000
n = II()
cr = Counter(LI())
cg = Counter(LI())

cb = [0]*(m+1)
for b in LI(): cb[b] += 1
cs = [0]
for c in cb: cs.append(cs[-1]+c)

ans = 0
for r in cr:
    for g in cg:
        if g > r: continue
        b = r-g
        ans += cr[r]*cg[g]*(cs[r+1]-cs[b+1])

print(ans)
0