Codeforces Round 173 (Div. 2)

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.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
282 Codeforces Round 173 (Div. 2) FINISHED False 7200 368634599 March 13, 2013, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 13020 ) B Painting Eggs PROGRAMMING greedy math 1500

B'The Bitlandians are quite weird people. They have very peculiar customs. As is customary, Uncle J. wants to have n eggs painted for Bitruz (an ancient Bitland festival). He has asked G. and A. to do the work. The kids are excited because just as is customary, they 're going to be paid for the job! Overall uncle J. has got n eggs. G. named his price for painting each egg. Similarly, A. named his price for painting each egg. It turns out that for each egg the sum of the money both A. and G. want for the painting equals 1000. Uncle J. wants to distribute the eggs between the children so as to give each egg to exactly one child. Also, Uncle J. wants the total money paid to A. to be different from the total money paid to G. by no more than 500. Help Uncle J. Find the required distribution of eggs or otherwise say that distributing the eggs in the required manner is impossible. The first line contains integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89106) -- the number of eggs. Next n lines contain two integers ai and gi each (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai, xe2 x80 x89gi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891000; ai xe2 x80 x89+ xe2 x80 x89gi xe2 x80 x89= xe2 x80 x891000): ai is the price said by A. for the i-th egg and gi is the price said by G. for the i-th egg. If it is impossible to assign the painting, print "-1" (without quotes). Otherwise print a string, consisting of n letters "G" and "A". The i-th letter of this string should represent the child who will get the i-th egg in the required distribution. Letter "A" represents A. and letter "G" represents G. If we denote the money Uncle J. must pay A. for the painting as Sa, and the money Uncle J. must pay G. for the painting as Sg, then this inequality must hold: |Sa xe2 x80 x89 xe2 x80 x89- xe2 x80 x89 xe2 x80 x89Sg| xe2 x80 x89 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89 xe2 x80 x89500. If there are several solutions, you are allowed to print any of them.'...

Tutorials

