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"Let's call an integer array a_1, a_2, ... , a_n good if a_i neq i for each i . Let F(a) be the number of pairs (i, j) ( 1 <= i < j <= n ) such that a_i + a_j = i + j . Let's say that an array a_1, a_2, ... , a_n is excellent if: Given n , l and r , calculate the number of excellent arrays modulo 10^9 + 7 . The first line contains a single integer t ( 1 <= t <= 1000 ) -- the number of test cases. The first and only line of each test case contains three integers n , l , and r ( 2 <= n <= 2 cdot 10^5 ; -10^9 <= l <= 1 ; n <= r <= 10^9 ). It's guaranteed that the sum of n doesn't exceed 2 cdot 10^5 . For each test case, print the number of excellent arrays modulo 10^9 + 7 . In the first test case, it can be proven that the maximum F(a) among all good arrays a is equal to 2 . The excellent arrays are: "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
122499662 |
0114346323 |
D |
July 14, 2021, 4:06 p.m. |
OK |
GNU C++11 |
TESTS |
11 |
30 |
6553600 |
|
|
122544193 |
PGladius |
D |
July 15, 2021, 3:57 a.m. |
OK |
GNU C++11 |
TESTS |
11 |
30 |
6860800 |
|
|
122515472 |
ZAwei |
D |
July 14, 2021, 5:33 p.m. |
OK |
GNU C++11 |
TESTS |
11 |
30 |
7168000 |
|
|
122510091 |
275307894a |
D |
July 14, 2021, 4:45 p.m. |
OK |
GNU C++11 |
TESTS |
11 |
30 |
7168000 |
|
|
122509478 |
cuixiao |
D |
July 14, 2021, 4:40 p.m. |
OK |
GNU C++11 |
TESTS |
11 |
31 |
5324800 |
|
|
122542332 |
fishcathu. |
D |
July 15, 2021, 3:23 a.m. |
OK |
GNU C++11 |
TESTS |
11 |
31 |
5529600 |
|
|
122542321 |
fishcathu. |
D |
July 15, 2021, 3:23 a.m. |
OK |
GNU C++11 |
TESTS |
11 |
31 |
5529600 |
|
|
122518494 |
nudun001 |
D |
July 14, 2021, 6:11 p.m. |
OK |
GNU C++11 |
TESTS |
11 |
31 |
5529600 |
|
|
122512316 |
fishcathu. |
D |
July 14, 2021, 5:02 p.m. |
OK |
GNU C++11 |
TESTS |
11 |
31 |
5529600 |
|
|
122507923 |
kcn999 |
D |
July 14, 2021, 4:33 p.m. |
OK |
GNU C++11 |
TESTS |
11 |
31 |
5529600 |
|
|
122510835 |
zhaoyunb |
D |
July 14, 2021, 4:50 p.m. |
OK |
GNU C++14 |
TESTS |
11 |
30 |
11776000 |
|
|
122512159 |
Magi_karp |
D |
July 14, 2021, 5:01 p.m. |
OK |
GNU C++14 |
TESTS |
11 |
31 |
4505600 |
|
|
122547142 |
_rainbow_trops_ |
D |
July 15, 2021, 4:47 a.m. |
OK |
GNU C++14 |
TESTS |
11 |
31 |
5324800 |
|
|
122509501 |
serener |
D |
July 14, 2021, 4:40 p.m. |
OK |
GNU C++14 |
TESTS |
11 |
31 |
6963200 |
|
|
122507697 |
non_zero |
D |
July 14, 2021, 4:33 p.m. |
OK |
GNU C++14 |
TESTS |
11 |
31 |
6963200 |
|
|
122502898 |
binsjl |
D |
July 14, 2021, 4:17 p.m. |
OK |
GNU C++14 |
TESTS |
11 |
31 |
6963200 |
|
|
122499901 |
cscsc |
D |
July 14, 2021, 4:07 p.m. |
OK |
GNU C++14 |
TESTS |
11 |
31 |
6963200 |
|
|
122512684 |
Kira_1234 |
D |
July 14, 2021, 5:06 p.m. |
OK |
GNU C++14 |
TESTS |
11 |
31 |
7065600 |
|
|
122512787 |
cwc-cwc |
D |
July 14, 2021, 5:07 p.m. |
OK |
GNU C++14 |
TESTS |
11 |
31 |
8499200 |
|
|
122502603 |
SkqLiiiao |
D |
July 14, 2021, 4:16 p.m. |
OK |
GNU C++14 |
TESTS |
11 |
31 |
8499200 |
|
|
122508633 |
Hobodog_Jo |
D |
July 14, 2021, 4:36 p.m. |
OK |
GNU C++17 |
TESTS |
11 |
15 |
6144000 |
|
|
122512491 |
DataSTRucture_ |
D |
July 14, 2021, 5:04 p.m. |
OK |
GNU C++17 |
TESTS |
11 |
15 |
6963200 |
|
|
122521822 |
islingr |
D |
July 14, 2021, 6:55 p.m. |
OK |
GNU C++17 |
TESTS |
11 |
30 |
5324800 |
|
|
122521740 |
islingr |
D |
July 14, 2021, 6:54 p.m. |
OK |
GNU C++17 |
TESTS |
11 |
30 |
5324800 |
|
|
122519602 |
Blondie |
D |
July 14, 2021, 6:25 p.m. |
OK |
GNU C++17 |
TESTS |
11 |
30 |
5324800 |
|
|
122523242 |
supandi |
D |
July 14, 2021, 7:19 p.m. |
OK |
GNU C++17 |
TESTS |
11 |
30 |
6963200 |
|
|
122533759 |
Yzm007 |
D |
July 15, 2021, 12:07 a.m. |
OK |
GNU C++17 |
TESTS |
11 |
30 |
8499200 |
|
|
122519660 |
asem_alaa1224 |
D |
July 14, 2021, 6:26 p.m. |
OK |
GNU C++17 |
TESTS |
11 |
30 |
8704000 |
|
|
122543481 |
dyyyyyyyy |
D |
July 15, 2021, 3:44 a.m. |
OK |
GNU C++17 |
TESTS |
11 |
31 |
5324800 |
|
|
122542518 |
iuiou |
D |
July 15, 2021, 3:27 a.m. |
OK |
GNU C++17 |
TESTS |
11 |
31 |
5324800 |
|
|
122531987 |
AnandOza |
D |
July 14, 2021, 10:55 p.m. |
OK |
GNU C++17 (64) |
TESTS |
11 |
15 |
5939200 |
|
|
122518215 |
nanocosmos |
D |
July 14, 2021, 6:08 p.m. |
OK |
GNU C++17 (64) |
TESTS |
11 |
15 |
7475200 |
|
|
122518148 |
nanocosmos |
D |
July 14, 2021, 6:07 p.m. |
OK |
GNU C++17 (64) |
TESTS |
11 |
15 |
7475200 |
|
|
122513381 |
321zdq |
D |
July 14, 2021, 5:12 p.m. |
OK |
GNU C++17 (64) |
TESTS |
11 |
15 |
7475200 |
|
|
122510272 |
CharlesDai |
D |
July 14, 2021, 4:46 p.m. |
OK |
GNU C++17 (64) |
TESTS |
11 |
15 |
7475200 |
|
|
122499949 |
sorry_for_losing |
D |
July 14, 2021, 4:07 p.m. |
OK |
GNU C++17 (64) |
TESTS |
11 |
15 |
11264000 |
|
|
122500581 |
GudDay |
D |
July 14, 2021, 4:09 p.m. |
OK |
GNU C++17 (64) |
TESTS |
11 |
30 |
5939200 |
|
|
122520601 |
kaiboy |
D |
July 14, 2021, 6:38 p.m. |
OK |
GNU C++17 (64) |
TESTS |
11 |
30 |
6758400 |
|
|
122511807 |
Coxie |
D |
July 14, 2021, 4:58 p.m. |
OK |
GNU C++17 (64) |
TESTS |
11 |
30 |
7475200 |
|
|
122502280 |
Sh0 |
D |
July 14, 2021, 4:15 p.m. |
OK |
GNU C++17 (64) |
TESTS |
11 |
30 |
9113600 |
|
|
122540843 |
jamesfan961101 |
D |
July 15, 2021, 2:58 a.m. |
OK |
Java 11 |
TESTS |
11 |
202 |
24473600 |
|
|
122520600 |
Dukkha |
D |
July 14, 2021, 6:38 p.m. |
OK |
Java 11 |
TESTS |
11 |
234 |
24473600 |
|
|
122501705 |
Is2ac |
D |
July 14, 2021, 4:13 p.m. |
OK |
Java 11 |
TESTS |
11 |
389 |
23756800 |
|
|
122502986 |
m1m3n1n3 |
D |
July 14, 2021, 4:17 p.m. |
OK |
Java 11 |
TESTS |
11 |
546 |
23859200 |
|
|
122501762 |
rabaiBomkarBittalBang |
D |
July 14, 2021, 4:13 p.m. |
OK |
Java 8 |
TESTS |
11 |
233 |
20480000 |
|
|
122504330 |
DraymondGreen |
D |
July 14, 2021, 4:22 p.m. |
OK |
Java 8 |
TESTS |
11 |
467 |
20480000 |
|
|
122511610 |
pulkit1411 |
D |
July 14, 2021, 4:56 p.m. |
OK |
Java 8 |
TESTS |
11 |
1481 |
38502400 |
|
|
122504583 |
SecondThread |
D |
July 14, 2021, 4:23 p.m. |
OK |
Java 8 |
TESTS |
11 |
1559 |
38195200 |
|
|
122499516 |
Hakiobo |
D |
July 14, 2021, 4:05 p.m. |
OK |
Kotlin |
TESTS |
11 |
109 |
20992000 |
|
|
122549560 |
Mukundan314 |
D |
July 15, 2021, 5:22 a.m. |
OK |
PyPy 2 |
TESTS |
11 |
529 |
76390400 |
|
|
122525019 |
silvertint |
D |
July 14, 2021, 7:49 p.m. |
OK |
PyPy 3 |
TESTS |
11 |
202 |
44441600 |
|
|
122524746 |
silvertint |
D |
July 14, 2021, 7:44 p.m. |
OK |
PyPy 3 |
TESTS |
11 |
202 |
44441600 |
|
|
122517122 |
silvertint |
D |
July 14, 2021, 5:54 p.m. |
OK |
PyPy 3 |
TESTS |
11 |
218 |
44441600 |
|
|
122524948 |
silvertint |
D |
July 14, 2021, 7:48 p.m. |
OK |
PyPy 3 |
TESTS |
11 |
248 |
44544000 |
|
|
122516345 |
peakyfuckingblinder |
D |
July 14, 2021, 5:44 p.m. |
OK |
PyPy 3 |
TESTS |
11 |
390 |
55193600 |
|
|
122512014 |
titia |
D |
July 14, 2021, 4:59 p.m. |
OK |
PyPy 3 |
TESTS |
11 |
452 |
73113600 |
|
|
122502439 |
Kiri8128 |
D |
July 14, 2021, 4:15 p.m. |
OK |
PyPy 3 |
TESTS |
11 |
468 |
81100800 |
|
|
122507010 |
keroru |
D |
July 14, 2021, 4:31 p.m. |
OK |
PyPy 3 |
TESTS |
11 |
498 |
51814400 |
|
|
122507509 |
eepsilon |
D |
July 14, 2021, 4:32 p.m. |
OK |
PyPy 3 |
TESTS |
11 |
607 |
45875200 |
|
|
122499191 |
baigeizhanshi |
D |
July 14, 2021, 4:04 p.m. |
OK |
PyPy 3 |
TESTS |
11 |
623 |
46387200 |
|
|
122548074 |
mkawa2 |
D |
July 15, 2021, 5:01 a.m. |
OK |
Python 3 |
TESTS |
11 |
514 |
15155200 |
|
|
122500269 |
belkka |
D |
July 14, 2021, 4:08 p.m. |
OK |
Python 3 |
TESTS |
11 |
966 |
12185600 |
|
|
122509893 |
ITO |
D |
July 14, 2021, 4:43 p.m. |
OK |
Python 3 |
TESTS |
11 |
1871 |
6963200 |
|
|
122503243 |
sansen |
D |
July 14, 2021, 4:18 p.m. |
OK |
Rust |
TESTS |
11 |
15 |
6246400 |
|
|
remove filters
Back to search problems