結果

問題 No.1623 三角形の制作
ユーザー U SU S
提出日時 2021-07-23 22:10:54
言語 PyPy3
(7.3.13)
結果
WA  
実行時間 -
コード長 1,155 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 117,840 KB
最終ジャッジ日時 2023-09-25 22:14:50
合計ジャッジ時間 15,342 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
72,940 KB
testcase_01 AC 109 ms
72,968 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 108 ms
73,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#sys.setrecursionlimit(1000000)
input = sys.stdin.readline
def mp():return map(int,input().split())
def lmp():return list(map(int,input().split()))
import math
import bisect
from copy import deepcopy as dc
from itertools import accumulate
from collections import Counter, defaultdict, deque
import itertools
def ceil(U,V):return (U+V-1)//V
def modf1(N,MOD):return (N-1)%MOD+1
inf = int(1e10)
mod = int(1e9+7)

n = int(input())
r = sorted(list(Counter(lmp()).items()))
g = sorted(list(Counter(lmp()).items()))
b = [(-inf,0)]+sorted(list(Counter(lmp()).items()))+[(inf, 0)]
ans = 0
for i,u in r:
    for j,v in g:
        if i < j:break
        L,R = 0,len(b)-1
        while (R-L) != 1:
            m = (R+L)//2
            if b[m][0] <= i-j:
                L = m
            else:
                R = m
        #print(L,R)
        LL,RR = 0,len(b)-1
        while (RR-LL) != 1:
            m = (RR+LL)//2
            if b[m][0] <= i:
                LL = m
            else:
                RR = m
        #print(i,j,R,RR)
        # L = bisect.bisect_right(b,i-j)
        # R = bisect.bisect_right(b,i)
        ans += (RR-R)*u*v
print(ans)



0