結果

問題 No.1623 三角形の制作
ユーザー ntudantuda
提出日時 2021-08-20 23:11:05
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 541 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 113,920 KB
最終ジャッジ日時 2024-04-22 07:25:51
合計ジャッジ時間 4,064 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
57,088 KB
testcase_01 AC 38 ms
51,992 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 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = sorted(list(map(int,input().split())))
B = sorted(list(map(int,input().split())))
C = sorted(list(map(int,input().split())))
Amax = A[-1]
CC = [0] * (Amax+1)
j = 0
temp = 0
for c in C:
    if c > Amax:
        break
    while j < c:
        j += 1
        CC[j] = CC[j-1]
    temp += 1
    CC[j] = temp
while j < Amax:
    j += 1
    CC[j] = CC[j-1]

ans = 0
for a in A:
    for b in B:
        if b > a:
            break
        ans += CC[a] - CC[a - b]
        #print(a,b,CC[a],CC[a-b+1],CC[a] - CC[a - b])
print(ans)
0