Codeforces Round 166 (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
271 Codeforces Round 166 (Div. 2) FINISHED False 7200 376929023 Feb. 11, 2013, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 13384 ) B Prime Matrix PROGRAMMING binary search brute force math number theory 1400

B"You've got an n xe2 x80 x89 xc3 x97 xe2 x80 x89m matrix. The matrix consists of integers. In one move, you can apply a single transformation to the matrix: choose an arbitrary element of the matrix and increase it by 1. Each element can be increased an arbitrary number of times. You are really curious about prime numbers. Let us remind you that a prime number is a positive integer that has exactly two distinct positive integer divisors: itself and number one. For example, numbers 2, 3, 5 are prime and numbers 1, 4, 6 are not. A matrix is prime if at least one of the two following conditions fulfills: Your task is to count the minimum number of moves needed to get a prime matrix from the one you've got. The first line contains two integers n, xe2 x80 x89m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89500) -- the number of rows and columns in the matrix, correspondingly. Each of the following n lines contains m integers -- the initial matrix. All matrix elements are positive integers. All numbers in the initial matrix do not exceed 105. The numbers in the lines are separated by single spaces. Print a single integer -- the minimum number of moves needed to get a prime matrix from the one you've got. If you've got a prime matrix, print 0. In the first sample you need to increase number 1 in cell (1, 1). Thus, the first row will consist of prime numbers: 2, 2, 3. In the second sample you need to increase number 8 in cell (1, 2) three times. Thus, the second column will consist of prime numbers: 11, 2. In the third sample you don't have to do anything as the second column already consists of prime numbers: 3, 2. "...

Tutorials

