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'You are given an array a of n integers. Count the number of pairs of indices (i, j) such that i < j and a_j - a_i = j - i . The first line contains one integer t ( 1 <= t <= 10^4 ). Then t test cases follow. The first line of each test case contains one integer n ( 1 <= n <= 2 cdot 10^5 ). The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= n ) -- array a . It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case output the number of pairs of indices (i, j) such that i < j and a_j - a_i = j - i . '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
115369527 |
ZJH111111 |
D |
May 6, 2021, 2:49 a.m. |
OK |
GNU C++11 |
TESTS |
82 |
31 |
4710400 |
|
|
115378774 |
maoyifan |
D |
May 6, 2021, 5:07 a.m. |
OK |
GNU C++11 |
TESTS |
82 |
46 |
7475200 |
|
|
115367115 |
wheneveright |
D |
May 6, 2021, 1:54 a.m. |
OK |
GNU C++11 |
TESTS |
82 |
61 |
4710400 |
|
|
115369277 |
moqizhu2005 |
D |
May 6, 2021, 2:43 a.m. |
OK |
GNU C++11 |
TESTS |
82 |
62 |
5529600 |
|
|
115373773 |
first_star |
D |
May 6, 2021, 3:57 a.m. |
OK |
GNU C++11 |
TESTS |
82 |
62 |
6348800 |
|
|
115367480 |
Orz_Sponge_Bob |
D |
May 6, 2021, 2:04 a.m. |
OK |
GNU C++11 |
TESTS |
82 |
77 |
11980800 |
|
|
115371391 |
Aoi_Tori |
D |
May 6, 2021, 3:20 a.m. |
OK |
GNU C++11 |
TESTS |
82 |
77 |
12697600 |
|
|
115371157 |
syyyl |
D |
May 6, 2021, 3:16 a.m. |
OK |
GNU C++11 |
TESTS |
82 |
78 |
11161600 |
|
|
115367634 |
CCoolGuang |
D |
May 6, 2021, 2:08 a.m. |
OK |
GNU C++11 |
TESTS |
82 |
78 |
11161600 |
|
|
115366263 |
lovesickman |
D |
May 6, 2021, 1:33 a.m. |
OK |
GNU C++11 |
TESTS |
82 |
78 |
12697600 |
|
|
115378031 |
Bold_Eagle |
D |
May 6, 2021, 4:58 a.m. |
OK |
GNU C++14 |
TESTS |
82 |
62 |
4505600 |
|
|
115351499 |
robert.barbu27 |
D |
May 5, 2021, 7:37 p.m. |
OK |
GNU C++14 |
TESTS |
22 |
62 |
5427200 |
|
|
115379281 |
Timothee |
D |
May 6, 2021, 5:13 a.m. |
OK |
GNU C++14 |
TESTS |
82 |
62 |
6963200 |
|
|
115350888 |
pushkar.vns16 |
D |
May 5, 2021, 7:29 p.m. |
OK |
GNU C++14 |
TESTS |
22 |
62 |
6963200 |
|
|
115348284 |
buriXzura |
D |
May 5, 2021, 6:57 p.m. |
OK |
GNU C++14 |
TESTS |
22 |
62 |
6963200 |
|
|
115372059 |
Deadshot007 |
D |
May 6, 2021, 3:30 a.m. |
OK |
GNU C++14 |
TESTS |
82 |
62 |
8499200 |
|
|
115352606 |
red_king |
D |
May 5, 2021, 7:53 p.m. |
OK |
GNU C++14 |
TESTS |
22 |
62 |
8499200 |
|
|
115366307 |
shaker007 |
D |
May 6, 2021, 1:34 a.m. |
OK |
GNU C++14 |
TESTS |
82 |
62 |
10137600 |
|
|
115380138 |
littleinfinity |
D |
May 6, 2021, 5:23 a.m. |
OK |
GNU C++14 |
TESTS |
82 |
62 |
10649600 |
|
|
115374706 |
littleinfinity |
D |
May 6, 2021, 4:11 a.m. |
OK |
GNU C++14 |
TESTS |
82 |
62 |
10649600 |
|
|
remove filters
Back to search problems