Codeforces Round 157 (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
258 Codeforces Round 157 (Div. 1) FINISHED False 7200 375632999 Dec. 22, 2012, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1794 ) C Little Elephant and LCM PROGRAMMING binary search combinatorics dp math 2400

B"The Little Elephant loves the LCM (least common multiple) operation of a non-empty set of positive integers. The result of the LCM operation of k positive integers x1, xe2 x80 x89x2, xe2 x80 x89..., xe2 x80 x89xk is the minimum positive integer that is divisible by each of numbers xi. Let's assume that there is a sequence of integers b1, xe2 x80 x89b2, xe2 x80 x89..., xe2 x80 x89bn. Let's denote their LCMs as lcm(b1, xe2 x80 x89b2, xe2 x80 x89..., xe2 x80 x89bn) and the maximum of them as max(b1, xe2 x80 x89b2, xe2 x80 x89..., xe2 x80 x89bn). The Little Elephant considers a sequence b good, if lcm(b1, xe2 x80 x89b2, xe2 x80 x89..., xe2 x80 x89bn) xe2 x80 x89= xe2 x80 x89max(b1, xe2 x80 x89b2, xe2 x80 x89..., xe2 x80 x89bn). The Little Elephant has a sequence of integers a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an. Help him find the number of good sequences of integers b1, xe2 x80 x89b2, xe2 x80 x89..., xe2 x80 x89bn, such that for all i (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) the following condition fulfills: 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89bi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai. As the answer can be rather large, print the remainder from dividing it by 1000000007 (109 xe2 x80 x89+ xe2 x80 x897). The first line contains a single positive integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105) -- the number of integers in the sequence a. The second line contains n space-separated integers a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105) -- sequence a. In the single line print a single integer -- the answer to the problem modulo 1000000007 (109 xe2 x80 x89+ xe2 x80 x897)."...

Tutorials

