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"Paul is at the orchestra. The string section is arranged in an r xe2 x80 x89 xc3 x97 xe2 x80 x89c rectangular grid and is filled with violinists with the exception of n violists. Paul really likes violas, so he would like to take a picture including at least k of them. Paul can take a picture of any axis-parallel rectangle in the orchestra. Count the number of possible pictures that Paul can take. Two pictures are considered to be different if the coordinates of corresponding rectangles are different. The first line of input contains four space-separated integers r, c, n, k (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89r, xe2 x80 x89c, xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x893000, 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89min(n, xe2 x80 x8910)) -- the number of rows and columns of the string section, the total number of violas, and the minimum number of violas Paul would like in his photograph, respectively. The next n lines each contain two integers xi and yi (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89xi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89r, 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89yi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89c): the position of the i-th viola. It is guaranteed that no location appears more than once in the input. Print a single integer -- the number of photographs Paul can take which include at least k violas. We will use '*' to denote violinists and '#' to denote violists. In the first sample, the orchestra looks as follows: In the second sample, the orchestra looks as follows: In the third sample, the orchestra looks the same as in the second sample. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
20207695 |
vjudge5 |
E |
Aug. 28, 2016, 8:38 a.m. |
OK |
GNU C++ |
TESTS |
48 |
327 |
2252800 |
|
3000 |
16667806 |
jcvb |
E |
March 12, 2016, 7:42 a.m. |
OK |
GNU C++ |
TESTS |
48 |
343 |
102400 |
|
3000 |
16594443 |
RNS_JKS |
E |
March 8, 2016, 1:51 a.m. |
OK |
GNU C++ |
TESTS |
48 |
358 |
36864000 |
|
3000 |
19443551 |
YxuanwKeith |
E |
July 27, 2016, 2:01 p.m. |
OK |
GNU C++ |
TESTS |
48 |
390 |
204800 |
|
3000 |
16525047 |
SanSiroWaltz |
E |
March 5, 2016, 1:57 a.m. |
OK |
GNU C++ |
TESTS |
48 |
421 |
0 |
|
3000 |
16423506 |
C_SUNSHINE |
E |
Feb. 29, 2016, 9:37 a.m. |
OK |
GNU C++ |
TESTS |
48 |
436 |
102400 |
|
3000 |
16600821 |
Philipsweng |
E |
March 8, 2016, 12:29 p.m. |
OK |
GNU C++ |
TESTS |
48 |
467 |
204800 |
|
3000 |
16520773 |
guille |
E |
March 4, 2016, 6:03 p.m. |
OK |
GNU C++ |
TESTS |
48 |
467 |
204800 |
|
3000 |
17926130 |
KFDong |
E |
May 16, 2016, 1:58 a.m. |
OK |
GNU C++ |
TESTS |
48 |
468 |
2355200 |
|
3000 |
27295199 |
AkaneSasu |
E |
May 23, 2017, 6:23 a.m. |
OK |
GNU C++ |
TESTS |
48 |
483 |
102400 |
|
3000 |
66313870 |
yasugongshang |
E |
Dec. 5, 2019, 12:23 p.m. |
OK |
GNU C++11 |
TESTS |
48 |
218 |
102400 |
|
3000 |
40985143 |
ReaLNero1 |
E |
July 30, 2018, 7:46 p.m. |
OK |
GNU C++11 |
TESTS |
48 |
234 |
102400 |
|
3000 |
16719443 |
ershov.stanislav |
E |
March 14, 2016, 6:02 p.m. |
OK |
GNU C++11 |
TESTS |
48 |
249 |
102400 |
|
3000 |
66774436 |
luogu_bot5 |
E |
Dec. 13, 2019, 9:22 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
280 |
0 |
|
3000 |
26506222 |
Charles_Han |
E |
April 20, 2017, 1:30 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
312 |
2252800 |
|
3000 |
20207684 |
jinzhihan |
E |
Aug. 28, 2016, 8:37 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
343 |
2252800 |
|
3000 |
27301580 |
dogET |
E |
May 23, 2017, 12:53 p.m. |
OK |
GNU C++11 |
TESTS |
48 |
389 |
0 |
|
3000 |
53349312 |
alonefight |
E |
April 26, 2019, 3:41 p.m. |
OK |
GNU C++11 |
TESTS |
48 |
405 |
102400 |
|
3000 |
66527636 |
BFLSTiger |
E |
Dec. 9, 2019, 5:58 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
421 |
102400 |
|
3000 |
16427750 |
ftiasch |
E |
Feb. 29, 2016, 2:40 p.m. |
OK |
GNU C++11 |
TESTS |
48 |
421 |
102400 |
|
3000 |
30418117 |
NiroBC |
E |
Sept. 17, 2017, 10:55 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
234 |
0 |
|
3000 |
27298885 |
wtltw |
E |
May 23, 2017, 10:13 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
389 |
102400 |
|
3000 |
27070984 |
chemthan |
E |
May 13, 2017, 7:56 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
405 |
36659200 |
|
3000 |
27298248 |
zhanglexing |
E |
May 23, 2017, 9:33 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
436 |
102400 |
|
3000 |
23409286 |
Ali.Pi |
E |
Dec. 29, 2016, 8:57 p.m. |
OK |
GNU C++14 |
TESTS |
48 |
483 |
2252800 |
|
3000 |
53975071 |
djq_cpp |
E |
May 11, 2019, 3:12 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
514 |
307200 |
|
3000 |
53996905 |
JU_RUO |
E |
May 11, 2019, 3:04 p.m. |
OK |
GNU C++14 |
TESTS |
48 |
529 |
307200 |
|
3000 |
67686087 |
251 |
E |
Dec. 27, 2019, 8:57 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
561 |
307200 |
|
3000 |
40003249 |
otrecnoc |
E |
July 5, 2018, 6:01 p.m. |
OK |
GNU C++14 |
TESTS |
48 |
685 |
307200 |
|
3000 |
53957369 |
vjudge1 |
E |
May 10, 2019, 12:28 p.m. |
OK |
GNU C++14 |
TESTS |
48 |
701 |
109056000 |
|
3000 |
66550974 |
mlby |
E |
Dec. 9, 2019, 2:54 p.m. |
OK |
GNU C++17 |
TESTS |
48 |
483 |
307200 |
|
3000 |
53973188 |
yht_boyfriend |
E |
May 11, 2019, 1:21 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
483 |
307200 |
|
3000 |
46565795 |
Hiasat |
E |
Dec. 3, 2018, 10:56 p.m. |
OK |
GNU C++17 |
TESTS |
48 |
592 |
409600 |
|
3000 |
66585862 |
liuxiao |
E |
Dec. 10, 2019, 11:08 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
764 |
409600 |
|
3000 |
53956927 |
tender_green |
E |
May 10, 2019, 12:18 p.m. |
OK |
GNU C++17 |
TESTS |
48 |
936 |
102400 |
|
3000 |
53955752 |
ppc_qjd |
E |
May 10, 2019, 11:49 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
1201 |
512000 |
|
3000 |
69708200 |
ruo |
E |
Jan. 29, 2020, 5:47 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
1856 |
307200 |
|
3000 |
66166795 |
bking11 |
E |
Dec. 2, 2019, 8:04 a.m. |
OK |
Java 8 |
TESTS |
48 |
1356 |
0 |
|
3000 |
16652773 |
edorundo |
E |
March 11, 2016, 4:18 p.m. |
OK |
Java 8 |
TESTS |
48 |
1512 |
0 |
|
3000 |
16652838 |
edorundo |
E |
March 11, 2016, 4:20 p.m. |
OK |
Java 8 |
TESTS |
48 |
1575 |
0 |
|
3000 |
16415708 |
Egor |
E |
Feb. 28, 2016, 8:01 p.m. |
OK |
Java 8 |
TESTS |
48 |
1606 |
0 |
|
3000 |
16412575 |
Petr |
E |
Feb. 28, 2016, 7:14 p.m. |
OK |
Java 8 |
TESTS |
48 |
1621 |
0 |
|
3000 |
16652677 |
edorundo |
E |
March 11, 2016, 4:17 p.m. |
OK |
Java 8 |
TESTS |
48 |
1933 |
0 |
|
3000 |
16467011 |
Taube |
E |
March 2, 2016, 2:40 p.m. |
OK |
MS C++ |
TESTS |
48 |
826 |
204800 |
|
3000 |
remove filters
Back to search problems