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 |
---|---|---|---|---|---|---|
1934 | Codeforces Round 931 (Div. 2) | FINISHED | False | 7200 | 22519499 | March 1, 2024, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 6848 ) | C | Find a Mine | PROGRAMMING | constructive algorithms geometry greedy interactive math |
B'This is an interactive problem. You are given a grid with n rows and m columns. The coordinates (x, y) represent the cell on the grid, where x ( 1 <= q x <= q n ) is the row number counting from the top and y ( 1 <= q y <= q m ) is the column number counting from the left. It is guaranteed that there are exactly 2 mines in the grid at distinct cells, denoted as (x_1, y_1) and (x_2, y_2) . You are allowed to make no more than 4 queries to the interactor, and after these queries, you need to provide the location of one of the mines. In each query, you can choose any grid cell (x, y) , and in return, you will receive the minimum Manhattan distance from both the mines to the chosen cell, i.e., you will receive the value min(|x-x_1|+|y-y_1|, |x-x_2|+|y-y_2|) . Your task is to determine the location of one of the mines after making the queries. Each test contains multiple test cases. The first line of input contains a single integer t ( 1 <= q t <= q 3 cdot 10^{3} ) -- the number of test cases. The only line of each test case contains two integers n and m ( 2 <= q n <= q 10^{8} , 2 <= q m <= q 10^{8} ) -- the number of rows and columns. For each test case, the interaction starts with reading n and m . Then you are allowed to make at most 4 queries in the following way: "? x y" ( 1 <= q x <= q n and 1 <= q y <= q m ) After each one, you should read an integer d which is equal to min(|x-x_1|+|y-y_1|, |x-x_2|+|y-y_2|) . When you have found the location of any one of the mines, print a single line "! x y" (without quotes), representing the row and the column of one of the mines. Outputting the answer does not count as a query. After printing the answer, your program must then continue to solve the remaining test cases, or exit if all test cases have been solved. The interactor for this problem is not adaptive: cells of mi'... |
Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
249188859 | NenadDapic | C | March 1, 2024, 6:12 p.m. | OK | FPC | TESTS | 26 | 155 | 0 | ||
249176282 | iffatul_anon | C | March 1, 2024, 5:10 p.m. | OK | GNU C11 | TESTS | 26 | 202 | 0 | ||
249216255 | iffatul_anon | C | March 1, 2024, 10 p.m. | OK | GNU C11 | TESTS | 26 | 202 | 0 | ||
249189999 | sujal22514 | C | March 1, 2024, 6:19 p.m. | OK | GNU C11 | TESTS | 26 | 202 | 0 | ||
249177889 | iffatul_anon | C | March 1, 2024, 5:16 p.m. | OK | GNU C11 | TESTS | 26 | 202 | 0 | ||
249218371 | mertyilmaz | C | March 1, 2024, 10:35 p.m. | OK | GNU C++17 | TESTS | 26 | 108 | 0 | ||
249170973 | realmaster | C | March 1, 2024, 4:33 p.m. | OK | GNU C++17 | TESTS | 26 | 139 | 0 | ||
249196558 | Rarma | C | March 1, 2024, 6:59 p.m. | OK | GNU C++17 | TESTS | 26 | 139 | 0 | ||
249180734 | Yuris | C | March 1, 2024, 5:27 p.m. | OK | GNU C++17 | TESTS | 26 | 139 | 0 | ||
249179909 | aryankesharwani142004 | C | March 1, 2024, 5:24 p.m. | OK | GNU C++17 | TESTS | 26 | 139 | 0 | ||
249234768 | zrj66 | C | March 2, 2024, 3:24 a.m. | OK | GNU C++17 | TESTS | 26 | 139 | 29388800 | ||
249240146 | M_SQRT | C | March 2, 2024, 4:17 a.m. | OK | GNU C++17 | TESTS | 26 | 140 | 0 | ||
249246346 | Ghosting | C | March 2, 2024, 5:12 a.m. | OK | GNU C++17 | TESTS | 26 | 140 | 0 | ||
249246132 | siddhesh.o4 | C | March 2, 2024, 5:11 a.m. | OK | GNU C++17 | TESTS | 26 | 140 | 0 | ||
249240528 | power_verse | C | March 2, 2024, 4:21 a.m. | OK | GNU C++17 | TESTS | 26 | 140 | 0 | ||
249180225 | Dlringww | C | March 1, 2024, 5:25 p.m. | OK | GNU C++17 (64) | TESTS | 26 | 109 | 19251200 | ||
249182853 | AhmadSelo | C | March 1, 2024, 5:38 p.m. | OK | GNU C++17 (64) | TESTS | 26 | 124 | 0 | ||
249170095 | lakshmankattunga | C | March 1, 2024, 4:32 p.m. | OK | GNU C++17 (64) | TESTS | 26 | 124 | 0 | ||
249169484 | wxgmjfhy | C | March 1, 2024, 4:31 p.m. | OK | GNU C++17 (64) | TESTS | 26 | 124 | 0 | ||
249184347 | Lu_xZ | C | March 1, 2024, 5:46 p.m. | OK | GNU C++17 (64) | TESTS | 26 | 124 | 0 | ||
249224738 | TJUHuangTao | C | March 2, 2024, 12:50 a.m. | OK | GNU C++17 (64) | TESTS | 26 | 124 | 0 | ||
249222650 | OutsiderZz | C | March 2, 2024, 12:11 a.m. | OK | GNU C++17 (64) | TESTS | 26 | 124 | 0 | ||
249185391 | Chirag2907 | C | March 1, 2024, 5:52 p.m. | OK | GNU C++17 (64) | TESTS | 26 | 124 | 0 | ||
249188486 | AKSingh29 | C | March 1, 2024, 6:10 p.m. | OK | GNU C++17 (64) | TESTS | 26 | 124 | 819200 | ||
249235675 | domo0508 | C | March 2, 2024, 3:32 a.m. | OK | GNU C++17 (64) | TESTS | 26 | 124 | 1638400 | ||
249176384 | virinci | C | March 1, 2024, 5:10 p.m. | OK | GNU C++20 (64) | TESTS | 26 | 109 | 0 | ||
249191445 | knightstour | C | March 1, 2024, 6:27 p.m. | OK | GNU C++20 (64) | TESTS | 26 | 109 | 0 | ||
249189638 | code_with_atif | C | March 1, 2024, 6:16 p.m. | OK | GNU C++20 (64) | TESTS | 26 | 109 | 0 | ||
249216890 | IvanRenison | C | March 1, 2024, 10:09 p.m. | OK | GNU C++20 (64) | TESTS | 26 | 109 | 0 | ||
249197654 | InfernoStinger | C | March 1, 2024, 7:07 p.m. | OK | GNU C++20 (64) | TESTS | 26 | 109 | 0 | ||
249237869 | Baba__Yagaa | C | March 2, 2024, 3:54 a.m. | OK | GNU C++20 (64) | TESTS | 26 | 124 | 0 | ||
249249334 | MushfiqTalha | C | March 2, 2024, 5:35 a.m. | OK | GNU C++20 (64) | TESTS | 26 | 124 | 0 | ||
249252583 | uday0904 | C | March 2, 2024, 5:59 a.m. | OK | GNU C++20 (64) | TESTS | 26 | 124 | 0 | ||
249245250 | spexcher | C | March 2, 2024, 5:04 a.m. | OK | GNU C++20 (64) | TESTS | 26 | 124 | 0 | ||
249242180 | kratos_2711 | C | March 2, 2024, 4:37 a.m. | OK | GNU C++20 (64) | TESTS | 26 | 124 | 0 | ||
249186529 | priyaroy3370 | C | March 1, 2024, 5:59 p.m. | OK | Java 21 | TESTS | 26 | 655 | 716800 | ||
249181816 | priyaroy3370 | C | March 1, 2024, 5:32 p.m. | OK | Java 21 | TESTS | 26 | 733 | 409600 | ||
249184254 | is_this_greedy | C | March 1, 2024, 5:46 p.m. | OK | Java 21 | TESTS | 26 | 764 | 512000 | ||
249244360 | VIVEK_8877 | C | March 2, 2024, 4:56 a.m. | OK | Java 21 | TESTS | 26 | 795 | 307200 | ||
249180948 | vaibhav_1710 | C | March 1, 2024, 5:28 p.m. | OK | Java 21 | TESTS | 26 | 826 | 409600 | ||
249171290 | venom246800 | C | March 1, 2024, 4:33 p.m. | OK | Java 21 | TESTS | 26 | 842 | 614400 | ||
249220233 | kbliu | C | March 1, 2024, 11:12 p.m. | OK | Java 21 | TESTS | 26 | 857 | 512000 | ||
249192345 | codeanand17 | C | March 1, 2024, 6:33 p.m. | OK | Java 21 | TESTS | 26 | 904 | 819200 | ||
249214419 | dk_g | C | March 1, 2024, 9:37 p.m. | OK | Java 21 | TESTS | 26 | 919 | 716800 | ||
249237723 | mapleKing | C | March 2, 2024, 3:53 a.m. | OK | Java 21 | TESTS | 26 | 919 | 921600 | ||
249220903 | vatsal_04 | C | March 1, 2024, 11:27 p.m. | OK | Java 8 | TESTS | 26 | 561 | 0 | ||
249229872 | cc4414 | C | March 2, 2024, 2:24 a.m. | OK | Java 8 | TESTS | 26 | 685 | 0 | ||
249232682 | wat2 | C | March 2, 2024, 3:03 a.m. | OK | Java 8 | TESTS | 26 | 701 | 0 | ||
249176629 | samy10127 | C | March 1, 2024, 5:11 p.m. | OK | Java 8 | TESTS | 26 | 732 | 0 | ||
249181714 | kunal_0199 | C | March 1, 2024, 5:32 p.m. | OK | Java 8 | TESTS | 26 | 748 | 0 | ||
249178263 | PlayDate | C | March 1, 2024, 5:17 p.m. | OK | Java 8 | TESTS | 26 | 764 | 0 | ||
249242881 | a20031030 | C | March 2, 2024, 4:43 a.m. | OK | MS C++ 2017 | TESTS | 26 | 218 | 0 | ||
249182704 | Letinapx | C | March 1, 2024, 5:37 p.m. | OK | PyPy 3 | TESTS | 26 | 811 | 6553600 | ||
249187136 | srll | C | March 1, 2024, 6:02 p.m. | OK | PyPy 3 | TESTS | 26 | 842 | 6041600 | ||
249194704 | Synaptic_Savant | C | March 1, 2024, 6:47 p.m. | OK | PyPy 3-64 | TESTS | 26 | 498 | 9523200 | ||
249217238 | _aadiupadhyay_ | C | March 1, 2024, 10:14 p.m. | OK | PyPy 3-64 | TESTS | 26 | 577 | 10035200 | ||
249178412 | find | C | March 1, 2024, 5:18 p.m. | OK | PyPy 3-64 | TESTS | 26 | 592 | 10240000 | ||
249186694 | Rohan_7503 | C | March 1, 2024, 6 p.m. | OK | PyPy 3-64 | TESTS | 26 | 592 | 10547200 | ||
249215042 | Tanz | C | March 1, 2024, 9:44 p.m. | OK | PyPy 3-64 | TESTS | 26 | 654 | 9420800 | ||
249194022 | DeepJ | C | March 1, 2024, 6:43 p.m. | OK | PyPy 3-64 | TESTS | 26 | 655 | 9830400 | ||
249216107 | VeryLate | C | March 1, 2024, 9:58 p.m. | OK | PyPy 3-64 | TESTS | 26 | 655 | 9932800 | ||
249215414 | momoyao | C | March 1, 2024, 9:49 p.m. | OK | PyPy 3-64 | TESTS | 26 | 655 | 9932800 | ||
249179228 | gardengnome | C | March 1, 2024, 5:21 p.m. | OK | PyPy 3-64 | TESTS | 26 | 655 | 10035200 | ||
249179637 | a-rn-va27 | C | March 1, 2024, 5:23 p.m. | OK | PyPy 3-64 | TESTS | 26 | 655 | 10342400 | ||
249182104 | OLOGY | C | March 1, 2024, 5:34 p.m. | OK | Python 2 | TESTS | 26 | 296 | 0 | ||
249169764 | htnhtn | C | March 1, 2024, 4:31 p.m. | OK | Python 3 | TESTS | 26 | 327 | 102400 | ||
249201750 | sgshivamgarg8 | C | March 1, 2024, 7:37 p.m. | OK | Python 3 | TESTS | 26 | 390 | 204800 | ||
249220898 | lo_krlo_baatt | C | March 1, 2024, 11:27 p.m. | OK | Python 3 | TESTS | 26 | 405 | 102400 | ||
249229162 | najmiddinweb | C | March 2, 2024, 2:12 a.m. | OK | Python 3 | TESTS | 26 | 420 | 102400 | ||
249171267 | Adeer_Bakht | C | March 1, 2024, 4:33 p.m. | OK | Python 3 | TESTS | 26 | 436 | 102400 | ||
249170230 | Surin | C | March 1, 2024, 4:32 p.m. | OK | Python 3 | TESTS | 26 | 483 | 204800 | ||
249179295 | vstiff | C | March 1, 2024, 5:21 p.m. | OK | Rust 2021 | TESTS | 26 | 234 | 0 | ||
249180644 | ArnedeB | C | March 1, 2024, 5:27 p.m. | OK | Rust 2021 | TESTS | 26 | 249 | 0 |
Back to search problems