leetcode.cn 2026-07-17
🔴3312.sorted-gcd-pair-queries
🏷️ Tags
#array #hash_table #math #binary_search #combinatorics #counting #number_theory #prefix_sum
🔴3312.sorted-gcd-pair-queries
🏷️ Tags
#array #hash_table #math #binary_search #combinatorics #counting #number_theory #prefix_sum
Telegraph
sorted-gcd-pair-queries
给你一个长度为 n 的整数数组 nums 和一个整数数组 queries 。 gcdPairs 表示数组 nums 中所有满足 0 <= i < j < n 的数对 (nums[i], nums[j]) 的 最大公约数 升序 排列构成的数组。 对于每个查询 queries[i] ,你需要找到 gcdPairs 中下标为 queries[i] 的元素。
leetcode.com 2026-07-17
🔴3312.sorted-gcd-pair-queries
🏷️ Tags
#array #hash_table #math #binary_search #combinatorics #counting #number_theory #prefix_sum
🔴3312.sorted-gcd-pair-queries
🏷️ Tags
#array #hash_table #math #binary_search #combinatorics #counting #number_theory #prefix_sum
Telegraph
sorted-gcd-pair-queries
You are given an integer array nums of length n and an integer array queries. Let gcdPairs denote an array obtained by calculating the GCD of all possible pairs (nums[i], nums[j]), where 0 <= i < j < n, and then sorting these values in ascending order. For…