Educational Codeforces Round 180 (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
2112 Educational Codeforces Round 180 (Rated for Div. 2) FINISHED False 7200 25716323 June 23, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 17602 ) C Coloring Game PROGRAMMING binary search brute force greedy two pointers

Alice and Bob are playing a game using an integer array (a) of size (n). Initially, all elements of the array are colorless. First, Alice chooses (3) elements and colors them red. Then Bob chooses any element and colors it blue (if it was red — recolor it). Alice wins if the sum of the red elements is strictly greater than the value of the blue element. Your task is to calculate the number of ways that Alice can choose (3) elements in order to win regardless of Bob's actions. The first line contains a single integer (t) ((1 \le t \le 1000)) — the number of test cases. The first line of each test case contains a single integer (n) ((3 \le n \le 5000)). The second line contains (n) integers (a_1, a_2, \dots, a_n) ((1 \le a_1 \le a_2 \le \cdots \le a_n \le 10^5)). Additional constraint on the input: the sum of (n) over all test cases doesn't exceed (5000). For each test case, print a single integer — the number of ways that Alice can choose (3) elements in order to win regardless of Bob's actions. In the first two test cases, no matter which three elements Alice chooses, Bob will be able to paint one element blue so that Alice does not win. In the third test case, Alice can choose any three elements. If Bob colors one of the red elements, the sum of red elements will be (14), and the sum of blue elements will be (7). If Bob chooses an uncolored element, the sum of red elements will be (21), and the sum of blue elements will be (7). In the fourth test case, Alice can choose either the (1)-st, (3)-rd and (4)-th element, or the (2)-nd, (3)-rd and (4)-th element.

Tutorials