Round #173 — Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
56067151 chaorenhaha B June 26, 2019, 8:32 a.m. OK FPC TESTS 54 622 4505600 1500
56067167 chaorenhaha B June 26, 2019, 8:32 a.m. OK FPC TESTS 54 624 12595200 1500
38655137 archit_chochu B May 27, 2018, 12:22 p.m. OK GNU C TESTS 54 592 0 1500
38913106 gargmehul10 B June 3, 2018, 7:27 a.m. OK GNU C TESTS 54 684 3379200 1500
41372657 smit_1999 B Aug. 8, 2018, 6:30 p.m. OK GNU C TESTS 54 684 7987200 1500
38969371 _mhs B June 5, 2018, 1:04 p.m. OK GNU C TESTS 54 686 3584000 1500
41218565 vjudge5 B Aug. 4, 2018, 2:16 p.m. OK GNU C++ TESTS 54 124 1024000 1500
40990120 ReaLNero1 B July 30, 2018, 11:36 p.m. OK GNU C++ TESTS 54 154 3993600 1500
38312058 Scut82 B May 16, 2018, 7:10 a.m. OK GNU C++ TESTS 54 154 11878400 1500
41218578 vjudge3 B Aug. 4, 2018, 2:16 p.m. OK GNU C++ TESTS 54 156 1024000 1500
38310264 Scut82 B May 16, 2018, 6:02 a.m. OK GNU C++ TESTS 54 342 24883200 1500
40579725 Yasseenkamel B July 20, 2018, 1:31 p.m. OK GNU C++ TESTS 54 498 0 1500
38442060 TheBlaDe B May 19, 2018, 8:20 p.m. OK GNU C++ TESTS 54 560 0 1500
42275883 palin B Aug. 30, 2018, 11:28 a.m. OK GNU C++ TESTS 54 560 3993600 1500
39015273 sidmojo B June 7, 2018, 9:59 a.m. OK GNU C++ TESTS 54 560 8806400 1500
38311201 Scut82 B May 16, 2018, 6:37 a.m. OK GNU C++ TESTS 54 592 3788800 1500
58106778 Cloud_ B Aug. 1, 2019, 4:52 a.m. OK GNU C11 TESTS 54 498 1024000 1500
54570926 MajAK B May 24, 2019, 7:13 p.m. OK GNU C11 TESTS 54 528 1024000 1500
61808222 lucas.a B Oct. 3, 2019, 11:48 p.m. OK GNU C11 TESTS 54 530 1024000 1500
68096481 kaiboy B Jan. 2, 2020, 9:11 p.m. OK GNU C11 TESTS 54 530 1024000 1500
46849139 vjudge4 B Dec. 10, 2018, 11:29 a.m. OK GNU C11 TESTS 54 560 1024000 1500
46849121 vjudge5 B Dec. 10, 2018, 11:29 a.m. OK GNU C11 TESTS 54 560 1024000 1500
54863515 hitman_28 B May 31, 2019, 4:28 a.m. OK GNU C11 TESTS 54 560 1024000 1500
46849064 nirjhorJU B Dec. 10, 2018, 11:26 a.m. OK GNU C11 TESTS 54 592 1024000 1500
39269165 searcher7 B June 15, 2018, 2:45 p.m. OK GNU C++11 TESTS 54 124 1024000 1500
47677562 Scut82 B Dec. 29, 2018, 10:07 a.m. OK GNU C++11 TESTS 54 218 1024000 1500
61339406 lioness_coder B Sept. 26, 2019, 7:11 p.m. OK GNU C++11 TESTS 54 436 0 1500
58786705 luogu_bot5 B Aug. 13, 2019, 11:16 p.m. OK GNU C++11 TESTS 54 436 0 1500
58714022 luogu_bot5 B Aug. 13, 2019, 1:21 p.m. OK GNU C++11 TESTS 54 436 0 1500
57897091 lopare B July 28, 2019, 2:03 p.m. OK GNU C++11 TESTS 54 436 0 1500
57821375 py_ultron B July 26, 2019, 11:35 p.m. OK GNU C++11 TESTS 54 436 0 1500
45062760 Hisoka B Oct. 29, 2018, 3:37 p.m. OK GNU C++11 TESTS 54 436 0 1500
45588058 mini4141 B Nov. 12, 2018, 10:25 a.m. OK GNU C++11 TESTS 54 436 819200 1500
46391346 Sleepy_Guy B Nov. 30, 2018, 6:07 a.m. OK GNU C++11 TESTS 54 436 3993600 1500
46914160 Conkyy B Dec. 11, 2018, 6:56 p.m. OK GNU C++14 TESTS 54 560 0 1500
60363799 SAAD B Sept. 10, 2019, 7:38 p.m. OK GNU C++14 TESTS 54 560 0 1500
48474295 vjudge1 B Jan. 17, 2019, 1:11 a.m. OK GNU C++14 TESTS 54 590 1228800 1500
58800540 anthropocene2020 B Aug. 14, 2019, 7:18 a.m. OK GNU C++14 TESTS 54 592 0 1500
62770717 dinesh_1997 B Oct. 17, 2019, 10:10 a.m. OK GNU C++14 TESTS 54 622 0 1500
51837787 Lone__wolf B March 25, 2019, 7:19 p.m. OK GNU C++14 TESTS 54 624 0 1500
61844808 BlueSharK B Oct. 4, 2019, 11 a.m. OK GNU C++14 TESTS 54 654 2969600 1500
68630146 vjudge4 B Jan. 12, 2020, 2:15 a.m. OK GNU C++14 TESTS 54 654 2969600 1500
65155461 Un.CD B Nov. 16, 2019, 9:09 a.m. OK GNU C++14 TESTS 54 654 2969600 1500
68630184 edge555 B Jan. 12, 2020, 2:17 a.m. OK GNU C++14 TESTS 54 654 2969600 1500
55844385 abhisheksingh9 B June 20, 2019, 8:07 p.m. OK GNU C++17 TESTS 54 560 0 1500
48057902 t1war1 B Jan. 7, 2019, 1:25 p.m. OK GNU C++17 TESTS 54 590 0 1500
62757469 akash19jain B Oct. 17, 2019, 5:26 a.m. OK GNU C++17 TESTS 54 592 0 1500
57320169 mad_i B July 19, 2019, 9:40 a.m. OK GNU C++17 TESTS 54 592 0 1500
64485973 KronoFaze B Nov. 7, 2019, 5:47 p.m. OK GNU C++17 TESTS 54 622 0 1500
41983608 N0ne_ B Aug. 23, 2018, 4:09 a.m. OK GNU C++17 TESTS 54 654 0 1500
44074701 Jaihk662 B Oct. 10, 2018, 12:44 p.m. OK GNU C++17 TESTS 54 654 307200 1500
64094172 Sephiroth_Shinra B Nov. 2, 2019, 1:27 p.m. OK GNU C++17 TESTS 54 684 10956800 1500
64485144 KronoFaze B Nov. 7, 2019, 5:28 p.m. OK GNU C++17 TESTS 54 686 1024000 1500
64585082 ASM_ATIKUR B Nov. 9, 2019, 1:08 p.m. OK GNU C++17 TESTS 54 686 1024000 1500
42360322 SaHLeT B Sept. 2, 2018, 11:29 a.m. OK Haskell TESTS 54 1184 26009600 1500
42360192 SaHLeT B Sept. 2, 2018, 11:25 a.m. OK Haskell TESTS 54 1464 16998400 1500
55499264 Akshita_Maheshwari B June 12, 2019, 2:12 p.m. OK Java 8 TESTS 54 310 0 1500
52001413 Ikari_stream B March 30, 2019, 6:25 a.m. OK Java 8 TESTS 54 310 0 1500
51786967 MaxHeap B March 24, 2019, 11:05 a.m. OK Java 8 TESTS 54 342 0 1500
54432274 Blastman B May 21, 2019, 1:17 a.m. OK Java 8 TESTS 54 372 0 1500
62570456 Avi_2506 B Oct. 14, 2019, 2:21 p.m. OK Java 8 TESTS 54 374 0 1500
57638551 Abanish B July 24, 2019, 11:47 a.m. OK Java 8 TESTS 54 374 0 1500
48065150 manish_98 B Jan. 7, 2019, 5:40 p.m. OK Java 8 TESTS 54 374 0 1500
48065025 manish_98 B Jan. 7, 2019, 5:35 p.m. OK Java 8 TESTS 54 374 0 1500
43360904 o.radwan B Sept. 24, 2018, 9:12 a.m. OK Java 8 TESTS 54 374 8704000 1500
68212549 wabadabakalakaboo B Jan. 4, 2020, 8:12 p.m. OK Java 8 TESTS 54 404 0 1500
51200375 nemars B March 11, 2019, 10:18 p.m. OK Mono C# TESTS 54 1028 16998400 1500
48476562 vjudge3 B Jan. 17, 2019, 3:05 a.m. OK MS C++ TESTS 54 404 9011200 1500
46969512 vjudge1 B Dec. 13, 2018, 1:06 p.m. OK MS C++ TESTS 54 436 9011200 1500
48482082 vjudge1 B Jan. 17, 2019, 6:32 a.m. OK MS C++ TESTS 54 436 9011200 1500
60026004 vjudge3 B Sept. 4, 2019, 2:11 p.m. OK MS C++ TESTS 54 560 1024000 1500
48490783 vjudge4 B Jan. 17, 2019, 10:47 a.m. OK MS C++ TESTS 54 590 0 1500
50321762 vjudge1 B Feb. 22, 2019, 2:51 p.m. OK MS C++ TESTS 54 592 0 1500
48486500 vjudge3 B Jan. 17, 2019, 8:38 a.m. OK MS C++ TESTS 54 592 7987200 1500
48476292 vjudge2 B Jan. 17, 2019, 2:50 a.m. OK MS C++ TESTS 54 624 1024000 1500
60017526 vjudge4 B Sept. 4, 2019, 12:26 p.m. OK MS C++ TESTS 54 654 0 1500
48476551 vjudge5 B Jan. 17, 2019, 3:04 a.m. OK MS C++ TESTS 54 654 1024000 1500
54609825 Dragostan B May 25, 2019, 10:52 a.m. OK MS C++ 2017 TESTS 54 2402 1024000 1500
64724730 SRRRW B Nov. 12, 2019, 5:58 a.m. OK MS C++ 2017 TESTS 54 2464 9932800 1500
64620438 yuanyuan2048 B Nov. 10, 2019, 6:40 a.m. OK MS C++ 2017 TESTS 54 2494 10649600 1500
63082658 CtrlAlt B Oct. 21, 2019, 3:37 p.m. OK MS C++ 2017 TESTS 54 2496 13004800 1500
57277994 surbhi_88 B July 18, 2019, 11:38 a.m. OK MS C++ 2017 TESTS 54 2556 1945600 1500
58269458 Abugozah B Aug. 4, 2019, 4:14 p.m. OK MS C++ 2017 TESTS 54 2558 9932800 1500
65767835 kchau B Nov. 26, 2019, 6:53 p.m. OK MS C++ 2017 TESTS 54 2588 2560000 1500
59703946 vjudge4 B Aug. 30, 2019, 11:52 a.m. OK MS C++ 2017 TESTS 54 2744 21094400 1500
56227623 Keldante B June 28, 2019, 1:14 p.m. OK PHP TESTS 54 1090 409600 1500
49822693 c1729 B Feb. 12, 2019, 9:45 a.m. OK PyPy 3 TESTS 54 592 26931200 1500
49822504 c1729 B Feb. 12, 2019, 9:39 a.m. OK PyPy 3 TESTS 54 716 26931200 1500
49822391 c1729 B Feb. 12, 2019, 9:36 a.m. OK PyPy 3 TESTS 54 904 68403200 1500
63681064 longobardo B Oct. 28, 2019, 8 p.m. OK PyPy 3 TESTS 54 2588 21401600 1500
63681517 bisgona B Oct. 28, 2019, 8:10 p.m. OK PyPy 3 TESTS 54 2588 21606400 1500
57973839 rajat_2548 B July 30, 2019, 6:59 a.m. OK PyPy 3 TESTS 54 2712 21811200 1500
61177946 UTMoonlight B Sept. 23, 2019, 6:52 p.m. OK PyPy 3 TESTS 54 2744 9932800 1500
68683053 beethoven97 B Jan. 13, 2020, 12:57 a.m. OK PyPy 3 TESTS 54 3180 127385600 1500
58377593 bergus B Aug. 6, 2019, 8:46 a.m. OK PyPy 3 TESTS 54 3398 140288000 1500
43031587 chandak_vikas B Sept. 18, 2018, 11:56 a.m. OK PyPy 3 TESTS 54 4990 9932800 1500
46821628 jaaguptamme B Dec. 9, 2018, 3:38 p.m. OK Python 2 TESTS 54 2370 16384000 1500
63870793 chaudhary_19 B Oct. 30, 2019, 5:26 p.m. OK Python 2 TESTS 54 2588 16384000 1500
57077442 ashwin2000 B July 15, 2019, 5:51 a.m. OK Python 2 TESTS 54 4490 0 1500
55597489 kpiiitb B June 15, 2019, 3:55 p.m. OK Python 2 TESTS 54 4554 3276800 1500
62607738 ashok123 B Oct. 15, 2019, 8:29 a.m. OK Python 2 TESTS 54 4554 18636800 1500
49811593 kipply B Feb. 12, 2019, 1:49 a.m. OK Python 2 TESTS 54 4648 1945600 1500
59792287 sr4saurabh B Aug. 31, 2019, 7:31 a.m. OK Python 2 TESTS 54 4740 0 1500
49106737 deadguy B Jan. 28, 2019, 1:25 p.m. OK Python 2 TESTS 54 4742 19968000 1500
51931614 saurabhs1206 B March 28, 2019, 10:41 a.m. OK Python 2 TESTS 54 4772 0 1500
50535097 kurokyI1 B Feb. 26, 2019, 3:20 p.m. OK Python 2 TESTS 54 4772 0 1500
49822959 c1729 B Feb. 12, 2019, 9:53 a.m. OK Python 3 TESTS 54 1778 11059200 1500
49822364 c1729 B Feb. 12, 2019, 9:35 a.m. OK Python 3 TESTS 54 2276 45056000 1500
54438195 Mohamed_Ayman B May 21, 2019, 7:07 a.m. OK Python 3 TESTS 54 3026 23961600 1500
47026332 Silky_Littleraisin B Dec. 15, 2018, 7:08 a.m. OK Python 3 TESTS 54 3182 1945600 1500
66239933 zaid09 B Dec. 3, 2019, 5:41 p.m. OK Python 3 TESTS 54 3212 2252800 1500
54852597 3x7 B May 30, 2019, 5:24 p.m. OK Python 3 TESTS 54 3244 2048000 1500
54423053 zapdospops B May 20, 2019, 4:38 p.m. OK Python 3 TESTS 54 3274 2048000 1500
48878347 xumouyi B Jan. 24, 2019, 9:10 a.m. OK Python 3 TESTS 54 3276 2048000 1500
49822259 c1729 B Feb. 12, 2019, 9:32 a.m. OK Python 3 TESTS 54 3338 45056000 1500
66215168 shade1010 B Dec. 3, 2019, 8:35 a.m. OK Python 3 TESTS 54 3524 2048000 1500

remove filters

Back to search problems