CodeCraft-21 and Codeforces Round 711 (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
1498 CodeCraft-21 and Codeforces Round 711 (Div. 2) FINISHED False 7200 114794699 March 29, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 23346 ) A GCD Sum PROGRAMMING brute force math

B'The text{ gcdSum } of a positive integer is the gcd of that integer with its sum of digits. Formally, text{ gcdSum }(x) = gcd(x, text{ sum of digits of } x) for a positive integer x . gcd(a, b) denotes the greatest common divisor of a and b -- the largest integer d such that both integers a and b are divisible by d . For example: text{ gcdSum }(762) = gcd(762, 7 + 6 + 2)=gcd(762,15) = 3 . Given an integer n , find the smallest integer x ge n such that text{ gcdSum }(x) > 1 . The first line of input contains one integer t (1 <= t <= 10^4) -- the number of test cases. Then t lines follow, each containing a single integer n (1 <= n <= 10^{18}) . All test cases in one test are different. Output t lines, where the i -th line is a single integer containing the answer to the i -th test case. Let us explain the three test cases in the sample. Test case 1: n = 11 : text{ gcdSum }(11) = gcd(11, 1 + 1) = gcd(11, 2) = 1 . text{ gcdSum }(12) = gcd(12, 1 + 2) = gcd(12, 3) = 3 . So the smallest number ge 11 whose gcdSum > 1 is 12 . Test case 2: n = 31 : text{ gcdSum }(31) = gcd(31, 3 + 1) = gcd(31, 4) = 1 . text{ gcdSum }(32) = gcd(32, 3 + 2) = gcd(32, 5) = 1 . text{ gcdSum }(33) = gcd(33, 3 + 3) = gcd(33, 6) = 3 . So the smallest number ge 31 whose gcdSum > 1 is 33 . Test case 3: n = 75 : text{ gcdSum }(75) = gcd(75, 7 + 5) = gcd(75, 12) = 3 . The text{ gcdSum } of 75 is already > 1 . Hence, it is the answer. '...

Tutorials

