목록부분합 (24)
넘치게 채우기
https://leetcode.com/problems/maximum-xor-for-each-query/description/?envType=daily-question&envId=2024-11-08leetcode - Maximum XOR for Each Query문제 유형: 비트마스킹, 비트 조작, 부분합문제 난이도: Medium 문제You are given a sorted array nums of n non-negative integers and an integer maximumBit. You want to perform the following query n times:Find a non-negative integer k such that nums[0] XOR nums[1] XOR ... XOR nu..
https://codeforces.com/contest/2033/problem/DCodeforces Round 981(Div.3) - D. Kosuke's Assignment문제 유형: 부분합, 그리디, 다이나믹 프로그래밍시간 제한: 2초메모리 제한: 256MB 문제After a trip with Sakurako, Kousuke was very scared because he forgot about his programming assignment.In this assignment, the teacher gave him an array a">a of n">n integers and asked him to calculate the number of non-overlapping segments of the a..
https://leetcode.com/problems/make-sum-divisible-by-p/description/?envType=daily-question&envId=2024-10-03leetcode - Make Sum Divisible by P문제 유형 : 부분합, 해시문제 난이도 : Medium 문제Given an array of positive integers nums, remove the smallest subarray (possibly empty) such that the sum of the remaining elements is divisible by p. It is not allowed to remove the whole array.Return the length of the small..
https://codeforces.com/contest/2013/problem/DCodeforces Round 973(Div. 2) - D. Minimize the Difference문제 유형 : 스택, 부분합, 그리디제한 시간: 2초제한 메모리: 256MB 문제Zhan, tired after the contest, gave the only task that he did not solve during the contest to his friend, Sungat. However, he could not solve it either, so we ask you to try to solve this problem.You are given an array a1,a2,…,an">𝑎1,𝑎2,…,𝑎?..
https://leetcode.com/problems/xor-queries-of-a-subarray/description/?envType=daily-question&envId=2024-09-13leetcode - XOR Queries of a Subarray문제 유형 : 비트마스킹, 부분합문제 난이도 : Medium 문제You are given an array arr of positive integers. You are also given the array queries where queries[i] = [lefti, righti].For each query i compute the XOR of elements from lefti to righti (that is, arr[lefti] XOR arr[le..
https://leetcode.com/problems/stone-game-ii/description/?envType=daily-question&envId=2024-08-20leetcode - Stone Game II문제 유형 : 다이나믹 프로그래밍, 부분합문제 난이도 : Medium 문제Alice and Bob continue their games with piles of stones. There are a number of piles arranged in a row, and each pile has a positive integer number of stones piles[i]. The objective of the game is to end with the most stones.Alice and ..
https://leetcode.com/problems/range-sum-of-sorted-subarray-sums/description/?envType=daily-question&envId=2024-08-04leetcode - Range Sum of Sorted Subarray Sums문제 유형 : 정렬, 부분합문제 난이도 : Medium 문제You are given the array nums consisting of n positive integers. You computed the sum of all non-empty continuous subarrays from the array and then sorted them in non-decreasing order, creating a new array ..
https://leetcode.com/problems/subarray-sums-divisible-by-k/description/leetcode - Subarray Sums Divisible by K문제 유형 : 부분합문제 난이도 : Medium 문제Given an integer array nums and an integer k, return the number of non-empty subarrays that have a sum divisible by k.A subarray is a contiguous part of an array. 정수배열 nums와 정수 k가 주어진다.길이가 1이상이며 합이 k의배수인 부분배열의 개수를 구하시오. 풀이부분합으로 값을 누적해서 풀어주면 된다.https://riverov..
https://leetcode.com/problems/continuous-subarray-sum/description/leetcode - Continuous Subarray Sum문제 유형 : 부분합, 수학문제 난이도 : Medium 문제Given an integer array nums and an integer k, return true if nums has a good subarray or false otherwise.A good subarray is a subarray where:its length is at least two, andthe sum of the elements of the subarray is a multiple of k.Note that:A subarray is a contiguo..
https://leetcode.com/problems/count-triplets-that-can-form-two-arrays-of-equal-xor/description/leetcode - Count Triplets That Can Form Two Arrays of Equal XOR문제 유형 : 부분합, 비트마스킹문제 난이도 : Medium 문제Given an array of integers arr.We want to select three indices i, j and k where (0 Let's define a and b as follows:a = arr[i] ^ arr[i + 1] ^ ... ^ arr[j - 1]b = arr[j] ^ arr[j + 1] ^ ... ^ arr[k]Note that..