Codeforces Round 618 (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
1299 Codeforces Round 618 (Div. 1) FINISHED False 7200 156095711 Feb. 9, 2020, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 169 ) E So Mean PROGRAMMING interactive math 3400

B"This problem is interactive. We have hidden a permutation p_1, p_2, ... , p_n of numbers from 1 to n from you, where n is even. You can try to guess it using the following queries: ? k a_1 a_2 ... a_k . In response, you will learn if the average of elements with indexes a_1, a_2, ... , a_k is an integer. In other words, you will receive 1 if frac{p_{a_1} + p_{a_2} + ... + p_{a_k}}{k} is integer, and 0 otherwise. You have to guess the permutation. You can ask not more than 18n queries. Note that permutations [p_1, p_2, ... , p_k] and [n + 1 - p_1, n + 1 - p_2, ... , n + 1 - p_k] are indistinguishable. Therefore, you are guaranteed that p_1 <= frac{n}{2} . Note that the permutation p is fixed before the start of the interaction and doesn't depend on your queries. In other words, interactor is not adaptive. Note that you don't have to minimize the number of queries. The first line contains a single integer n ( 2 <= n <= 800 , n is even). You begin the interaction by reading n . To ask a question about elements on positions a_1, a_2, ... , a_k , in a separate line output ? k a_1 a_2 ... a_k Numbers in the query have to satisfy 1 <= a_i <= n , and all a_i have to be different. Don't forget to 'flush', to get the answer. In response, you will receive 1 if frac{p_{a_1} + p_{a_2} + ... + p_{a_k}}{k} is integer, and 0 otherwise. In case your query is invalid or you asked more than 18n queries, the program will print -1 and will finish interaction. You will receive a Wrong answer verdict. Make sure to exit immediately to avoid getting other verdicts. When you determine permutation, output ! p_1 p_2 ... p_n After printing a query do not forget to output end of line and flush the output. Otherwise, you will get Idlene"...

Tutorials

Codeforces Round #618 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
70797322 stal_xy23z7b8 E Feb. 11, 2020, 3:53 p.m. OK GNU C++11 TESTS 75 561 0 3400
70786659 gay__cjioer E Feb. 11, 2020, 12:34 p.m. OK GNU C++11 TESTS 75 561 0 3400
70702051 WZYYN E Feb. 10, 2020, 3:17 a.m. OK GNU C++11 TESTS 75 577 0 3400
70740023 imalyd E Feb. 10, 2020, 3:43 p.m. OK GNU C++11 TESTS 75 592 6656000 3400
70828543 tyler178 E Feb. 12, 2020, 7:27 a.m. OK GNU C++11 TESTS 75 608 102400 3400
70780998 cuizhuyefei E Feb. 11, 2020, 10:39 a.m. OK GNU C++11 TESTS 75 623 0 3400
70790234 ohweonfire E Feb. 11, 2020, 1:33 p.m. OK GNU C++11 TESTS 75 670 0 3400
70731099 zx2003 E Feb. 10, 2020, 1:19 p.m. OK GNU C++11 TESTS 75 670 102400 3400
70836620 _twilight E Feb. 12, 2020, 10:23 a.m. OK GNU C++11 TESTS 75 951 102400 3400
70694505 MAOoo E Feb. 9, 2020, 9:33 p.m. OK GNU C++11 TESTS 75 1123 0 3400
70737004 zhouzhendong E Feb. 10, 2020, 2:56 p.m. OK GNU C++14 TESTS 75 483 204800 3400
70764054 yzyejh E Feb. 11, 2020, 3:37 a.m. OK GNU C++14 TESTS 75 498 204800 3400
70790500 ZZZZZZZZZZZZZZZZZZ E Feb. 11, 2020, 1:55 p.m. OK GNU C++14 TESTS 75 530 0 3400
70795795 Toxel E Feb. 11, 2020, 3:27 p.m. OK GNU C++14 TESTS 75 545 204800 3400
70716482 cz_xuyixuan E Feb. 10, 2020, 8:42 a.m. OK GNU C++14 TESTS 75 577 0 3400
70736957 zhouzhendong E Feb. 10, 2020, 2:55 p.m. OK GNU C++14 TESTS 75 592 204800 3400
70714093 gisp_zjz E Feb. 10, 2020, 7:56 a.m. OK GNU C++14 TESTS 75 592 204800 3400
70723071 yhx-12243 E Feb. 10, 2020, 10:59 a.m. OK GNU C++14 TESTS 75 608 204800 3400
70740148 mohammedehab2002 E Feb. 10, 2020, 3:45 p.m. OK GNU C++14 TESTS 75 655 204800 3400
71094603 mayiyang E Feb. 15, 2020, 4:09 a.m. OK GNU C++14 TESTS 75 717 409600 3400
70832092 ecnerwala E Feb. 12, 2020, 8:48 a.m. OK GNU C++17 TESTS 75 202 204800 3400
70823984 chenkuowen E Feb. 12, 2020, 5:32 a.m. OK GNU C++17 TESTS 75 218 409600 3400
70682706 ksun48 E Feb. 9, 2020, 5:21 p.m. OK GNU C++17 TESTS 75 405 307200 3400
71090791 krijgertje E Feb. 15, 2020, 1:24 a.m. OK GNU C++17 TESTS 75 436 307200 3400
70821963 gongsuidashen E Feb. 12, 2020, 4:24 a.m. OK GNU C++17 TESTS 75 436 409600 3400
70693501 neal E Feb. 9, 2020, 8:55 p.m. OK GNU C++17 TESTS 75 468 204800 3400
70777351 Shayan.P E Feb. 11, 2020, 9:22 a.m. OK GNU C++17 TESTS 75 483 1843200 3400
70693389 neal E Feb. 9, 2020, 8:51 p.m. OK GNU C++17 TESTS 75 514 204800 3400
70948149 BYTX E Feb. 13, 2020, 10:22 a.m. OK GNU C++17 TESTS 75 530 0 3400
70929038 BYTX E Feb. 13, 2020, 4:12 a.m. OK GNU C++17 TESTS 75 530 0 3400

remove filters

Back to search problems