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"As you might remember from the previous round, Vova is currently playing a strategic game known as Rage of Empires. Vova managed to build a large army, but forgot about the main person in the army - the commander. So he tries to hire a commander, and he wants to choose the person who will be respected by warriors. Each warrior is represented by his personality -- an integer number pi. Each commander has two characteristics -- his personality pj and leadership lj (both are integer numbers). Warrior i respects commander j only if ( is the bitwise excluding OR of x and y). Initially Vova's army is empty. There are three different types of events that can happen with the army: For each event of the third type Vova wants to know how many warriors (counting only those who joined the army and haven't left yet) respect the commander he tries to hire. The first line contains one integer q (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89q xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100000) -- the number of events. Then q lines follow. Each line describes the event: For each event of the third type print one integer -- the number of warriors who respect the commander Vova tries to hire in the event. In the example the army consists of two warriors with personalities 3 and 4 after first two events. Then Vova tries to hire a commander with personality 6 and leadership 3, and only one warrior respects him (, and 2 xe2 x80 x89< xe2 x80 x893, but , and 5 xe2 x80 x89 xe2 x89 xa5 xe2 x80 x893). Then warrior with personality 4 leaves, and when Vova tries to hire that commander again, there are no warriors who respect him. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
27827822 |
FalseMirror |
E |
June 16, 2017, 2:51 p.m. |
OK |
D |
TESTS |
42 |
265 |
36966400 |
|
2100 |
27805532 |
tungtinhoctre126 |
E |
June 15, 2017, 4:51 p.m. |
OK |
FPC |
TESTS |
42 |
249 |
52940800 |
|
2100 |
28108638 |
c-and-j |
E |
June 28, 2017, 5:50 a.m. |
OK |
GNU C |
TESTS |
42 |
46 |
36761600 |
|
2100 |
28108616 |
c-and-j |
E |
June 28, 2017, 5:48 a.m. |
OK |
GNU C |
TESTS |
42 |
46 |
40345600 |
|
2100 |
27804501 |
sgtlaugh |
E |
June 15, 2017, 4:35 p.m. |
OK |
GNU C |
TESTS |
42 |
62 |
48128000 |
|
2100 |
27804912 |
rainboy |
E |
June 15, 2017, 4:41 p.m. |
OK |
GNU C |
TESTS |
42 |
139 |
35737600 |
|
2100 |
33403627 |
Scut82 |
E |
Dec. 19, 2017, 9:56 a.m. |
OK |
GNU C++ |
TESTS |
42 |
31 |
32256000 |
|
2100 |
27835720 |
AkaneSasu |
E |
June 17, 2017, 1:22 a.m. |
OK |
GNU C++ |
TESTS |
42 |
31 |
35840000 |
|
2100 |
27835318 |
King_of_Paladins |
E |
June 17, 2017, 12:37 a.m. |
OK |
GNU C++ |
TESTS |
42 |
31 |
35840000 |
|
2100 |
33403458 |
Scut82 |
E |
Dec. 19, 2017, 9:49 a.m. |
OK |
GNU C++ |
TESTS |
42 |
31 |
42291200 |
|
2100 |
33260627 |
Scut82 |
E |
Dec. 15, 2017, 10:26 a.m. |
OK |
GNU C++ |
TESTS |
42 |
31 |
87654400 |
|
2100 |
40980716 |
ReaLNero1 |
E |
July 30, 2018, 5:39 p.m. |
OK |
GNU C++ |
TESTS |
42 |
46 |
35840000 |
|
2100 |
27804001 |
yasugongshang |
E |
June 15, 2017, 4:27 p.m. |
OK |
GNU C++ |
TESTS |
42 |
46 |
36044800 |
|
2100 |
27803200 |
ColdSu |
E |
June 15, 2017, 4:15 p.m. |
OK |
GNU C++ |
TESTS |
42 |
46 |
36044800 |
|
2100 |
27984389 |
131441373 |
E |
June 23, 2017, 12:10 p.m. |
OK |
GNU C++ |
TESTS |
42 |
46 |
37990400 |
|
2100 |
28780245 |
zqh_wz |
E |
July 22, 2017, 1:51 p.m. |
OK |
GNU C++ |
TESTS |
42 |
46 |
38195200 |
|
2100 |
50561333 |
aboAdnan |
E |
Feb. 27, 2019, 11:14 a.m. |
OK |
GNU C11 |
TESTS |
42 |
343 |
26828800 |
|
2100 |
50561258 |
Math_Master |
E |
Feb. 27, 2019, 11:11 a.m. |
OK |
GNU C11 |
TESTS |
42 |
343 |
26828800 |
|
2100 |
50561379 |
Math_Master |
E |
Feb. 27, 2019, 11:15 a.m. |
OK |
GNU C11 |
TESTS |
42 |
358 |
26828800 |
|
2100 |
27835503 |
ZYF1024 |
E |
June 17, 2017, 12:59 a.m. |
OK |
GNU C++11 |
TESTS |
42 |
31 |
37478400 |
|
2100 |
27897325 |
zykzhenshuai |
E |
June 19, 2017, 6:38 a.m. |
OK |
GNU C++11 |
TESTS |
42 |
46 |
18022400 |
|
2100 |
28931163 |
aleex |
E |
July 27, 2017, 1:21 p.m. |
OK |
GNU C++11 |
TESTS |
42 |
46 |
34201600 |
|
2100 |
27821675 |
zcyskyaa |
E |
June 16, 2017, 9:33 a.m. |
OK |
GNU C++11 |
TESTS |
42 |
46 |
36044800 |
|
2100 |
27828951 |
yeguanghao |
E |
June 16, 2017, 3:53 p.m. |
OK |
GNU C++11 |
TESTS |
42 |
46 |
36249600 |
|
2100 |
63956490 |
vjudge5 |
E |
Nov. 1, 2019, 2:07 a.m. |
OK |
GNU C++11 |
TESTS |
42 |
46 |
37785600 |
|
2100 |
62618835 |
QAQAutoMaton |
E |
Oct. 15, 2019, 12:15 p.m. |
OK |
GNU C++11 |
TESTS |
42 |
46 |
41472000 |
|
2100 |
34608705 |
-wawawa8 |
E |
Jan. 27, 2018, 2:37 p.m. |
OK |
GNU C++11 |
TESTS |
42 |
46 |
42188800 |
|
2100 |
27806700 |
llgyc |
E |
June 15, 2017, 5:12 p.m. |
OK |
GNU C++11 |
TESTS |
42 |
46 |
60108800 |
|
2100 |
27828991 |
yeguanghao |
E |
June 16, 2017, 3:55 p.m. |
OK |
GNU C++11 |
TESTS |
42 |
61 |
36147200 |
|
2100 |
27837777 |
q234rty |
E |
June 17, 2017, 4:44 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
46 |
63692800 |
|
2100 |
27805735 |
NormalCoder |
E |
June 15, 2017, 4:54 p.m. |
OK |
GNU C++14 |
TESTS |
42 |
77 |
36044800 |
|
2100 |
27816072 |
y553546436 |
E |
June 16, 2017, 3:43 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
78 |
36044800 |
|
2100 |
62364065 |
young_dumb_broke |
E |
Oct. 11, 2019, 1:19 p.m. |
OK |
GNU C++14 |
TESTS |
42 |
78 |
36044800 |
|
2100 |
28014708 |
despair |
E |
June 25, 2017, 2:46 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
78 |
37990400 |
|
2100 |
28007585 |
mikoarm |
E |
June 24, 2017, 3:07 p.m. |
OK |
GNU C++14 |
TESTS |
42 |
78 |
37990400 |
|
2100 |
27969303 |
Taxman |
E |
June 22, 2017, 4:29 p.m. |
OK |
GNU C++14 |
TESTS |
42 |
78 |
37990400 |
|
2100 |
27833159 |
_Ash__ |
E |
June 16, 2017, 8:45 p.m. |
OK |
GNU C++14 |
TESTS |
42 |
78 |
42086400 |
|
2100 |
27885562 |
etiennerossignol |
E |
June 18, 2017, 1:40 p.m. |
OK |
GNU C++14 |
TESTS |
42 |
78 |
48128000 |
|
2100 |
62581582 |
Roohi |
E |
Oct. 14, 2019, 5:24 p.m. |
OK |
GNU C++14 |
TESTS |
42 |
78 |
48128000 |
|
2100 |
50174805 |
vjudge4 |
E |
Feb. 19, 2019, 2:58 p.m. |
OK |
GNU C++17 |
TESTS |
42 |
93 |
36044800 |
|
2100 |
64192994 |
KillerX |
E |
Nov. 4, 2019, 8:31 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
93 |
36044800 |
|
2100 |
63960217 |
xxyu |
E |
Nov. 1, 2019, 4:45 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
93 |
36044800 |
|
2100 |
63985700 |
alshahreyaj |
E |
Nov. 1, 2019, 11:40 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
93 |
36044800 |
|
2100 |
47815821 |
lohit_97 |
E |
Jan. 1, 2019, 2:20 p.m. |
OK |
GNU C++17 |
TESTS |
42 |
93 |
36044800 |
|
2100 |
58038176 |
Phortox |
E |
July 30, 2019, 6:35 p.m. |
OK |
GNU C++17 |
TESTS |
42 |
93 |
36044800 |
|
2100 |
45331246 |
MeoIsMyLove |
E |
Nov. 5, 2018, 3:20 p.m. |
OK |
GNU C++17 |
TESTS |
42 |
93 |
36352000 |
|
2100 |
42867681 |
dmkozyrev |
E |
Sept. 14, 2018, 4:44 p.m. |
OK |
GNU C++17 |
TESTS |
42 |
93 |
37888000 |
|
2100 |
53566794 |
CPX99 |
E |
April 30, 2019, 12:52 p.m. |
OK |
GNU C++17 |
TESTS |
42 |
93 |
37888000 |
|
2100 |
54517501 |
vjudge1 |
E |
May 23, 2019, 10:42 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
93 |
77004800 |
|
2100 |
29244674 |
WangJialei |
E |
Aug. 6, 2017, 3:38 p.m. |
OK |
Go |
TESTS |
42 |
670 |
28262400 |
|
2100 |
27806298 |
uwi |
E |
June 15, 2017, 5:04 p.m. |
OK |
Java 8 |
TESTS |
42 |
218 |
0 |
|
2100 |
27805626 |
Azat_Yusupov |
E |
June 15, 2017, 4:52 p.m. |
OK |
Java 8 |
TESTS |
42 |
218 |
41779200 |
|
2100 |
60736516 |
jakejase2 |
E |
Sept. 17, 2019, 5:45 p.m. |
OK |
Java 8 |
TESTS |
42 |
265 |
72396800 |
|
2100 |
27841926 |
Ahmad_Elsagheer |
E |
June 17, 2017, 8:55 a.m. |
OK |
Java 8 |
TESTS |
42 |
421 |
33996800 |
|
2100 |
27921207 |
Kammola |
E |
June 20, 2017, 9:11 a.m. |
OK |
Java 8 |
TESTS |
42 |
467 |
33996800 |
|
2100 |
27806414 |
Dukkha |
E |
June 15, 2017, 5:06 p.m. |
OK |
Java 8 |
TESTS |
42 |
467 |
34099200 |
|
2100 |
27844546 |
bhishma |
E |
June 17, 2017, 11:16 a.m. |
OK |
Java 8 |
TESTS |
42 |
467 |
34201600 |
|
2100 |
27844554 |
bhishma |
E |
June 17, 2017, 11:16 a.m. |
OK |
Java 8 |
TESTS |
42 |
468 |
34201600 |
|
2100 |
39276499 |
AQT |
E |
June 16, 2018, 12:10 a.m. |
OK |
Java 8 |
TESTS |
42 |
483 |
38297600 |
|
2100 |
27936862 |
hitesh.bothra |
E |
June 21, 2017, 4:19 a.m. |
OK |
Java 8 |
TESTS |
42 |
498 |
60928000 |
|
2100 |
27807083 |
og.kostya |
E |
June 15, 2017, 5:17 p.m. |
OK |
MS C# |
TESTS |
42 |
280 |
31641600 |
|
2100 |
27876157 |
lucyanna2018 |
E |
June 18, 2017, 4:11 a.m. |
OK |
MS C++ |
TESTS |
42 |
78 |
32460800 |
|
2100 |
27804875 |
SaMer |
E |
June 15, 2017, 4:41 p.m. |
OK |
MS C++ |
TESTS |
42 |
109 |
26726400 |
|
2100 |
50157564 |
vjudge3 |
E |
Feb. 19, 2019, 10:58 a.m. |
OK |
MS C++ |
TESTS |
42 |
140 |
222412800 |
|
2100 |
27807797 |
pbt17 |
E |
June 15, 2017, 5:40 p.m. |
OK |
MS C++ |
TESTS |
42 |
530 |
32563200 |
|
2100 |
27805243 |
nwi |
E |
June 15, 2017, 4:47 p.m. |
OK |
Python 2 |
TESTS |
42 |
1606 |
113459200 |
|
2100 |
remove filters
Back to search problems