Educational Codeforces Round 180 — Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
325962365 og.kostya C June 25, 2025, 5:55 a.m. OK C# 13 TESTS 21 703 0
325854633 pottery_03 C June 24, 2025, 10:12 a.m. OK C++17 (GCC 7-32) TESTS 21 92 0
325958779 F3R618 C June 25, 2025, 5:16 a.m. OK C++17 (GCC 7-32) TESTS 21 93 0
325937106 Binary-Brigade C June 24, 2025, 9:36 p.m. OK C++17 (GCC 7-32) TESTS 21 93 0
325924487 JorgeMartinez C June 24, 2025, 7:29 p.m. OK C++17 (GCC 7-32) TESTS 21 93 0
325833465 hcoder_17 C June 23, 2025, 6:43 p.m. OK C++17 (GCC 7-32) TESTS 21 93 0
325827095 Ahanaf_Reza C June 23, 2025, 5:50 p.m. OK C++17 (GCC 7-32) TESTS 21 93 0
325945448 zh02311845 C June 25, 2025, 1:48 a.m. OK C++17 (GCC 7-32) TESTS 21 93 102400
325936128 aniket_deore C June 24, 2025, 9:15 p.m. OK C++17 (GCC 7-32) TESTS 21 93 102400
325903443 Yaser_Almasri C June 24, 2025, 4:32 p.m. OK C++17 (GCC 7-32) TESTS 21 93 102400
325856140 chiragkapoor1009 C June 24, 2025, 10:30 a.m. OK C++17 (GCC 7-32) TESTS 21 93 102400
325938671 Bhuban C June 24, 2025, 10:13 p.m. OK C++20 (GCC 13-64) TESTS 21 62 0
325925067 Nady_ C June 24, 2025, 7:36 p.m. OK C++20 (GCC 13-64) TESTS 21 77 102400
325947622 Andyqian7 C June 25, 2025, 2:32 a.m. OK C++20 (GCC 13-64) TESTS 21 77 512000
325924500 Hoopoe404 C June 24, 2025, 7:29 p.m. OK C++20 (GCC 13-64) TESTS 21 78 102400
325895805 RePhiKnowPubIMB C June 24, 2025, 3:40 p.m. OK C++20 (GCC 13-64) TESTS 21 78 102400
325837963 hackboii C June 23, 2025, 7:39 p.m. OK C++20 (GCC 13-64) TESTS 21 78 102400
325836185 rubixsid05 C June 23, 2025, 7:12 p.m. OK C++20 (GCC 13-64) TESTS 21 78 102400
325900968 CodeBlossom C June 24, 2025, 4:15 p.m. OK C++20 (GCC 13-64) TESTS 21 92 102400
325900321 Deep_Kakadiya C June 24, 2025, 4:11 p.m. OK C++20 (GCC 13-64) TESTS 21 92 102400
325943457 anurag888 C June 25, 2025, 12:54 a.m. OK C++20 (GCC 13-64) TESTS 21 93 0
325863275 Prumize wlh__1 C June 24, 2025, 11:27 a.m. OK C++23 (GCC 14-64, msys2) TESTS 21 62 1228800
325901648 A7Med_Ma7Moud C June 24, 2025, 4:20 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 77 102400
325826739 danken C June 23, 2025, 5:47 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 77 102400
325953201 greedyforces_ C June 25, 2025, 3:56 a.m. OK C++23 (GCC 14-64, msys2) TESTS 21 78 0
325958650 Rayuga221b C June 25, 2025, 5:14 a.m. OK C++23 (GCC 14-64, msys2) TESTS 21 78 102400
325905155 Xannora C June 24, 2025, 4:44 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 78 102400
325854176 i_drive C June 24, 2025, 10:05 a.m. OK C++23 (GCC 14-64, msys2) TESTS 21 78 102400
325841092 sohammargaj55555 C June 23, 2025, 8:32 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 92 102400
325831981 mimiQ C June 23, 2025, 6:28 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 92 102400
325829691 SerajOmar C June 23, 2025, 6:10 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 92 102400
325903605 ruban C June 24, 2025, 4:34 p.m. OK FPC TESTS 21 437 14540800
325894638 sad10001 C June 24, 2025, 3:32 p.m. OK GNU C11 TESTS 21 109 102400
325844619 dev-am_gengar C June 23, 2025, 9:46 p.m. OK GNU C11 TESTS 21 109 102400
325963087 tekka_ity C June 25, 2025, 6:02 a.m. OK Java 21 TESTS 21 327 921600
325827391 Legend... C June 23, 2025, 5:52 p.m. OK Java 21 TESTS 21 342 614400
325858592 ThorOfWebDev C June 24, 2025, 10:53 a.m. OK Java 21 TESTS 21 343 1126400
325927107 Avinashchy7061 C June 24, 2025, 8:01 p.m. OK Java 21 TESTS 21 343 1945600
325937491 harshitgrover007 C June 24, 2025, 9:44 p.m. OK Java 21 TESTS 21 358 1126400
325899899 Abhishekdound C June 24, 2025, 4:08 p.m. OK Java 21 TESTS 21 374 1331200
325958500 fatal-98 C June 25, 2025, 5:12 a.m. OK Java 21 TESTS 21 389 512000
325855096 UI-Shashank C June 24, 2025, 10:19 a.m. OK Java 21 TESTS 21 389 1638400
325920186 kevinliu_ C June 24, 2025, 6:40 p.m. OK Java 21 TESTS 21 390 716800
325827216 bajrangbali_ C June 23, 2025, 5:51 p.m. OK Java 21 TESTS 21 390 1228800
325823361 Akash_Baidya2005 C June 23, 2025, 5:22 p.m. OK Java 8 TESTS 21 218 0
325819733 Akash_Baidya2005 C June 23, 2025, 4:59 p.m. OK Java 8 TESTS 21 218 0
325842768 Sumitsingh7 C June 23, 2025, 9:04 p.m. OK Java 8 TESTS 21 233 6963200
325836183 Akshatgupta069_069 C June 23, 2025, 7:12 p.m. OK Java 8 TESTS 21 1015 0
325955710 abhayrajnegi0416 C June 25, 2025, 4:36 a.m. OK Java 8 TESTS 21 1390 0
325827705 dark_rays C June 23, 2025, 5:54 p.m. OK Java 8 TESTS 21 2155 0
325901422 tittiesboy99 C June 24, 2025, 4:18 p.m. OK Java 8 TESTS 21 2374 0
325939187 jvhaa C June 24, 2025, 10:28 p.m. OK PyPy 3 TESTS 21 390 2969600
325908279 pranprocodes C June 24, 2025, 5:07 p.m. OK PyPy 3 TESTS 21 593 2457600
325915945 SwaroopB C June 24, 2025, 6:04 p.m. OK PyPy 3 TESTS 21 1155 4505600
325849866 MeghJesalpura C June 24, 2025, 12:43 a.m. OK PyPy 3 TESTS 21 1499 4710400
325960753 Circulation C June 25, 2025, 5:38 a.m. OK PyPy 3-64 TESTS 21 171 2355200
325922350 learnerdaily5 C June 24, 2025, 7:02 p.m. OK PyPy 3-64 TESTS 21 171 2457600
325920216 adi115181 C June 24, 2025, 6:40 p.m. OK PyPy 3-64 TESTS 21 171 2457600
325830753 Evil_Gene C June 23, 2025, 6:19 p.m. OK PyPy 3-64 TESTS 21 187 2355200
325851468 bufferacct C June 24, 2025, 9:16 a.m. OK PyPy 3-64 TESTS 21 187 2867200
325838500 ChickenTamer C June 23, 2025, 7:47 p.m. OK PyPy 3-64 TESTS 21 187 3072000
325844689 samchen123 C June 23, 2025, 9:47 p.m. OK PyPy 3-64 TESTS 21 202 2355200
325830086 rup130104 C June 23, 2025, 6:13 p.m. OK PyPy 3-64 TESTS 21 202 2457600
325856871 AdityaVegad C June 24, 2025, 10:37 a.m. OK PyPy 3-64 TESTS 21 202 2662400
325890215 Katrina55553 C June 24, 2025, 3:04 p.m. OK PyPy 3-64 TESTS 21 202 3276800
325934467 V1_Forces7Y7 C June 24, 2025, 8:46 p.m. OK Python 3 TESTS 21 1562 1433600
325858404 svrmalaviya C June 24, 2025, 10:51 a.m. OK Python 3 TESTS 21 1562 1536000
325833715 RohithReddy14 C June 23, 2025, 6:45 p.m. OK Python 3 TESTS 21 1593 1433600
325824853 cioppy C June 23, 2025, 5:32 p.m. OK Python 3 TESTS 21 1593 1433600
325821661 ashvathhb C June 23, 2025, 5:11 p.m. OK Python 3 TESTS 21 1593 1433600
325819679 ashvathhb C June 23, 2025, 4:59 p.m. OK Python 3 TESTS 21 1702 1228800
325843884 krkushwant C June 23, 2025, 9:28 p.m. OK Python 3 TESTS 21 1702 1536000
325858545 The_Elephant C June 24, 2025, 10:52 a.m. OK Python 3 TESTS 21 2108 1536000
325908384 pranprocodes C June 24, 2025, 5:08 p.m. OK Python 3 TESTS 21 2437 1536000
325846863 DeanMenezes3 C June 23, 2025, 10:55 p.m. OK Rust 2021 TESTS 21 93 102400
325891203 0x81 C June 24, 2025, 3:10 p.m. OK Rust 2021 TESTS 21 109 102400
325853330 DanielAnker C June 24, 2025, 9:45 a.m. OK Rust 2021 TESTS 21 703 102400
325961260 qqqqc C June 25, 2025, 5:43 a.m. OK Rust 2021 TESTS 21 718 102400

remove filters

Back to search problems