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 |
---|---|---|---|---|---|---|
1147 | Forethought Future Cup - Final Round (Onsite Finalists Only) | FINISHED | False | 7200 | 180536124 | May 4, 2019, 5:05 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 344 ) | E | Rainbow Coins | PROGRAMMING | interactive | 2900 |
B'Carl has n coins of various colors, and he would like to sort them into piles. The coins are labeled 1,2, ldots,n , and each coin is exactly one of red, green, or blue. He would like to sort the coins into three different piles so one pile contains all red coins, one pile contains all green coins, and one pile contains all blue coins. Unfortunately, Carl is colorblind, so this task is impossible for him. Luckily, he has a friend who can take a pair of coins and tell Carl if they are the same color or not. Using his friend, Carl believes he can now sort the coins. The order of the piles doesn 't matter, as long as all same colored coins are in the one pile, and no two different colored coins are in the same pile. His friend will answer questions about multiple pairs of coins in batches, and will answer about all of those pairs in parallel. Each coin should be in at most one pair in each batch. The same coin can appear in different batches. Carl can use only 7 batches. Help him find the piles of coins after sorting. You will be given multiple test cases. The first line contains an integer t (1 <= q t <= q 5 ) -- the number of test cases. The first line of each test case contains one integer n ( 1 <= q n <= q 10^5 ) -- the number of coins. If you read in a value of -1 here, that means that you printed an invalid answer in the previous case and exit immediately to avoid getting other verdicts. To ask a question, print "Q k x_1 y_1 ldots x_k y_k " ( 1 <= q k <= q n/2, 1 <= q x_i,y_i <= q n, x_i neq y_i ). k denotes the number of pairs in the batch, and x_i, y_i denote the i -th pair of coins in the batch. A coin can only appear at most once in a batch. All x_i and y_i should be distinct. The judge will respond with a bitstring of length k , where the i -th character is "1" if x_i and y_i are the same color, and "0" otherwise. The judge will respond '... |
Forethought Future Cup Final Round Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
65269189 | Khazhak | E | Nov. 17, 2019, 6:44 p.m. | OK | Clang++17 Diagnostics | TESTS | 20 | 1747 | 35123200 | 2900 | |
53810787 | newbiechdboom0 | E | May 6, 2019, 6:31 a.m. | OK | GNU C++11 | TESTS | 20 | 358 | 3788800 | 2900 | |
54015913 | ffffxk | E | May 12, 2019, 6:39 a.m. | OK | GNU C++11 | TESTS | 20 | 373 | 4096000 | 2900 | |
58900512 | lichenxi | E | Aug. 16, 2019, 8:58 a.m. | OK | GNU C++11 | TESTS | 20 | 374 | 2662400 | 2900 | |
53806367 | Rubbish12345 | E | May 6, 2019, 1:20 a.m. | OK | GNU C++11 | TESTS | 20 | 405 | 5734400 | 2900 | |
53811118 | Ra16bit | E | May 6, 2019, 6:49 a.m. | OK | GNU C++11 | TESTS | 20 | 421 | 2867200 | 2900 | |
53980499 | macs | E | May 11, 2019, 6:52 a.m. | OK | GNU C++11 | TESTS | 20 | 421 | 4198400 | 2900 | |
54350362 | Big_black_jujube | E | May 18, 2019, 2:30 p.m. | OK | GNU C++11 | TESTS | 20 | 436 | 3891200 | 2900 | |
65908933 | lzoiexplorer2004 | E | Nov. 28, 2019, 12:09 p.m. | OK | GNU C++11 | TESTS | 20 | 436 | 6144000 | 2900 | |
54017820 | stal_xy23z7b8 | E | May 12, 2019, 7:53 a.m. | OK | GNU C++11 | TESTS | 20 | 483 | 3584000 | 2900 | |
53909259 | vjudge5 | E | May 9, 2019, 2:59 p.m. | OK | GNU C++11 | TESTS | 20 | 483 | 4198400 | 2900 | |
57747082 | schtomi97 | E | July 25, 2019, 1:25 p.m. | OK | GNU C++14 | TESTS | 20 | 296 | 4198400 | 2900 | |
53909224 | vjudge3 | E | May 9, 2019, 2:58 p.m. | OK | GNU C++14 | TESTS | 20 | 311 | 3993600 | 2900 | |
63849642 | 21August | E | Oct. 30, 2019, 3:21 p.m. | OK | GNU C++14 | TESTS | 20 | 311 | 4505600 | 2900 | |
53880215 | luogu_bot2 | E | May 8, 2019, 2:14 p.m. | OK | GNU C++14 | TESTS | 20 | 311 | 4915200 | 2900 | |
54015192 | wilson.ho | E | May 12, 2019, 6:09 a.m. | OK | GNU C++14 | TESTS | 20 | 342 | 3686400 | 2900 | |
53758569 | ACRush | E | May 4, 2019, 6:37 p.m. | OK | GNU C++14 | TESTS | 20 | 374 | 6860800 | 2900 | |
53769611 | fofao_funk | E | May 5, 2019, 3:49 a.m. | OK | GNU C++14 | TESTS | 20 | 405 | 6451200 | 2900 | |
57378998 | shanin | E | July 20, 2019, 1:46 p.m. | OK | GNU C++14 | TESTS | 20 | 405 | 6963200 | 2900 | |
53837203 | Leonardo_Blanger | E | May 7, 2019, 4:19 a.m. | OK | GNU C++14 | TESTS | 20 | 421 | 3072000 | 2900 | |
53881413 | skrydg | E | May 8, 2019, 2:59 p.m. | OK | GNU C++14 | TESTS | 20 | 421 | 8806400 | 2900 | |
53797909 | pmnox | E | May 5, 2019, 4:20 p.m. | OK | GNU C++17 | TESTS | 20 | 312 | 4710400 | 2900 | |
55610348 | ReaLNero1 | E | June 16, 2019, 5:16 a.m. | OK | GNU C++17 | TESTS | 20 | 327 | 3686400 | 2900 | |
53907004 | lmiskiew | E | May 9, 2019, 1:17 p.m. | OK | GNU C++17 | TESTS | 20 | 374 | 6041600 | 2900 | |
69482155 | amiralisalimi | E | Jan. 24, 2020, 6:08 p.m. | OK | GNU C++17 | TESTS | 20 | 389 | 6860800 | 2900 | |
54899046 | dinosaurs | E | June 1, 2019, 5:26 a.m. | OK | GNU C++17 | TESTS | 20 | 420 | 3379200 | 2900 | |
53851397 | Kmcode | E | May 7, 2019, 1:38 p.m. | OK | GNU C++17 | TESTS | 20 | 451 | 3891200 | 2900 | |
55299176 | vjudge3 | E | June 8, 2019, 11:16 a.m. | OK | GNU C++17 | TESTS | 20 | 467 | 3072000 | 2900 | |
53769539 | nikgaevoy | E | May 5, 2019, 3:45 a.m. | OK | GNU C++17 | TESTS | 20 | 499 | 2560000 | 2900 | |
55608103 | square1001 | E | June 16, 2019, 3:03 a.m. | OK | GNU C++17 | TESTS | 20 | 514 | 3072000 | 2900 | |
54017770 | dalt | E | May 12, 2019, 7:51 a.m. | OK | Java 8 | TESTS | 20 | 264 | 409600 | 2900 |
Back to search problems