Codeforces Round 499 (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
1010 Codeforces Round 499 (Div. 1) FINISHED False 7200 199205699 July 26, 2018, 3:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4874 ) C Border PROGRAMMING number theory 1800

B"Astronaut Natasha arrived on Mars. She knows that the Martians are very poor aliens. To ensure a better life for the Mars citizens, their emperor decided to take tax from every tourist who visited the planet. Natasha is the inhabitant of Earth, therefore she had to pay the tax to enter the territory of Mars. There are n banknote denominations on Mars: the value of i -th banknote is a_i . Natasha has an infinite number of banknotes of each denomination. Martians have k fingers on their hands, so they use a number system with base k . In addition, the Martians consider the digit d (in the number system with base k ) divine. Thus, if the last digit in Natasha's tax amount written in the number system with the base k is d , the Martians will be happy. Unfortunately, Natasha does not know the Martians' divine digit yet. Determine for which values d Natasha can make the Martians happy. Natasha can use only her banknotes. Martians don't give her change. The first line contains two integers n and k ( 1 <= n <= 100 ,000 , 2 <= k <= 100 ,000 ) -- the number of denominations of banknotes and the base of the number system on Mars. The second line contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 10^9 ) -- denominations of banknotes on Mars. All numbers are given in decimal notation. On the first line output the number of values d for which Natasha can make the Martians happy. In the second line, output all these values in increasing order. Print all numbers in decimal notation. Consider the first test case. It uses the octal number system. If you take one banknote with the value of 12 , you will get 14_8 in octal system. The last digit is 4_8 . If you take one banknote with the value of 12 and one banknote with the value of 20 , the total value will be 32 . In the octal system, it is 40_8 . The last digit is 0_8 . "...

Tutorials

