Codeforces Round 964 (Div. 4)

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
1999 Codeforces Round 964 (Div. 4) FINISHED False 8700 53450723 Aug. 6, 2024, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 10934 ) G2 Ruler (hard version) PROGRAMMING binary search interactive ternary search

This is the hard version of the problem. The only difference between the two versions is that in this version, you can make at most (\mathbf{7}) queries . This is an interactive problem. If you are unsure how interactive problems work, then it is recommended to read the guide for participants . We have a secret ruler that is missing one number (x) ((2 \leq x \leq 999)). When you measure an object of length (y), the ruler reports the following values: If (y < x), the ruler (correctly) measures the object as having length (y). If (y \geq x), the ruler incorrectly measures the object as having length (y+1). The ruler above is missing the number (4), so it correctly measures the first segment as length (3) but incorrectly measures the second segment as length (6) even though it is actually (5). You need to find the value of (x). To do that, you can make queries of the following form: (?~a~b) — in response, we will measure the side lengths of an (a \times b) rectangle with our ruler and multiply the results, reporting the measured area of the rectangle back to you. For example, if (x=4) and you query a (3 \times 5) rectangle, we will measure its side lengths as (3 \times 6) and report (18) back to you. Find the value of (x). You can ask at most (\mathbf{7}) queries. Each test contains multiple test cases. The first line of input contains a single integer (t) ((1 \leq t \leq 1000)) — the number of test cases. There is no initial input for each test case. You should begin the interaction by asking a query. To make a query, output a single line of the form (?~a~b) ((1 \leq a, b \leq 1000)). In response, you will be told the measured area of the rectangle, according to our secret ruler. When you are ready to print the answer, output a single line of the form (!~x) ((2 \leq x \leq 999)). After that, proceed to process the next test c

Tutorials

