Codeforces Round 251 (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
439 Codeforces Round 251 (Div. 2) FINISHED False 7200 335716204 June 4, 2014, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1596 ) E Devu and Birthday Celebration PROGRAMMING combinatorics dp math 2600

B"Today is Devu's birthday. For celebrating the occasion, he bought n sweets from the nearby market. He has invited his f friends. He would like to distribute the sweets among them. As he is a nice guy and the occasion is great, he doesn't want any friend to be sad, so he would ensure to give at least one sweet to each friend. He wants to celebrate it in a unique style, so he would like to ensure following condition for the distribution of sweets. Assume that he has distributed n sweets to his friends such that ith friend is given ai sweets. He wants to make sure that there should not be any positive integer x xe2 x80 x89> xe2 x80 x891, which divides every ai. Please find the number of ways he can distribute sweets to his friends in the required way. Note that the order of distribution is important, for example [1, 2] and [2, 1] are distinct distributions. As the answer could be very large, output answer modulo 1000000007 (109 xe2 x80 x89+ xe2 x80 x897). To make the problem more interesting, you are given q queries. Each query contains an n, f pair. For each query please output the required number of ways modulo 1000000007 (109 xe2 x80 x89+ xe2 x80 x897). The first line contains an integer q representing the number of queries (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89q xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105). Each of the next q lines contains two space space-separated integers n, f (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89f xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105). For each query, output a single integer in a line corresponding to the answer of each query. For first query: n xe2 x80 x89= xe2 x80 x896, xe2 x80 x89f xe2 x80 x89= xe2 x80 x892. Possible partitions are [1, 5] and [5, 1]. For second query: n xe2 x80 x89= xe2 x80 x897, xe2 x80 x89f xe2 x80 x89= xe2 x80 x892. Possible partitions are [1, 6] and [2, 5] and [3, 4] and [4, 3] and [5, 3] and [6, 1]. So in total there are 6 possible ways of partitioning."...

Tutorials

