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 |
|---|---|---|---|---|---|---|
| 772 | VK Cup 2017 - Round 2 | FINISHED | False | 7200 | 284048723 | April 16, 2017, 3:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 219 ) | E | Verifying Kingdom | PROGRAMMING | binary search divide and conquer interactive trees | 3200 |
This is an interactive problem. The judge has a hidden rooted full binary tree with n leaves. A full binary tree is one where every node has either 0 or 2 children. The nodes with 0 children are called the leaves of the tree. Since this is a full binary tree, there are exactly 2 n - 1 nodes in the tree. The leaves of the judge's tree has labels from 1 to n . You would like to reconstruct a tree that is isomorphic to the judge's tree. To do this, you can ask some questions. A question consists of printing the label of three distinct leaves a 1 , a 2 , a 3 . Let the depth of a node be the shortest distance from the node to the root of the tree. Let LCA ( a , b ) denote the node with maximum depth that is a common ancestor of the nodes a and b . Consider X = LCA ( a 1 , a 2 ), Y = LCA ( a 2 , a 3 ), Z = LCA ( a 3 , a 1 ) . The judge will tell you which one of X , Y , Z has the maximum depth. Note, this pair is uniquely determined since the tree is a binary tree; there can't be any ties. More specifically, if X (or Y , Z respectively) maximizes the depth, the judge will respond with the string " X " (or " Y ", " Z " respectively). You may only ask at most 10· n questions. The first line of input will contain a single integer n ( 3 ≤ n ≤ 1 000 ) — the number of leaves in the tree. To print the final answer, print out the string " -1 " on its own line. Then, the next line should contain 2 n - 1 integers. The i -th integer should be the parent of the i -th node, or -1, if it is the root. Your answer will be judged correct if your output is isomorphic to the judge's tree. In particular, the labels of the leaves do not need to be labeled from 1 to n . Here, isomorphic means that there exists a permutation π such that node i is the parent of node j in the judge tree if and only node π( i ) is the parent of node π( j ) in your tree. To ask a question, print out three distinct integers a 1 , a 2 , a 3 . These integers should be between 1 and n , inclusive. The judge w |
| VK Cup Round 2 + Codeforces Round #409 Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 27661194 | jiyutian | E | June 8, 2017, 1:45 a.m. | OK | GNU C++ | TESTS | 153 | 93 | 0 | 3200 | |
| 26432741 | SergeiFedorov | E | April 16, 2017, 5:19 p.m. | OK | GNU C++ | TESTS | 153 | 93 | 2150400 | 3200 | |
| 42268886 | luogu_bot2 | E | Aug. 30, 2018, 7:03 a.m. | OK | GNU C++ | TESTS | 153 | 140 | 0 | 3200 | |
| 26505034 | BSBandme | E | April 19, 2017, 10:33 p.m. | OK | GNU C++11 | TESTS | 153 | 77 | 2150400 | 3200 | |
| 27755013 | Manchery | E | June 13, 2017, 12:09 p.m. | OK | GNU C++11 | TESTS | 153 | 93 | 0 | 3200 | |
| 27327893 | Dirak | E | May 25, 2017, 1:55 a.m. | OK | GNU C++11 | TESTS | 153 | 93 | 0 | 3200 | |
| 36164942 | narci6ix | E | March 10, 2018, 4:30 p.m. | OK | GNU C++11 | TESTS | 153 | 93 | 2150400 | 3200 | |
| 26432704 | LHiC V--o_o--V | E | April 16, 2017, 5:19 p.m. | OK | GNU C++11 | TESTS | 153 | 93 | 2150400 | 3200 | |
| 26495773 | aid | E | April 19, 2017, 12:52 p.m. | OK | GNU C++11 | TESTS | 153 | 108 | 2252800 | 3200 | |
| 28482012 | staffik | E | July 12, 2017, 7:10 p.m. | OK | GNU C++11 | TESTS | 153 | 108 | 4300800 | 3200 | |
| 55018520 | __23333 | E | June 3, 2019, 1:34 p.m. | OK | GNU C++11 | TESTS | 153 | 109 | 102400 | 3200 | |
| 55018456 | __23333 | E | June 3, 2019, 1:32 p.m. | OK | GNU C++11 | TESTS | 153 | 109 | 102400 | 3200 | |
| 36289596 | zhouyuyang | E | March 15, 2018, 3:12 a.m. | OK | GNU C++11 | TESTS | 153 | 109 | 2150400 | 3200 | |
| 36299516 | akapros | E | March 15, 2018, 12:34 p.m. | OK | GNU C++14 | TESTS | 153 | 93 | 1945600 | 3200 | |
| 28354901 | Andrei1998 | E | July 7, 2017, 6:28 p.m. | OK | GNU C++14 | TESTS | 153 | 93 | 2048000 | 3200 | |
| 26670528 | Ali.Pi | E | April 25, 2017, 8:24 p.m. | OK | GNU C++14 | TESTS | 153 | 93 | 2048000 | 3200 | |
| 26529846 | Philipsweng | E | April 21, 2017, 3:31 a.m. | OK | GNU C++14 | TESTS | 153 | 93 | 2252800 | 3200 | |
| 26446095 | jcvb | E | April 17, 2017, 5:15 a.m. | OK | GNU C++14 | TESTS | 153 | 93 | 2560000 | 3200 | |
| 37694592 | tinca_matei | E | April 28, 2018, 8:12 p.m. | OK | GNU C++14 | TESTS | 153 | 93 | 3379200 | 3200 | |
| 40982319 | ReaLNero1 | E | July 30, 2018, 6:22 p.m. | OK | GNU C++14 | TESTS | 153 | 108 | 102400 | 3200 | |
| 37010550 | g1n0st | E | April 6, 2018, 2:15 a.m. | OK | GNU C++14 | TESTS | 153 | 108 | 3481600 | 3200 | |
| 39277122 | XingGeRuCi | E | June 16, 2018, 1:36 a.m. | OK | GNU C++14 | TESTS | 153 | 109 | 102400 | 3200 | |
| 36571089 | shaochengxi | E | March 24, 2018, 10:34 a.m. | OK | GNU C++14 | TESTS | 153 | 109 | 3686400 | 3200 | |
| 69951660 | gongsuidashen | E | Feb. 1, 2020, 9:07 a.m. | OK | GNU C++17 | TESTS | 153 | 140 | 102400 | 3200 | |
| 58340902 | superguyjm | E | Aug. 5, 2019, 1:11 p.m. | OK | GNU C++17 | TESTS | 153 | 170 | 4198400 | 3200 | |
| 26503352 | mmaxio | E | April 19, 2017, 7:39 p.m. | OK | Java 8 | TESTS | 153 | 358 | 20480000 | 3200 |
Back to search problems