Kotlin Heroes: Episode 14

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
2199 Kotlin Heroes: Episode 14 FINISHED False 9000 3943523 March 2, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 1276 ) A Game PROGRAMMING *special

Alice and Bob are playing a card game. The game consists of (3) rounds, in each round both players score some points (from (0) to (k)), and for each round, Alice's score differs from Bob's score. The player who scores more points in a round is considered the winner of that round. In the first round, Alice scored (a_1) points, and Bob scored (b_1). In the second round, Alice scored (a_2) points, and Bob scored (b_2). The winner of the game is the one who has the higher total score. If Alice's total score equals Bob's total score, the player who won more rounds is declared the winner. Alice wants to understand if Bob has a chance to win, or if she will definitely win regardless of the results of the (3)-rd round. Help her determine this! Please note that in each round, a player can score at least (0) and at most (k) points. Additionally, for each round, Alice's score differs from Bob's score. The first line contains a single integer (t) ((1 \le t \le 10^4)) — the number of test cases. Each test case consists of three lines: the first line contains a single integer (k) ((1 \le k \le 50)) — the maximum number of points that can be scored in a round; the second line contains two integers (a_1) and (b_1) ((0 \le a_1, b_1 \le k); (a_1 \ne b_1)) — the points scored by Alice and Bob respectively in the first round; the third line contains two integers (a_2) and (b_2) ((0 \le a_2, b_2 \le k); (a_2 \ne b_2)) — the points scored by Alice and Bob respectively in the second round. For each test case, output NO if Alice will win regardless of the results of the third round, or YES if Bob has a chance to win. In the first example, Bob will win if, for example, Alice scores (3) points in the last round, and Bob scores (2). In the second example, Bob will win if Alice scores (0) points in the last round, and Bob scores (5).

Tutorials

151783

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
365113340 Koushal_26 A March 2, 2026, 3:56 p.m. OK Kotlin 1.7 TESTS 3 171 0
365101306 RitikaBaliyan8 A March 2, 2026, 2:39 p.m. OK Kotlin 1.7 TESTS 3 171 614400
365102326 Pinaka A March 2, 2026, 2:45 p.m. OK Kotlin 1.7 TESTS 3 171 5939200
365109446 FS_NEO A March 2, 2026, 3:29 p.m. OK Kotlin 1.7 TESTS 3 187 0
365101133 potato167 A March 2, 2026, 2:38 p.m. OK Kotlin 1.7 TESTS 3 187 0
365104381 ankit360 A March 2, 2026, 2:56 p.m. OK Kotlin 1.7 TESTS 3 187 921600
365102591 AliHasanli736 A March 2, 2026, 2:46 p.m. OK Kotlin 1.7 TESTS 3 187 921600
365102400 Halaat_Kharab_Hein A March 2, 2026, 2:45 p.m. OK Kotlin 1.7 TESTS 3 187 4403200
365105817 micro_farad A March 2, 2026, 3:05 p.m. OK Kotlin 1.7 TESTS 3 187 5939200
365106296 ismunandarmuis311 A March 2, 2026, 3:08 p.m. OK Kotlin 1.7 TESTS 3 187 6553600
365101489 Elite_Aadi1 A March 2, 2026, 2:40 p.m. OK Kotlin 1.9 TESTS 3 78 0
365124810 yuisgame A March 2, 2026, 5:27 p.m. OK Kotlin 1.9 TESTS 3 93 0
365101080 __jk__ A March 2, 2026, 2:38 p.m. OK Kotlin 1.9 TESTS 3 93 0
365119984 Fundrush A March 2, 2026, 4:49 p.m. OK Kotlin 1.9 TESTS 3 109 0
365115361 jinxedcat A March 2, 2026, 4:13 p.m. OK Kotlin 1.9 TESTS 3 109 0
365120640 dtsci A March 2, 2026, 4:54 p.m. OK Kotlin 1.9 TESTS 3 125 0
365107135 sathvika810 A March 2, 2026, 3:14 p.m. OK Kotlin 1.9 TESTS 3 125 0
365101035 BucketPotato A March 2, 2026, 2:37 p.m. OK Kotlin 1.9 TESTS 3 125 0
365104975 xiaowuc1 A March 2, 2026, 3 p.m. OK Kotlin 1.9 TESTS 3 125 102400
365101533 1435730 A March 2, 2026, 2:40 p.m. OK Kotlin 1.9 TESTS 3 125 102400
365102412 oa8315980 A March 2, 2026, 2:45 p.m. OK Kotlin 2.2 TESTS 3 62 0
365100842 CodexMonarch A March 2, 2026, 2:36 p.m. OK Kotlin 2.2 TESTS 3 62 0
365101843 SINNOCENT A March 2, 2026, 2:42 p.m. OK Kotlin 2.2 TESTS 3 78 0
365101372 MohamedAboOkail A March 2, 2026, 2:39 p.m. OK Kotlin 2.2 TESTS 3 78 0
365119343 SakibSibly2 A March 2, 2026, 4:44 p.m. OK Kotlin 2.2 TESTS 3 78 23859200
365101083 binminh A March 2, 2026, 2:38 p.m. OK Kotlin 2.2 TESTS 3 78 23859200
365147258 akshitjain24 A March 2, 2026, 9:24 p.m. OK Kotlin 2.2 TESTS 3 93 0
365114821 chyckchyryk A March 2, 2026, 4:08 p.m. OK Kotlin 2.2 TESTS 3 93 0
365112383 Aurora_Dik A March 2, 2026, 3:49 p.m. OK Kotlin 2.2 TESTS 3 93 0
365111611 joyo16 A March 2, 2026, 3:44 p.m. OK Kotlin 2.2 TESTS 3 93 0

remove filters

Back to search problems