Codeforces Round 373 (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
718 Codeforces Round 373 (Div. 1) FINISHED False 7200 257187299 Sept. 23, 2016, 1:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 395 ) D Andrew and Chemistry PROGRAMMING dp hashing trees 2900

B"During the chemistry lesson Andrew learned that the saturated hydrocarbons (alkanes) enter into radical chlorination reaction. Andrew is a very curious boy, so he wondered how many different products of the reaction may be forms for a given alkane. He managed to solve the task for small molecules, but for large ones he faced some difficulties and asks you to help. Formally, you are given a tree consisting of n vertices, such that the degree of each vertex doesn't exceed 4. You have to count the number of distinct non-isomorphic trees that can be obtained by adding to this tree one new vertex and one new edge, such that the graph is still the tree and the degree of each vertex doesn't exceed 4. Two trees are isomorphic if there exists a bijection f(v) such that vertices u and v are connected by an edge if and only if vertices f(v) and f(u) are connected by an edge. The first line of the input contains an integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100 xe2 x80 x89000) -- the number of vertices in the tree. Then follow n xe2 x80 x89- xe2 x80 x891 lines with edges descriptions. Each edge is given by two integers ui and vi (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ui, xe2 x80 x89vi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) -- indices of vertices connected by an edge. It's guaranteed that the given graph is a tree and the degree of each vertex doesn't exceed 4. Print one integer -- the answer to the question. In the first sample, one can add new vertex to any existing vertex, but the trees we obtain by adding a new vertex to vertices 1, 3 and 4 are isomorphic, thus the answer is 2. In the second sample, one can't add new vertex to the first vertex, as its degree is already equal to four. Trees, obtained by adding a new vertex to vertices 2, 3, 4 and 5 are isomorphic, thus the answer is 1. "...

Tutorials

