Codeforces Round 741 (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
1562 Codeforces Round 741 (Div. 2) FINISHED False 8100 107191463 Aug. 26, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 19819 ) B Scenes From a Memory PROGRAMMING brute force implementation math number theory

B"During the hypnosis session, Nicholas suddenly remembered a positive integer n , which doesn't contain zeros in decimal notation. Soon, when he returned home, he got curious: what is the maximum number of digits that can be removed from the number so that the number becomes not prime, that is, either composite or equal to one? For some numbers doing so is impossible: for example, for number 53 it's impossible to delete some of its digits to obtain a not prime integer. However, for all n in the test cases of this problem, it's guaranteed that it's possible to delete some of their digits to obtain a not prime number. Note that you cannot remove all the digits from the number. A prime number is a number that has no divisors except one and itself. A composite is a number that has more than two divisors. 1 is neither a prime nor a composite number. Each test contains multiple test cases. The first line contains one positive integer t ( 1 <= t <= 10^3 ), denoting the number of test cases. Description of the test cases follows. The first line of each test case contains one positive integer k ( 1 <= k <= 50 ) -- the number of digits in the number. The second line of each test case contains a positive integer n , which doesn't contain zeros in decimal notation ( 10^{k-1} <= n < 10^{k} ). It is guaranteed that it is always possible to remove less than k digits to make the number not prime. It is guaranteed that the sum of k over all test cases does not exceed 10^4 . For every test case, print two numbers in two lines. In the first line print the number of digits, that you have left in the number. In the second line print the digits left after all delitions. If there are multiple solutions, print any. In the first test case, you can't delete 2 digits from the number 237 , as all the numbers 2 , 3 , and 7 are prime. However, you can delete 1 digit, obtaining "...

Tutorials

