Manthan, Codefest 16

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
633 Manthan, Codefest 16 FINISHED False 9000 280932287 Feb. 26, 2016, 5:15 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 797 ) G Yash And Trees PROGRAMMING bitmasks data structures dfs and similar math number theory 2700

B"Yash loves playing with trees and gets especially excited when they have something to do with prime numbers. On his 20th birthday he was granted with a rooted tree of n nodes to answer queries on. Hearing of prime numbers on trees, Yash gets too intoxicated with excitement and asks you to help out and answer queries on trees for him. Tree is rooted at node 1. Each node i has some value ai associated with it. Also, integer m is given. There are queries of two types: The first of the input contains two integers n and m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100 xe2 x80 x89000, xe2 x80 x891 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891000) -- the number of nodes in the tree and value m from the problem statement, respectively. The second line consists of n integers ai (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109) -- initial values of the nodes. Then follow n xe2 x80 x89- xe2 x80 x891 lines that describe the tree. Each of them contains 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 nodes connected by the i-th edge. Next line contains a single integer q (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89q xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100 xe2 x80 x89000) -- the number of queries to proceed. Each of the last q lines is either 1 v x or 2 v (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89v xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, xe2 x80 x890 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89x xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109), giving the query of the first or the second type, respectively. It's guaranteed that there will be at least one query of the second type. For each of the queries of the second type print the number of suitable prime numbers."...

Tutorials