editroal

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
57379362 vjudge4 B July 20, 2019, 1:56 p.m. OK Clang++17 Diagnostics TESTS 42 1622 19046400 1400
37023243 xXLucarioXx B April 6, 2018, 2:15 p.m. OK GNU C TESTS 42 498 4403200 1400
37022882 xXLucarioXx B April 6, 2018, 2:02 p.m. OK GNU C TESTS 42 530 4403200 1400
39052637 vjudge2 B June 8, 2018, 6:19 p.m. OK GNU C++ TESTS 42 62 1638400 1400
39504910 Patti B June 22, 2018, 3:52 a.m. OK GNU C++ TESTS 42 62 2252800 1400
39691712 Andy20070106 B June 27, 2018, 5:28 a.m. OK GNU C++ TESTS 42 62 2252800 1400
39596317 Andy20070106 B June 24, 2018, 9:04 a.m. OK GNU C++ TESTS 42 62 2252800 1400
38306056 Scut82 B May 16, 2018, 2:05 a.m. OK GNU C++ TESTS 42 62 5427200 1400
38306165 Scut82 B May 16, 2018, 2:14 a.m. OK GNU C++ TESTS 42 62 6451200 1400
36219796 NEU_Karl B March 12, 2018, 10:06 a.m. OK GNU C++ TESTS 42 62 8294400 1400
27846802 Scut82 B June 17, 2017, 1:31 p.m. OK GNU C++ TESTS 42 92 2048000 1400
29305158 vjudge2 B Aug. 9, 2017, 12:06 p.m. OK GNU C++ TESTS 42 92 2457600 1400
28109729 ghoshsai5000 B June 28, 2017, 6:57 a.m. OK GNU C++ TESTS 42 92 3584000 1400
62223834 You_Know_Who B Oct. 9, 2019, 6:24 p.m. OK GNU C11 TESTS 42 92 1536000 1400
52796020 jalalium B April 15, 2019, 8:44 p.m. OK GNU C11 TESTS 42 122 1433600 1400
62238814 kaiboy B Oct. 10, 2019, 12:24 a.m. OK GNU C11 TESTS 42 122 2048000 1400
45473320 mini4141 B Nov. 9, 2018, 11:12 a.m. OK GNU C11 TESTS 42 122 2764800 1400
49684660 838889732 B Feb. 10, 2019, 6:14 a.m. OK GNU C11 TESTS 42 124 1433600 1400
43400628 nirjhorJU B Sept. 25, 2018, 8:25 a.m. OK GNU C11 TESTS 42 124 1945600 1400
62715927 akash19jain B Oct. 16, 2019, 3:55 p.m. OK GNU C11 TESTS 42 124 2867200 1400
69281817 mth1908 B Jan. 22, 2020, 6:18 a.m. OK GNU C11 TESTS 42 124 2867200 1400
55791722 Cloud_ B June 19, 2019, 4:47 p.m. OK GNU C11 TESTS 42 154 409600 1400
43023915 vjudge5 B Sept. 18, 2018, 7:23 a.m. OK GNU C11 TESTS 42 154 1740800 1400
64048124 vjudge1 B Nov. 1, 2019, 8:14 p.m. OK GNU C++11 TESTS 42 92 0 1400
66680788 vjudge2 B Dec. 12, 2019, 1:02 p.m. OK GNU C++11 TESTS 42 92 921600 1400
49398471 Lu_Anlai B Feb. 3, 2019, 1:32 p.m. OK GNU C++11 TESTS 42 92 921600 1400
67155074 Peppa_king_8 B Dec. 18, 2019, 12:13 p.m. OK GNU C++11 TESTS 42 92 1536000 1400
50593617 UESTC_Forsaken B Feb. 28, 2019, 8:54 a.m. OK GNU C++11 TESTS 42 92 3072000 1400
45313174 LLL_2820 B Nov. 5, 2018, 6:14 a.m. OK GNU C++11 TESTS 42 92 6144000 1400
46363723 vjudge3 B Nov. 29, 2018, 12:16 p.m. OK GNU C++11 TESTS 42 122 819200 1400
67597917 vjudge5 B Dec. 25, 2019, 10:55 a.m. OK GNU C++11 TESTS 42 122 1228800 1400
31833525 Amr.Gouhar B Oct. 28, 2017, 11:13 a.m. OK GNU C++11 TESTS 42 122 1228800 1400
46634385 Juww B Dec. 5, 2018, 5:46 a.m. OK GNU C++11 TESTS 42 122 1331200 1400
36061734 vjudge5 B March 8, 2018, 5:47 a.m. OK GNU C++14 TESTS 42 92 10137600 1400
27710308 vinayjaisinghani B June 10, 2017, 7:27 p.m. OK GNU C++14 TESTS 42 122 1228800 1400
29779138 AMnu B Aug. 25, 2017, 12:34 p.m. OK GNU C++14 TESTS 42 124 512000 1400
57599931 M.Soliman B July 23, 2019, 3:22 p.m. OK GNU C++14 TESTS 42 124 819200 1400
27409164 vjudge2 B May 28, 2017, 10:24 a.m. OK GNU C++14 TESTS 42 124 1638400 1400
45796300 ljx19990328 B Nov. 16, 2018, 10:57 a.m. OK GNU C++14 TESTS 42 124 2252800 1400
68127207 Mel1odas B Jan. 3, 2020, 3:37 p.m. OK GNU C++14 TESTS 42 124 2355200 1400
66244519 racsosabe B Dec. 3, 2019, 7:46 p.m. OK GNU C++14 TESTS 42 124 2662400 1400
49337521 AsassinCreed B Feb. 1, 2019, 7:24 p.m. OK GNU C++14 TESTS 42 124 2764800 1400
33612948 Volkov_Ivan B Dec. 25, 2017, 9:29 a.m. OK GNU C++14 TESTS 42 124 3379200 1400
67470574 vjudge1 B Dec. 23, 2019, 12:39 p.m. OK GNU C++17 TESTS 42 122 1843200 1400
45857758 vjudge2 B Nov. 17, 2018, 3:18 a.m. OK GNU C++17 TESTS 42 122 2252800 1400
43639122 Jaihk662 B Oct. 1, 2018, 10:20 a.m. OK GNU C++17 TESTS 42 124 1433600 1400
54792523 algotron B May 29, 2019, 7:48 a.m. OK GNU C++17 TESTS 42 124 1536000 1400
67290336 vjudge4 B Dec. 20, 2019, 3:25 p.m. OK GNU C++17 TESTS 42 124 1843200 1400
66679089 vjudge4 B Dec. 12, 2019, 12:26 p.m. OK GNU C++17 TESTS 42 124 1843200 1400
62094429 vjudge4 B Oct. 8, 2019, 6:59 a.m. OK GNU C++17 TESTS 42 124 2150400 1400
46142068 Nadim_brur B Nov. 24, 2018, 7:02 a.m. OK GNU C++17 TESTS 42 124 5017600 1400
49979279 Surya_41 B Feb. 16, 2019, 7:31 a.m. OK GNU C++17 TESTS 42 154 102400 1400
57941549 nikits B July 29, 2019, 12:45 p.m. OK GNU C++17 TESTS 42 154 102400 1400
64048911 vjudge2 B Nov. 1, 2019, 8:35 p.m. OK Go TESTS 42 218 0 1400
65495474 NGUYEN_THANH_LOI B Nov. 21, 2019, 4:23 p.m. OK Go TESTS 42 404 4505600 1400
69542964 YahiaMostafa B Jan. 25, 2020, 11:05 p.m. OK Java 11 TESTS 42 592 0 1400
64045681 memoTana B Nov. 1, 2019, 7:20 p.m. OK Java 11 TESTS 42 810 16691200 1400
51476196 yaminote B March 19, 2019, 9:32 a.m. OK Java 8 TESTS 42 280 0 1400
30968177 jack04 B Oct. 3, 2017, 1:15 p.m. OK Java 8 TESTS 42 280 0 1400
43543364 bhautik_77 B Sept. 28, 2018, 6:04 p.m. OK Java 8 TESTS 42 310 0 1400
68030134 shefali163 B Jan. 1, 2020, 8:45 a.m. OK Java 8 TESTS 42 310 0 1400
62894847 HashHakim B Oct. 18, 2019, 10:55 p.m. OK Java 8 TESTS 42 310 0 1400
47024996 sameer_hack B Dec. 15, 2018, 6:17 a.m. OK Java 8 TESTS 42 310 0 1400
28986154 rizqyfaishal272 B July 30, 2017, 8:33 a.m. OK Java 8 TESTS 42 312 20582400 1400
57628615 Seco_seco B July 24, 2019, 7:59 a.m. OK Java 8 TESTS 42 340 0 1400
45068426 Mohd. B Oct. 29, 2018, 6:20 p.m. OK Java 8 TESTS 42 340 0 1400
41108319 aavakaaya B Aug. 2, 2018, 5:31 a.m. OK Java 8 TESTS 42 342 0 1400
51041145 nemars B March 8, 2019, 5:02 p.m. OK Mono C# TESTS 42 312 11059200 1400
62412616 teru B Oct. 12, 2019, 10:47 a.m. OK Mono C# TESTS 42 340 11161600 1400
28294797 artsin666 B July 5, 2017, 5:31 a.m. OK MS C# TESTS 42 248 14438400 1400
29491693 ShowStopper728 B Aug. 15, 2017, 8:39 p.m. OK MS C# TESTS 42 748 15769600 1400
29200334 ShowStopper728 B Aug. 4, 2017, 5:22 p.m. OK MS C# TESTS 42 780 15872000 1400
48781495 ymz6666 B Jan. 23, 2019, 7:01 a.m. OK MS C++ TESTS 42 92 1536000 1400
48781470 ymz6666 B Jan. 23, 2019, 7 a.m. OK MS C++ TESTS 42 92 1638400 1400
45796701 vjudge3 B Nov. 16, 2018, 11:14 a.m. OK MS C++ TESTS 42 92 2252800 1400
48792187 ymz6666 B Jan. 23, 2019, 11:17 a.m. OK MS C++ TESTS 42 122 1536000 1400
48790536 law6666 B Jan. 23, 2019, 11:08 a.m. OK MS C++ TESTS 42 122 1536000 1400
64041341 vjudge5 B Nov. 1, 2019, 5:59 p.m. OK MS C++ TESTS 42 124 102400 1400
64066633 vjudge2 B Nov. 2, 2019, 6:01 a.m. OK MS C++ TESTS 42 124 102400 1400
64053450 vjudge3 B Nov. 1, 2019, 11:25 p.m. OK MS C++ TESTS 42 124 102400 1400
64043888 vjudge1 B Nov. 1, 2019, 6:45 p.m. OK MS C++ TESTS 42 124 102400 1400
66679888 vjudge5 B Dec. 12, 2019, 12:43 p.m. OK MS C++ TESTS 42 124 1433600 1400
64047451 charlhye B Nov. 1, 2019, 8 p.m. OK MS C++ 2017 TESTS 42 186 102400 1400
64074627 vjudge4 B Nov. 2, 2019, 8:27 a.m. OK MS C++ 2017 TESTS 42 186 1536000 1400
64042234 vjudge5 B Nov. 1, 2019, 6:13 p.m. OK MS C++ 2017 TESTS 42 404 1433600 1400
64042142 vjudge5 B Nov. 1, 2019, 6:12 p.m. OK MS C++ 2017 TESTS 42 404 1433600 1400
64066245 cuenta.xbox99 B Nov. 2, 2019, 5:53 a.m. OK MS C++ 2017 TESTS 42 404 1843200 1400
64066637 vjudge4 B Nov. 2, 2019, 6:01 a.m. OK MS C++ 2017 TESTS 42 404 1945600 1400
64066133 cuenta.xbox99 B Nov. 2, 2019, 5:51 a.m. OK MS C++ 2017 TESTS 42 404 2048000 1400
67623838 vjudge2 B Dec. 25, 2019, 8:16 p.m. OK MS C++ 2017 TESTS 42 404 2355200 1400
64055662 vjudge2 B Nov. 2, 2019, 1:14 a.m. OK MS C++ 2017 TESTS 42 404 2355200 1400
64055674 alepv B Nov. 2, 2019, 1:14 a.m. OK MS C++ 2017 TESTS 42 404 3276800 1400
29335230 sambit25 B Aug. 10, 2017, 5:21 p.m. OK PyPy 2 TESTS 42 342 24985600 1400
55748045 markovDPro B June 19, 2019, 11:09 a.m. OK PyPy 2 TESTS 42 498 9932800 1400
66156333 aeternalis1 B Dec. 1, 2019, 10:56 p.m. OK PyPy 2 TESTS 42 592 4812800 1400
68415112 vishwesh18 B Jan. 8, 2020, 6:32 p.m. OK PyPy 3 TESTS 42 590 8396800 1400
68122885 Catalyst259 B Jan. 3, 2020, 2:01 p.m. OK PyPy 3 TESTS 42 654 9625600 1400
64469909 KrishRawat B Nov. 7, 2019, 12:47 p.m. OK PyPy 3 TESTS 42 778 12083200 1400
62318958 lIn_nIl B Oct. 10, 2019, 4:07 p.m. OK PyPy 3 TESTS 42 780 9830400 1400
36464657 Schullz B March 21, 2018, 8:59 p.m. OK PyPy 3 TESTS 42 780 33996800 1400
69544119 beethoven97 B Jan. 26, 2020, 12:25 a.m. OK PyPy 3 TESTS 42 872 15974400 1400
62894819 JProgrammer B Oct. 18, 2019, 10:54 p.m. OK PyPy 3 TESTS 42 904 17408000 1400
68316436 Roshixa B Jan. 6, 2020, 1:23 p.m. OK PyPy 3 TESTS 42 1090 19456000 1400
55943955 kgmkr00001 B June 22, 2019, 6:25 p.m. OK PyPy 3 TESTS 42 1278 35020800 1400
38202716 homoeconomicus B May 13, 2018, 11:57 p.m. OK PyPy 3 TESTS 42 1496 30105600 1400
35856560 ______u______ B March 2, 2018, 8:22 p.m. OK Python 2 TESTS 42 654 10854400 1400
35856505 ______n______ B March 2, 2018, 8:22 p.m. OK Python 2 TESTS 42 654 10854400 1400
35855738 _____i_____ B March 2, 2018, 8:06 p.m. OK Python 2 TESTS 42 654 10854400 1400
35855706 _____k_____ B March 2, 2018, 8:06 p.m. OK Python 2 TESTS 42 654 10854400 1400
35844586 ______h______ B March 2, 2018, 3:32 p.m. OK Python 2 TESTS 42 654 10854400 1400
35844460 ______k______ B March 2, 2018, 3:30 p.m. OK Python 2 TESTS 42 654 10854400 1400
35844181 ______i______ B March 2, 2018, 3:25 p.m. OK Python 2 TESTS 42 654 10854400 1400
35842250 ______M______ B March 2, 2018, 2:49 p.m. OK Python 2 TESTS 42 654 10854400 1400
64055756 vjudge2 B Nov. 2, 2019, 1:18 a.m. OK Python 2 TESTS 42 1060 6451200 1400
35462953 laoliumang B Feb. 19, 2018, 6:06 a.m. OK Python 2 TESTS 42 1122 11571200 1400
42124404 Mk_Python_v1 B Aug. 26, 2018, 2:15 p.m. OK Python 3 TESTS 42 498 2355200 1400
49616904 KanhuKeNanu B Feb. 8, 2019, 6:45 a.m. OK Python 3 TESTS 42 592 7475200 1400
67439528 ishmumkhan1234 B Dec. 22, 2019, 6:37 p.m. OK Python 3 TESTS 42 624 10137600 1400
37253963 nowyyz B April 12, 2018, 2:49 p.m. OK Python 3 TESTS 42 686 7987200 1400
53538385 vjudge2 B April 30, 2019, 4:43 a.m. OK Python 3 TESTS 42 716 4198400 1400
65444786 vovik123 B Nov. 20, 2019, 3:34 p.m. OK Python 3 TESTS 42 936 6656000 1400
53664011 Mohamed_Ayman B May 2, 2019, 9:22 a.m. OK Python 3 TESTS 42 966 6451200 1400
61326297 bergus B Sept. 26, 2019, 1:49 p.m. OK Python 3 TESTS 42 966 6656000 1400
64045976 AlexNaunt5 B Nov. 1, 2019, 7:27 p.m. OK Python 3 TESTS 42 966 6758400 1400
63381076 MinecraftFuns B Oct. 25, 2019, 12:29 p.m. OK Python 3 TESTS 42 966 6758400 1400

remove filters

Back to search problems