Editorial of Codeforces Round 741 (Div. 2)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
127136421 ssvb B Aug. 26, 2021, 7:04 p.m. OK D TESTS 12 30 4710400
127161581 murali_33 B Aug. 27, 2021, 5:23 a.m. OK GNU C11 TESTS 12 30 3686400
127160328 Bargav B Aug. 27, 2021, 5:05 a.m. OK GNU C11 TESTS 12 30 3686400
127148989 ajwquestion B Aug. 27, 2021, 1:41 a.m. OK GNU C11 TESTS 12 31 3686400
127133557 ThursdayLoser B Aug. 26, 2021, 6:25 p.m. OK GNU C11 TESTS 12 31 3686400
127151009 Harsh768 B Aug. 27, 2021, 2:24 a.m. OK GNU C++14 TESTS 12 15 3686400
127154561 88alchemist88 B Aug. 27, 2021, 3:29 a.m. OK GNU C++14 TESTS 12 15 3686400
127153916 KaranBardhan B Aug. 27, 2021, 3:19 a.m. OK GNU C++14 TESTS 12 15 3686400
127153153 Sparsh-123 B Aug. 27, 2021, 3:06 a.m. OK GNU C++14 TESTS 12 15 3686400
127152339 _Shagun B Aug. 27, 2021, 2:51 a.m. OK GNU C++14 TESTS 12 15 3686400
127152177 PsephurusGladius B Aug. 27, 2021, 2:48 a.m. OK GNU C++14 TESTS 12 15 3686400
127163150 20203246 B Aug. 27, 2021, 5:47 a.m. OK GNU C++14 TESTS 12 15 3686400
127162885 sumitverma B Aug. 27, 2021, 5:43 a.m. OK GNU C++14 TESTS 12 15 3686400
127162585 devp_pro B Aug. 27, 2021, 5:38 a.m. OK GNU C++14 TESTS 12 15 3686400
127155766 ddevarshee12 B Aug. 27, 2021, 3:50 a.m. OK GNU C++14 TESTS 12 15 3686400
127162122 docflex B Aug. 27, 2021, 5:31 a.m. OK GNU C++17 TESTS 12 15 3686400
127162056 __shinchan__ B Aug. 27, 2021, 5:30 a.m. OK GNU C++17 TESTS 12 15 3686400
127161363 shreyas_171 B Aug. 27, 2021, 5:20 a.m. OK GNU C++17 TESTS 12 15 3686400
127160982 LEGENDVISHAL07 B Aug. 27, 2021, 5:14 a.m. OK GNU C++17 TESTS 12 15 3686400
127160773 saras_2299 B Aug. 27, 2021, 5:12 a.m. OK GNU C++17 TESTS 12 15 3686400
127160712 mahfuz31 B Aug. 27, 2021, 5:11 a.m. OK GNU C++17 TESTS 12 15 3686400
127163610 w-- B Aug. 27, 2021, 5:53 a.m. OK GNU C++17 TESTS 12 15 3686400
127163351 govardhanshah456 B Aug. 27, 2021, 5:49 a.m. OK GNU C++17 TESTS 12 15 3686400
127162794 _nidhi_ B Aug. 27, 2021, 5:42 a.m. OK GNU C++17 TESTS 12 15 3686400
127162333 akshat_1911 B Aug. 27, 2021, 5:34 a.m. OK GNU C++17 TESTS 12 15 3686400
127160815 sksinghal17 B Aug. 27, 2021, 5:12 a.m. OK GNU C++17 (64) TESTS 12 15 4300800
127163941 Joaquin144 B Aug. 27, 2021, 5:57 a.m. OK GNU C++17 (64) TESTS 12 15 4300800
127163066 Aratab B Aug. 27, 2021, 5:45 a.m. OK GNU C++17 (64) TESTS 12 15 4300800
127162342 CHIN2 B Aug. 27, 2021, 5:35 a.m. OK GNU C++17 (64) TESTS 12 15 4300800
127162316 vikash_007 B Aug. 27, 2021, 5:34 a.m. OK GNU C++17 (64) TESTS 12 15 4300800
127162225 TanayKulkarni B Aug. 27, 2021, 5:33 a.m. OK GNU C++17 (64) TESTS 12 15 4300800
127161362 dutinmeow B Aug. 27, 2021, 5:20 a.m. OK GNU C++17 (64) TESTS 12 15 4300800
127160492 Nokimochi B Aug. 27, 2021, 5:08 a.m. OK GNU C++17 (64) TESTS 12 15 4300800
127159168 chthon B Aug. 27, 2021, 4:49 a.m. OK GNU C++17 (64) TESTS 12 15 4300800
127158534 AfLZK B Aug. 27, 2021, 4:38 a.m. OK GNU C++17 (64) TESTS 12 15 4300800
127154190 huangxuepeng B Aug. 27, 2021, 3:24 a.m. OK Go TESTS 12 62 10649600
127132891 bikramB01 B Aug. 26, 2021, 6:18 p.m. OK Java 11 TESTS 12 171 23756800
127138533 iamsoumik B Aug. 26, 2021, 7:40 p.m. OK Java 11 TESTS 12 171 23859200
127137238 MoonCoder1234 B Aug. 26, 2021, 7:18 p.m. OK Java 11 TESTS 12 171 23859200
127155725 SaberXpro B Aug. 27, 2021, 3:49 a.m. OK Java 11 TESTS 12 186 24166400
127135600 5612 B Aug. 26, 2021, 6:52 p.m. OK Java 11 TESTS 12 187 23756800
127122040 manav00 B Aug. 26, 2021, 4:41 p.m. OK Java 11 TESTS 12 187 23756800
127156584 Arjun-Ichiban B Aug. 27, 2021, 4:03 a.m. OK Java 11 TESTS 12 187 24371200
127133830 bittubittu B Aug. 26, 2021, 6:29 p.m. OK Java 11 TESTS 12 187 25292800
127156001 shivam29702 B Aug. 27, 2021, 3:54 a.m. OK Java 11 TESTS 12 187 35123200
127122927 shininghyunho B Aug. 26, 2021, 4:43 p.m. OK Java 11 TESTS 12 202 23756800
127136164 arjunbhatt670 B Aug. 26, 2021, 7 p.m. OK Java 8 TESTS 12 108 20480000
127128571 harsh_03_m B Aug. 26, 2021, 5:43 p.m. OK Java 8 TESTS 12 108 20992000
127128819 slow.coder B Aug. 26, 2021, 5:45 p.m. OK Java 8 TESTS 12 109 20377600
127151918 aggarwalanshul01 B Aug. 27, 2021, 2:43 a.m. OK Java 8 TESTS 12 109 20480000
127131453 slow.coder B Aug. 26, 2021, 6:04 p.m. OK Java 8 TESTS 12 109 20480000
127151021 SubhaniSk7 B Aug. 27, 2021, 2:24 a.m. OK Java 8 TESTS 12 124 20480000
127150086 amit_roy B Aug. 27, 2021, 2:05 a.m. OK Java 8 TESTS 12 124 20480000
127139863 PRIYANSH_TOMAR B Aug. 26, 2021, 8:09 p.m. OK Java 8 TESTS 12 124 20480000
127139512 pdk.abhishek B Aug. 26, 2021, 8:02 p.m. OK Java 8 TESTS 12 124 20480000
127122137 DarkAster B Aug. 26, 2021, 4:41 p.m. OK Java 8 TESTS 12 124 20480000
127122246 hitmyer B Aug. 26, 2021, 4:41 p.m. OK Kotlin TESTS 12 156 21094400
127155661 didadida B Aug. 27, 2021, 3:48 a.m. OK MS C++ 2017 TESTS 12 15 3788800
127143903 d3l3t3_my_l1f3 B Aug. 26, 2021, 10:28 p.m. OK MS C++ 2017 TESTS 12 30 3686400
127133815 INVEdge B Aug. 26, 2021, 6:29 p.m. OK MS C++ 2017 TESTS 12 30 3788800
127121877 marilova B Aug. 26, 2021, 4:40 p.m. OK MS C++ 2017 TESTS 12 30 3788800
127159471 LeterCall B Aug. 27, 2021, 4:53 a.m. OK MS C++ 2017 TESTS 12 31 3686400
127155377 JJMV B Aug. 27, 2021, 3:44 a.m. OK MS C++ 2017 TESTS 12 31 3686400
127147694 xing_sang1 B Aug. 27, 2021, 1:11 a.m. OK MS C++ 2017 TESTS 12 31 3686400
127146460 LordM B Aug. 27, 2021, 12:31 a.m. OK MS C++ 2017 TESTS 12 31 3788800
127144864 James_Lee B Aug. 26, 2021, 11:15 p.m. OK MS C++ 2017 TESTS 12 31 3788800
127142660 astrodol B Aug. 26, 2021, 9:35 p.m. OK MS C++ 2017 TESTS 12 31 3788800
127147992 guanghechen B Aug. 27, 2021, 1:19 a.m. OK Node.js TESTS 12 62 30822400
127133644 shajith_ham B Aug. 26, 2021, 6:27 p.m. OK PyPy 3 TESTS 12 139 25190400
127133602 F3NR1R B Aug. 26, 2021, 6:26 p.m. OK PyPy 3 TESTS 12 139 25190400
127134633 akshitm16 B Aug. 26, 2021, 6:39 p.m. OK PyPy 3 TESTS 12 140 24166400
127133914 Granebo B Aug. 26, 2021, 6:30 p.m. OK PyPy 3 TESTS 12 140 24166400
127145237 codicon wizwilzo B Aug. 26, 2021, 11:36 p.m. OK PyPy 3 TESTS 12 155 24166400
127147798 M0u1ea5 B Aug. 27, 2021, 1:14 a.m. OK PyPy 3 TESTS 12 155 24268800
127160703 behindyou B Aug. 27, 2021, 5:11 a.m. OK PyPy 3 TESTS 12 156 24576000
127124669 _SODA B Aug. 26, 2021, 4:47 p.m. OK PyPy 3 TESTS 12 171 24268800
127140966 Het_Fadia B Aug. 26, 2021, 8:39 p.m. OK PyPy 3 TESTS 12 171 25292800
127156598 kojihashimoto B Aug. 27, 2021, 4:04 a.m. OK PyPy 3 TESTS 12 186 24678400
127163193 Sam._.072 B Aug. 27, 2021, 5:47 a.m. OK Python 3 TESTS 12 62 6963200
127133950 souvik03 B Aug. 26, 2021, 6:30 p.m. OK Python 3 TESTS 12 62 6963200
127132248 eugalt B Aug. 26, 2021, 6:11 p.m. OK Python 3 TESTS 12 62 6963200
127132142 vaibhavgoel11 B Aug. 26, 2021, 6:10 p.m. OK Python 3 TESTS 12 62 6963200
127131328 vyas_samarth11 B Aug. 26, 2021, 6:03 p.m. OK Python 3 TESTS 12 62 6963200
127128869 srinivasanpalay B Aug. 26, 2021, 5:45 p.m. OK Python 3 TESTS 12 62 6963200
127128431 eugalt B Aug. 26, 2021, 5:43 p.m. OK Python 3 TESTS 12 62 6963200
127124959 x_wolf_x B Aug. 26, 2021, 4:48 p.m. OK Python 3 TESTS 12 62 6963200
127124138 minf07l B Aug. 26, 2021, 4:46 p.m. OK Python 3 TESTS 12 62 6963200
127161499 dth13 B Aug. 27, 2021, 5:22 a.m. OK Python 3 TESTS 12 77 6963200
127162663 DMCoder B Aug. 27, 2021, 5:40 a.m. OK Rust TESTS 12 31 3788800
127136502 IvanDyachenko B Aug. 26, 2021, 7:06 p.m. OK Scala TESTS 12 514 39833600
127136229 IvanDyachenko B Aug. 26, 2021, 7:01 p.m. OK Scala TESTS 12 530 39833600

remove filters

Back to search problems