Forethought Future Cup - Elimination Round

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
1146 Forethought Future Cup - Elimination Round FINISHED False 9000 181655687 April 20, 2019, 6:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3758 ) C Tree Diameter PROGRAMMING bitmasks graphs interactive 1700

B'There is a weighted tree with n nodes and n-1 edges. The nodes are conveniently labeled from 1 to n . The weights are positive integers at most 100 . Define the distance between two nodes to be the sum of edges on the unique path between the nodes. You would like to find the diameter of the tree. Diameter is the maximum distance between a pair of nodes. Unfortunately, the tree isn 't given to you, but you can ask some questions about it. In one question, you can specify two nonempty disjoint sets of nodes p and q , and the judge will return the maximum distance between a node in p and a node in q . In the words, maximum distance between x and y , where x in p and y in q . After asking not more than 9 questions, you must report the maximum distance between any pair of nodes. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 1 ,000 ). Description of the test cases follows. The first line of each test case contains an integer n ( 2 <= q n <= q 100 ) -- the number of nodes in the tree. To ask a question, print " k_1 k_2 a_1 a_2 ldots a_{k_1} b_1 b_2 ldots b_{k_2} " (k_1, k_2 geq 1 and k_1+k_2 <= q n ). These two sets must be nonempty and disjoint. The judge will respond with a single integer max_{p,q} dist(a_p, b_q) . If you ever get a result of -1 (because you printed an invalid query), exit immediately to avoid getting other verdicts. After printing a query do not forget to output end of line and flush the output. Otherwise, you will get Idleness limit exceeded. To do this, use: When you are ready to answer, print " -1 d ", where d is the maximum shortest distance over all pairs of nodes. You can only ask at most 9 questions per test case. Hack Format To hack, use the following format. Note that you can only hack with one test case. The first line sh'...

Tutorials

