{"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":"1f02b2a1-ed37-53bc-8e2a-0a37951a50b7","task_key":"release~5fv1--test--2878","task_revision_id":"1","upstream_id":"2878","short_description":"apply-operations-to-make-all-array-elements-equal-to-zero","config":"release_v1","split":"test","body":"{\"contest_date\":\"2023-07-09T00:00:00\",\"contest_id\":\"weekly-contest-353\",\"difficulty\":\"medium\",\"platform\":\"leetcode\",\"question_content\":\"You are given a 0-indexed integer array nums and a positive integer k.\\nYou can apply the following operation on the array any number of times:\\n\\nChoose any subarray of size k from the array and decrease all its elements by 1.\\n\\nReturn true if you can make all the array elements equal to 0, or false otherwise.\\nA subarray is a contiguous non-empty part of an array.\\n \\nExample 1:\\n\\nInput: nums = [2,2,3,1,1,0], k = 3\\nOutput: true\\nExplanation: We can do the following operations:\\n- Choose the subarray [2,2,3]. The resulting array will be nums = [1,1,2,1,1,0].\\n- Choose the subarray [2,1,1]. The resulting array will be nums = [1,1,1,0,0,0].\\n- Choose the subarray [1,1,1]. The resulting array will be nums = [0,0,0,0,0,0].\\n\\nExample 2:\\n\\nInput: nums = [1,3,1,1], k = 2\\nOutput: false\\nExplanation: It is not possible to make all the array elements equal to 0.\\n\\n \\nConstraints:\\n\\n1 <= k <= nums.length <= 10^5\\n0 <= nums[i] <= 10^6\",\"question_title\":\"apply-operations-to-make-all-array-elements-equal-to-zero\",\"starter_code\":\"class Solution:\\n    def checkArray(self, nums: List[int], k: int) -> bool:\\n        \"}","display_format":"text","language":"","answer_status":"published","assets":[],"source_url":"https://livecodebench.github.io/","history":"initial import","indexing_mode":"noindex","subproblems":[],"grids":[]}