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.
Problems
B"For given integers n and m , let's call a pair of arrays a and b of integers good, if they satisfy the following conditions: Find the sum of |a| over all good pairs of arrays (a,b) . Since the answer can be very large, output it modulo 10^9 + 7 . The input consists of multiple test cases. The first line contains a single integer t (1 <= q t <= q 10^4) -- the number of test cases. The description of the test cases follows. The only line of each test case contains two integers n and m (1 <= q n, m <= q 5 cdot 10^6) . It is guaranteed that the sum of n over all test cases does not exceed 5 cdot 10^6 and the sum of m over all test cases does not exceed 5 cdot 10^6 . For each test case, output a single integer -- the sum of |a| over all good pairs of arrays (a,b) modulo 10^9 + 7 . In the first testcase, the good pairs of arrays are Hence the sum of the lengths would be {2 + 3 + 3} = 8 . "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
179350252 |
Febleaf |
E |
Nov. 5, 2022, 5:11 a.m. |
OK |
GNU C++14 |
TESTS |
39 |
654 |
120217600 |
|
|
179289950 |
themoon |
E |
Nov. 4, 2022, 5:20 p.m. |
OK |
GNU C++14 |
TESTS |
38 |
654 |
120217600 |
|
|
179349008 |
Ecrade_ |
E |
Nov. 5, 2022, 4:55 a.m. |
OK |
GNU C++14 |
TESTS |
39 |
717 |
200396800 |
|
|
179351335 |
gzw2005 |
E |
Nov. 5, 2022, 5:23 a.m. |
OK |
GNU C++14 |
TESTS |
39 |
826 |
80179200 |
|
|
179330634 |
GrigoriySol1902 |
E |
Nov. 4, 2022, 10:34 p.m. |
OK |
GNU C++14 |
TESTS |
38 |
889 |
140288000 |
|
|
179350011 |
xgf |
E |
Nov. 5, 2022, 5:08 a.m. |
OK |
GNU C++14 |
TESTS |
39 |
936 |
240435200 |
|
|
179318342 |
samitmaharjan.g |
E |
Nov. 4, 2022, 7:52 p.m. |
OK |
GNU C++17 |
TESTS |
38 |
545 |
81408000 |
|
|
179332841 |
Wailydest |
E |
Nov. 4, 2022, 11:32 p.m. |
OK |
GNU C++17 |
TESTS |
38 |
873 |
120217600 |
|
|
179294920 |
Freedom__King |
E |
Nov. 4, 2022, 5:42 p.m. |
OK |
GNU C++17 (64) |
TESTS |
38 |
140 |
60620800 |
|
|
179306345 |
ffao |
E |
Nov. 4, 2022, 6:43 p.m. |
OK |
GNU C++17 (64) |
TESTS |
38 |
140 |
81408000 |
|
|
179288915 |
Freedom__King |
E |
Nov. 4, 2022, 5:17 p.m. |
OK |
GNU C++17 (64) |
TESTS |
38 |
233 |
132812800 |
|
|
179301850 |
huangxiaohua |
E |
Nov. 4, 2022, 6:19 p.m. |
OK |
GNU C++17 (64) |
TESTS |
38 |
249 |
120832000 |
|
|
179348943 |
YeongTree |
E |
Nov. 5, 2022, 4:54 a.m. |
OK |
GNU C++17 (64) |
TESTS |
39 |
326 |
121446400 |
|
|
179348586 |
zhangshaojia |
E |
Nov. 5, 2022, 4:49 a.m. |
OK |
GNU C++17 (64) |
TESTS |
39 |
358 |
120217600 |
|
|
179347761 |
zhangshaojia |
E |
Nov. 5, 2022, 4:38 a.m. |
OK |
GNU C++17 (64) |
TESTS |
39 |
374 |
120217600 |
|
|
179337704 |
ZongDeChuangSiYiGeBa |
E |
Nov. 5, 2022, 1:53 a.m. |
OK |
GNU C++17 (64) |
TESTS |
39 |
389 |
180326400 |
|
|
179337606 |
ZongDeChuangSiYiGeBa |
E |
Nov. 5, 2022, 1:52 a.m. |
OK |
GNU C++17 (64) |
TESTS |
39 |
420 |
180326400 |
|
|
179350099 |
YeongTree |
E |
Nov. 5, 2022, 5:09 a.m. |
OK |
GNU C++17 (64) |
TESTS |
39 |
436 |
160358400 |
|
|
179337825 |
A_G |
E |
Nov. 5, 2022, 1:56 a.m. |
OK |
GNU C++20 (64) |
TESTS |
39 |
171 |
80179200 |
|
|
179343042 |
liaopengfei |
E |
Nov. 5, 2022, 3:25 a.m. |
OK |
GNU C++20 (64) |
TESTS |
39 |
218 |
120832000 |
|
|
179339571 |
kfqg |
E |
Nov. 5, 2022, 2:28 a.m. |
OK |
GNU C++20 (64) |
TESTS |
39 |
218 |
120832000 |
|
|
179346410 |
sabbirahmeds877 |
E |
Nov. 5, 2022, 4:18 a.m. |
OK |
GNU C++20 (64) |
TESTS |
39 |
234 |
120832000 |
|
|
179288236 |
teraqqq |
E |
Nov. 4, 2022, 5:15 p.m. |
OK |
GNU C++20 (64) |
TESTS |
38 |
280 |
160358400 |
|
|
179313618 |
p.hinata |
E |
Nov. 4, 2022, 7:20 p.m. |
OK |
GNU C++20 (64) |
TESTS |
38 |
280 |
240435200 |
|
|
179340017 |
_lbw_ |
E |
Nov. 5, 2022, 2:35 a.m. |
OK |
GNU C++20 (64) |
TESTS |
39 |
311 |
240435200 |
|
|
179281826 |
leilaqwq |
E |
Nov. 4, 2022, 4:29 p.m. |
OK |
GNU C++20 (64) |
TESTS |
38 |
327 |
100147200 |
|
|
179348723 |
YeongTree |
E |
Nov. 5, 2022, 4:51 a.m. |
OK |
GNU C++20 (64) |
TESTS |
39 |
358 |
121446400 |
|
|
179295236 |
KemononeRou |
E |
Nov. 4, 2022, 5:44 p.m. |
OK |
GNU C++20 (64) |
TESTS |
38 |
358 |
122368000 |
|
|
remove filters
Back to search problems