CodeCraft-21 and Codeforces Round #711 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
111436306 wweihao.zj A March 30, 2021, 5:10 a.m. OK Clang++17 Diagnostics TESTS 5 218 0
111395644 preshitha1 A March 29, 2021, 4:04 p.m. OK GNU C11 TESTS 5 61 0
111400500 pranay_32 A March 29, 2021, 4:22 p.m. OK GNU C11 TESTS 5 61 0
111409965 Faruk01 A March 29, 2021, 5:48 p.m. OK GNU C11 TESTS 5 61 0
111410023 old_soul A March 29, 2021, 5:49 p.m. OK GNU C11 TESTS 5 61 0
111418177 nilavasarkarkol56 A March 29, 2021, 7:50 p.m. OK GNU C11 TESTS 5 61 0
111437333 CastleBravo A March 30, 2021, 5:27 a.m. OK GNU C11 TESTS 5 62 0
111402252 wszdbha A March 29, 2021, 4:29 p.m. OK GNU C11 TESTS 5 62 0
111426846 Shirasawa A March 30, 2021, 12:54 a.m. OK GNU C11 TESTS 5 62 0
111433745 manish_1605 A March 30, 2021, 4:21 a.m. OK GNU C11 TESTS 5 62 0
111400651 Akshit_Gureja A March 29, 2021, 4:23 p.m. OK GNU C11 TESTS 5 62 204800
111434700 Eason_AC A March 30, 2021, 4:40 a.m. OK GNU C++11 TESTS 5 15 0
111431294 fallow.man A March 30, 2021, 3:21 a.m. OK GNU C++11 TESTS 5 15 0
111429230 liujia123456 A March 30, 2021, 2:24 a.m. OK GNU C++11 TESTS 5 15 0
111428149 leapfrog A March 30, 2021, 1:48 a.m. OK GNU C++11 TESTS 5 30 0
111427083 NickJerome A March 30, 2021, 1:06 a.m. OK GNU C++11 TESTS 5 30 0
111426221 ArvinCiu A March 30, 2021, 12:29 a.m. OK GNU C++11 TESTS 5 30 0
111427039 sky123 A March 30, 2021, 1:03 a.m. OK GNU C++11 TESTS 5 30 0
111425668 liufuhang A March 30, 2021, 12:04 a.m. OK GNU C++11 TESTS 5 30 0
111429659 Dubhep A March 30, 2021, 2:37 a.m. OK GNU C++11 TESTS 5 30 0
111438073 Huah A March 30, 2021, 5:38 a.m. OK GNU C++11 TESTS 5 30 0
111439389 vinaydahiya04 A March 30, 2021, 5:59 a.m. OK GNU C++14 TESTS 5 15 0
111429726 Evil_Hunter A March 30, 2021, 2:39 a.m. OK GNU C++14 TESTS 5 15 0
111424799 HanTroid A March 29, 2021, 11:17 p.m. OK GNU C++14 TESTS 5 15 0
111418049 rishab_g30 A March 29, 2021, 7:47 p.m. OK GNU C++14 TESTS 5 15 0
111407181 adityarajiv A March 29, 2021, 5:17 p.m. OK GNU C++14 TESTS 5 15 0
111405602 rishisgsits_22 A March 29, 2021, 5:06 p.m. OK GNU C++14 TESTS 5 15 0
111436017 pedastrian57 A March 30, 2021, 5:05 a.m. OK GNU C++14 TESTS 5 30 0
111438098 aditya3356 A March 30, 2021, 5:39 a.m. OK GNU C++14 TESTS 5 30 0
111439196 m0t9_ A March 30, 2021, 5:56 a.m. OK GNU C++14 TESTS 5 30 0
111439899 mahim_mittal A March 30, 2021, 6:07 a.m. OK GNU C++14 TESTS 5 30 0
111416265 ishi_10 A March 29, 2021, 7:16 p.m. OK GNU C++17 TESTS 5 15 0
111399857 Leomon A March 29, 2021, 4:20 p.m. OK GNU C++17 TESTS 5 15 0
111410297 Back_Log A March 29, 2021, 5:52 p.m. OK GNU C++17 TESTS 5 15 0
111411665 Utkarsh_cyborg A March 29, 2021, 6:09 p.m. OK GNU C++17 TESTS 5 15 0
111413782 AlokKT105 A March 29, 2021, 6:36 p.m. OK GNU C++17 TESTS 5 15 0
111401656 Arpit_022 A March 29, 2021, 4:27 p.m. OK GNU C++17 TESTS 5 15 0
111409040 AC_2000 A March 29, 2021, 5:37 p.m. OK GNU C++17 TESTS 5 15 0
111406940 Atik_ A March 29, 2021, 5:15 p.m. OK GNU C++17 TESTS 5 15 0
111407033 mrm36 A March 29, 2021, 5:16 p.m. OK GNU C++17 TESTS 5 15 0
111432027 zucyo05 A March 30, 2021, 3:39 a.m. OK GNU C++17 TESTS 5 15 2150400
111420975 tupside A March 29, 2021, 8:50 p.m. OK GNU C++17 (64) TESTS 5 0 0
111426489 AccioAC A March 30, 2021, 12:40 a.m. OK GNU C++17 (64) TESTS 5 15 0
111436745 roshan_mehta A March 30, 2021, 5:17 a.m. OK GNU C++17 (64) TESTS 5 15 0
111435822 _Isaunoya_ A March 30, 2021, 5:01 a.m. OK GNU C++17 (64) TESTS 5 15 0
111430570 rgnerdplayer A March 30, 2021, 3:03 a.m. OK GNU C++17 (64) TESTS 5 15 0
111427831 tysm A March 30, 2021, 1:35 a.m. OK GNU C++17 (64) TESTS 5 15 0
111427487 lutljs A March 30, 2021, 1:21 a.m. OK GNU C++17 (64) TESTS 5 15 0
111427246 peroon A March 30, 2021, 1:13 a.m. OK GNU C++17 (64) TESTS 5 15 0
111423535 smax A March 29, 2021, 10:16 p.m. OK GNU C++17 (64) TESTS 5 15 0
111422759 VenomIL A March 29, 2021, 9:43 p.m. OK GNU C++17 (64) TESTS 5 15 0
111425377 Puru299792458 A March 29, 2021, 11:48 p.m. OK Go TESTS 5 46 0
111399357 datnt3696 A March 29, 2021, 4:18 p.m. OK Go TESTS 5 592 0
111436101 skk_18 A March 30, 2021, 5:06 a.m. OK Go TESTS 5 639 0
111427184 bobbilyking A March 30, 2021, 1:10 a.m. OK Java 11 TESTS 5 171 0
111419118 folsatraptai A March 29, 2021, 8:08 p.m. OK Java 11 TESTS 5 186 0
111409706 deepaksach A March 29, 2021, 5:45 p.m. OK Java 11 TESTS 5 186 0
111411777 Spiegel A March 29, 2021, 6:11 p.m. OK Java 11 TESTS 5 187 0
111424168 Is2ac A March 29, 2021, 10:43 p.m. OK Java 11 TESTS 5 187 0
111434665 typewriter999 A March 30, 2021, 4:40 a.m. OK Java 11 TESTS 5 187 0
111429881 pathakbaba A March 30, 2021, 2:44 a.m. OK Java 11 TESTS 5 187 0
111429766 pathakbaba A March 30, 2021, 2:40 a.m. OK Java 11 TESTS 5 187 0
111437705 Sanju_250406 A March 30, 2021, 5:33 a.m. OK Java 11 TESTS 5 202 0
111436263 nagabhushan A March 30, 2021, 5:09 a.m. OK Java 11 TESTS 5 202 0
111410855 umang_345 A March 29, 2021, 5:59 p.m. OK Java 8 TESTS 5 109 0
111407455 The_Duke A March 29, 2021, 5:20 p.m. OK Java 8 TESTS 5 109 0
111405458 sakethsriram19 A March 29, 2021, 5:05 p.m. OK Java 8 TESTS 5 124 0
111437829 gawsfbet A March 30, 2021, 5:34 a.m. OK Java 8 TESTS 5 124 0
111411772 Columbus A March 29, 2021, 6:10 p.m. OK Java 8 TESTS 5 124 0
111409648 SooNoob A March 29, 2021, 5:44 p.m. OK Java 8 TESTS 5 124 0
111408464 AhmedSoliman A March 29, 2021, 5:30 p.m. OK Java 8 TESTS 5 124 0
111394913 MJ21 A March 29, 2021, 4:01 p.m. OK Java 8 TESTS 5 124 0
111406072 RonWonWon A March 29, 2021, 5:09 p.m. OK Java 8 TESTS 5 139 0
111406299 Akram-Adel A March 29, 2021, 5:10 p.m. OK Java 8 TESTS 5 139 0
111432519 Spheniscine A March 30, 2021, 3:51 a.m. OK Kotlin TESTS 5 124 0
111415043 mnrmustafa A March 29, 2021, 6:55 p.m. OK MS C++ 2017 TESTS 5 46 0
111427033 Albertplus007 A March 30, 2021, 1:03 a.m. OK MS C++ 2017 TESTS 5 46 0
111401170 deva_sudeeshna A March 29, 2021, 4:25 p.m. OK MS C++ 2017 TESTS 5 61 0
111430458 Sachin_Tripathi A March 30, 2021, 2:59 a.m. OK MS C++ 2017 TESTS 5 62 0
111439017 jivanijeet A March 30, 2021, 5:53 a.m. OK MS C++ 2017 TESTS 5 62 0
111425629 andreykuzmin A March 30, 2021, 12:02 a.m. OK MS C++ 2017 TESTS 5 62 0
111410116 picofarad A March 29, 2021, 5:50 p.m. OK MS C++ 2017 TESTS 5 62 0
111397713 y15219376913 A March 29, 2021, 4:12 p.m. OK MS C++ 2017 TESTS 5 62 0
111397649 gzp12345 A March 29, 2021, 4:11 p.m. OK MS C++ 2017 TESTS 5 62 0
111416044 truevampire A March 29, 2021, 7:13 p.m. OK MS C++ 2017 TESTS 5 62 307200
111408422 hkcsser2 A March 29, 2021, 5:30 p.m. OK .NET Core C# TESTS 5 155 3072000
111398733 henrychenOutlook A March 29, 2021, 4:15 p.m. OK Node.js TESTS 5 234 5632000
111435243 srijan.sarkar A March 30, 2021, 4:50 a.m. OK PyPy 3 TESTS 5 155 4198400
111435259 rajbit A March 30, 2021, 4:51 a.m. OK PyPy 3 TESTS 5 187 7577600
111417444 nitish420 A March 29, 2021, 7:36 p.m. OK PyPy 3 TESTS 5 202 8704000
111424915 koogoro A March 29, 2021, 11:24 p.m. OK PyPy 3 TESTS 5 202 8908800
111410571 _aadiupadhyay_ A March 29, 2021, 5:55 p.m. OK PyPy 3 TESTS 5 217 7270400
111408230 manmohan1105 A March 29, 2021, 5:28 p.m. OK PyPy 3 TESTS 5 217 9011200
111425801 frostbyte2103 A March 30, 2021, 12:10 a.m. OK PyPy 3 TESTS 5 218 6246400
111418494 palashjhanwar10 A March 29, 2021, 7:55 p.m. OK PyPy 3 TESTS 5 218 7884800
111419965 Stephan A March 29, 2021, 8:25 p.m. OK PyPy 3 TESTS 5 218 9625600
111406256 AggarwalRaghav A March 29, 2021, 5:10 p.m. OK PyPy 3 TESTS 5 233 7680000
111439439 code_coder A March 30, 2021, 6 a.m. OK Python 3 TESTS 5 124 307200
111400674 raghav142 A March 29, 2021, 4:23 p.m. OK Python 3 TESTS 5 124 307200
111433385 magpie_robin A March 30, 2021, 4:12 a.m. OK Python 3 TESTS 5 139 1228800
111396567 sushibob A March 29, 2021, 4:07 p.m. OK Python 3 TESTS 5 140 307200
111433227 magpie_robin A March 30, 2021, 4:08 a.m. OK Python 3 TESTS 5 140 1228800
111438966 magpie_robin A March 30, 2021, 5:52 a.m. OK Python 3 TESTS 5 155 307200
111439035 magpie_robin A March 30, 2021, 5:53 a.m. OK Python 3 TESTS 5 155 409600
111426995 imadilkhan A March 30, 2021, 1:01 a.m. OK Python 3 TESTS 5 156 409600
111422201 lym20041026 A March 29, 2021, 9:25 p.m. OK Python 3 TESTS 5 171 409600
111395353 kingslayer268 A March 29, 2021, 4:03 p.m. OK Python 3 TESTS 5 171 2662400

remove filters

Back to search problems