Educational Codeforces Round 179 (Rated for 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
2111 Educational Codeforces Round 179 (Rated for Div. 2) FINISHED False 7200 27444323 June 3, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 393 ) G Divisible Subarrays PROGRAMMING brute force data structures interactive

Technically, this is an interactive problem. An array (a) of (m) numbers is called divisible if at least one of the following conditions holds: There exists an index (i) ((1 \le i < m)) and an integer (x) such that for all indices (j) ((j \le i)), it holds that (a_{j} \le x) and for all indices (k) ((k > i)), it holds that (a_{k} > x). There exists an index (i) ((1 \le i < m)) and an integer (x) such that for all indices (j) ((j \le i)), it holds that (a_{j} > x) and for all indices (k) ((k > i)), it holds that (a_{k} \le x). You are given a permutation (p) of integers (1, 2, \dots, n). Your task is to answer queries of the following form fast: if we take only the segment (l), (r) from the permutation, that is, the numbers (p_{l}, p_{l + 1}, \dots, p_{r}), is this subarray of numbers divisible ? Queries will be submitted in interactive mode in groups of (10), meaning you will not receive the next group of queries until you output all answers for the current group. The first line contains one integer (n) ((2 \le n \le 2 \cdot 10^{5})) — the size of the permutation. The second line contains (n) integers (p_{i}) ((1 \le p_{i} \le n)) — the permutation of natural numbers itself. The third line contains one integer (q) ((10 \le q \le 10^{6}, q \bmod 10 = 0)) — the number of queries. The following (q) lines contain two integers (l) and (r) ((1 \le l < r \le n)) — the parameters of the query. For each query, output the string " YES " if the subarray from this query is divisible and " NO " otherwise. After printing the answers to a group of queries, do not forget to output the end of line and flush the output buffer. Otherwise, you may get the Idleness Limit Exceeded verdict. To flush the buffer, use: fflush(stdout) or cout.flush() in C++ ; System.out.flush() in Java ; flush(output) in Pascal ; stdout.flush() in Pyth

Tutorials

Educational Codeforces Round 179 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
322812426 kgqy G June 4, 2025, 7:02 a.m. OK C++17 (GCC 7-32) TESTS 80 1936 389222400
322843077 getawronganswer G June 4, 2025, 10:41 a.m. OK C++17 (GCC 7-32) TESTS 80 2406 503091200
322786934 AA-2007 G June 4, 2025, 12:48 a.m. OK C++17 (GCC 7-32) TESTS 80 2483 507084800
322786777 AA-2007 G June 4, 2025, 12:44 a.m. OK C++17 (GCC 7-32) TESTS 80 2592 507084800
322786983 AA-2007 G June 4, 2025, 12:50 a.m. OK C++17 (GCC 7-32) TESTS 80 2671 507084800
322911553 -adhd- G June 4, 2025, 8:47 p.m. OK C++17 (GCC 7-32) TESTS 80 2686 639590400
322870409 masonpop G June 4, 2025, 2:05 p.m. OK C++17 (GCC 7-32) TESTS 80 2718 349593600
322787090 AA-2007 G June 4, 2025, 12:53 a.m. OK C++17 (GCC 7-32) TESTS 80 2905 507084800
322802423 wind_cross G June 4, 2025, 5:12 a.m. OK C++17 (GCC 7-32) TESTS 80 3983 815308800
322802850 wind_cross G June 4, 2025, 5:17 a.m. OK C++17 (GCC 7-32) TESTS 80 5218 815308800
322825564 zhenja G June 4, 2025, 8:38 a.m. OK C++20 (GCC 13-64) TESTS 80 1499 145100800
322822252 Warma G June 4, 2025, 8:15 a.m. OK C++20 (GCC 13-64) TESTS 80 1765 398438400
322824365 zhenja G June 4, 2025, 8:30 a.m. OK C++20 (GCC 13-64) TESTS 80 1936 145100800
322778201 Rubikun G June 3, 2025, 9:05 p.m. OK C++20 (GCC 13-64) TESTS 80 1967 61644800
322778020 Rubikun G June 3, 2025, 9 p.m. OK C++20 (GCC 13-64) TESTS 80 1968 61644800
322778419 Rubikun G June 3, 2025, 9:09 p.m. OK C++20 (GCC 13-64) TESTS 80 2062 62464000
322837805 zac2010 G June 4, 2025, 10:01 a.m. OK C++20 (GCC 13-64) TESTS 80 2077 417177600
322924533 SuitokuinTenmu G June 5, 2025, 2:44 a.m. OK C++20 (GCC 13-64) TESTS 80 2078 436838400
322938128 SF-Manman G June 5, 2025, 5:31 a.m. OK C++20 (GCC 13-64) TESTS 80 2109 97894400
322904042 kaiboy G June 4, 2025, 6:58 p.m. OK C++20 (GCC 13-64) TESTS 80 2140 389324800
322802831 ian_HLX G June 4, 2025, 5:16 a.m. OK C++23 (GCC 14-64, msys2) TESTS 80 1733 136294400
322802149 ian_HLX G June 4, 2025, 5:09 a.m. OK C++23 (GCC 14-64, msys2) TESTS 80 1796 136396800
322801172 ian_HLX G June 4, 2025, 4:58 a.m. OK C++23 (GCC 14-64, msys2) TESTS 80 1843 136294400
322794857 ian_HLX G June 4, 2025, 3:30 a.m. OK C++23 (GCC 14-64, msys2) TESTS 80 1889 128307200
322937912 jiangly G June 5, 2025, 5:29 a.m. OK C++23 (GCC 14-64, msys2) TESTS 80 2156 413798400
322883664 skdns G June 4, 2025, 3:52 p.m. OK C++23 (GCC 14-64, msys2) TESTS 80 2233 93798400
322883187 skdns G June 4, 2025, 3:48 p.m. OK C++23 (GCC 14-64, msys2) TESTS 80 2233 95436800
322882248 skdns G June 4, 2025, 3:39 p.m. OK C++23 (GCC 14-64, msys2) TESTS 80 2233 100249600
322794783 thisislike G June 4, 2025, 3:29 a.m. OK C++23 (GCC 14-64, msys2) TESTS 80 2390 316313600
322793686 thisislike G June 4, 2025, 3:11 a.m. OK C++23 (GCC 14-64, msys2) TESTS 80 2484 483430400
322857542 giaaphuc_06 G June 4, 2025, 12:29 p.m. OK GNU C11 TESTS 80 6343 388608000
322911342 DanielAnker G June 4, 2025, 8:42 p.m. OK Rust 2021 TESTS 80 6265 538214400

remove filters

Back to search problems