結果
問題 | No.1623 三角形の制作 |
ユーザー | U S |
提出日時 | 2021-07-23 21:40:45 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 717 bytes |
コンパイル時間 | 2,325 ms |
コンパイル使用メモリ | 86,740 KB |
実行使用メモリ | 119,588 KB |
最終ジャッジ日時 | 2023-09-25 21:34:38 |
合計ジャッジ時間 | 24,761 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 113 ms
73,392 KB |
testcase_01 | AC | 112 ms
72,720 KB |
testcase_02 | TLE | - |
testcase_03 | TLE | - |
testcase_04 | TLE | - |
testcase_05 | TLE | - |
testcase_06 | TLE | - |
testcase_07 | TLE | - |
testcase_08 | TLE | - |
testcase_09 | TLE | - |
testcase_10 | TLE | - |
testcase_11 | TLE | - |
testcase_12 | AC | 148 ms
95,592 KB |
testcase_13 | AC | 156 ms
100,812 KB |
testcase_14 | AC | 155 ms
97,748 KB |
testcase_15 | AC | 203 ms
119,588 KB |
testcase_16 | AC | 203 ms
119,508 KB |
testcase_17 | AC | 206 ms
119,580 KB |
testcase_18 | AC | 203 ms
114,668 KB |
testcase_19 | AC | 170 ms
112,412 KB |
testcase_20 | AC | 118 ms
73,460 KB |
ソースコード
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 = sorted(lmp()) ans = 0 for i,u in r: for j,v in g: if i < j:break L = bisect.bisect_right(b,i-j) R = bisect.bisect_right(b,i) ans += (R-L)*u*v print(ans)