Manthan, Codefest 16: Editorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
27750351 jiyutian G June 13, 2017, 6:46 a.m. OK GNU C++ TESTS 98 467 59801600 2700
40984962 ReaLNero1 G July 30, 2018, 7:40 p.m. OK GNU C++ TESTS 98 545 19251200 2700
16971126 RNS_CUS G March 27, 2016, 12:41 p.m. OK GNU C++ TESTS 98 545 21299200 2700
27527436 jyt1999 G June 2, 2017, 3:55 p.m. OK GNU C++ TESTS 98 545 59801600 2700
27527401 jyt1999 G June 2, 2017, 3:53 p.m. OK GNU C++ TESTS 98 545 59801600 2700
27749546 zhan8855 G June 13, 2017, 5:49 a.m. OK GNU C++ TESTS 98 561 14643200 2700
27527461 jyt1999 G June 2, 2017, 3:56 p.m. OK GNU C++ TESTS 98 561 59801600 2700
27527115 jyt1999 G June 2, 2017, 3:39 p.m. OK GNU C++ TESTS 98 592 59801600 2700
27527252 jyt1999 G June 2, 2017, 3:46 p.m. OK GNU C++ TESTS 98 607 59801600 2700
27526863 jyt1999 G June 2, 2017, 3:24 p.m. OK GNU C++ TESTS 98 607 59801600 2700
57881925 lopare G July 28, 2019, 8:11 a.m. OK GNU C++11 TESTS 98 514 45056000 2700
54504126 vjudge3 G May 23, 2019, 1:59 a.m. OK GNU C++11 TESTS 98 514 59699200 2700
54504159 YIMEI G May 23, 2019, 2:01 a.m. OK GNU C++11 TESTS 98 514 80384000 2700
57815902 py_ultron G July 26, 2019, 7:40 p.m. OK GNU C++11 TESTS 98 529 45056000 2700
16403983 huantwofat G Feb. 28, 2016, 1:30 p.m. OK GNU C++11 TESTS 98 576 11264000 2700
27749342 ZYF1024 G June 13, 2017, 5:32 a.m. OK GNU C++11 TESTS 98 701 44953600 2700
16732462 krijgertje G March 15, 2016, 6:15 p.m. OK GNU C++11 TESTS 98 748 34816000 2700
16366663 LHiC G Feb. 26, 2016, 7:13 p.m. OK GNU C++11 TESTS 98 779 61030400 2700
27751468 pyop G June 13, 2017, 8:11 a.m. OK GNU C++11 TESTS 98 780 57753600 2700
27750859 rxdoi G June 13, 2017, 7:26 a.m. OK GNU C++11 TESTS 98 810 59699200 2700
27766172 wtltw G June 14, 2017, 2:35 a.m. OK GNU C++14 TESTS 98 779 59699200 2700
47815879 TadijaSebez G Jan. 1, 2019, 2:22 p.m. OK GNU C++14 TESTS 98 997 37376000 2700
44380291 Marckess G Oct. 16, 2018, 3:03 a.m. OK GNU C++14 TESTS 98 998 62361600 2700
60813426 sagarthecoder2 G Sept. 18, 2019, 6:56 p.m. OK GNU C++14 TESTS 98 1013 62361600 2700
58964699 kataki G Aug. 17, 2019, 5:10 p.m. OK GNU C++14 TESTS 98 1014 62259200 2700
29302187 vjudge4 G Aug. 9, 2017, 9:11 a.m. OK GNU C++14 TESTS 98 1014 66355200 2700
29302222 vjudge4 G Aug. 9, 2017, 9:13 a.m. OK GNU C++14 TESTS 98 1029 66355200 2700
31356875 vjudge4 G Oct. 15, 2017, 9:41 a.m. OK GNU C++14 TESTS 98 1060 61132800 2700
59359862 BamiTorabi G Aug. 23, 2019, 2:51 p.m. OK GNU C++14 TESTS 98 1060 62259200 2700
22851558 245075255 G Dec. 10, 2016, 9:02 a.m. OK GNU C++14 TESTS 98 1060 72908800 2700
60394387 cuiaoxiang G Sept. 11, 2019, 2:23 p.m. OK GNU C++17 TESTS 98 966 39014400 2700
59905206 vjudge3 G Sept. 2, 2019, 3:05 p.m. OK GNU C++17 TESTS 98 997 67481600 2700
59904145 vjudge1 G Sept. 2, 2019, 2:41 p.m. OK GNU C++17 TESTS 98 1013 65433600 2700
59905235 acisnull G Sept. 2, 2019, 3:06 p.m. OK GNU C++17 TESTS 98 1013 67481600 2700
60394763 cuiaoxiang G Sept. 11, 2019, 2:31 p.m. OK GNU C++17 TESTS 98 1044 39014400 2700
60442635 vjudge5 G Sept. 12, 2019, 1:03 p.m. OK GNU C++17 TESTS 98 1045 63795200 2700
59905644 acisnull G Sept. 2, 2019, 3:15 p.m. OK GNU C++17 TESTS 98 1045 65433600 2700
59898152 vjudge4 G Sept. 2, 2019, 12:49 p.m. OK GNU C++17 TESTS 98 1045 65433600 2700
59899833 acisnull G Sept. 2, 2019, 1:18 p.m. OK GNU C++17 TESTS 98 1060 66252800 2700
59899478 acisnull G Sept. 2, 2019, 1:12 p.m. OK GNU C++17 TESTS 98 1060 66252800 2700
16366924 mmaxio G Feb. 26, 2016, 7:16 p.m. OK Java 8 TESTS 98 1434 107929600 2700
16391144 og.kostya G Feb. 27, 2016, 7:08 p.m. OK MS C# TESTS 98 1622 103321600 2700
16391326 og.kostya G Feb. 27, 2016, 7:16 p.m. OK MS C# TESTS 98 1746 103219200 2700
16389279 og.kostya G Feb. 27, 2016, 5:52 p.m. OK MS C# TESTS 98 1762 103731200 2700
16398792 yubowenok G Feb. 28, 2016, 8:04 a.m. OK MS C++ TESTS 98 1185 146329600 2700
16438490 Mosyagin G March 1, 2016, 9:35 a.m. OK MS C++ TESTS 98 1294 43315200 2700
16434771 iblacksun G March 1, 2016, 2:35 a.m. OK MS C++ TESTS 98 1466 47411200 2700
16386435 Taube G Feb. 27, 2016, 3:53 p.m. OK MS C++ TESTS 98 1903 62054400 2700

remove filters

Back to search problems