Video Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
275013738 Plossom G2 Aug. 7, 2024, 2:43 a.m. OK C++14 (GCC 6-32) TESTS 4 46 0
275022699 2h_xingren G2 Aug. 7, 2024, 3:59 a.m. OK C++14 (GCC 6-32) TESTS 4 62 0
275013235 luogu_bot1 G2 Aug. 7, 2024, 2:39 a.m. OK C++14 (GCC 6-32) TESTS 4 62 0
275009913 66xyyd G2 Aug. 7, 2024, 2:08 a.m. OK C++14 (GCC 6-32) TESTS 4 62 0
274998908 Ray_Wu G2 Aug. 6, 2024, 11:35 p.m. OK C++14 (GCC 6-32) TESTS 4 62 0
275033477 Rishabh__a G2 Aug. 7, 2024, 5:34 a.m. OK C++14 (GCC 6-32) TESTS 4 77 0
275017383 lishiao3405 G2 Aug. 7, 2024, 3:13 a.m. OK C++14 (GCC 6-32) TESTS 4 77 0
275016620 sry417 G2 Aug. 7, 2024, 3:07 a.m. OK C++14 (GCC 6-32) TESTS 4 77 0
275012954 ritam.mohanty784 G2 Aug. 7, 2024, 2:36 a.m. OK C++14 (GCC 6-32) TESTS 4 77 0
275010073 yanlikun G2 Aug. 7, 2024, 2:10 a.m. OK C++14 (GCC 6-32) TESTS 4 77 0
275031720 akkafakka G2 Aug. 7, 2024, 5:20 a.m. OK C++17 (GCC 7-32) TESTS 4 46 0
274994495 luthanhar G2 Aug. 6, 2024, 10:06 p.m. OK C++17 (GCC 7-32) TESTS 4 46 0
275028373 000ywq G2 Aug. 7, 2024, 4:53 a.m. OK C++17 (GCC 7-32) TESTS 4 61 0
275021188 prakl G2 Aug. 7, 2024, 3:45 a.m. OK C++17 (GCC 7-32) TESTS 4 61 0
275009880 twotf G2 Aug. 7, 2024, 2:08 a.m. OK C++17 (GCC 7-32) TESTS 4 61 0
275027550 hannnnpiggy G2 Aug. 7, 2024, 4:46 a.m. OK C++17 (GCC 7-32) TESTS 4 62 0
275020794 yottabot G2 Aug. 7, 2024, 3:42 a.m. OK C++17 (GCC 7-32) TESTS 4 62 0
275019347 alkuhs_hseved G2 Aug. 7, 2024, 3:30 a.m. OK C++17 (GCC 7-32) TESTS 4 62 0
275017906 Anndy_bonus G2 Aug. 7, 2024, 3:18 a.m. OK C++17 (GCC 7-32) TESTS 4 62 0
275016056 4saken G2 Aug. 7, 2024, 3:02 a.m. OK C++17 (GCC 7-32) TESTS 4 62 0
275030782 Abdullah-Ishfaq G2 Aug. 7, 2024, 5:13 a.m. OK C++20 (GCC 13-64) TESTS 4 46 0
275022285 _nightingale_ G2 Aug. 7, 2024, 3:55 a.m. OK C++20 (GCC 13-64) TESTS 4 46 0
275021540 nibutaihaoshijieywr G2 Aug. 7, 2024, 3:49 a.m. OK C++20 (GCC 13-64) TESTS 4 46 0
275011271 stu_mao G2 Aug. 7, 2024, 2:22 a.m. OK C++20 (GCC 13-64) TESTS 4 46 0
275020385 Pemguimn G2 Aug. 7, 2024, 3:39 a.m. OK C++20 (GCC 13-64) TESTS 4 46 1638400
274986976 kakabadzeteo G2 Aug. 6, 2024, 8:25 p.m. OK C++20 (GCC 13-64) TESTS 4 46 9625600
275036346 Now_say_my_name G2 Aug. 7, 2024, 5:55 a.m. OK C++20 (GCC 13-64) TESTS 4 61 0
275036225 The_Contender G2 Aug. 7, 2024, 5:54 a.m. OK C++20 (GCC 13-64) TESTS 4 61 0
275024119 oopsenheimer G2 Aug. 7, 2024, 4:12 a.m. OK C++20 (GCC 13-64) TESTS 4 61 0
275020951 _baljyot G2 Aug. 7, 2024, 3:43 a.m. OK C++20 (GCC 13-64) TESTS 4 61 0
275002666 0x3F G2 Aug. 7, 2024, 12:45 a.m. OK Go TESTS 4 124 512000
275002383 0x3F G2 Aug. 7, 2024, 12:41 a.m. OK Go TESTS 4 155 512000
275016052 ccj123 G2 Aug. 7, 2024, 3:02 a.m. OK Java 21 TESTS 4 358 921600
275008823 Zhanzhe_Lee G2 Aug. 7, 2024, 1:57 a.m. OK Java 21 TESTS 4 390 921600
274994626 mangos194 G2 Aug. 6, 2024, 10:08 p.m. OK Java 21 TESTS 4 390 1024000
275024693 2210030094_Rahul G2 Aug. 7, 2024, 4:18 a.m. OK Java 21 TESTS 4 405 1740800
275023250 UlaanBatat G2 Aug. 7, 2024, 4:04 a.m. OK Java 21 TESTS 4 406 204800
274987234 Abnghassan015 G2 Aug. 6, 2024, 8:28 p.m. OK Java 21 TESTS 4 406 1331200
275023946 man-ray G2 Aug. 7, 2024, 4:11 a.m. OK Java 21 TESTS 4 436 716800
275010963 1474 G2 Aug. 7, 2024, 2:19 a.m. OK Java 21 TESTS 4 453 409600
275007014 ishitjain0690 G2 Aug. 7, 2024, 1:39 a.m. OK Java 21 TESTS 4 453 1331200
275007873 yong106 G2 Aug. 7, 2024, 1:48 a.m. OK Java 21 TESTS 4 468 1536000
275011484 Night1324 G2 Aug. 7, 2024, 2:24 a.m. OK Java 8 TESTS 4 250 0
274985636 kkkkush G2 Aug. 6, 2024, 8:12 p.m. OK Java 8 TESTS 4 296 0
275019081 lpychemistry G2 Aug. 7, 2024, 3:28 a.m. OK Java 8 TESTS 4 359 0
275028877 taegyunn123 G2 Aug. 7, 2024, 4:58 a.m. OK Kotlin 1.9 TESTS 4 280 0
274985044 tghsd G2 Aug. 6, 2024, 8:07 p.m. OK Kotlin 1.9 TESTS 4 312 0
274997388 gsomani G2 Aug. 6, 2024, 11 p.m. OK PyPy 3-64 TESTS 4 233 2969600
275001118 smilences G2 Aug. 7, 2024, 12:19 a.m. OK PyPy 3-64 TESTS 4 234 3481600
274991132 NitroSpear G2 Aug. 6, 2024, 9:13 p.m. OK PyPy 3-64 TESTS 4 249 3481600
275027097 ychangseok G2 Aug. 7, 2024, 4:41 a.m. OK PyPy 3-64 TESTS 4 249 4300800
275016726 quad_wipe G2 Aug. 7, 2024, 3:08 a.m. OK PyPy 3-64 TESTS 4 249 5120000
274987427 eugenechka.boyko.2_0-0 G2 Aug. 6, 2024, 8:30 p.m. OK PyPy 3-64 TESTS 4 249 7065600
275026120 pierrot G2 Aug. 7, 2024, 4:32 a.m. OK PyPy 3-64 TESTS 4 250 3686400
274999867 Monocrap G2 Aug. 6, 2024, 11:57 p.m. OK PyPy 3-64 TESTS 4 264 3686400
275024455 429d51579a491c57 G2 Aug. 7, 2024, 4:15 a.m. OK PyPy 3-64 TESTS 4 264 5939200
274990424 x3mka G2 Aug. 6, 2024, 9:04 p.m. OK PyPy 3-64 TESTS 4 265 4403200
275031795 coding_sucks_1001001 G2 Aug. 7, 2024, 5:21 a.m. OK Python 3 TESTS 4 171 0
275004285 ok12 G2 Aug. 7, 2024, 1:08 a.m. OK Python 3 TESTS 4 171 0
274999737 coder.sy G2 Aug. 6, 2024, 11:54 p.m. OK Python 3 TESTS 4 203 0
274992484 sypwex G2 Aug. 6, 2024, 9:33 p.m. OK Rust 2021 TESTS 4 93 0

remove filters

Back to search problems