{"kind":"task","effective_mode":"full","benchmark":{"kind":"benchmark","effective_mode":"full","slug":"livecodebench","formal_name":"LiveCodeBench","introduction":"競技プログラミングの新しい問題を継続的に収集し、コードに関する能力を評価するベンチマークです。初期release_v1は400問で、問題の出題元と公開日時、データセットの版を区別して扱います。\n\nLiveCodeBench continuously collects new competitive-programming problems to evaluate coding capabilities. Its initial release_v1 contains 400 problems, with source platform, contest date, and dataset version tracked explicitly.","introduction_ja":"","introduction_en":"","category":"Category not supplied","task_count":null,"acquisition_status":"Acquisition status not supplied","official_url":"https://livecodebench.github.io/","indexing_mode":"noindex"},"task_id":"129ae598-5ace-5af4-8f31-644960c44d8e","task_key":"release~5fv1--test--2917","task_revision_id":"1","upstream_id":"2917","short_description":"count-pairs-whose-sum-is-less-than-target","config":"release_v1","split":"test","body":"{\"contest_date\":\"2023-08-19T00:00:00\",\"contest_id\":\"biweekly-contest-111\",\"difficulty\":\"easy\",\"platform\":\"leetcode\",\"question_content\":\"Given a 0-indexed integer array nums of length n and an integer target, return the number of pairs (i, j) where 0 <= i < j < n and nums[i] + nums[j] < target.\\n \\nExample 1:\\n\\nInput: nums = [-1,1,2,3,1], target = 2\\nOutput: 3\\nExplanation: There are 3 pairs of indices that satisfy the conditions in the statement:\\n- (0, 1) since 0 < 1 and nums[0] + nums[1] = 0 < target\\n- (0, 2) since 0 < 2 and nums[0] + nums[2] = 1 < target \\n- (0, 4) since 0 < 4 and nums[0] + nums[4] = 0 < target\\nNote that (0, 3) is not counted since nums[0] + nums[3] is not strictly less than the target.\\n\\nExample 2:\\n\\nInput: nums = [-6,2,5,-2,-7,-1,3], target = -2\\nOutput: 10\\nExplanation: There are 10 pairs of indices that satisfy the conditions in the statement:\\n- (0, 1) since 0 < 1 and nums[0] + nums[1] = -4 < target\\n- (0, 3) since 0 < 3 and nums[0] + nums[3] = -8 < target\\n- (0, 4) since 0 < 4 and nums[0] + nums[4] = -13 < target\\n- (0, 5) since 0 < 5 and nums[0] + nums[5] = -7 < target\\n- (0, 6) since 0 < 6 and nums[0] + nums[6] = -3 < target\\n- (1, 4) since 1 < 4 and nums[1] + nums[4] = -5 < target\\n- (3, 4) since 3 < 4 and nums[3] + nums[4] = -9 < target\\n- (3, 5) since 3 < 5 and nums[3] + nums[5] = -3 < target\\n- (4, 5) since 4 < 5 and nums[4] + nums[5] = -8 < target\\n- (4, 6) since 4 < 6 and nums[4] + nums[6] = -4 < target\\n\\n \\nConstraints:\\n\\n1 <= nums.length == n <= 50\\n-50 <= nums[i], target <= 50\",\"question_title\":\"count-pairs-whose-sum-is-less-than-target\",\"starter_code\":\"class Solution:\\n    def countPairs(self, nums: List[int], target: int) -> int:\\n        \"}","display_format":"text","language":"","answer_status":"published","assets":[],"source_url":"https://livecodebench.github.io/","history":"initial import","indexing_mode":"noindex","subproblems":[],"grids":[]}