66639

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
53060118 hos.lyric C April 20, 2019, 6:16 p.m. OK D TESTS 46 655 204800 1700
53094907 ruban C April 21, 2019, 1:03 p.m. OK Delphi TESTS 46 218 27852800 1700
53065130 PhuongPeu C April 20, 2019, 6:44 p.m. OK FPC TESTS 46 1980 307200 1700
53083032 sansen C April 21, 2019, 7:37 a.m. OK GNU C11 TESTS 46 156 0 1700
53118194 jschr C April 22, 2019, 9:35 a.m. OK GNU C11 TESTS 46 2340 0 1700
53072565 SNIPER1947 C April 20, 2019, 8:03 p.m. OK GNU C11 TESTS 46 2370 0 1700
55610367 ReaLNero1 C June 16, 2019, 5:17 a.m. OK GNU C++11 TESTS 46 109 0 1700
53904866 bakpark C May 9, 2019, 12:13 p.m. OK GNU C++11 TESTS 46 124 0 1700
53163288 arthur.nascimento C April 22, 2019, 5:01 p.m. OK GNU C++11 TESTS 46 124 614400 1700
57510499 pmitkov C July 22, 2019, 1:36 p.m. OK GNU C++11 TESTS 46 139 0 1700
53064792 Lius C April 20, 2019, 6:41 p.m. OK GNU C++11 TESTS 46 139 0 1700
53072317 mijatolaxd C April 20, 2019, 7:59 p.m. OK GNU C++11 TESTS 46 140 0 1700
53062923 Aviously C April 20, 2019, 6:29 p.m. OK GNU C++11 TESTS 46 140 0 1700
53091738 daifucong C April 21, 2019, 11:34 a.m. OK GNU C++11 TESTS 46 140 0 1700
53879162 beacon_cwk C May 8, 2019, 1:41 p.m. OK GNU C++11 TESTS 46 140 0 1700
55849853 oduesp C June 21, 2019, 2:36 a.m. OK GNU C++11 TESTS 46 140 0 1700
53116751 Madeline C April 22, 2019, 8:38 a.m. OK GNU C++14 TESTS 46 140 204800 1700
53165638 izanbf C April 22, 2019, 5:55 p.m. OK GNU C++14 TESTS 46 155 0 1700
53092722 Xorawar C April 21, 2019, noon OK GNU C++14 TESTS 46 155 0 1700
53089984 kzvd4729 C April 21, 2019, 10:44 a.m. OK GNU C++14 TESTS 46 155 0 1700
53081022 evilbuggy C April 21, 2019, 6:29 a.m. OK GNU C++14 TESTS 46 155 0 1700
53064406 Mindjolt C April 20, 2019, 6:38 p.m. OK GNU C++14 TESTS 46 155 0 1700
55064844 keunbum C June 4, 2019, 2:48 a.m. OK GNU C++14 TESTS 46 155 0 1700
56648971 ZNI C July 7, 2019, 7:25 a.m. OK GNU C++14 TESTS 46 155 0 1700
55980983 Single_Ready_To_Mingle C June 23, 2019, 9:01 p.m. OK GNU C++14 TESTS 46 155 0 1700
53070323 guillermo C April 20, 2019, 7:33 p.m. OK GNU C++14 TESTS 46 155 102400 1700
53106362 road_to_petr C April 21, 2019, 8:20 p.m. OK GNU C++17 TESTS 46 140 0 1700
53066178 Ishbaev C April 20, 2019, 6:51 p.m. OK GNU C++17 TESTS 46 155 0 1700
53093086 misir C April 21, 2019, 12:10 p.m. OK GNU C++17 TESTS 46 155 0 1700
53066620 art1st C April 20, 2019, 6:55 p.m. OK GNU C++17 TESTS 46 155 0 1700
53083262 akagami_no_shanks C April 21, 2019, 7:44 a.m. OK GNU C++17 TESTS 46 155 0 1700
53105544 mblazev C April 21, 2019, 7:37 p.m. OK GNU C++17 TESTS 46 155 0 1700
53065932 Deanamic_Programming C April 20, 2019, 6:49 p.m. OK GNU C++17 TESTS 46 155 204800 1700
53477860 anybody... C April 28, 2019, 4:55 p.m. OK GNU C++17 TESTS 46 156 0 1700
55267389 sksinghal17 C June 7, 2019, 2:24 p.m. OK GNU C++17 TESTS 46 156 0 1700
64731375 jjang36524 C Nov. 12, 2019, 8:34 a.m. OK GNU C++17 TESTS 46 156 0 1700
68467099 ZeyadKhattab C Jan. 9, 2020, 9:14 p.m. OK Java 11 TESTS 46 733 0 1700
53810147 happybelly C May 6, 2019, 5:57 a.m. OK Java 8 TESTS 46 358 0 1700
53807552 happybelly C May 6, 2019, 3 a.m. OK Java 8 TESTS 46 358 0 1700
53810250 happybelly C May 6, 2019, 6:03 a.m. OK Java 8 TESTS 46 358 0 1700
53101201 prituladima C April 21, 2019, 4:34 p.m. OK Java 8 TESTS 46 390 0 1700
53669426 dalt C May 2, 2019, 12:23 p.m. OK Java 8 TESTS 46 405 0 1700
53077702 aman28rwt C April 21, 2019, 2:45 a.m. OK Java 8 TESTS 46 420 0 1700
64850721 bluesky111 C Nov. 13, 2019, 7:29 p.m. OK Java 8 TESTS 46 436 0 1700
53070149 mTvTm C April 20, 2019, 7:31 p.m. OK Java 8 TESTS 46 451 0 1700
53069466 naam_me_kya_rakha_he C April 20, 2019, 7:23 p.m. OK Java 8 TESTS 46 451 0 1700
53094437 hack1nt0 C April 21, 2019, 12:48 p.m. OK Java 8 TESTS 46 452 0 1700
53062737 Sergey.Bankevich C April 20, 2019, 6:28 p.m. OK Kotlin TESTS 46 670 0 1700
53065698 diego_93 C April 20, 2019, 6:48 p.m. OK Kotlin TESTS 46 904 0 1700
53071747 calmarj C April 20, 2019, 7:51 p.m. OK Kotlin TESTS 46 2667 0 1700
53064444 TrabajoNocturno C April 20, 2019, 6:39 p.m. OK Mono C# TESTS 46 373 74035200 1700
53103126 GroOND C April 21, 2019, 5:47 p.m. OK Mono C# TESTS 46 389 3174400 1700
53067264 omikad C April 20, 2019, 7 p.m. OK Mono C# TESTS 46 389 6758400 1700
53062629 keymoon C April 20, 2019, 6:27 p.m. OK Mono C# TESTS 46 421 3174400 1700
53075871 old_boo C April 20, 2019, 9:34 p.m. OK Mono C# TESTS 46 421 6758400 1700
53103287 GroOND C April 21, 2019, 5:54 p.m. OK Mono C# TESTS 46 467 3174400 1700
53063251 math957963 C April 20, 2019, 6:31 p.m. OK MS C++ TESTS 46 280 0 1700
60960466 vjudge2 C Sept. 21, 2019, 5:08 a.m. OK MS C++ TESTS 46 280 0 1700
53067309 2xJelly C April 20, 2019, 7 p.m. OK MS C++ TESTS 46 358 0 1700
53062148 BaturaDima C April 20, 2019, 6:25 p.m. OK MS C++ TESTS 46 561 0 1700
53076925 SugarOnBacon C April 20, 2019, 10:19 p.m. OK MS C++ 2017 TESTS 46 280 0 1700
53066898 youx C April 20, 2019, 6:57 p.m. OK MS C++ 2017 TESTS 46 327 102400 1700
53062493 SendThemToHell C April 20, 2019, 6:27 p.m. OK MS C++ 2017 TESTS 46 343 0 1700
53078016 Kucha C April 21, 2019, 3:38 a.m. OK MS C++ 2017 TESTS 46 358 0 1700
53086871 Boryan07 C April 21, 2019, 9:20 a.m. OK MS C++ 2017 TESTS 46 358 0 1700
60387809 Yanhui C Sept. 11, 2019, 12:11 p.m. OK MS C++ 2017 TESTS 46 358 0 1700
53180328 MenOfPassion C April 23, 2019, 7:12 a.m. OK MS C++ 2017 TESTS 46 405 0 1700
53065785 siwei C April 20, 2019, 6:48 p.m. OK MS C++ 2017 TESTS 46 420 0 1700
53197530 pseuda C April 23, 2019, 4:10 p.m. OK MS C++ 2017 TESTS 46 499 102400 1700
53173689 fatant C April 23, 2019, 1:22 a.m. OK MS C++ 2017 TESTS 46 576 0 1700
53068808 Mukundan314 C April 20, 2019, 7:15 p.m. OK PyPy 2 TESTS 46 483 5222400 1700
53298997 Helli.code C April 25, 2019, 7:16 p.m. OK PyPy 2 TESTS 46 529 2457600 1700
53063035 pedrosorio C April 20, 2019, 6:30 p.m. OK PyPy 2 TESTS 46 529 2457600 1700
53063247 alexwice C April 20, 2019, 6:31 p.m. OK PyPy 2 TESTS 46 623 4710400 1700
53069592 makkader C April 20, 2019, 7:24 p.m. OK PyPy 2 TESTS 46 623 7372800 1700
53066380 cherry_su C April 20, 2019, 6:53 p.m. OK PyPy 2 TESTS 46 716 5734400 1700
53067176 supachai_pay C April 20, 2019, 6:59 p.m. OK PyPy 2 TESTS 46 1122 8192000 1700
53073755 beriefing C April 20, 2019, 8:20 p.m. OK PyPy 2 TESTS 46 2979 10035200 1700
53219509 spikerheado1234 C April 24, 2019, 11:05 a.m. OK PyPy 3 TESTS 46 810 7884800 1700
53065308 pineriver C April 20, 2019, 6:45 p.m. OK PyPy 3 TESTS 46 811 6348800 1700
53071254 dizballanze C April 20, 2019, 7:45 p.m. OK PyPy 3 TESTS 46 872 8089600 1700
53512723 nexus.chebykin C April 29, 2019, 3:08 p.m. OK PyPy 3 TESTS 46 873 6656000 1700
61332017 yumtam C Sept. 26, 2019, 3:17 p.m. OK PyPy 3 TESTS 46 873 7884800 1700
53075960 malylesio C April 20, 2019, 9:37 p.m. OK PyPy 3 TESTS 46 904 5529600 1700
53070613 _Tachibana_Kanade_ C April 20, 2019, 7:36 p.m. OK PyPy 3 TESTS 46 904 7168000 1700
53081136 glucose C April 21, 2019, 6:33 a.m. OK PyPy 3 TESTS 46 904 7475200 1700
53189268 Leendertz C April 23, 2019, noon OK PyPy 3 TESTS 46 904 8704000 1700
53297925 Jarik C April 25, 2019, 6:29 p.m. OK PyPy 3 TESTS 46 904 8704000 1700
53071678 Nika86 C April 20, 2019, 7:50 p.m. OK Python 2 TESTS 46 514 102400 1700
53111966 Uranux C April 22, 2019, 4:14 a.m. OK Python 2 TESTS 46 607 102400 1700
53063852 nwi C April 20, 2019, 6:35 p.m. OK Python 2 TESTS 46 654 0 1700
53071007 bl4ckc4t C April 20, 2019, 7:41 p.m. OK Python 2 TESTS 46 873 204800 1700
53070395 wolffd C April 20, 2019, 7:33 p.m. OK Python 2 TESTS 46 967 409600 1700
53073696 primate C April 20, 2019, 8:19 p.m. OK Python 2 TESTS 46 1652 1228800 1700
53210915 SamuelLH C April 24, 2019, 5:22 a.m. OK Python 3 TESTS 46 576 307200 1700
53075791 theskushwaha C April 20, 2019, 9:33 p.m. OK Python 3 TESTS 46 592 307200 1700
53067405 2nt1 C April 20, 2019, 7:01 p.m. OK Python 3 TESTS 46 592 307200 1700
53071975 fireyyouth C April 20, 2019, 7:54 p.m. OK Python 3 TESTS 46 607 307200 1700
53086640 365050244 C April 21, 2019, 9:14 a.m. OK Python 3 TESTS 46 655 307200 1700
53067315 erickjohnross C April 20, 2019, 7 p.m. OK Python 3 TESTS 46 685 307200 1700
53101278 erickjohnross C April 21, 2019, 4:36 p.m. OK Python 3 TESTS 46 701 307200 1700
54090634 the_white_devil C May 14, 2019, 10:37 a.m. OK Python 3 TESTS 46 702 307200 1700
53066462 HowToWinICPC C April 20, 2019, 6:53 p.m. OK Python 3 TESTS 46 748 307200 1700
53660318 kvn320 C May 2, 2019, 7:21 a.m. OK Python 3 TESTS 46 779 307200 1700
53437016 old_boo C April 27, 2019, 7:55 p.m. OK Ruby TESTS 46 607 409600 1700
53074373 rinzu C April 20, 2019, 8:27 p.m. OK Ruby TESTS 46 701 512000 1700
53066444 EbTech C April 20, 2019, 6:53 p.m. OK Rust TESTS 46 374 204800 1700
53123204 wh317706 C April 22, 2019, 12:29 p.m. OK Rust TESTS 46 436 0 1700
53082485 EbTech C April 21, 2019, 7:21 a.m. OK Rust TESTS 46 436 204800 1700
53065509 limed C April 20, 2019, 6:46 p.m. OK Scala TESTS 46 1107 307200 1700

remove filters

Back to search problems