Codeforces Round 1079 (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
2196 Codeforces Round 1079 (Div. 1) FINISHED False 10800 5585123 Feb. 11, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 8380 ) B Another Problem about Beautiful Pairs PROGRAMMING brute force math two pointers

In the array (a), we call a pair of indices (i), (j) beautiful if the following condition holds: (a_{i} \cdot a_{j} = j - i). Count the number of beautiful pairs in the array (a). Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains a single integer (n) ((2 \le n \le 2 \cdot 10^{5})). The second line of each test case contains (n) integers (a_{i}) ((1 \le a_{i} \le 10^{9})). Additional constraints on the input: The sum of (n) across all test cases does not exceed (2 \cdot 10^5). For each test case, output a single integer — the answer to the problem. In the first example, there are (3) beautiful pairs: ((1, 2)), ((1, 3)), and ((1, 5)). In the second example, there are (7) beautiful pairs: ((1, 3)), ((1, 5)), ((2, 4)), ((2, 6)), ((3, 4)), ((3, 5)), and ((4, 6)).

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
362433515 -firefly- B Feb. 11, 2026, 2:56 p.m. OK C# 13 TESTS 20 1046 14848000
362423662 pandaforever B Feb. 11, 2026, 2:47 p.m. OK C++17 (GCC 7-32) TESTS 20 125 921600
362438654 SmpaelFx B Feb. 11, 2026, 3:02 p.m. OK C++17 (GCC 7-32) TESTS 20 140 819200
362430800 MrAndria B Feb. 11, 2026, 2:54 p.m. OK C++17 (GCC 7-32) TESTS 20 140 28160000
362579208 Gyanendra_Kumar_007 B Feb. 12, 2026, 5:59 a.m. OK C++17 (GCC 7-32) TESTS 26 156 102400
362565688 Twits B Feb. 12, 2026, 3:04 a.m. OK C++17 (GCC 7-32) TESTS 24 156 102400
362452071 LISOP9527 B Feb. 11, 2026, 3:18 p.m. OK C++17 (GCC 7-32) TESTS 20 156 102400
362444270 Kieray B Feb. 11, 2026, 3:08 p.m. OK C++17 (GCC 7-32) TESTS 20 156 819200
362438306 syysongyuyang B Feb. 11, 2026, 3:01 p.m. OK C++17 (GCC 7-32) TESTS 20 156 16076800
362544783 niwrad B Feb. 11, 2026, 8:01 p.m. OK C++17 (GCC 7-32) TESTS 23 171 102400
362568903 biltharesatyendra B Feb. 12, 2026, 3:55 a.m. OK C++17 (GCC 7-32) TESTS 24 171 921600
362434845 titania- B Feb. 11, 2026, 2:58 p.m. OK C++20 (GCC 13-64) TESTS 20 125 102400
362431160 Ormlis B Feb. 11, 2026, 2:54 p.m. OK C++20 (GCC 13-64) TESTS 20 125 102400
362418617 tourist B Feb. 11, 2026, 2:42 p.m. OK C++20 (GCC 13-64) TESTS 20 125 102400
362428803 OdtreeKing B Feb. 11, 2026, 2:52 p.m. OK C++20 (GCC 13-64) TESTS 20 125 819200
362551892 Eren__Coder B Feb. 11, 2026, 9:35 p.m. OK C++20 (GCC 13-64) TESTS 23 140 0
362569063 CitruOvO B Feb. 12, 2026, 3:56 a.m. OK C++20 (GCC 13-64) TESTS 24 140 102400
362565637 Lappland_the_Decadenza B Feb. 12, 2026, 3:03 a.m. OK C++20 (GCC 13-64) TESTS 24 140 102400
362563801 Tomwsc B Feb. 12, 2026, 2:27 a.m. OK C++20 (GCC 13-64) TESTS 24 140 102400
362557064 Danider2010 B Feb. 11, 2026, 11:31 p.m. OK C++20 (GCC 13-64) TESTS 23 140 102400
362546894 yoroy B Feb. 11, 2026, 8:25 p.m. OK C++20 (GCC 13-64) TESTS 23 140 102400
362430468 Runa_Inui B Feb. 11, 2026, 2:53 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 125 0
362547982 BestHermitCrab B Feb. 11, 2026, 8:39 p.m. OK C++23 (GCC 14-64, msys2) TESTS 23 125 102400
362447547 kevin B Feb. 11, 2026, 3:12 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 125 102400
362441628 Remedy943 B Feb. 11, 2026, 3:05 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 125 102400
362445204 mod998244353 B Feb. 11, 2026, 3:09 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 125 819200
362573061 enslaved B Feb. 12, 2026, 4:49 a.m. OK C++23 (GCC 14-64, msys2) TESTS 26 140 0
362560610 Benq B Feb. 12, 2026, 1:11 a.m. OK C++23 (GCC 14-64, msys2) TESTS 23 140 0
362447928 Dr_Zhang B Feb. 11, 2026, 3:13 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 140 0
362553366 TeletubiGaim33 B Feb. 11, 2026, 10:01 p.m. OK C++23 (GCC 14-64, msys2) TESTS 23 140 102400
362547888 Nanako7_ix B Feb. 11, 2026, 8:37 p.m. OK C++23 (GCC 14-64, msys2) TESTS 23 140 102400
362438312 Gassa B Feb. 11, 2026, 3:01 p.m. OK D TESTS 20 234 3072000
362433431 Ritwin B Feb. 11, 2026, 2:56 p.m. OK GNU C11 TESTS 20 234 819200
362438042 pengin_2000 B Feb. 11, 2026, 3:01 p.m. OK GNU C11 TESTS 20 250 1638400
362424302 __baozii__ B Feb. 11, 2026, 2:47 p.m. OK Go TESTS 20 203 4608000
362573179 LittleGopher B Feb. 12, 2026, 4:50 a.m. OK Go TESTS 26 218 4198400
362448928 Hmzaawy B Feb. 11, 2026, 3:14 p.m. OK Go TESTS 20 375 2048000
362576156 again85 B Feb. 12, 2026, 5:26 a.m. OK Java 21 TESTS 26 484 1024000
362450926 MBBN B Feb. 11, 2026, 3:16 p.m. OK Java 21 TESTS 20 500 4505600
362439989 SumitXorY B Feb. 11, 2026, 3:03 p.m. OK Java 21 TESTS 20 640 409600
362545927 tarun_op B Feb. 11, 2026, 8:14 p.m. OK Java 21 TESTS 23 984 1228800
362570397 Ati_3 B Feb. 12, 2026, 4:10 a.m. OK Java 21 TESTS 26 1296 14438400
362435855 gotexans B Feb. 11, 2026, 2:59 p.m. OK Java 8 TESTS 20 328 0
362430478 Tlatoani B Feb. 11, 2026, 2:53 p.m. OK Kotlin 2.2 TESTS 20 1796 33280000
362435131 smilences B Feb. 11, 2026, 2:58 p.m. OK PyPy 3-64 TESTS 20 343 26624000
362432638 Z_actuary B Feb. 11, 2026, 2:55 p.m. OK PyPy 3-64 TESTS 20 375 27136000
362560087 SsyHow B Feb. 12, 2026, 12:56 a.m. OK PyPy 3-64 TESTS 23 390 27033600
362431825 Ergodic137 B Feb. 11, 2026, 2:54 p.m. OK PyPy 3-64 TESTS 20 421 27238400
362547195 YamOCHca B Feb. 11, 2026, 8:29 p.m. OK PyPy 3-64 TESTS 23 453 31232000
362449940 Jank B Feb. 11, 2026, 3:15 p.m. OK PyPy 3-64 TESTS 20 562 32358400
362576303 again85 B Feb. 12, 2026, 5:27 a.m. OK PyPy 3-64 TESTS 26 640 26931200
362506089 x3x3 B Feb. 11, 2026, 4:48 p.m. OK PyPy 3-64 TESTS 20 843 33075200
362438634 Emikooh B Feb. 11, 2026, 3:02 p.m. OK PyPy 3-64 TESTS 20 906 35942400
362443726 tassei903 B Feb. 11, 2026, 3:07 p.m. OK PyPy 3-64 TESTS 20 921 32870400
362433930 sansen B Feb. 11, 2026, 2:57 p.m. OK Rust 2021 TESTS 20 375 4096000
362431294 Mon_ster B Feb. 11, 2026, 2:54 p.m. OK Rust 2024 TESTS 20 140 11776000
362419314 Egor B Feb. 11, 2026, 2:43 p.m. OK Rust 2024 TESTS 20 156 11776000
362450763 darkkcyan B Feb. 11, 2026, 3:16 p.m. OK Rust 2024 TESTS 20 281 3891200
362428807 DanielAnker B Feb. 11, 2026, 2:52 p.m. OK Rust 2024 TESTS 20 421 58368000
362426252 Sugar_fan B Feb. 11, 2026, 2:49 p.m. OK Rust 2024 TESTS 20 1125 2355200

remove filters

Back to search problems