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 everyone knows, bears love fish. But Mike is a strange bear; He hates fish! The even more strange thing about him is he has an infinite number of blue and red fish. He has marked n distinct points in the plane. i-th point is point (xi, xe2 x80 x89yi). He wants to put exactly one fish in each of these points such that the difference between the number of red fish and the blue fish on each horizontal or vertical line is at most 1. He can't find a way to perform that! Please help him. The first line of input contains integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x892 xe2 x80 x89 xc3 x97 xe2 x80 x89105). The next n lines contain the information about the points, i-th line contains two integers xi and yi (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89xi, xe2 x80 x89yi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x892 xe2 x80 x89 xc3 x97 xe2 x80 x89105), the i-th point coordinates. It is guaranteed that there is at least one valid answer. Print the answer as a sequence of n characters 'r' (for red) or 'b' (for blue) where i-th character denotes the color of the fish in the i-th point."... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
11735298 |
zshi |
D |
June 24, 2015, 11:34 a.m. |
OK |
Delphi |
TESTS |
50 |
93 |
13312000 |
|
2500 |
21363881 |
s34vv1nd |
D |
Oct. 11, 2016, 4:27 p.m. |
OK |
FPC |
TESTS |
50 |
155 |
18432000 |
|
2500 |
13854283 |
xszxxc |
D |
Oct. 25, 2015, 1:47 p.m. |
OK |
FPC |
TESTS |
50 |
436 |
30003200 |
|
2500 |
11407208 |
satyam.pandey |
D |
June 3, 2015, 9:45 p.m. |
OK |
GNU C |
TESTS |
50 |
124 |
12185600 |
|
2500 |
27300854 |
Abreto |
D |
May 23, 2017, 12:13 p.m. |
OK |
GNU C |
TESTS |
50 |
124 |
14438400 |
|
2500 |
11438487 |
Bakser |
D |
June 5, 2015, 12:53 a.m. |
OK |
GNU C++ |
TESTS |
50 |
62 |
15667200 |
|
2500 |
20186039 |
Hermera |
D |
Aug. 27, 2016, 1:58 a.m. |
OK |
GNU C++ |
TESTS |
50 |
77 |
16281600 |
|
2500 |
11327099 |
Kudryavka |
D |
May 28, 2015, 12:18 a.m. |
OK |
GNU C++ |
TESTS |
50 |
93 |
7987200 |
|
2500 |
40221280 |
Icyfox |
D |
July 12, 2018, 6:35 a.m. |
OK |
GNU C++ |
TESTS |
50 |
93 |
12595200 |
|
2500 |
40986589 |
ReaLNero1 |
D |
July 30, 2018, 8:38 p.m. |
OK |
GNU C++ |
TESTS |
50 |
93 |
14233600 |
|
2500 |
11389522 |
xindubawukong |
D |
June 2, 2015, 12:07 p.m. |
OK |
GNU C++ |
TESTS |
50 |
93 |
28262400 |
|
2500 |
32715239 |
vjudge2 |
D |
Nov. 27, 2017, 12:55 p.m. |
OK |
GNU C++ |
TESTS |
50 |
93 |
46284800 |
|
2500 |
21176866 |
King_George |
D |
Oct. 4, 2016, 2:30 a.m. |
OK |
GNU C++ |
TESTS |
50 |
108 |
10240000 |
|
2500 |
11346047 |
SUNXIN |
D |
May 29, 2015, 1:17 p.m. |
OK |
GNU C++ |
TESTS |
50 |
108 |
15769600 |
|
2500 |
11319668 |
aaaaajack |
D |
May 27, 2015, 12:57 p.m. |
OK |
GNU C++ |
TESTS |
50 |
109 |
6451200 |
|
2500 |
64774093 |
luogu_bot1 |
D |
Nov. 13, 2019, 2:44 a.m. |
OK |
GNU C++11 |
TESTS |
50 |
46 |
7884800 |
|
2500 |
56368970 |
vjudge5 |
D |
July 1, 2019, 2:05 a.m. |
OK |
GNU C++11 |
TESTS |
50 |
46 |
14336000 |
|
2500 |
64783771 |
xiaolin2 |
D |
Nov. 13, 2019, 8:21 a.m. |
OK |
GNU C++11 |
TESTS |
50 |
46 |
14438400 |
|
2500 |
62032057 |
Dream-chasing_Juvenile |
D |
Oct. 7, 2019, 1:34 a.m. |
OK |
GNU C++11 |
TESTS |
50 |
61 |
11161600 |
|
2500 |
56455501 |
xgzc |
D |
July 3, 2019, 3:30 a.m. |
OK |
GNU C++11 |
TESTS |
50 |
61 |
11878400 |
|
2500 |
56455557 |
vjudge1 |
D |
July 3, 2019, 3:33 a.m. |
OK |
GNU C++11 |
TESTS |
50 |
61 |
11878400 |
|
2500 |
56774568 |
PDDNB |
D |
July 10, 2019, 1:45 a.m. |
OK |
GNU C++11 |
TESTS |
50 |
61 |
12083200 |
|
2500 |
44766732 |
wangxuezhu |
D |
Oct. 24, 2018, 10:19 a.m. |
OK |
GNU C++11 |
TESTS |
50 |
61 |
12083200 |
|
2500 |
43944147 |
sxd666 |
D |
Oct. 7, 2018, 12:53 p.m. |
OK |
GNU C++11 |
TESTS |
50 |
61 |
16896000 |
|
2500 |
65732917 |
AutumnKite |
D |
Nov. 26, 2019, 6:13 a.m. |
OK |
GNU C++11 |
TESTS |
50 |
61 |
17510400 |
|
2500 |
40136063 |
VisJiao |
D |
July 9, 2018, 4:44 p.m. |
OK |
GNU C++14 |
TESTS |
50 |
124 |
33280000 |
|
2500 |
36022227 |
kuppu |
D |
March 6, 2018, 5:08 p.m. |
OK |
GNU C++14 |
TESTS |
50 |
156 |
18534400 |
|
2500 |
39645084 |
shivsharmastr |
D |
June 25, 2018, 9:38 a.m. |
OK |
GNU C++14 |
TESTS |
50 |
171 |
13824000 |
|
2500 |
33011630 |
FallDream |
D |
Dec. 7, 2017, 11:31 p.m. |
OK |
GNU C++14 |
TESTS |
50 |
171 |
13926400 |
|
2500 |
32796650 |
dujvet |
D |
Nov. 30, 2017, 6:16 a.m. |
OK |
GNU C++14 |
TESTS |
50 |
171 |
19148800 |
|
2500 |
64580379 |
mayaohua2003 |
D |
Nov. 9, 2019, 11:55 a.m. |
OK |
GNU C++14 |
TESTS |
50 |
171 |
22016000 |
|
2500 |
51828569 |
sunshiness |
D |
March 25, 2019, 3:04 p.m. |
OK |
GNU C++14 |
TESTS |
50 |
171 |
23961600 |
|
2500 |
63496120 |
shiliangzhi |
D |
Oct. 26, 2019, 3:37 p.m. |
OK |
GNU C++14 |
TESTS |
50 |
171 |
25702400 |
|
2500 |
66178336 |
yhx-12243 |
D |
Dec. 2, 2019, 11:55 a.m. |
OK |
GNU C++14 |
TESTS |
50 |
171 |
28467200 |
|
2500 |
66158206 |
rushcheyo |
D |
Dec. 2, 2019, 1:34 a.m. |
OK |
GNU C++14 |
TESTS |
50 |
171 |
34611200 |
|
2500 |
47517758 |
nimphy |
D |
Dec. 26, 2018, 11:04 a.m. |
OK |
GNU C++17 |
TESTS |
50 |
93 |
89804800 |
|
2500 |
47519118 |
vjudge5 |
D |
Dec. 26, 2018, 11:55 a.m. |
OK |
GNU C++17 |
TESTS |
50 |
108 |
89804800 |
|
2500 |
47519102 |
vjudge2 |
D |
Dec. 26, 2018, 11:55 a.m. |
OK |
GNU C++17 |
TESTS |
50 |
108 |
89804800 |
|
2500 |
57969318 |
nickluo |
D |
July 30, 2019, 5 a.m. |
OK |
GNU C++17 |
TESTS |
50 |
109 |
67379200 |
|
2500 |
47519115 |
vjudge3 |
D |
Dec. 26, 2018, 11:55 a.m. |
OK |
GNU C++17 |
TESTS |
50 |
109 |
89804800 |
|
2500 |
65444201 |
Elegia |
D |
Nov. 20, 2019, 3:22 p.m. |
OK |
GNU C++17 |
TESTS |
50 |
140 |
24473600 |
|
2500 |
40762516 |
AcAutomata |
D |
July 26, 2018, 4:43 a.m. |
OK |
GNU C++17 |
TESTS |
50 |
156 |
14438400 |
|
2500 |
56774591 |
vjudge1 |
D |
July 10, 2019, 1:46 a.m. |
OK |
GNU C++17 |
TESTS |
50 |
171 |
12083200 |
|
2500 |
69965423 |
cold_chair |
D |
Feb. 1, 2020, 12:35 p.m. |
OK |
GNU C++17 |
TESTS |
50 |
171 |
16691200 |
|
2500 |
48440582 |
myx12345 |
D |
Jan. 16, 2019, 2:51 a.m. |
OK |
GNU C++17 |
TESTS |
50 |
171 |
39628800 |
|
2500 |
11328184 |
uwi |
D |
May 28, 2015, 4:25 a.m. |
OK |
Java 7 |
TESTS |
50 |
374 |
22425600 |
|
2500 |
12786242 |
mkirsche |
D |
Aug. 31, 2015, 9:06 a.m. |
OK |
Java 7 |
TESTS |
50 |
545 |
37683200 |
|
2500 |
12027527 |
hellcoder |
D |
July 13, 2015, 9:37 a.m. |
OK |
Java 8 |
TESTS |
50 |
436 |
79667200 |
|
2500 |
12027501 |
hellcoder |
D |
July 13, 2015, 9:35 a.m. |
OK |
Java 8 |
TESTS |
50 |
451 |
79564800 |
|
2500 |
11310372 |
AlexFetisov |
D |
May 26, 2015, 10:49 p.m. |
OK |
Java 8 |
TESTS |
50 |
452 |
79564800 |
|
2500 |
13712459 |
YakutovDmitriy |
D |
Oct. 18, 2015, 12:30 p.m. |
OK |
Java 8 |
TESTS |
50 |
685 |
67276800 |
|
2500 |
13712499 |
YakutovDmitriy |
D |
Oct. 18, 2015, 12:33 p.m. |
OK |
Java 8 |
TESTS |
50 |
701 |
98304000 |
|
2500 |
14430033 |
mashinist |
D |
Nov. 23, 2015, 4:47 p.m. |
OK |
Java 8 |
TESTS |
50 |
717 |
45260800 |
|
2500 |
11333699 |
Lewin |
D |
May 28, 2015, 1:34 p.m. |
OK |
Java 8 |
TESTS |
50 |
733 |
50380800 |
|
2500 |
13712517 |
YakutovDmitriy |
D |
Oct. 18, 2015, 12:34 p.m. |
OK |
Java 8 |
TESTS |
50 |
748 |
98201600 |
|
2500 |
11308077 |
mmaxio |
D |
May 26, 2015, 7:41 p.m. |
OK |
Java 8 |
TESTS |
50 |
826 |
83558400 |
|
2500 |
11385584 |
santa_calus |
D |
June 2, 2015, 4:27 a.m. |
OK |
Java 8 |
TESTS |
50 |
904 |
81100800 |
|
2500 |
11315365 |
og.kostya |
D |
May 27, 2015, 7:59 a.m. |
OK |
MS C# |
TESTS |
50 |
187 |
22528000 |
|
2500 |
11347270 |
AnatolyTolstobrov |
D |
May 29, 2015, 3 p.m. |
OK |
MS C# |
TESTS |
50 |
389 |
34816000 |
|
2500 |
11388085 |
sister_what_hate_most |
D |
June 2, 2015, 9:46 a.m. |
OK |
MS C++ |
TESTS |
50 |
140 |
12492800 |
|
2500 |
11362246 |
absi2011 |
D |
May 31, 2015, 2:32 a.m. |
OK |
MS C++ |
TESTS |
50 |
140 |
57753600 |
|
2500 |
43531396 |
vjudge5 |
D |
Sept. 28, 2018, 1:38 p.m. |
OK |
MS C++ |
TESTS |
50 |
186 |
13107200 |
|
2500 |
42549337 |
vjudge1 |
D |
Sept. 6, 2018, 11:07 a.m. |
OK |
MS C++ |
TESTS |
50 |
234 |
24064000 |
|
2500 |
11357285 |
SDil |
D |
May 30, 2015, 1:32 p.m. |
OK |
MS C++ |
TESTS |
50 |
374 |
13107200 |
|
2500 |
11524270 |
bloodbound |
D |
June 10, 2015, 5:28 p.m. |
OK |
MS C++ |
TESTS |
50 |
374 |
35532800 |
|
2500 |
11518326 |
laozhangxiaoY |
D |
June 10, 2015, 7:49 a.m. |
OK |
MS C++ |
TESTS |
50 |
421 |
17817600 |
|
2500 |
11323264 |
dotorya |
D |
May 27, 2015, 5:02 p.m. |
OK |
MS C++ |
TESTS |
50 |
499 |
58265600 |
|
2500 |
11309525 |
pacu |
D |
May 26, 2015, 8:57 p.m. |
OK |
MS C++ |
TESTS |
50 |
561 |
36147200 |
|
2500 |
13421153 |
asvid |
D |
Oct. 5, 2015, 6:29 p.m. |
OK |
MS C++ |
TESTS |
50 |
592 |
32972800 |
|
2500 |
remove filters
Back to search problems