Codeforces Round #251 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
18947527 sgtlaugh E July 7, 2016, 9:04 a.m. OK GNU C TESTS 55 420 1843200 2600
27746139 vjudge2 E June 12, 2017, 11:28 p.m. OK GNU C++ TESTS 55 140 1638400 2600
42229736 vjudge3 E Aug. 29, 2018, 5:52 a.m. OK GNU C++ TESTS 55 171 1843200 2600
25161515 vjudge5 E March 3, 2017, 2:25 a.m. OK GNU C++ TESTS 55 187 3891200 2600
33659610 vjudge2 E Dec. 27, 2017, 2:20 a.m. OK GNU C++ TESTS 55 202 11776000 2600
31995238 vjudge1 E Nov. 3, 2017, 12:13 a.m. OK GNU C++ TESTS 55 217 1638400 2600
11507824 JoshuaTree E June 9, 2015, 10:34 a.m. OK GNU C++ TESTS 55 218 13209600 2600
13999980 130705009 E Nov. 1, 2015, 4:39 a.m. OK GNU C++ TESTS 55 249 1433600 2600
42415500 vjudge4 E Sept. 3, 2018, 6:51 a.m. OK GNU C++ TESTS 55 249 1638400 2600
29303905 3015218054 E Aug. 9, 2017, 10:59 a.m. OK GNU C++ TESTS 55 249 6963200 2600
41750060 vjudge2 E Aug. 18, 2018, 9:12 a.m. OK GNU C++ TESTS 55 264 3993600 2600
10326795 Ahoma E March 17, 2015, 6:57 p.m. OK GNU C++0x TESTS 55 249 1228800 2600
10221462 kondranin E March 9, 2015, 8:18 p.m. OK GNU C++0x TESTS 55 763 8396800 2600
10221210 kondranin E March 9, 2015, 7:49 p.m. OK GNU C++0x TESTS 55 4368 7987200 2600
10221197 kondranin E March 9, 2015, 7:48 p.m. OK GNU C++0x TESTS 55 4524 8396800 2600
10221102 kondranin E March 9, 2015, 7:35 p.m. OK GNU C++0x TESTS 55 4898 8396800 2600
10221079 kondranin E March 9, 2015, 7:32 p.m. OK GNU C++0x TESTS 55 4976 8396800 2600
64612341 vjudge4 E Nov. 10, 2019, 2:33 a.m. OK GNU C++11 TESTS 55 155 2048000 2600
38936370 RNS_MHB E June 4, 2018, 6:42 a.m. OK GNU C++11 TESTS 55 171 4300800 2600
28066857 RNS_KSB E June 27, 2017, 1:51 a.m. OK GNU C++11 TESTS 55 171 6860800 2600
49944250 Chenqiqian E Feb. 15, 2019, 11:18 a.m. OK GNU C++11 TESTS 55 171 13926400 2600
22622813 rajat1603 E Nov. 30, 2016, 12:07 p.m. OK GNU C++11 TESTS 55 186 7987200 2600
57819354 py_ultron E July 26, 2019, 9:49 p.m. OK GNU C++11 TESTS 55 186 29081600 2600
22696106 pr3pony E Dec. 4, 2016, 12:58 p.m. OK GNU C++11 TESTS 55 187 1331200 2600
22695998 pr3pony E Dec. 4, 2016, 12:52 p.m. OK GNU C++11 TESTS 55 187 1331200 2600
17705754 fengsuiyan E May 4, 2016, 8:31 a.m. OK GNU C++11 TESTS 55 187 3481600 2600
57889911 lopare E July 28, 2019, 11:26 a.m. OK GNU C++11 TESTS 55 187 29081600 2600
58208800 liyh E Aug. 3, 2019, 8:07 a.m. OK GNU C++14 TESTS 55 170 8601600 2600
40316125 RobeZH E July 14, 2018, 10:49 a.m. OK GNU C++14 TESTS 55 171 5529600 2600
30496863 kolyukkonen E Sept. 19, 2017, 12:21 p.m. OK GNU C++14 TESTS 55 187 33587200 2600
31006378 fofao_funk E Oct. 5, 2017, 3:09 a.m. OK GNU C++14 TESTS 55 202 2560000 2600
33699965 mjhun E Dec. 28, 2017, 3:55 a.m. OK GNU C++14 TESTS 55 202 6656000 2600
33659603 Jubair_2147483647 E Dec. 27, 2017, 2:19 a.m. OK GNU C++14 TESTS 55 202 11776000 2600
30331269 Fullmetal_Algorithmist E Sept. 14, 2017, 2:48 p.m. OK GNU C++14 TESTS 55 218 8601600 2600
23335175 Noureldin E Dec. 26, 2016, 7:55 a.m. OK GNU C++14 TESTS 55 234 3276800 2600
27265838 dhsrhkdgus E May 21, 2017, 11:32 a.m. OK GNU C++14 TESTS 55 234 5632000 2600
32960079 Flash-boy E Dec. 6, 2017, 1:17 a.m. OK GNU C++14 TESTS 55 249 3891200 2600
65874819 Phortox E Nov. 27, 2019, 4:40 p.m. OK GNU C++17 TESTS 55 171 4812800 2600
45975486 lohit_97 E Nov. 19, 2018, 6:17 p.m. OK GNU C++17 TESTS 55 171 8192000 2600
45708960 Pakalns E Nov. 14, 2018, 1:05 p.m. OK GNU C++17 TESTS 55 186 3379200 2600
62372458 ivan100sic E Oct. 11, 2019, 4:11 p.m. OK GNU C++17 TESTS 55 218 11571200 2600
63125547 Roundgod E Oct. 22, 2019, 12:42 p.m. OK GNU C++17 TESTS 55 233 1740800 2600
41295125 XuZihan E Aug. 7, 2018, 6:43 a.m. OK GNU C++17 TESTS 55 249 2560000 2600
63699553 ffao E Oct. 29, 2019, 6:49 a.m. OK GNU C++17 TESTS 55 265 1433600 2600
68341364 SUDAL E Jan. 7, 2020, 3:57 a.m. OK GNU C++17 TESTS 55 265 2560000 2600
41298300 vjudge1 E Aug. 7, 2018, 8:29 a.m. OK GNU C++17 TESTS 55 296 2764800 2600
51842941 lmiskiew E March 26, 2019, 12:46 a.m. OK GNU C++17 TESTS 55 312 4710400 2600
9768289 vjudge3 E Feb. 8, 2015, 5:40 a.m. OK Java 6 TESTS 55 483 0 2600
9736905 vjudge1 E Feb. 6, 2015, 1:53 p.m. OK Java 6 TESTS 55 717 0 2600
18053061 alibaba E May 24, 2016, 9:24 a.m. OK Java 7 TESTS 55 2027 44748800 2600
57621559 Ahmad E July 24, 2019, 5:02 a.m. OK Java 8 TESTS 55 265 0 2600
40586454 amnesiac_dusk E July 20, 2018, 5:59 p.m. OK Java 8 TESTS 55 467 0 2600
46980730 ankurdua15 E Dec. 13, 2018, 7:38 p.m. OK Java 8 TESTS 55 1076 29593600 2600
35512729 zihanwangki E Feb. 20, 2018, 6:17 a.m. OK Java 8 TESTS 55 1091 20787200 2600
35512522 zihanwangki E Feb. 20, 2018, 6:06 a.m. OK Java 8 TESTS 55 1092 20787200 2600
32957818 MazzForces E Dec. 5, 2017, 8:45 p.m. OK Java 8 TESTS 55 1232 40960000 2600
23638336 MedoN11 E Jan. 8, 2017, 12:03 a.m. OK Java 8 TESTS 55 1653 37376000 2600
18053063 alibaba E May 24, 2016, 9:25 a.m. OK Java 8 TESTS 55 2152 26726400 2600
23611191 jin03002 E Jan. 6, 2017, 7:12 p.m. OK Java 8 TESTS 55 2246 20787200 2600
26994141 olya-chuchuk E May 10, 2017, 10:49 a.m. OK Java 8 TESTS 55 2667 31744000 2600
10363126 iamexist E March 20, 2015, 6:15 a.m. OK MS C++ TESTS 55 655 13209600 2600
10364398 bunos E March 20, 2015, 9:13 a.m. OK MS C++ TESTS 55 748 14131200 2600
10364182 MrKaStep E March 20, 2015, 8:45 a.m. OK MS C++ TESTS 55 998 5734400 2600
10364641 chiyar E March 20, 2015, 9:48 a.m. OK MS C++ TESTS 55 1029 4300800 2600
10689008 xuenene E April 13, 2015, 2:47 a.m. OK MS C++ TESTS 55 1606 1740800 2600
10688993 xuenene E April 13, 2015, 2:42 a.m. OK MS C++ TESTS 55 1918 1740800 2600
10688929 vjudge5 E April 13, 2015, 2:32 a.m. OK MS C++ TESTS 55 1933 1740800 2600
10688926 xuenene E April 13, 2015, 2:31 a.m. OK MS C++ TESTS 55 2028 1740800 2600
10667497 sister_what_hate_most E April 12, 2015, 1:20 p.m. OK MS C++ TESTS 55 3166 921600 2600
10664211 vjudge4 E April 12, 2015, 8:24 a.m. OK MS C++ TESTS 55 3182 921600 2600
9824303 mmaxio E Feb. 14, 2015, 9:14 a.m. OK PyPy 3 TESTS 55 3541 54784000 2600
35872200 ______u______ E March 3, 2018, 7:04 a.m. OK Python 2 TESTS 55 4009 11878400 2600
35872101 ______n______ E March 3, 2018, 7:04 a.m. OK Python 2 TESTS 55 4009 11878400 2600
35871503 _____i_____ E March 3, 2018, 6:52 a.m. OK Python 2 TESTS 55 4009 11878400 2600
35871493 _____k_____ E March 3, 2018, 6:52 a.m. OK Python 2 TESTS 55 4009 11878400 2600
35862491 ______k______ E March 2, 2018, 10:26 p.m. OK Python 2 TESTS 55 4009 11878400 2600
35862470 ______h______ E March 2, 2018, 10:26 p.m. OK Python 2 TESTS 55 4009 11878400 2600
35862185 ______i______ E March 2, 2018, 10:19 p.m. OK Python 2 TESTS 55 4009 11878400 2600
35860474 ______M______ E March 2, 2018, 9:42 p.m. OK Python 2 TESTS 55 4009 11878400 2600
9824308 mmaxio E Feb. 14, 2015, 9:15 a.m. OK Python 3 TESTS 55 4258 34918400 2600
69432565 kobae964 E Jan. 23, 2020, 5:48 p.m. OK Rust TESTS 55 202 6553600 2600

remove filters

Back to search problems