Codeforces Round 443 (Div. 1)

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
878 Codeforces Round 443 (Div. 1) FINISHED False 7200 222794099 Oct. 26, 2017, 2:45 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5538 ) A Short Program PROGRAMMING bitmasks constructive algorithms 1600

B'Petya learned a new programming language CALPAS. A program in this language always takes one non-negative integer and returns one non-negative integer as well. In the language, there are only three commands: apply a bitwise operation AND, OR or XOR with a given constant to the current integer. A program can contain an arbitrary sequence of these operations with arbitrary constants from 0 to 1023. When the program is run, all operations are applied (in the given order) to the argument and in the end the result integer is returned. Petya wrote a program in this language, but it turned out to be too long. Write a program in CALPAS that does the same thing as the Petya 's program, and consists of no more than 5 lines. Your program should return the same integer as Petya 's program for all arguments from 0 to 1023. The first line contains an integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x895 xc2 xb7105) -- the number of lines. Next n lines contain commands. A command consists of a character that represents the operation ("&", "|" or "^" for AND, OR or XOR respectively), and the constant xi 0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89xi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891023. Output an integer k (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x895) -- the length of your program. Next k lines must contain commands in the same format as in the input. You can read about bitwise operations in https://en.wikipedia.org/wiki/Bitwise_operation. Second sample: Let x be an input of the Petya 's program. It 's output is ((x&1)&3)&5 xe2 x80 x89= xe2 x80 x89x&(1&3&5) xe2 x80 x89= xe2 x80 x89x&1. So these two programs always give the same outputs. '...

