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"In Bubbleland a group of special programming forces gets a top secret job to calculate the number of potentially infected people by a new unknown virus. The state has a population of n people and every day there is new information about new contacts between people. The job of special programming forces is to calculate how many contacts in the last k days a given person had. The new virus has an incubation period of k days, and after that time people consider as non-infectious. Because the new virus is an extremely dangerous, government mark as suspicious everybody who had direct or indirect contact in the last k days, independently of the order of contacts. This virus is very strange, and people can't get durable immunity. You need to help special programming forces to calculate the number of suspicious people for a given person (number of people who had contact with a given person). There are 3 given inputs on beginning n where n is population, q number of queries, k virus incubation time in days. Each query is one of three types: The first line of input contains three integers n ( 1 <= n <= 10^5 ) the number of people in the state, q ( 1 <= q <= 5 xc3 x9710^5 ) number of queries and k ( 1 <= k <= 10^5 ) virus incubation time in days. Each of the next q lines starts with an integer t ( 1 <= t <= 3 ) the type of the query. A pair of integers x and y ( 1 <= x, y <= n ) follows in the query of the first type ( x neq y ). An integer i ( 1 <= i <= n ) follows in the query of the second type. Query of third type does not have the following number. For the queries of the second type print on a separate line the current number of people in contact with a given person. Pay attention if persons 1 and 2 had contact first day and next day persons 1 and 3 had contact, for k > 1 number of contacts of person $"... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
94789270 |
C20191629 TiwAirOAO |
H |
Oct. 5, 2020, 3:56 p.m. |
OK |
GNU C++11 |
TESTS |
26 |
296 |
231116800 |
|
|
94784749 |
Mivik |
H |
Oct. 5, 2020, 3:15 p.m. |
OK |
GNU C++11 |
TESTS |
26 |
390 |
61337600 |
|
|
94791540 |
KilIerX |
H |
Oct. 5, 2020, 4:18 p.m. |
OK |
GNU C++11 |
TESTS |
26 |
561 |
101990400 |
|
|
94822853 |
charlieyan |
H |
Oct. 6, 2020, 5:51 a.m. |
OK |
GNU C++11 |
TESTS |
26 |
623 |
145510400 |
|
|
94822793 |
charlieyan |
H |
Oct. 6, 2020, 5:50 a.m. |
OK |
GNU C++11 |
TESTS |
26 |
639 |
145510400 |
|
|
94819356 |
Eric_hooo |
H |
Oct. 6, 2020, 4:34 a.m. |
OK |
GNU C++11 |
TESTS |
26 |
686 |
112640000 |
|
|
94786992 |
Mackerel_Pike |
H |
Oct. 5, 2020, 3:35 p.m. |
OK |
GNU C++11 |
TESTS |
26 |
717 |
101273600 |
|
|
94780524 |
ZZZZZZZZZZZZZZZZZZ dqa2020 |
H |
Oct. 5, 2020, 2:38 p.m. |
OK |
GNU C++11 |
TESTS |
26 |
763 |
101888000 |
|
|
94783899 |
jzp hs-black chr_ |
H |
Oct. 5, 2020, 3:08 p.m. |
OK |
GNU C++11 |
TESTS |
26 |
1528 |
34304000 |
|
|
94775574 |
Cyanic ix35 s_r_f |
H |
Oct. 5, 2020, 1:58 p.m. |
OK |
GNU C++11 |
TESTS |
26 |
2371 |
26316800 |
|
|
94779997 |
JustasZ |
H |
Oct. 5, 2020, 2:34 p.m. |
OK |
GNU C++14 |
TESTS |
26 |
608 |
163328000 |
|
|
94816327 |
tzxydby |
H |
Oct. 6, 2020, 3:15 a.m. |
OK |
GNU C++14 |
TESTS |
26 |
623 |
76083200 |
|
|
94785215 |
Nero |
H |
Oct. 5, 2020, 3:19 p.m. |
OK |
GNU C++14 |
TESTS |
26 |
639 |
87961600 |
|
|
94783596 |
stefanbalaz2 |
H |
Oct. 5, 2020, 3:05 p.m. |
OK |
GNU C++14 |
TESTS |
26 |
639 |
159539200 |
|
|
94781413 |
kzvd4729 |
H |
Oct. 5, 2020, 2:46 p.m. |
OK |
GNU C++14 |
TESTS |
26 |
655 |
149606400 |
|
|
94791894 |
dum4ss |
H |
Oct. 5, 2020, 4:23 p.m. |
OK |
GNU C++14 |
TESTS |
26 |
670 |
155545600 |
|
|
94780499 |
pikmike Ne0n25 vovuh |
H |
Oct. 5, 2020, 2:38 p.m. |
OK |
GNU C++14 |
TESTS |
26 |
685 |
147763200 |
|
|
94800759 |
dum4ss |
H |
Oct. 5, 2020, 6:47 p.m. |
OK |
GNU C++14 |
TESTS |
26 |
685 |
155545600 |
|
|
94773806 |
Sonoda EternalAlexander ustze |
H |
Oct. 5, 2020, 1:44 p.m. |
OK |
GNU C++14 |
TESTS |
26 |
701 |
243507200 |
|
|
94776170 |
newbiegcz Itst Rubbish12345 |
H |
Oct. 5, 2020, 2:02 p.m. |
OK |
GNU C++14 |
TESTS |
26 |
748 |
113254400 |
|
|
94790329 |
cxaphoenix Origenes |
H |
Oct. 5, 2020, 4:04 p.m. |
OK |
GNU C++17 |
TESTS |
26 |
545 |
250470400 |
|
|
94780943 |
woofwoof321 sharabhagrawal25 demoralizer |
H |
Oct. 5, 2020, 2:42 p.m. |
OK |
GNU C++17 |
TESTS |
26 |
546 |
107929600 |
|
|
94783513 |
espo bortoz MrBrionix |
H |
Oct. 5, 2020, 3:04 p.m. |
OK |
GNU C++17 |
TESTS |
26 |
561 |
108134400 |
|
|
94774152 |
8-_-8 fake123 fedoseev.timofey |
H |
Oct. 5, 2020, 1:47 p.m. |
OK |
GNU C++17 |
TESTS |
26 |
608 |
49561600 |
|
|
94776178 |
I_love_chickpea |
H |
Oct. 5, 2020, 2:02 p.m. |
OK |
GNU C++17 |
TESTS |
26 |
623 |
108339200 |
|
|
94781312 |
Gom gs18115 Retro3014 |
H |
Oct. 5, 2020, 2:45 p.m. |
OK |
GNU C++17 |
TESTS |
26 |
639 |
118476800 |
|
|
94782999 |
mango_lassi |
H |
Oct. 5, 2020, 2:59 p.m. |
OK |
GNU C++17 |
TESTS |
26 |
654 |
107110400 |
|
|
94780471 |
Maripium Umi Kuroni |
H |
Oct. 5, 2020, 2:38 p.m. |
OK |
GNU C++17 |
TESTS |
26 |
655 |
184012800 |
|
|
94783200 |
linus123 Tzak thebes |
H |
Oct. 5, 2020, 3:01 p.m. |
OK |
GNU C++17 |
TESTS |
26 |
670 |
97177600 |
|
|
94779815 |
Farhod_Farmon |
H |
Oct. 5, 2020, 2:32 p.m. |
OK |
GNU C++17 |
TESTS |
26 |
702 |
113664000 |
|
|
94777878 |
QAQAutoMaton |
H |
Oct. 5, 2020, 2:16 p.m. |
OK |
GNU C++17 (64) |
TESTS |
26 |
296 |
102092800 |
|
|
94787261 |
2333333333333333333333 axs7384 q234rty |
H |
Oct. 5, 2020, 3:37 p.m. |
OK |
GNU C++17 (64) |
TESTS |
26 |
311 |
134553600 |
|
|
94778571 |
hos.lyric maroonrk yosupo |
H |
Oct. 5, 2020, 2:22 p.m. |
OK |
GNU C++17 (64) |
TESTS |
26 |
342 |
101478400 |
|
|
94784350 |
sjcakioi Misaka-Mikoto- |
H |
Oct. 5, 2020, 3:12 p.m. |
OK |
GNU C++17 (64) |
TESTS |
26 |
373 |
99020800 |
|
|
94783650 |
jiangly |
H |
Oct. 5, 2020, 3:05 p.m. |
OK |
GNU C++17 (64) |
TESTS |
26 |
452 |
88166400 |
|
|
94780475 |
Arg_007 _Ash__ Anachor |
H |
Oct. 5, 2020, 2:38 p.m. |
OK |
GNU C++17 (64) |
TESTS |
26 |
498 |
151961600 |
|
|
94797630 |
Cinque |
H |
Oct. 5, 2020, 5:51 p.m. |
OK |
GNU C++17 (64) |
TESTS |
26 |
546 |
62156800 |
|
|
94781370 |
xay5421 LJC00118 |
H |
Oct. 5, 2020, 2:46 p.m. |
OK |
GNU C++17 (64) |
TESTS |
26 |
576 |
146739200 |
|
|
94788804 |
shengzihang scimoon wlzhouzhuan |
H |
Oct. 5, 2020, 3:51 p.m. |
OK |
GNU C++17 (64) |
TESTS |
26 |
592 |
146739200 |
|
|
94797740 |
Wernier |
H |
Oct. 5, 2020, 5:53 p.m. |
OK |
GNU C++17 (64) |
TESTS |
26 |
607 |
263680000 |
|
|
94779603 |
uwi |
H |
Oct. 5, 2020, 2:31 p.m. |
OK |
Java 11 |
TESTS |
26 |
889 |
126668800 |
|
|
94822099 |
ZTSSS |
H |
Oct. 6, 2020, 5:37 a.m. |
OK |
MS C++ 2017 |
TESTS |
26 |
701 |
75059200 |
|
|
remove filters
Back to search problems