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'Oscolcovo city has a campus consisting of n student dormitories, n universities and n military offices. Initially, the i-th dormitory belongs to the i-th university and is assigned to the i-th military office. Life goes on and the campus is continuously going through some changes. The changes can be of four types: Thus, at each moment of time each dormitory is assigned to exactly one university and one military office. Initially, all the dormitory are empty. Your task is to process the changes that take place in the campus and answer the queries, how many people currently live in dormitory qj. The first line contains two integers, n and m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x895 xc2 xb7105) -- the number of dormitories and the number of queries, respectively. Next m lines contain the queries, each of them is given in one of the following formats: In the i-th line print the answer to the i-th query asking the number of people in the dormitory. Consider the first sample test: '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
65940248 |
ruo |
D |
Nov. 29, 2019, 5:44 a.m. |
OK |
Clang++17 Diagnostics |
TESTS |
81 |
935 |
222720000 |
|
3000 |
28713874 |
jiyutian |
D |
July 20, 2017, 6:21 a.m. |
OK |
GNU C++ |
TESTS |
81 |
140 |
78131200 |
|
3000 |
21713215 |
XuYipei |
D |
Oct. 23, 2016, 1:07 p.m. |
OK |
GNU C++ |
TESTS |
81 |
171 |
57139200 |
|
3000 |
38962166 |
jangjie |
D |
June 5, 2018, 7:25 a.m. |
OK |
GNU C++ |
TESTS |
81 |
187 |
115814400 |
|
3000 |
38956694 |
zhoudong |
D |
June 5, 2018, 12:32 a.m. |
OK |
GNU C++ |
TESTS |
81 |
202 |
126976000 |
|
3000 |
31627082 |
vjudge5 |
D |
Oct. 23, 2017, 11:41 a.m. |
OK |
GNU C++ |
TESTS |
81 |
217 |
78028800 |
|
3000 |
31627038 |
lllllllllllllllllllllll |
D |
Oct. 23, 2017, 11:39 a.m. |
OK |
GNU C++ |
TESTS |
81 |
218 |
77926400 |
|
3000 |
38941490 |
kcfzyhq |
D |
June 4, 2018, 10:29 a.m. |
OK |
GNU C++ |
TESTS |
81 |
218 |
116428800 |
|
3000 |
38956678 |
zhoudong |
D |
June 5, 2018, 12:30 a.m. |
OK |
GNU C++ |
TESTS |
81 |
233 |
126976000 |
|
3000 |
31627584 |
vjudge2 |
D |
Oct. 23, 2017, noon |
OK |
GNU C++ |
TESTS |
81 |
295 |
70246400 |
|
3000 |
12823091 |
luoruixuan |
D |
Sept. 3, 2015, 3:37 a.m. |
OK |
GNU C++ |
TESTS |
81 |
296 |
48537600 |
|
3000 |
44345767 |
luogu_bot4 |
D |
Oct. 15, 2018, 7:12 a.m. |
OK |
GNU C++11 |
TESTS |
81 |
109 |
67993600 |
|
3000 |
44345763 |
yukuai26 |
D |
Oct. 15, 2018, 7:12 a.m. |
OK |
GNU C++11 |
TESTS |
81 |
109 |
67993600 |
|
3000 |
44338575 |
q234rty |
D |
Oct. 15, 2018, 12:41 a.m. |
OK |
GNU C++11 |
TESTS |
81 |
109 |
128204800 |
|
3000 |
44340154 |
emoairx |
D |
Oct. 15, 2018, 2:37 a.m. |
OK |
GNU C++11 |
TESTS |
81 |
124 |
68096000 |
|
3000 |
44525406 |
nn020701 |
D |
Oct. 19, 2018, 1:47 a.m. |
OK |
GNU C++11 |
TESTS |
81 |
139 |
68096000 |
|
3000 |
31626431 |
vjudge3 |
D |
Oct. 23, 2017, 11:18 a.m. |
OK |
GNU C++11 |
TESTS |
81 |
139 |
70246400 |
|
3000 |
31626411 |
nn020701 |
D |
Oct. 23, 2017, 11:17 a.m. |
OK |
GNU C++11 |
TESTS |
81 |
140 |
70246400 |
|
3000 |
40986242 |
ReaLNero1 |
D |
July 30, 2018, 8:26 p.m. |
OK |
GNU C++11 |
TESTS |
81 |
155 |
68096000 |
|
3000 |
44349910 |
yasugongshang |
D |
Oct. 15, 2018, 9:30 a.m. |
OK |
GNU C++11 |
TESTS |
81 |
171 |
41779200 |
|
3000 |
44348756 |
yasugongshang |
D |
Oct. 15, 2018, 8:53 a.m. |
OK |
GNU C++11 |
TESTS |
81 |
171 |
41779200 |
|
3000 |
31622242 |
q234rty |
D |
Oct. 23, 2017, 7:55 a.m. |
OK |
GNU C++14 |
TESTS |
81 |
124 |
130150400 |
|
3000 |
31618536 |
q234rty |
D |
Oct. 23, 2017, 3:18 a.m. |
OK |
GNU C++14 |
TESTS |
81 |
140 |
100044800 |
|
3000 |
31618541 |
vjudge4 |
D |
Oct. 23, 2017, 3:19 a.m. |
OK |
GNU C++14 |
TESTS |
81 |
155 |
100044800 |
|
3000 |
31619290 |
vjudge5 |
D |
Oct. 23, 2017, 4:25 a.m. |
OK |
GNU C++14 |
TESTS |
81 |
327 |
45568000 |
|
3000 |
63389583 |
zsyzsy |
D |
Oct. 25, 2019, 2:47 p.m. |
OK |
GNU C++14 |
TESTS |
81 |
327 |
73625600 |
|
3000 |
66575139 |
mayaohua2003 |
D |
Dec. 10, 2019, 6:57 a.m. |
OK |
GNU C++14 |
TESTS |
81 |
342 |
44339200 |
|
3000 |
31619281 |
timber_wanglu |
D |
Oct. 23, 2017, 4:24 a.m. |
OK |
GNU C++14 |
TESTS |
81 |
343 |
45568000 |
|
3000 |
63487983 |
yhx-12243 |
D |
Oct. 26, 2019, 1:57 p.m. |
OK |
GNU C++14 |
TESTS |
81 |
343 |
64102400 |
|
3000 |
69392446 |
BJpers3 |
D |
Jan. 23, 2020, 4:29 a.m. |
OK |
GNU C++14 |
TESTS |
81 |
389 |
62259200 |
|
3000 |
56999265 |
Scut82 |
D |
July 14, 2019, 2:15 a.m. |
OK |
GNU C++14 |
TESTS |
81 |
390 |
106291200 |
|
3000 |
64884219 |
cjy2003 |
D |
Nov. 14, 2019, 12:36 p.m. |
OK |
GNU C++17 |
TESTS |
81 |
327 |
38809600 |
|
3000 |
63695140 |
jhzjk |
D |
Oct. 29, 2019, 5:06 a.m. |
OK |
GNU C++17 |
TESTS |
81 |
327 |
48435200 |
|
3000 |
63695075 |
Zhou_JK |
D |
Oct. 29, 2019, 5:04 a.m. |
OK |
GNU C++17 |
TESTS |
81 |
327 |
48435200 |
|
3000 |
67765054 |
HirasawaaYui |
D |
Dec. 28, 2019, 3:01 a.m. |
OK |
GNU C++17 |
TESTS |
81 |
327 |
228864000 |
|
3000 |
65960128 |
Martin53 |
D |
Nov. 29, 2019, 2:24 p.m. |
OK |
GNU C++17 |
TESTS |
81 |
342 |
36864000 |
|
3000 |
67267640 |
vjudge4 |
D |
Dec. 20, 2019, 6:50 a.m. |
OK |
GNU C++17 |
TESTS |
81 |
343 |
48435200 |
|
3000 |
52531067 |
Rzepa |
D |
April 9, 2019, 1:29 p.m. |
OK |
GNU C++17 |
TESTS |
81 |
358 |
91955200 |
|
3000 |
68674318 |
AlexLuchianov |
D |
Jan. 12, 2020, 5:57 p.m. |
OK |
GNU C++17 |
TESTS |
81 |
374 |
47923200 |
|
3000 |
65468465 |
AprilGrimoire |
D |
Nov. 21, 2019, 7:17 a.m. |
OK |
GNU C++17 |
TESTS |
81 |
389 |
52224000 |
|
3000 |
68757801 |
hjk1030 |
D |
Jan. 14, 2020, 8:20 a.m. |
OK |
GNU C++17 |
TESTS |
81 |
452 |
73113600 |
|
3000 |
12664128 |
uwi |
D |
Aug. 22, 2015, 7:25 p.m. |
OK |
Java 8 |
TESTS |
81 |
920 |
139571200 |
|
3000 |
12663075 |
Egor |
D |
Aug. 22, 2015, 6:59 p.m. |
OK |
Java 8 |
TESTS |
81 |
1201 |
181248000 |
|
3000 |
12736453 |
netman |
D |
Aug. 28, 2015, 9:38 p.m. |
OK |
Java 8 |
TESTS |
81 |
1310 |
231628800 |
|
3000 |
12696033 |
JKeeJ1e30 |
D |
Aug. 25, 2015, 1:12 p.m. |
OK |
MS C++ |
TESTS |
81 |
405 |
87244800 |
|
3000 |
12977742 |
aaaaajack |
D |
Sept. 12, 2015, 8:33 p.m. |
OK |
MS C++ |
TESTS |
81 |
467 |
90726400 |
|
3000 |
remove filters
Back to search problems