Tutorials

Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
31807939 SirNickolas A Oct. 27, 2017, 3:23 p.m. OK D TESTS 30 327 0 1600
31745939 fluffyowl A Oct. 26, 2017, 3:02 p.m. OK D TESTS 30 358 0 1600
31753982 nguyenxxxxxxx A Oct. 26, 2017, 3:31 p.m. OK FPC TESTS 30 124 0 1600
31753426 heklo A Oct. 26, 2017, 3:29 p.m. OK FPC TESTS 30 139 0 1600
31878238 yanok A Oct. 29, 2017, 10:34 p.m. OK GNU C TESTS 30 93 0 1600
33759878 andra1782 A Dec. 29, 2017, 12:46 p.m. OK GNU C TESTS 30 124 1843200 1600
31861384 gaelim A Oct. 29, 2017, 9:11 a.m. OK GNU C TESTS 30 140 0 1600
31857812 gaelim A Oct. 29, 2017, 6:35 a.m. OK GNU C TESTS 30 140 0 1600
31856062 gaelim A Oct. 29, 2017, 5:01 a.m. OK GNU C TESTS 30 171 0 1600
31769326 codemart786 A Oct. 26, 2017, 6:27 p.m. OK GNU C TESTS 30 217 27545600 1600
31864907 samjia2000 A Oct. 29, 2017, 11:29 a.m. OK GNU C++ TESTS 30 46 0 1600
31745030 Heaplax A Oct. 26, 2017, 3 p.m. OK GNU C++ TESTS 30 46 0 1600
31741498 1919810 A Oct. 26, 2017, 2:51 p.m. OK GNU C++ TESTS 30 46 0 1600
31745500 zx2003 A Oct. 26, 2017, 3:01 p.m. OK GNU C++ TESTS 30 61 0 1600
31853636 redbag A Oct. 29, 2017, 1:40 a.m. OK GNU C++ TESTS 30 62 0 1600
31806212 wh2001_ZY A Oct. 27, 2017, 3:03 p.m. OK GNU C++ TESTS 30 62 3993600 1600
31879644 cdgyp A Oct. 30, 2017, 1:40 a.m. OK GNU C++ TESTS 30 62 7987200 1600
32111701 thebestriven A Nov. 7, 2017, 7:11 a.m. OK GNU C++ TESTS 30 93 0 1600
31972623 vjudge5 A Nov. 2, 2017, 8:48 a.m. OK GNU C++ TESTS 30 93 0 1600
31785558 drlong10th A Oct. 27, 2017, 6:46 a.m. OK GNU C++ TESTS 30 93 0 1600
31775599 laofudasuan A Oct. 27, 2017, 12:07 a.m. OK GNU C++11 TESTS 30 31 0 1600
31797803 Jori A Oct. 27, 2017, 1:53 p.m. OK GNU C++11 TESTS 30 46 0 1600
43752158 vjudge4 A Oct. 4, 2018, 3:36 a.m. OK GNU C++11 TESTS 30 46 0 1600
43752147 vjudge3 A Oct. 4, 2018, 3:35 a.m. OK GNU C++11 TESTS 30 46 0 1600
43756312 Ithea_Myse_Valgulious A Oct. 4, 2018, 6:24 a.m. OK GNU C++11 TESTS 30 46 307200 1600
50775133 Gloid A March 4, 2019, 7:58 a.m. OK GNU C++11 TESTS 30 61 0 1600
31776837 860579 A Oct. 27, 2017, 1:50 a.m. OK GNU C++11 TESTS 30 61 2560000 1600
40979412 ReaLNero1 A July 30, 2018, 5:04 p.m. OK GNU C++11 TESTS 30 62 0 1600
39242174 Blue233333 A June 14, 2018, 11:42 a.m. OK GNU C++11 TESTS 30 62 0 1600
31745683 lawyerphx A Oct. 26, 2017, 3:02 p.m. OK GNU C++11 TESTS 30 78 0 1600
32086833 FizzyDavid A Nov. 6, 2017, 3:30 a.m. OK GNU C++14 TESTS 30 31 102400 1600
31891954 _SHENZHEBEI_ A Oct. 30, 2017, 11:39 a.m. OK GNU C++14 TESTS 30 31 46387200 1600
31796446 Egor.Lifar A Oct. 27, 2017, 1:14 p.m. OK GNU C++14 TESTS 30 61 2560000 1600
31763545 whjhr A Oct. 26, 2017, 4:35 p.m. OK GNU C++14 TESTS 30 61 4096000 1600
31744004 _LowestJN A Oct. 26, 2017, 2:57 p.m. OK GNU C++14 TESTS 30 77 2662400 1600
61354616 ZainaM A Sept. 27, 2019, 9:52 a.m. OK GNU C++14 TESTS 30 124 0 1600
55209460 kkrishnaswaroop99 A June 6, 2019, 1:59 p.m. OK GNU C++14 TESTS 30 124 0 1600
51281185 Nimazare A March 14, 2019, 4:02 a.m. OK GNU C++14 TESTS 30 124 0 1600
46096813 nanoshino A Nov. 23, 2018, 1:20 a.m. OK GNU C++14 TESTS 30 124 0 1600
32082639 suchanekj A Nov. 5, 2017, 7:38 p.m. OK GNU C++14 TESTS 30 124 0 1600
56017404 exe A June 24, 2019, 10:37 p.m. OK GNU C++17 TESTS 30 109 0 1600
68455938 Igor_2017 A Jan. 9, 2020, 4:13 p.m. OK GNU C++17 TESTS 30 124 0 1600
59674708 Khostiqa A Aug. 29, 2019, 5:36 p.m. OK GNU C++17 TESTS 30 124 0 1600
56620006 code_tamer A July 6, 2019, 11:35 a.m. OK GNU C++17 TESTS 30 124 0 1600
46931218 sergeykrokodil A Dec. 12, 2018, 11:43 a.m. OK GNU C++17 TESTS 30 124 0 1600
48706065 manish_joshi A Jan. 22, 2019, 5:57 a.m. OK GNU C++17 TESTS 30 124 204800 1600
45748154 Phortox A Nov. 14, 2018, 9:30 p.m. OK GNU C++17 TESTS 30 124 204800 1600
55955353 Baroudy A June 23, 2019, 6:38 a.m. OK GNU C++17 TESTS 30 139 0 1600
56849881 vjudge3 A July 11, 2019, 3:13 p.m. OK GNU C++17 TESTS 30 139 0 1600
56777366 XpqX A July 10, 2019, 3:36 a.m. OK GNU C++17 TESTS 30 139 0 1600
34498609 megaspazz A Jan. 23, 2018, 11:34 p.m. OK Go TESTS 30 93 28262400 1600
33381589 marek094 A Dec. 18, 2017, 1:53 p.m. OK Haskell TESTS 30 1934 73318400 1600
31742999 uwi A Oct. 26, 2017, 2:55 p.m. OK Java 8 TESTS 30 139 0 1600
53114391 tsumit023 A April 22, 2019, 6:47 a.m. OK Java 8 TESTS 30 140 0 1600
33135855 saitama_rox A Dec. 11, 2017, 6:31 p.m. OK Java 8 TESTS 30 155 20684800 1600
31771894 coderbond007 A Oct. 26, 2017, 8:07 p.m. OK Java 8 TESTS 30 171 0 1600
31747397 antkhorin A Oct. 26, 2017, 3:06 p.m. OK Java 8 TESTS 30 171 0 1600
31758700 Jeel_Vaishnav A Oct. 26, 2017, 4 p.m. OK Java 8 TESTS 30 186 0 1600
69649887 Katushechka A Jan. 28, 2020, 4:30 a.m. OK Java 8 TESTS 30 202 0 1600
58359479 Xylenox A Aug. 5, 2019, 10:17 p.m. OK Java 8 TESTS 30 217 0 1600
31741000 Lewin A Oct. 26, 2017, 2:50 p.m. OK Java 8 TESTS 30 218 0 1600
69190908 mennafadali A Jan. 20, 2020, 1:28 p.m. OK Java 8 TESTS 30 233 0 1600
31748890 kuuso A Oct. 26, 2017, 3:11 p.m. OK Mono C# TESTS 30 280 6041600 1600
31921688 ice_arbiter A Oct. 31, 2017, 12:54 p.m. OK MS C++ TESTS 30 109 0 1600
43751729 vjudge2 A Oct. 4, 2018, 3:18 a.m. OK MS C++ TESTS 30 109 0 1600
31871132 void_sora A Oct. 29, 2017, 3:42 p.m. OK MS C++ TESTS 30 109 102400 1600
43755051 vjudge1 A Oct. 4, 2018, 5:39 a.m. OK MS C++ TESTS 30 124 0 1600
43752601 vjudge1 A Oct. 4, 2018, 3:55 a.m. OK MS C++ TESTS 30 124 0 1600
43752361 vjudge4 A Oct. 4, 2018, 3:44 a.m. OK MS C++ TESTS 30 124 0 1600
45162288 vjudge1 A Nov. 1, 2018, 9:41 a.m. OK MS C++ TESTS 30 124 0 1600
31804466 master_1996 A Oct. 27, 2017, 2:46 p.m. OK MS C++ TESTS 30 124 102400 1600
31863936 kshitij A Oct. 29, 2017, 10:55 a.m. OK MS C++ TESTS 30 124 204800 1600
43757514 vjudge2 A Oct. 4, 2018, 7:05 a.m. OK MS C++ TESTS 30 124 307200 1600
52655341 index_ A April 12, 2019, 6:34 p.m. OK MS C++ 2017 TESTS 30 452 16076800 1600
46113187 kov A Nov. 23, 2018, 12:46 p.m. OK Node.js TESTS 30 639 47923200 1600
31861668 s_p A Oct. 29, 2017, 9:22 a.m. OK Perl TESTS 30 1200 114585600 1600
32239884 Bashuk A Nov. 12, 2017, 9:55 a.m. OK PyPy 2 TESTS 30 327 28467200 1600
31837807 SIackbot A Oct. 28, 2017, 12:54 p.m. OK PyPy 2 TESTS 30 499 1228800 1600
31742981 alexwice A Oct. 26, 2017, 2:55 p.m. OK PyPy 2 TESTS 30 733 23859200 1600
58787231 Leendertz A Aug. 13, 2019, 11:53 p.m. OK PyPy 3 TESTS 30 327 12697600 1600
32304051 xhae A Nov. 14, 2017, 5:46 a.m. OK PyPy 3 TESTS 30 748 9113600 1600
32815748 yugle7 A Nov. 30, 2017, 8:05 p.m. OK PyPy 3 TESTS 30 858 30617600 1600
31771967 madn A Oct. 26, 2017, 8:09 p.m. OK PyPy 3 TESTS 30 873 7884800 1600
31851562 tjsumonster A Oct. 28, 2017, 9:46 p.m. OK Python 2 TESTS 30 904 0 1600
38992245 Ali_Pi A June 6, 2018, 10:56 a.m. OK Python 2 TESTS 30 919 8396800 1600
32482678 xqma A Nov. 19, 2017, 7:44 p.m. OK Python 2 TESTS 30 982 13004800 1600
31770410 ReaLNero A Oct. 26, 2017, 7:01 p.m. OK Python 2 TESTS 30 1029 8396800 1600
32481148 WNG A Nov. 19, 2017, 6:26 p.m. OK Python 2 TESTS 30 1263 12902400 1600
32845907 RocketshipToaster A Dec. 2, 2017, 3:57 a.m. OK Python 3 TESTS 30 748 5632000 1600
51286476 mibobkov A March 14, 2019, 7:35 a.m. OK Python 3 TESTS 30 872 23449600 1600
32633613 JohnVonTuring A Nov. 24, 2017, 11:03 p.m. OK Python 3 TESTS 30 873 5632000 1600
31771988 madn A Oct. 26, 2017, 8:10 p.m. OK Python 3 TESTS 30 1138 0 1600
31772584 NiakTheWizard A Oct. 26, 2017, 8:40 p.m. OK Python 3 TESTS 30 1201 29388800 1600
42120048 Mk_Python_v1 A Aug. 26, 2018, 11:58 a.m. OK Python 3 TESTS 30 1263 0 1600
37775934 brandtnet1 A April 30, 2018, 4:45 p.m. OK Python 3 TESTS 30 1372 7065600 1600
32815984 yugle7 A Nov. 30, 2017, 8:22 p.m. OK Python 3 TESTS 30 1450 5632000 1600
31808554 yuto A Oct. 27, 2017, 3:31 p.m. OK Python 3 TESTS 30 1669 29900800 1600
32072605 Firepaw A Nov. 5, 2017, 9:49 a.m. OK Python 3 TESTS 30 1684 63488000 1600

remove filters

Back to search problems