Codeforces Round #373 — Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
22089272 vjudge4 D Nov. 7, 2016, 6:40 a.m. OK GNU C++ TESTS 78 93 11571200 2900
20918110 AkaneSasu D Sept. 26, 2016, 1:22 a.m. OK GNU C++ TESTS 78 93 62976000 2900
40983625 ReaLNero1 D July 30, 2018, 6:57 p.m. OK GNU C++ TESTS 78 93 63078400 2900
22469372 XuYipei D Nov. 24, 2016, 2:44 p.m. OK GNU C++ TESTS 78 93 83763200 2900
31526960 vjudge4 D Oct. 20, 2017, 8:22 a.m. OK GNU C++ TESTS 78 109 85811200 2900
22089282 kbnzlevy D Nov. 7, 2016, 6:40 a.m. OK GNU C++ TESTS 78 124 11571200 2900
31540416 vjudge5 D Oct. 20, 2017, 4:46 p.m. OK GNU C++ TESTS 78 124 15360000 2900
31540414 vjudge3 D Oct. 20, 2017, 4:46 p.m. OK GNU C++ TESTS 78 124 15360000 2900
21233709 jasonvictoryan D Oct. 6, 2016, 12:10 p.m. OK GNU C++ TESTS 78 140 11571200 2900
38711379 luogu_bot4 D May 29, 2018, 6:59 a.m. OK GNU C++ TESTS 78 140 13209600 2900
64278427 Zhou_JK D Nov. 4, 2019, 11:33 p.m. OK GNU C++11 TESTS 78 78 11264000 2900
64278417 jhzjk D Nov. 4, 2019, 11:32 p.m. OK GNU C++11 TESTS 78 78 11264000 2900
64278451 vjudge4 D Nov. 4, 2019, 11:34 p.m. OK GNU C++11 TESTS 78 93 11264000 2900
22216975 QAQQQ D Nov. 15, 2016, 5:24 a.m. OK GNU C++11 TESTS 78 109 11161600 2900
22216964 QAsQ D Nov. 15, 2016, 5:23 a.m. OK GNU C++11 TESTS 78 109 11161600 2900
31524618 vjudge2 D Oct. 20, 2017, 6:02 a.m. OK GNU C++11 TESTS 78 109 15667200 2900
63703683 cavary_cl D Oct. 29, 2019, 8:11 a.m. OK GNU C++11 TESTS 78 109 16384000 2900
20884900 poursoul D Sept. 24, 2016, 11:01 a.m. OK GNU C++11 TESTS 78 140 13209600 2900
30199588 Amayoneko D Sept. 8, 2017, 10:05 a.m. OK GNU C++11 TESTS 78 155 11468800 2900
23481001 smeke D Jan. 1, 2017, 9:38 a.m. OK GNU C++11 TESTS 78 155 15974400 2900
35954142 _quq D March 5, 2018, 1:40 a.m. OK GNU C++14 TESTS 78 78 17715200 2900
20962501 PItS D Sept. 28, 2016, 8:16 a.m. OK GNU C++14 TESTS 78 93 6451200 2900
26100132 rqgao2014 D April 3, 2017, 1:07 p.m. OK GNU C++14 TESTS 78 109 17203200 2900
44339397 luogu_bot2 D Oct. 15, 2018, 1:42 a.m. OK GNU C++14 TESTS 78 124 11059200 2900
44346045 luogu_bot5 D Oct. 15, 2018, 7:23 a.m. OK GNU C++14 TESTS 78 124 11264000 2900
30257690 Troywar D Sept. 11, 2017, 2:07 a.m. OK GNU C++14 TESTS 78 124 12492800 2900
38255281 AngelKnows D May 15, 2018, 3:44 a.m. OK GNU C++14 TESTS 78 155 15155200 2900
22463617 NiroBC D Nov. 24, 2016, 10:28 a.m. OK GNU C++14 TESTS 78 156 14848000 2900
45844974 _The_Mastermind_ D Nov. 16, 2018, 7:08 p.m. OK GNU C++14 TESTS 78 156 20889600 2900
36570547 chrisfsj2051 D March 24, 2018, 10:11 a.m. OK GNU C++14 TESTS 78 171 15155200 2900
56520235 maras D July 4, 2019, 2:35 p.m. OK GNU C++17 TESTS 78 265 30310400 2900
56983827 Benq D July 13, 2019, 3:03 p.m. OK GNU C++17 TESTS 78 296 32051200 2900
68102237 yan.silva D Jan. 3, 2020, 4:21 a.m. OK GNU C++17 TESTS 78 296 32153600 2900
44529600 xumingyang D Oct. 19, 2018, 5:41 a.m. OK GNU C++17 TESTS 78 405 42086400 2900
65426513 llbra9z D Nov. 20, 2019, 10:51 a.m. OK GNU C++17 TESTS 78 452 41369600 2900
59801029 FlyInTheSky D Aug. 31, 2019, 10:15 a.m. OK GNU C++17 TESTS 78 468 41369600 2900
58903144 fsociety00 D Aug. 16, 2019, 10:01 a.m. OK GNU C++17 TESTS 78 483 31436800 2900
21251064 JialinOuyang D Oct. 7, 2016, 6:17 a.m. OK Java 8 TESTS 78 327 50278400 2900
50338666 tri D Feb. 22, 2019, 11:38 p.m. OK Java 8 TESTS 78 436 32460800 2900
20984309 uwi D Sept. 29, 2016, 5:59 a.m. OK Java 8 TESTS 78 607 51302400 2900
22204106 emo D Nov. 14, 2016, 8:04 a.m. OK Java 8 TESTS 78 717 68505600 2900
22203614 emo D Nov. 14, 2016, 7:17 a.m. OK Java 8 TESTS 78 826 58675200 2900
20860016 Egor D Sept. 23, 2016, 2:29 p.m. OK Java 8 TESTS 78 857 58777600 2900
29238960 Acforgood D Aug. 6, 2017, 10:41 a.m. OK Java 8 TESTS 78 1465 188416000 2900
29130017 Acforgood D Aug. 2, 2017, 12:34 p.m. OK Java 8 TESTS 78 1481 162201600 2900
27484332 Los_Angelos_Laycurse D June 1, 2017, 12:16 p.m. OK MS C++ TESTS 78 296 26726400 2900
44432299 hengheng D Oct. 17, 2018, 8:15 a.m. OK MS C++ TESTS 78 498 41881600 2900

remove filters

Back to search problems