Codeforces Round 1085 (Div. 1 + Div. 2)

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
2207 Codeforces Round 1085 (Div. 1 + Div. 2) FINISHED False 10800 3425123 March 8, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 53 ) H3 Bowser's Castle (Hard Version) PROGRAMMING constructive algorithms divide and conquer interactive trees two pointers

This is the hard version of the problem. The difference between the versions is that in this version, (n \leq 400) and you may make (1500) queries. You can hack only if you solved all versions of this problem. This is an interactive problem. Let (n) be a positive integer. A function on (n) variables (x_1, \ldots, x_n) is called min-max if it can be constructed as writing only (\min) and (\max) calls around (x_1, \ldots, x_n) with each variable appearing exactly once in order from left to right in the expression. For example, (\min(x_1, x_2, x_3)) is a min-max function on (3) variables, but (\max(\min(x_1, x_3), x_2)) and (\min(\max(x_1, x_2), \max(x_2, x_3))) are not. Bowser has chosen a min-max function on (n) ((2 \leq n \leq 400)) variables and tells you (n). Additionally, he lets you ask queries of the following form: you give Bowser (n) integers (x_1, \ldots, x_n) ((1 \leq x_i \leq 10^9)) as input, and he tells you (f(x_1, \ldots, x_n)). To escape his castle, you have to deduce his function using at most (1500) queries in total. After that, to prove to him that you have learned the function, Bowser will give you up to (5000) of his own inputs (x_1, \ldots, x_n), to which you must respond with the correct value of (f(x_1, \ldots, x_n)). Since Bowser's castle is very secure, he actually has multiple functions for you to figure out, with a total variable count of at most (400). Additionally, he constrains that you use at most (1500) queries across all of the functions and that he will also not ask more than (5000) queries in total. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 200)). The description of the test cases follows. The first line of each test case contains a single integer (n) ((2 \leq n \leq 400)) — the number of variables in the min-max function. It is guaranteed t

Tutorials

Codeforces Round 1085 (Div. 1 + Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
365925880 nfowfnow H3 March 8, 2026, 11:30 p.m. OK C++17 (GCC 7-32) TESTS 47 500 102400
365904322 awesomeguy856 H3 March 8, 2026, 6:02 p.m. OK C++20 (GCC 13-64) TESTS 47 500 102400
365934355 gopal.thecoder H3 March 9, 2026, 3:26 a.m. OK C++23 (GCC 14-64, msys2) TESTS 47 406 102400
365931646 Benq H3 March 9, 2026, 2:23 a.m. OK C++23 (GCC 14-64, msys2) TESTS 47 421 102400
365931480 Benq H3 March 9, 2026, 2:18 a.m. OK C++23 (GCC 14-64, msys2) TESTS 47 437 102400
365896966 ecnerwala H3 March 8, 2026, 5:06 p.m. OK C++23 (GCC 14-64, msys2) TESTS 47 531 102400

remove filters

Back to search problems