Codeforces Round #157 — Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
2810535 vlad107 C Dec. 22, 2012, 3:57 p.m. OK FPC TESTS 32 781 3993600 2400
2816554 Alex_2oo8 C Dec. 22, 2012, 7:21 p.m. OK FPC TESTS 32 859 2560000 2400
2815463 Rubanenko C Dec. 22, 2012, 5:29 p.m. OK FPC TESTS 32 1046 2867200 2400
2813772 Furko C Dec. 22, 2012, 4:46 p.m. OK FPC TESTS 32 1250 24473600 2400
2827797 laoriu C Dec. 26, 2012, 5:49 a.m. OK FPC TESTS 32 1343 819200 2400
2957492 doanminhdragon C Jan. 18, 2013, 6:15 p.m. OK FPC TESTS 32 1375 921600 2400
2823944 scorpion C Dec. 24, 2012, 9:52 p.m. OK FPC TESTS 32 1406 1228800 2400
15119809 phanydi C Dec. 30, 2015, 4:50 p.m. OK FPC TESTS 32 1496 921600 2400
15102314 thanga2pbc C Dec. 30, 2015, 3:11 p.m. OK FPC TESTS 32 1682 1331200 2400
2821804 con_nha_ngheo C Dec. 24, 2012, 9:56 a.m. OK FPC TESTS 32 2062 921600 2400
2827472 lizziew C Dec. 26, 2012, 1:57 a.m. OK GNU C TESTS 32 609 1228800 2400
2812444 LayCurse C Dec. 22, 2012, 4:21 p.m. OK GNU C TESTS 32 1046 1638400 2400
2828731 jacky777 C Dec. 26, 2012, 11:38 a.m. OK GNU C++ TESTS 32 375 1945600 2400
2814788 alpc104 C Dec. 22, 2012, 5:13 p.m. OK GNU C++ TESTS 32 405 3584000 2400
2828728 jacky777 C Dec. 26, 2012, 11:36 a.m. OK GNU C++ TESTS 32 406 2764800 2400
4008704 Neil C July 4, 2013, 12:07 a.m. OK GNU C++ TESTS 32 406 4505600 2400
2814111 boleyn.su C Dec. 22, 2012, 4:54 p.m. OK GNU C++ TESTS 32 421 3174400 2400
2812042 UESTC_Nocturne C Dec. 22, 2012, 4:15 p.m. OK GNU C++ TESTS 32 421 25292800 2400
2960372 Moor C Jan. 19, 2013, 4:22 p.m. OK GNU C++ TESTS 32 436 10444800 2400
2821305 ByFlash C Dec. 24, 2012, 7:28 a.m. OK GNU C++ TESTS 32 453 1638400 2400
2819165 gs12117 C Dec. 23, 2012, 1:07 p.m. OK GNU C++ TESTS 32 453 1945600 2400
40990359 ReaLNero1 C July 30, 2018, 11:50 p.m. OK GNU C++ TESTS 32 466 3481600 2400
3717057 kraskevich C May 13, 2013, 2:12 p.m. OK GNU C++0x TESTS 32 500 12697600 2400
2817187 hex539 C Dec. 22, 2012, 11:50 p.m. OK GNU C++0x TESTS 32 500 19763200 2400
2816859 BryantMark C Dec. 22, 2012, 8:45 p.m. OK GNU C++0x TESTS 32 500 68096000 2400
2817179 hex539 C Dec. 22, 2012, 11:39 p.m. OK GNU C++0x TESTS 32 500 172851200 2400
6478027 vjudge5 C April 26, 2014, 9:04 a.m. OK GNU C++0x TESTS 32 528 10240000 2400
9351150 kcm1700 C Jan. 3, 2015, 9:04 a.m. OK GNU C++0x TESTS 32 530 1228800 2400
7115884 FancyCoder C July 16, 2014, 12:10 p.m. OK GNU C++0x TESTS 32 530 12492800 2400
2816889 BryantMark C Dec. 22, 2012, 8:58 p.m. OK GNU C++0x TESTS 32 531 68096000 2400
2824817 ILJ C Dec. 25, 2012, 7:41 a.m. OK GNU C++0x TESTS 32 562 1228800 2400
6006714 yutaka1999 C March 13, 2014, 4:52 a.m. OK GNU C++0x TESTS 32 592 1228800 2400
61723761 rainboy C Oct. 2, 2019, 2:36 p.m. OK GNU C11 TESTS 32 654 409600 2400
55009271 SoiMae C June 3, 2019, 9:14 a.m. OK GNU C++11 TESTS 32 436 10137600 2400
69565838 Kubic C Jan. 26, 2020, 12:23 p.m. OK GNU C++11 TESTS 32 436 10547200 2400
46684992 YaoBIG C Dec. 6, 2018, 1:38 p.m. OK GNU C++11 TESTS 32 466 10137600 2400
54997472 SoiMae C June 3, 2019, 1:03 a.m. OK GNU C++11 TESTS 32 468 10240000 2400
57821633 py_ultron C July 26, 2019, 11:50 p.m. OK GNU C++11 TESTS 32 498 1024000 2400
44956260 ivanilos C Oct. 27, 2018, 2:22 p.m. OK GNU C++11 TESTS 32 498 10547200 2400
69875141 liuweih C Jan. 31, 2020, 3:31 a.m. OK GNU C++11 TESTS 32 498 24985600 2400
64154757 vjudge3 C Nov. 3, 2019, 12:28 p.m. OK GNU C++11 TESTS 32 528 10137600 2400
44052311 Bengal_Tiger C Oct. 9, 2018, 7:58 p.m. OK GNU C++11 TESTS 32 528 10547200 2400
51165893 vjudge3 C March 11, 2019, 2:16 p.m. OK GNU C++11 TESTS 32 530 819200 2400
54048303 alimagde C May 12, 2019, 6:28 p.m. OK GNU C++14 TESTS 32 436 9523200 2400
54048784 alimagde C May 12, 2019, 6:41 p.m. OK GNU C++14 TESTS 32 436 9523200 2400
57064513 AJ47 C July 14, 2019, 8:14 p.m. OK GNU C++14 TESTS 32 468 10752000 2400
55862134 parasat C June 21, 2019, 10:06 a.m. OK GNU C++14 TESTS 32 498 13107200 2400
67865770 mota_haathi C Dec. 29, 2019, 9:38 a.m. OK GNU C++14 TESTS 32 528 1228800 2400
67845702 tbzard C Dec. 28, 2019, 9:28 p.m. OK GNU C++14 TESTS 32 560 819200 2400
41335694 vjudge3 C Aug. 8, 2018, 11:56 a.m. OK GNU C++14 TESTS 32 560 1228800 2400
35998941 yaksha C March 6, 2018, 3:12 p.m. OK GNU C++14 TESTS 32 560 2662400 2400
25762597 joyfun C March 24, 2017, 4:19 a.m. OK GNU C++14 TESTS 32 560 2764800 2400
50043224 NotNight C Feb. 17, 2019, 3:53 a.m. OK GNU C++14 TESTS 32 560 10752000 2400
64359127 IIeJlMeHb C Nov. 6, 2019, 11:14 a.m. OK GNU C++17 TESTS 32 468 10342400 2400
41295242 vjudge2 C Aug. 7, 2018, 6:48 a.m. OK GNU C++17 TESTS 32 468 25600000 2400
67848409 KevinWan C Dec. 28, 2019, 11:57 p.m. OK GNU C++17 TESTS 32 528 10342400 2400
55654470 AliShahali1382 C June 16, 2019, 4:24 p.m. OK GNU C++17 TESTS 32 528 10342400 2400
51408176 ruo C March 17, 2019, 10:52 a.m. OK GNU C++17 TESTS 32 528 10752000 2400
38714348 majk C May 29, 2018, 9:23 a.m. OK GNU C++17 TESTS 32 530 921600 2400
53591721 ivan100sic C May 1, 2019, 12:42 a.m. OK GNU C++17 TESTS 32 530 11161600 2400
59522511 rareone0602 C Aug. 26, 2019, 12:21 p.m. OK GNU C++17 TESTS 32 530 13721600 2400
38714270 majk C May 29, 2018, 9:19 a.m. OK GNU C++17 TESTS 32 560 1126400 2400
49689267 2ooWeak2ooSlow2ooDumb C Feb. 10, 2019, 10:08 a.m. OK GNU C++17 TESTS 32 560 15257600 2400
2814209 Petr C Dec. 22, 2012, 4:57 p.m. OK Java 6 TESTS 32 796 2457600 2400
2821637 ixxa C Dec. 24, 2012, 8:53 a.m. OK Java 6 TESTS 32 811 102400 2400
2813367 Egor C Dec. 22, 2012, 4:38 p.m. OK Java 6 TESTS 32 858 2252800 2400
2821594 ixxa C Dec. 24, 2012, 8:44 a.m. OK Java 6 TESTS 32 873 102400 2400
2813855 m.radwan C Dec. 22, 2012, 4:48 p.m. OK Java 6 TESTS 32 873 2252800 2400
2817232 sokokaleb C Dec. 23, 2012, 12:33 a.m. OK Java 6 TESTS 32 906 2252800 2400
2815675 uwi C Dec. 22, 2012, 6:04 p.m. OK Java 6 TESTS 32 984 2252800 2400
2895064 mukku C Jan. 9, 2013, 4:10 a.m. OK Java 6 TESTS 32 1029 141926400 2400
2814796 hama-du C Dec. 22, 2012, 5:13 p.m. OK Java 6 TESTS 32 1078 204800 2400
2818372 piotr.kukla C Dec. 23, 2012, 8:24 a.m. OK Java 6 TESTS 32 1203 2457600 2400
2816028 cerealguy C Dec. 22, 2012, 6:20 p.m. OK Java 7 TESTS 32 609 204800 2400
2816020 cerealguy C Dec. 22, 2012, 6:19 p.m. OK Java 7 TESTS 32 625 204800 2400
2815274 Jokser C Dec. 22, 2012, 5:26 p.m. OK Java 7 TESTS 32 937 307200 2400
2812560 mmaxio C Dec. 22, 2012, 4:23 p.m. OK Java 7 TESTS 32 968 102400 2400
2816426 alexey.enkov C Dec. 22, 2012, 7 p.m. OK Java 7 TESTS 32 1062 0 2400
2816491 riadwaw C Dec. 22, 2012, 7:10 p.m. OK Java 7 TESTS 32 1156 102400 2400
2815977 cerealguy C Dec. 22, 2012, 6:16 p.m. OK Java 7 TESTS 32 1171 307200 2400
2815997 cerealguy C Dec. 22, 2012, 6:18 p.m. OK Java 7 TESTS 32 1232 409600 2400
2816486 sweiss C Dec. 22, 2012, 7:09 p.m. OK Java 7 TESTS 32 1312 307200 2400
2816011 cerealguy C Dec. 22, 2012, 6:19 p.m. OK Java 7 TESTS 32 1312 409600 2400
19278429 Sumeet.Varma C July 20, 2016, 11:04 a.m. OK Java 8 TESTS 32 1090 0 2400
43172494 aabdelzaher C Sept. 21, 2018, 9:20 a.m. OK Java 8 TESTS 32 1248 0 2400
61723760 Dukkha C Oct. 2, 2019, 2:36 p.m. OK Java 8 TESTS 32 1496 0 2400
39521402 amnesiac_dusk C June 22, 2018, 4 p.m. OK Java 8 TESTS 32 1744 15564800 2400
55725539 spar5h C June 18, 2019, 5:30 p.m. OK Java 8 TESTS 32 1746 29081600 2400
20676453 Bruteforceman C Sept. 17, 2016, 8:29 a.m. OK Java 8 TESTS 32 1934 0 2400
39521484 amnesiac_dusk C June 22, 2018, 4:04 p.m. OK Java 8 TESTS 32 2026 35942400 2400
26719257 Kammola C April 28, 2017, 12:44 p.m. OK Java 8 TESTS 32 2244 53862400 2400
27318490 MazzForces C May 24, 2017, 10:48 a.m. OK Java 8 TESTS 32 2276 10444800 2400
26719150 Kammola C April 28, 2017, 12:38 p.m. OK Java 8 TESTS 32 2400 58572800 2400
2813450 it4.kp C Dec. 22, 2012, 4:39 p.m. OK Mono C# TESTS 32 889 22118400 2400
2818711 Fdg C Dec. 23, 2012, 10:08 a.m. OK MS C++ TESTS 32 468 1228800 2400
2813166 Fdg C Dec. 22, 2012, 4:34 p.m. OK MS C++ TESTS 32 499 1228800 2400
3732529 XilinX C May 18, 2013, 7:59 a.m. OK MS C++ TESTS 32 577 11059200 2400
2815209 Shef C Dec. 22, 2012, 5:24 p.m. OK MS C++ TESTS 32 578 1536000 2400
2813744 Timur_Sitdikov C Dec. 22, 2012, 4:45 p.m. OK MS C++ TESTS 32 640 55705600 2400
2813713 Milanin C Dec. 22, 2012, 4:45 p.m. OK MS C++ TESTS 32 655 819200 2400
2814430 tyamgin C Dec. 22, 2012, 5:03 p.m. OK MS C++ TESTS 32 655 1638400 2400
2813192 Olja C Dec. 22, 2012, 4:34 p.m. OK MS C++ TESTS 32 656 1228800 2400
2818537 lxhgww C Dec. 23, 2012, 9:09 a.m. OK MS C++ TESTS 32 671 409600 2400
2814892 Dabek C Dec. 22, 2012, 5:16 p.m. OK MS C++ TESTS 32 686 1638400 2400

remove filters

Back to search problems