60851

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
40806606 fluffyowl C July 26, 2018, 4:42 p.m. OK D TESTS 107 77 4198400 1800
40787421 alex_china C July 26, 2018, 3:22 p.m. OK GNU C++ TESTS 107 46 0 1800
40800995 wwwxxxddd C July 26, 2018, 4:15 p.m. OK GNU C++ TESTS 107 46 409600 1800
40786547 Tima C July 26, 2018, 3:19 p.m. OK GNU C++ TESTS 107 46 1228800 1800
40788152 yasugongshang C July 26, 2018, 3:24 p.m. OK GNU C++ TESTS 107 46 1638400 1800
40807957 _Cwystc_Killer_ C July 26, 2018, 4:49 p.m. OK GNU C++ TESTS 107 61 0 1800
40808755 fksquare C July 26, 2018, 4:52 p.m. OK GNU C++ TESTS 107 62 0 1800
40794278 lezdzh C July 26, 2018, 3:46 p.m. OK GNU C++ TESTS 107 62 0 1800
40791679 valorwxp C July 26, 2018, 3:36 p.m. OK GNU C++ TESTS 107 62 0 1800
40790362 JOHNKRAM C July 26, 2018, 3:31 p.m. OK GNU C++ TESTS 107 62 0 1800
40806071 616156 C July 26, 2018, 4:39 p.m. OK GNU C++ TESTS 107 62 307200 1800
40798444 danya090699 C July 26, 2018, 4:03 p.m. OK GNU C++11 TESTS 107 46 0 1800
40795383 miaom C July 26, 2018, 3:50 p.m. OK GNU C++11 TESTS 107 46 0 1800
40794406 dredwerkz C July 26, 2018, 3:46 p.m. OK GNU C++11 TESTS 107 46 0 1800
40797579 Neymarss C July 26, 2018, 3:59 p.m. OK GNU C++11 TESTS 107 46 204800 1800
40794759 Blue233333 C July 26, 2018, 3:48 p.m. OK GNU C++11 TESTS 107 46 204800 1800
40792148 cuizhuyefei C July 26, 2018, 3:38 p.m. OK GNU C++11 TESTS 107 46 204800 1800
40789929 SidneyJupiter C July 26, 2018, 3:30 p.m. OK GNU C++11 TESTS 107 46 204800 1800
40809142 zy1997 C July 26, 2018, 4:54 p.m. OK GNU C++11 TESTS 107 46 409600 1800
40792332 architkarandikar C July 26, 2018, 3:38 p.m. OK GNU C++11 TESTS 107 46 409600 1800
40809293 zzb111 C July 26, 2018, 4:55 p.m. OK GNU C++11 TESTS 107 46 614400 1800
40797615 Waj C July 26, 2018, 3:59 p.m. OK GNU C++14 TESTS 107 46 0 1800
40797455 wxy_z C July 26, 2018, 3:58 p.m. OK GNU C++14 TESTS 107 46 0 1800
40796405 sulfuric C July 26, 2018, 3:54 p.m. OK GNU C++14 TESTS 107 46 0 1800
40795578 beginend C July 26, 2018, 3:51 p.m. OK GNU C++14 TESTS 107 46 0 1800
40791341 metatron C July 26, 2018, 3:35 p.m. OK GNU C++14 TESTS 107 46 0 1800
40788897 Xellos C July 26, 2018, 3:26 p.m. OK GNU C++14 TESTS 107 46 0 1800
40787212 Um_nik C July 26, 2018, 3:21 p.m. OK GNU C++14 TESTS 107 46 0 1800
40796640 sava-cska C July 26, 2018, 3:55 p.m. OK GNU C++14 TESTS 107 46 409600 1800
40796597 MegaBidoof C July 26, 2018, 3:55 p.m. OK GNU C++14 TESTS 107 46 409600 1800
40795064 olphe C July 26, 2018, 3:49 p.m. OK GNU C++14 TESTS 107 46 409600 1800
40789380 irkstepanov C July 26, 2018, 3:28 p.m. OK GNU C++17 TESTS 107 46 0 1800
40786362 LiChenKoh C July 26, 2018, 3:19 p.m. OK GNU C++17 TESTS 107 46 102400 1800
40794909 RedTea C July 26, 2018, 3:48 p.m. OK GNU C++17 TESTS 107 46 409600 1800
40793709 ErdemKirez C July 26, 2018, 3:43 p.m. OK GNU C++17 TESTS 107 46 1126400 1800
40786963 MrDindows C July 26, 2018, 3:21 p.m. OK GNU C++17 TESTS 107 46 1228800 1800
40809364 volamtruyenkyii C July 26, 2018, 4:55 p.m. OK GNU C++17 TESTS 107 46 1536000 1800
40808286 WillyPillow C July 26, 2018, 4:50 p.m. OK GNU C++17 TESTS 107 46 1945600 1800
40790435 LHiC C July 26, 2018, 3:32 p.m. OK GNU C++17 TESTS 107 61 0 1800
40787298 TonySnark C July 26, 2018, 3:22 p.m. OK GNU C++17 TESTS 107 61 0 1800
40795636 Jaihk662 C July 26, 2018, 3:51 p.m. OK GNU C++17 TESTS 107 61 409600 1800
40785563 Egor C July 26, 2018, 3:17 p.m. OK Java 8 TESTS 107 155 0 1800
40804537 Lewin C July 26, 2018, 4:32 p.m. OK Java 8 TESTS 107 155 0 1800
40792802 uwi C July 26, 2018, 3:40 p.m. OK Java 8 TESTS 107 155 0 1800
40803022 AkshajK C July 26, 2018, 4:24 p.m. OK Java 8 TESTS 107 171 0 1800
40796235 PrakharJain C July 26, 2018, 3:53 p.m. OK Java 8 TESTS 107 171 0 1800
40793232 fetetriste C July 26, 2018, 3:42 p.m. OK Java 8 TESTS 107 171 0 1800
40788850 mmaxio C July 26, 2018, 3:26 p.m. OK Java 8 TESTS 107 171 0 1800
40797156 Harpae C July 26, 2018, 3:57 p.m. OK Java 8 TESTS 107 187 0 1800
40784781 Petr C July 26, 2018, 3:15 p.m. OK Java 8 TESTS 107 187 0 1800
40790969 sirknightingfail C July 26, 2018, 3:33 p.m. OK Java 8 TESTS 107 202 0 1800
40787414 mircea85 C July 26, 2018, 3:22 p.m. OK Mono C# TESTS 107 109 13926400 1800
40791733 witua C July 26, 2018, 3:36 p.m. OK MS C++ TESTS 107 62 2355200 1800
40791359 almogwald C July 26, 2018, 3:35 p.m. OK MS C++ TESTS 107 156 0 1800
40802269 nwi C July 26, 2018, 4:21 p.m. OK Python 2 TESTS 107 343 8192000 1800
40798264 MathisHammel C July 26, 2018, 4:02 p.m. OK Python 2 TESTS 107 389 7680000 1800

remove filters

Back to search problems