Codeforces Round 831 (Div. 1 + 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
1740 Codeforces Round 831 (Div. 1 + Div. 2) FINISHED False 9900 70231762 Oct. 29, 2022, 9:10 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 20670 ) A Factorise N+M PROGRAMMING math number theory 800

B'Pak Chanek has a prime number ^ dagger n . Find a prime number m such that n + m is not prime. ^ dagger A prime number is a number with exactly 2 factors. The first few prime numbers are 2,3,5,7,11,13, ldots . In particular, 1 is not a prime number. Each test contains multiple test cases. The first line contains an integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. The following lines contain the description of each test case. The only line of each test case contains a prime number n ( 2 <= q n <= q 10^5 ). For each test case, output a line containing a prime number m ( 2 <= q m <= q 10^5 ) such that n + m is not prime. It can be proven that under the constraints of the problem, such m always exists. If there are multiple solutions, you can output any of them. In the first test case, m = 2 , which is prime, and n + m = 7 + 2 = 9 , which is not prime. In the second test case, m = 7 , which is prime, and n + m = 2 + 7 = 9 , which is not prime. In the third test case, m = 47837 , which is prime, and n + m = 75619 + 47837 = 123456 , which is not prime. '...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
178470933 absa1am A Oct. 30, 2022, 5:08 a.m. OK C# 10 TESTS 8 93 409600 800
178470474 Andrey0947 A Oct. 30, 2022, 5 a.m. OK C# 10 TESTS 8 93 409600 800
178402284 absa1am A Oct. 29, 2022, 12:52 p.m. OK C# 10 TESTS 8 93 512000 800
178472086 guuuuuuuuuyuuuuuuuu A Oct. 30, 2022, 5:25 a.m. OK Clang++17 Diagnostics TESTS 8 109 0 800
178416889 AvidAshu A Oct. 29, 2022, 2:43 p.m. OK Clang++17 Diagnostics TESTS 8 140 0 800
178467539 vjudge5 A Oct. 30, 2022, 3:52 a.m. OK Clang++17 Diagnostics TESTS 8 155 0 800
178431289 egor.okhterov A Oct. 29, 2022, 4:43 p.m. OK Clang++20 Diagnostics TESTS 8 124 0 800
178464204 bkifhr10 A Oct. 30, 2022, 2:16 a.m. OK Clang++20 Diagnostics TESTS 8 139 0 800
178469446 lemoon_05 A Oct. 30, 2022, 4:38 a.m. OK FPC TESTS 8 46 0 800
178436700 _Gaara A Oct. 29, 2022, 5:34 p.m. OK GNU C11 TESTS 8 46 0 800
178398668 SP2003 A Oct. 29, 2022, 12:36 p.m. OK GNU C11 TESTS 8 46 0 800
178406854 Has-Borutocu A Oct. 29, 2022, 1:26 p.m. OK GNU C11 TESTS 8 46 0 800
178417040 spade3 A Oct. 29, 2022, 2:44 p.m. OK GNU C11 TESTS 8 46 0 800
178420727 namanpahwa20 A Oct. 29, 2022, 3:17 p.m. OK GNU C11 TESTS 8 46 0 800
178424506 redwan_rafio A Oct. 29, 2022, 3:51 p.m. OK GNU C11 TESTS 8 46 0 800
178426491 NNROY94 A Oct. 29, 2022, 4:09 p.m. OK GNU C11 TESTS 8 46 0 800
178463020 meimingzi1 A Oct. 30, 2022, 1:34 a.m. OK GNU C11 TESTS 8 46 0 800
178398470 Hantur A Oct. 29, 2022, 12:35 p.m. OK GNU C11 TESTS 8 61 0 800
178441974 RifatAlHasan1 A Oct. 29, 2022, 6:26 p.m. OK GNU C11 TESTS 8 62 0 800
178466414 Tom66 A Oct. 30, 2022, 3:24 a.m. OK GNU C++14 TESTS 8 0 307200 800
178466509 Tom66 A Oct. 30, 2022, 3:27 a.m. OK GNU C++14 TESTS 8 0 307200 800
178470938 AkaiLemon A Oct. 30, 2022, 5:08 a.m. OK GNU C++14 TESTS 8 15 0 800
178472079 hacker_dvd A Oct. 30, 2022, 5:25 a.m. OK GNU C++14 TESTS 8 15 0 800
178472298 gcc_adi A Oct. 30, 2022, 5:28 a.m. OK GNU C++14 TESTS 8 15 0 800
178473634 MysticCoder A Oct. 30, 2022, 5:48 a.m. OK GNU C++14 TESTS 8 15 0 800
178466047 Theidealcoder A Oct. 30, 2022, 3:13 a.m. OK GNU C++14 TESTS 8 15 0 800
178468862 xuxuxuxuxu A Oct. 30, 2022, 4:27 a.m. OK GNU C++14 TESTS 8 15 0 800
178470571 BudiArb A Oct. 30, 2022, 5:02 a.m. OK GNU C++14 TESTS 8 15 0 800
178465759 luoZH111 A Oct. 30, 2022, 3:04 a.m. OK GNU C++14 TESTS 8 15 0 800
178463912 acwing_meow A Oct. 30, 2022, 2:07 a.m. OK GNU C++17 TESTS 8 0 0 800
178428011 Dominater069 A Oct. 29, 2022, 4:23 p.m. OK GNU C++17 TESTS 8 0 0 800
178471186 SuB0Dh_ChaNdrA_SHiL A Oct. 30, 2022, 5:12 a.m. OK GNU C++17 TESTS 8 15 0 800
178474630 mayank.codeforce A Oct. 30, 2022, 6:02 a.m. OK GNU C++17 TESTS 8 15 0 800
178474498 mayank.codeforce A Oct. 30, 2022, 6 a.m. OK GNU C++17 TESTS 8 15 0 800
178473941 vjudge5 A Oct. 30, 2022, 5:52 a.m. OK GNU C++17 TESTS 8 15 0 800
178472527 BlankYang A Oct. 30, 2022, 5:32 a.m. OK GNU C++17 TESTS 8 15 0 800
178472158 one_leaf A Oct. 30, 2022, 5:26 a.m. OK GNU C++17 TESTS 8 15 0 800
178472147 Altopc A Oct. 30, 2022, 5:26 a.m. OK GNU C++17 TESTS 8 15 0 800
178471481 Anshu_nyt A Oct. 30, 2022, 5:17 a.m. OK GNU C++17 TESTS 8 15 0 800
178461258 FRIENDpr A Oct. 30, 2022, 12:22 a.m. OK GNU C++17 (64) TESTS 8 0 0 800
178471140 hithu A Oct. 30, 2022, 5:11 a.m. OK GNU C++17 (64) TESTS 8 0 0 800
178472584 411315181 A Oct. 30, 2022, 5:33 a.m. OK GNU C++17 (64) TESTS 8 0 0 800
178443035 arnav2004 A Oct. 29, 2022, 6:37 p.m. OK GNU C++17 (64) TESTS 8 0 0 800
178437183 PurpleCrayon A Oct. 29, 2022, 5:39 p.m. OK GNU C++17 (64) TESTS 8 0 0 800
178399159 izumiQR A Oct. 29, 2022, 12:38 p.m. OK GNU C++17 (64) TESTS 8 0 204800 800
178464362 1907195154 A Oct. 30, 2022, 2:22 a.m. OK GNU C++17 (64) TESTS 8 0 3584000 800
178464334 1907195154 A Oct. 30, 2022, 2:21 a.m. OK GNU C++17 (64) TESTS 8 0 3584000 800
178465373 pursuit_of_happiness A Oct. 30, 2022, 2:51 a.m. OK GNU C++17 (64) TESTS 8 0 40038400 800
178474552 AKCqhzdy A Oct. 30, 2022, 6:01 a.m. OK GNU C++17 (64) TESTS 8 15 0 800
178458410 defaultedplayer A Oct. 29, 2022, 10:33 p.m. OK GNU C++20 (64) TESTS 8 0 0 800
178471791 njwrz A Oct. 30, 2022, 5:21 a.m. OK GNU C++20 (64) TESTS 8 0 0 800
178471574 Aaravjn A Oct. 30, 2022, 5:18 a.m. OK GNU C++20 (64) TESTS 8 0 0 800
178468660 omarsalem33 A Oct. 30, 2022, 4:22 a.m. OK GNU C++20 (64) TESTS 8 0 0 800
178468432 FoolestBoy A Oct. 30, 2022, 4:16 a.m. OK GNU C++20 (64) TESTS 8 0 0 800
178468051 uwq A Oct. 30, 2022, 4:05 a.m. OK GNU C++20 (64) TESTS 8 0 0 800
178466504 Menos A Oct. 30, 2022, 3:26 a.m. OK GNU C++20 (64) TESTS 8 0 0 800
178464218 Sun_flower_ A Oct. 30, 2022, 2:17 a.m. OK GNU C++20 (64) TESTS 8 0 0 800
178462435 rxlfd314 A Oct. 30, 2022, 1:10 a.m. OK GNU C++20 (64) TESTS 8 0 0 800
178461505 Lansong A Oct. 30, 2022, 12:32 a.m. OK GNU C++20 (64) TESTS 8 0 0 800
178428701 mtarunsai1999 A Oct. 29, 2022, 4:29 p.m. OK Go TESTS 8 30 204800 800
178474368 enuguru_2002 A Oct. 30, 2022, 5:58 a.m. OK Java 11 TESTS 8 171 0 800
178470232 the_unseen A Oct. 30, 2022, 4:56 a.m. OK Java 11 TESTS 8 171 0 800
178465710 rizkyjun A Oct. 30, 2022, 3:02 a.m. OK Java 11 TESTS 8 171 0 800
178431721 doomhammer. A Oct. 29, 2022, 4:47 p.m. OK Java 11 TESTS 8 171 0 800
178390070 blackpanther79 A Oct. 29, 2022, 11:39 a.m. OK Java 11 TESTS 8 171 0 800
178436449 veerabhadra A Oct. 29, 2022, 5:32 p.m. OK Java 11 TESTS 8 187 0 800
178409061 princeayush04 A Oct. 29, 2022, 1:42 p.m. OK Java 11 TESTS 8 202 0 800
178416095 wolfy_thee_wolf A Oct. 29, 2022, 2:36 p.m. OK Java 11 TESTS 8 218 0 800
178439660 balajirudrawar123 A Oct. 29, 2022, 6:03 p.m. OK Java 11 TESTS 8 233 0 800
178437863 bajpaisharanya A Oct. 29, 2022, 5:45 p.m. OK Java 11 TESTS 8 233 0 800
178441776 merlin_ A Oct. 29, 2022, 6:24 p.m. OK Java 17 TESTS 8 187 204800 800
178434531 Thejas_n A Oct. 29, 2022, 5:14 p.m. OK Java 17 TESTS 8 202 0 800
178400523 hahahursh A Oct. 29, 2022, 12:41 p.m. OK Java 17 TESTS 8 233 0 800
178415987 Ali04 A Oct. 29, 2022, 2:35 p.m. OK Java 17 TESTS 8 233 204800 800
178464112 a_dev A Oct. 30, 2022, 2:13 a.m. OK Java 17 TESTS 8 233 409600 800
178448717 zaghaltariq007 A Oct. 29, 2022, 7:48 p.m. OK Java 17 TESTS 8 264 614400 800
178409476 _Abeke_ A Oct. 29, 2022, 1:45 p.m. OK Java 17 TESTS 8 264 614400 800
178405401 chandni139btcsai21 A Oct. 29, 2022, 1:14 p.m. OK Java 17 TESTS 8 265 921600 800
178403700 RinKonri A Oct. 29, 2022, 1:01 p.m. OK Java 17 TESTS 8 280 512000 800
178401212 maksutovnurda A Oct. 29, 2022, 12:45 p.m. OK Java 17 TESTS 8 295 102400 800
178417191 ankit_0207 A Oct. 29, 2022, 2:45 p.m. OK Java 8 TESTS 8 93 0 800
178467787 youtsuha A Oct. 30, 2022, 3:59 a.m. OK Java 8 TESTS 8 108 0 800
178438668 wadissimo A Oct. 29, 2022, 5:53 p.m. OK Java 8 TESTS 8 108 0 800
178433973 Koka A Oct. 29, 2022, 5:09 p.m. OK Java 8 TESTS 8 108 0 800
178428871 RahulAhuja2901 A Oct. 29, 2022, 4:30 p.m. OK Java 8 TESTS 8 108 0 800
178411699 lcheeme1 A Oct. 29, 2022, 2:01 p.m. OK Java 8 TESTS 8 108 0 800
178410944 52-Clowns A Oct. 29, 2022, 1:55 p.m. OK Java 8 TESTS 8 108 0 800
178398558 ikillmyself A Oct. 29, 2022, 12:35 p.m. OK Java 8 TESTS 8 108 0 800
178456386 ahmedtawfik A Oct. 29, 2022, 9:41 p.m. OK Java 8 TESTS 8 109 0 800
178446207 mohamedhassan_c A Oct. 29, 2022, 7:16 p.m. OK Java 8 TESTS 8 109 0 800
178406688 Gompu123 A Oct. 29, 2022, 1:24 p.m. OK Kotlin 1.5 TESTS 8 170 0 800
178451184 asvitha A Oct. 29, 2022, 8:05 p.m. OK MS C++ 2017 TESTS 8 15 0 800
178425758 craybeats A Oct. 29, 2022, 4:03 p.m. OK MS C++ 2017 TESTS 8 15 0 800
178398800 Autlomu A Oct. 29, 2022, 12:36 p.m. OK MS C++ 2017 TESTS 8 15 0 800
178472077 maharana1151 A Oct. 30, 2022, 5:25 a.m. OK MS C++ 2017 TESTS 8 46 0 800
178461923 Alex0304 A Oct. 30, 2022, 12:51 a.m. OK MS C++ 2017 TESTS 8 46 0 800
178445801 132001029 A Oct. 29, 2022, 7:11 p.m. OK MS C++ 2017 TESTS 8 46 0 800
178416604 Anonymous_chief A Oct. 29, 2022, 2:40 p.m. OK MS C++ 2017 TESTS 8 46 0 800
178415017 ambesh_dixit_42 A Oct. 29, 2022, 2:27 p.m. OK MS C++ 2017 TESTS 8 46 0 800
178410849 abdulkader_haffar A Oct. 29, 2022, 1:55 p.m. OK MS C++ 2017 TESTS 8 46 0 800
178437245 hot_chert A Oct. 29, 2022, 5:40 p.m. OK MS C++ 2017 TESTS 8 46 614400 800
178458422 nil0o A Oct. 29, 2022, 10:33 p.m. OK PHP TESTS 8 233 409600 800
178402835 aneesh2002 A Oct. 29, 2022, 12:56 p.m. OK PyPy 3 TESTS 8 93 2764800 800
178418112 Shirotsume A Oct. 29, 2022, 2:53 p.m. OK PyPy 3 TESTS 8 124 4300800 800
178402249 auvred A Oct. 29, 2022, 12:52 p.m. OK PyPy 3 TESTS 8 139 3379200 800
178429132 mohammadolimat A Oct. 29, 2022, 4:33 p.m. OK PyPy 3 TESTS 8 233 4608000 800
178456749 yfo A Oct. 29, 2022, 9:48 p.m. OK PyPy 3 TESTS 8 234 4710400 800
178454535 kasbievazamat A Oct. 29, 2022, 9:01 p.m. OK PyPy 3 TESTS 8 234 4710400 800
178468914 anupomkar A Oct. 30, 2022, 4:28 a.m. OK PyPy 3 TESTS 8 249 4300800 800
178445506 arihant72600 A Oct. 29, 2022, 7:07 p.m. OK PyPy 3 TESTS 8 249 4300800 800
178428741 donny1234 A Oct. 29, 2022, 4:29 p.m. OK PyPy 3 TESTS 8 249 4710400 800
178447525 vishu.ut A Oct. 29, 2022, 7:33 p.m. OK PyPy 3 TESTS 8 264 4300800 800
178405304 lx_tyin A Oct. 29, 2022, 1:14 p.m. OK PyPy 3-64 TESTS 8 46 0 800
178405877 liuaaa A Oct. 29, 2022, 1:18 p.m. OK PyPy 3-64 TESTS 8 62 0 800
178453049 A_G A Oct. 29, 2022, 8:34 p.m. OK PyPy 3-64 TESTS 8 62 4608000 800
178474366 Varad2002 A Oct. 30, 2022, 5:58 a.m. OK PyPy 3-64 TESTS 8 77 3276800 800
178405214 petyb A Oct. 29, 2022, 1:13 p.m. OK PyPy 3-64 TESTS 8 77 4505600 800
178428012 Girniiiii A Oct. 29, 2022, 4:23 p.m. OK PyPy 3-64 TESTS 8 77 5427200 800
178404026 biglunchdude A Oct. 29, 2022, 1:04 p.m. OK PyPy 3-64 TESTS 8 77 6246400 800
178402694 Neothehero A Oct. 29, 2022, 12:55 p.m. OK PyPy 3-64 TESTS 8 93 3993600 800
178428465 blue_ice_yj A Oct. 29, 2022, 4:27 p.m. OK PyPy 3-64 TESTS 8 93 4300800 800
178394598 gesuta A Oct. 29, 2022, 11:53 a.m. OK PyPy 3-64 TESTS 8 93 4915200 800
178463601 alidiab22 A Oct. 30, 2022, 1:56 a.m. OK Python 3 TESTS 8 46 0 800
178402438 lx_tyin A Oct. 29, 2022, 12:53 p.m. OK Python 3 TESTS 8 46 0 800
178444304 AutumnShell A Oct. 29, 2022, 6:52 p.m. OK Python 3 TESTS 8 46 204800 800
178443856 AutumnShell A Oct. 29, 2022, 6:46 p.m. OK Python 3 TESTS 8 46 307200 800
178444062 AutumnShell A Oct. 29, 2022, 6:49 p.m. OK Python 3 TESTS 8 61 0 800
178436735 ralexeev77 A Oct. 29, 2022, 5:35 p.m. OK Python 3 TESTS 8 62 0 800
178443593 AutumnShell A Oct. 29, 2022, 6:43 p.m. OK Python 3 TESTS 8 62 307200 800
178406363 MohamedHamed123 A Oct. 29, 2022, 1:22 p.m. OK Python 3 TESTS 8 62 307200 800
178402447 xiaobaibai123 A Oct. 29, 2022, 12:53 p.m. OK Python 3 TESTS 8 62 307200 800
178401710 zubayr-ahmad A Oct. 29, 2022, 12:48 p.m. OK Python 3 TESTS 8 77 0 800
178418924 jcowgill A Oct. 29, 2022, 3 p.m. OK Rust 2021 TESTS 8 93 0 800

remove filters

Back to search problems