Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
---|---|---|---|---|---|---|
1900 | Codeforces Round 911 (Div. 2) | FINISHED | False | 7200 | 43341910 | Nov. 26, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 4621 ) | D | Small GCD | PROGRAMMING | brute force math number theory |
B'Let a , b , and c be integers. We define function f(a, b, c) as follows: Order the numbers a , b , c in such a way that a <= b <= c . Then return gcd(a, b) , where gcd(a, b) denotes the greatest common divisor (GCD) of integers a and b . So basically, we take the gcd of the 2 smaller values and ignore the biggest one. You are given an array a of n elements. Compute the sum of f(a_i, a_j, a_k) for each i , j , k , such that 1 <= i < j < k <= n . More formally, compute sum_{i = 1}^n sum_{j = i+1}^n sum_{k =j +1}^n f(a_i, a_j, a_k). Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10 ). The description of the test cases follows. The first line of each test case contains a single integer n ( 3 <= n <= 8 cdot 10^4 ) -- length of the array a . The second line of each test case contains n integers, a_1, a_2, ldots, a_n ( 1 <= a_i <= 10^5 ) -- elements of the array a . It is guaranteed that the sum of n over all test cases does not exceed 8 cdot 10^4 . For each test case, output a single number -- the sum from the problem statement. In the first test case, the values of f are as follows: In the second test case, there are 56 ways to choose values of i , j , k . The sum over all f(a_i,a_j,a_k) is 203 . '... |
Codeforces Round 911 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
234513019 | omeganot | D | Nov. 26, 2023, 8:55 p.m. | OK | GNU C++14 | TESTS | 61 | 93 | 11468800 | ||
234528626 | midrangemaster | D | Nov. 27, 2023, 2:52 a.m. | OK | GNU C++14 | TESTS | 61 | 108 | 2764800 | ||
234530290 | CLOCKS_PER_SEC | D | Nov. 27, 2023, 3:23 a.m. | OK | GNU C++14 | TESTS | 61 | 109 | 11571200 | ||
234534906 | RernaG | D | Nov. 27, 2023, 4:35 a.m. | OK | GNU C++14 | TESTS | 61 | 124 | 11468800 | ||
234527437 | 1_will | D | Nov. 27, 2023, 2:27 a.m. | OK | GNU C++14 | TESTS | 61 | 140 | 23756800 | ||
234538701 | ljr_yyds | D | Nov. 27, 2023, 5:23 a.m. | OK | GNU C++14 | TESTS | 61 | 155 | 19660800 | ||
234500888 | tamminaina_y | D | Nov. 26, 2023, 7:45 p.m. | OK | GNU C++14 | TESTS | 61 | 156 | 19456000 | ||
234525749 | honey | D | Nov. 27, 2023, 1:48 a.m. | OK | GNU C++14 | TESTS | 61 | 171 | 1945600 | ||
234472413 | T-S_2392 | D | Nov. 26, 2023, 4 p.m. | OK | GNU C++14 | TESTS | 59 | 171 | 67584000 | ||
234472661 | buko | D | Nov. 26, 2023, 4:01 p.m. | OK | GNU C++14 | TESTS | 59 | 171 | 68505600 |
Back to search problems