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"Mike wants to prepare for IMO but he doesn't know geometry, so his teacher gave him an interesting geometry problem. Let's define f([l, xe2 x80 x89r]) xe2 x80 x89= xe2 x80 x89r xe2 x80 x89- xe2 x80 x89l xe2 x80 x89+ xe2 x80 x891 to be the number of integer points in the segment [l, xe2 x80 x89r] with l xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89r (say that ). You are given two integers n and k and n closed intervals [li, xe2 x80 x89ri] on OX axis and you have to find: In other words, you should find the sum of the number of integer points in the intersection of any k of the segments. As the answer may be very large, output it modulo 1000000007 (109 xe2 x80 x89+ xe2 x80 x897). Mike can't solve this problem so he needs your help. You will help him, won't you? The first line contains two integers n and k (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89200 xe2 x80 x89000) -- the number of segments and the number of segments in intersection groups respectively. Then n lines follow, the i-th line contains two integers li, xe2 x80 x89ri ( xe2 x80 x89- xe2 x80 x89109 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89li xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ri xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109), describing i-th segment bounds. Print one integer number -- the answer to Mike's problem modulo 1000000007 (109 xe2 x80 x89+ xe2 x80 x897) in the only line. In the first example: ; ; . So the answer is 2 xe2 x80 x89+ xe2 x80 x891 xe2 x80 x89+ xe2 x80 x892 xe2 x80 x89= xe2 x80 x895."... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
18933123 |
MarisaKirisame |
E |
July 6, 2016, 6:14 p.m. |
OK |
D |
TESTS |
69 |
483 |
4198400 |
|
2300 |
18923426 |
yosupo |
E |
July 6, 2016, 4:54 p.m. |
OK |
D |
TESTS |
69 |
654 |
11571200 |
|
2300 |
19053193 |
lkmcfj |
E |
July 12, 2016, 2:33 p.m. |
OK |
FPC |
TESTS |
69 |
405 |
6451200 |
|
2300 |
18943263 |
tungtinhoctre126 |
E |
July 7, 2016, 5:19 a.m. |
OK |
FPC |
TESTS |
69 |
2869 |
40038400 |
|
2300 |
18929873 |
Chloe_fan |
E |
July 6, 2016, 5:42 p.m. |
OK |
GNU C++ |
TESTS |
69 |
93 |
7884800 |
|
2300 |
30235429 |
vjudge4 |
E |
Sept. 9, 2017, 11:23 p.m. |
OK |
GNU C++ |
TESTS |
69 |
93 |
14438400 |
|
2300 |
18987911 |
RicardoWang |
E |
July 9, 2016, 2:54 p.m. |
OK |
GNU C++ |
TESTS |
69 |
139 |
14438400 |
|
2300 |
18993449 |
sky46262 |
E |
July 10, 2016, 1:46 a.m. |
OK |
GNU C++ |
TESTS |
69 |
140 |
9420800 |
|
2300 |
39883162 |
vjudge1 |
E |
July 3, 2018, 4:05 a.m. |
OK |
GNU C++ |
TESTS |
69 |
140 |
9625600 |
|
2300 |
18954082 |
vjudge3 |
E |
July 7, 2016, 3:17 p.m. |
OK |
GNU C++ |
TESTS |
69 |
155 |
11059200 |
|
2300 |
34793695 |
BeNoble |
E |
Feb. 1, 2018, 7:34 a.m. |
OK |
GNU C++ |
TESTS |
69 |
156 |
13209600 |
|
2300 |
20755579 |
VictorXie |
E |
Sept. 19, 2016, 12:54 p.m. |
OK |
GNU C++ |
TESTS |
69 |
171 |
6246400 |
|
2300 |
40413588 |
luogu_bot1 |
E |
July 16, 2018, 1:41 p.m. |
OK |
GNU C++ |
TESTS |
69 |
171 |
7884800 |
|
2300 |
30236596 |
vjudge3 |
E |
Sept. 10, 2017, 2:22 a.m. |
OK |
GNU C++ |
TESTS |
69 |
171 |
11161600 |
|
2300 |
56682988 |
rainboy |
E |
July 7, 2019, 7:50 p.m. |
OK |
GNU C11 |
TESTS |
69 |
218 |
3174400 |
|
2300 |
18971603 |
kefaa |
E |
July 8, 2016, 2:39 p.m. |
OK |
GNU C++11 |
TESTS |
69 |
93 |
4812800 |
|
2300 |
40984195 |
ReaLNero1 |
E |
July 30, 2018, 7:14 p.m. |
OK |
GNU C++11 |
TESTS |
69 |
93 |
4812800 |
|
2300 |
54421347 |
PresHerobrine |
E |
May 20, 2019, 3:39 p.m. |
OK |
GNU C++11 |
TESTS |
69 |
93 |
6451200 |
|
2300 |
49950211 |
luogu_bot5 |
E |
Feb. 15, 2019, 1:44 p.m. |
OK |
GNU C++11 |
TESTS |
69 |
109 |
4812800 |
|
2300 |
54503178 |
WOSHIGEPACHONG2 |
E |
May 23, 2019, 12:49 a.m. |
OK |
GNU C++11 |
TESTS |
69 |
109 |
6451200 |
|
2300 |
19917705 |
lzw4896s |
E |
Aug. 17, 2016, 1:22 a.m. |
OK |
GNU C++11 |
TESTS |
69 |
124 |
6860800 |
|
2300 |
18971577 |
kefaa |
E |
July 8, 2016, 2:37 p.m. |
OK |
GNU C++11 |
TESTS |
69 |
124 |
7884800 |
|
2300 |
69232147 |
cor001 |
E |
Jan. 21, 2020, 9:54 a.m. |
OK |
GNU C++11 |
TESTS |
69 |
124 |
7884800 |
|
2300 |
53096281 |
ShafinKhadem |
E |
April 21, 2019, 1:43 p.m. |
OK |
GNU C++11 |
TESTS |
69 |
124 |
9625600 |
|
2300 |
18953695 |
forever97 |
E |
July 7, 2016, 2:51 p.m. |
OK |
GNU C++11 |
TESTS |
69 |
139 |
11059200 |
|
2300 |
25779146 |
unused |
E |
March 24, 2017, 5:08 p.m. |
OK |
GNU C++14 |
TESTS |
69 |
171 |
12288000 |
|
2300 |
27042933 |
.I. |
E |
May 11, 2017, 10:10 p.m. |
OK |
GNU C++14 |
TESTS |
69 |
171 |
13721600 |
|
2300 |
33039270 |
Flash-boy |
E |
Dec. 9, 2017, 3 a.m. |
OK |
GNU C++14 |
TESTS |
69 |
186 |
6656000 |
|
2300 |
69514337 |
yan-zp |
E |
Jan. 25, 2020, 11:29 a.m. |
OK |
GNU C++14 |
TESTS |
69 |
186 |
8806400 |
|
2300 |
39882330 |
mohammedehab2002 |
E |
July 3, 2018, 2:59 a.m. |
OK |
GNU C++14 |
TESTS |
69 |
187 |
9523200 |
|
2300 |
33669348 |
dupazbitastorazy |
E |
Dec. 27, 2017, 1:05 p.m. |
OK |
GNU C++14 |
TESTS |
69 |
187 |
10752000 |
|
2300 |
34340834 |
shenyunhan |
E |
Jan. 20, 2018, 6:27 a.m. |
OK |
GNU C++14 |
TESTS |
69 |
187 |
11468800 |
|
2300 |
34292291 |
DatVu |
E |
Jan. 19, 2018, 5:15 a.m. |
OK |
GNU C++14 |
TESTS |
69 |
187 |
13926400 |
|
2300 |
56819397 |
hugcc |
E |
July 10, 2019, 9:56 p.m. |
OK |
GNU C++14 |
TESTS |
69 |
202 |
15872000 |
|
2300 |
28295652 |
square1001 |
E |
July 5, 2017, 6:15 a.m. |
OK |
GNU C++14 |
TESTS |
69 |
218 |
9113600 |
|
2300 |
52892261 |
AryaKnight |
E |
April 17, 2019, 8:26 a.m. |
OK |
GNU C++17 |
TESTS |
69 |
171 |
7987200 |
|
2300 |
44841555 |
amnesiac_dusk |
E |
Oct. 25, 2018, 12:56 p.m. |
OK |
GNU C++17 |
TESTS |
69 |
202 |
10649600 |
|
2300 |
55584126 |
chongryong |
E |
June 15, 2019, 8:29 a.m. |
OK |
GNU C++17 |
TESTS |
69 |
218 |
3993600 |
|
2300 |
47255399 |
arpit040199 |
E |
Dec. 19, 2018, 10:13 a.m. |
OK |
GNU C++17 |
TESTS |
69 |
218 |
15872000 |
|
2300 |
55549293 |
chongryong |
E |
June 14, 2019, 5:57 a.m. |
OK |
GNU C++17 |
TESTS |
69 |
249 |
9523200 |
|
2300 |
55487697 |
chongryong |
E |
June 12, 2019, 8:38 a.m. |
OK |
GNU C++17 |
TESTS |
69 |
249 |
14131200 |
|
2300 |
65763904 |
mahmoudbadawy |
E |
Nov. 26, 2019, 5:02 p.m. |
OK |
GNU C++17 |
TESTS |
69 |
264 |
11161600 |
|
2300 |
40106133 |
vjudge4 |
E |
July 9, 2018, 8:38 a.m. |
OK |
GNU C++17 |
TESTS |
69 |
265 |
9932800 |
|
2300 |
53690462 |
vjudge5 |
E |
May 3, 2019, 4:28 a.m. |
OK |
GNU C++17 |
TESTS |
69 |
280 |
9523200 |
|
2300 |
66452826 |
vjudge5 |
E |
Dec. 7, 2019, 12:06 p.m. |
OK |
GNU C++17 |
TESTS |
69 |
280 |
9625600 |
|
2300 |
19147241 |
alibaba |
E |
July 15, 2016, 8:07 a.m. |
OK |
Java 7 |
TESTS |
69 |
1777 |
5017600 |
|
2300 |
56682963 |
Dukkha |
E |
July 7, 2019, 7:49 p.m. |
OK |
Java 8 |
TESTS |
69 |
249 |
0 |
|
2300 |
19931525 |
FFyuan |
E |
Aug. 17, 2016, 4:31 p.m. |
OK |
Java 8 |
TESTS |
69 |
436 |
26931200 |
|
2300 |
21559471 |
rrepeat |
E |
Oct. 18, 2016, 7:05 a.m. |
OK |
Java 8 |
TESTS |
69 |
514 |
26828800 |
|
2300 |
21559194 |
rrepeat |
E |
Oct. 18, 2016, 6:51 a.m. |
OK |
Java 8 |
TESTS |
69 |
514 |
26931200 |
|
2300 |
18928947 |
uwi |
E |
July 6, 2016, 5:34 p.m. |
OK |
Java 8 |
TESTS |
69 |
546 |
15872000 |
|
2300 |
38081782 |
unicorn20141 |
E |
May 9, 2018, 10:19 p.m. |
OK |
Java 8 |
TESTS |
69 |
561 |
36966400 |
|
2300 |
18978882 |
hs484 |
E |
July 9, 2016, 3:37 a.m. |
OK |
Java 8 |
TESTS |
69 |
655 |
24064000 |
|
2300 |
19173401 |
gu_castle |
E |
July 16, 2016, 12:42 p.m. |
OK |
Java 8 |
TESTS |
69 |
685 |
26009600 |
|
2300 |
19174688 |
gu_castle |
E |
July 16, 2016, 2:02 p.m. |
OK |
Java 8 |
TESTS |
69 |
748 |
15564800 |
|
2300 |
18928886 |
WhatIsLove |
E |
July 6, 2016, 5:33 p.m. |
OK |
Java 8 |
TESTS |
69 |
826 |
15462400 |
|
2300 |
18932120 |
azukun |
E |
July 6, 2016, 6:04 p.m. |
OK |
MS C# |
TESTS |
69 |
452 |
33484800 |
|
2300 |
18948672 |
koyaaniqatsi |
E |
July 7, 2016, 10:02 a.m. |
OK |
MS C# |
TESTS |
69 |
685 |
29184000 |
|
2300 |
19026113 |
DigitalArtistKz |
E |
July 11, 2016, 9:03 a.m. |
OK |
MS C# |
TESTS |
69 |
763 |
28569600 |
|
2300 |
42815489 |
vjudge3 |
E |
Sept. 13, 2018, 1:08 a.m. |
OK |
MS C++ |
TESTS |
69 |
202 |
9625600 |
|
2300 |
42821040 |
vjudge1 |
E |
Sept. 13, 2018, 6:33 a.m. |
OK |
MS C++ |
TESTS |
69 |
218 |
13107200 |
|
2300 |
42820148 |
vjudge4 |
E |
Sept. 13, 2018, 5:45 a.m. |
OK |
MS C++ |
TESTS |
69 |
265 |
7475200 |
|
2300 |
42816970 |
vjudge4 |
E |
Sept. 13, 2018, 2:37 a.m. |
OK |
MS C++ |
TESTS |
69 |
280 |
8294400 |
|
2300 |
19283123 |
sister_what_hate_most |
E |
July 20, 2016, 2:54 p.m. |
OK |
MS C++ |
TESTS |
69 |
295 |
3993600 |
|
2300 |
42815715 |
vjudge2 |
E |
Sept. 13, 2018, 1:20 a.m. |
OK |
MS C++ |
TESTS |
69 |
296 |
11468800 |
|
2300 |
18932473 |
Filyan |
E |
July 6, 2016, 6:07 p.m. |
OK |
MS C++ |
TESTS |
69 |
342 |
4812800 |
|
2300 |
42817256 |
vjudge2 |
E |
Sept. 13, 2018, 2:53 a.m. |
OK |
MS C++ |
TESTS |
69 |
358 |
14643200 |
|
2300 |
19012836 |
Mosyagin |
E |
July 10, 2016, 4:13 p.m. |
OK |
MS C++ |
TESTS |
69 |
374 |
7577600 |
|
2300 |
42816670 |
vjudge4 |
E |
Sept. 13, 2018, 2:20 a.m. |
OK |
MS C++ |
TESTS |
69 |
389 |
13209600 |
|
2300 |
56698133 |
Sebek |
E |
July 8, 2019, 7:58 a.m. |
OK |
MS C++ 2017 |
TESTS |
69 |
436 |
9932800 |
|
2300 |
19014962 |
kuritzky |
E |
July 10, 2016, 6:56 p.m. |
OK |
PyPy 3 |
TESTS |
69 |
2807 |
36454400 |
|
2300 |
18933811 |
nwi |
E |
July 6, 2016, 6:22 p.m. |
OK |
Python 2 |
TESTS |
69 |
2105 |
44441600 |
|
2300 |
18932871 |
Giove |
E |
July 6, 2016, 6:11 p.m. |
OK |
Python 2 |
TESTS |
69 |
2979 |
67993600 |
|
2300 |
remove filters
Back to search problems