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 |
---|---|---|---|---|---|---|
1991 | Pinely Round 4 (Div. 1 + Div. 2) | FINISHED | False | 10800 | 15002663 | July 28, 2024, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 2437 ) | F | Triangle Formation | PROGRAMMING | brute force greedy math sortings |
B'You are given n sticks, numbered from 1 to n . The length of the i -th stick is a_i . You need to answer q queries. In each query, you are given two integers l and r ( 1 <= l < r <= n , r - l + 1 ge 6 ). Determine whether it is possible to choose 6 distinct sticks from the sticks numbered l to r , to form 2 non-degenerate triangles ^{ text{ xe2 x88 x97}} . ^{ text{ xe2 x88 x97}} A triangle with side lengths a , b , and c is called non-degenerate if: The first line contains two integers n and q ( 6 <= n <= 10^5 , 1 <= q <= 10^5 ) -- the number of sticks and the number of queries respectively. The second line contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 10^9 ) -- a_i denotes the length of the i -th stick. Each of the following q lines contains two integers l and r ( 1 <= l < r <= n , r - l + 1 ge 6 ) -- the parameters of each query. For each query, output "YES" (without quotes) if it is possible to form 2 triangles, and "NO" (without quotes) otherwise. You can output the answer in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive responses. In the first query, the lengths of the sticks are [5, 2, 2, 10, 4, 10] . Two sets of sticks [2, 4, 5] and [2, 10, 10] can be selected to form 2 non-degenerate triangles. In the second query, the lengths of the sticks are [2, 2, 10, 4, 10, 6] . It can be shown that it is impossible to form 2 non-degenerate triangles. In the third query, the lengths of the sticks are [2, 2, 10, 4, 10, 6, 1] . Two sets of sticks [1, 2, 2] and [4, 10, 10] can be selected to form 2 non-degenerate triangles. In the fourth query, the lengths of the sticks are [4, 10, 6, 1, 5, 3] . It can be shown that it is impossible to form 2'... |
Video Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
273271142 | yeminghan | F | July 29, 2024, 3:41 a.m. | OK | C++14 (GCC 6-32) | TESTS | 37 | 171 | 409600 | ||
273271973 | FNOIwyhao | F | July 29, 2024, 3:51 a.m. | OK | C++14 (GCC 6-32) | TESTS | 39 | 202 | 819200 | ||
273267949 | hhhyyyfff | F | July 29, 2024, 3:04 a.m. | OK | C++14 (GCC 6-32) | TESTS | 36 | 203 | 409600 | ||
273268052 | hhhyyyfff | F | July 29, 2024, 3:06 a.m. | OK | C++14 (GCC 6-32) | TESTS | 36 | 218 | 409600 | ||
273259392 | yeminghan | F | July 29, 2024, 1:22 a.m. | OK | C++14 (GCC 6-32) | TESTS | 33 | 218 | 409600 | ||
273242511 | shagou | F | July 28, 2024, 8:07 p.m. | OK | C++14 (GCC 6-32) | TESTS | 32 | 218 | 1228800 | ||
273270922 | yeminghan | F | July 29, 2024, 3:39 a.m. | OK | C++14 (GCC 6-32) | TESTS | 37 | 234 | 409600 | ||
273221375 | AEM_YNxingkong | F | July 28, 2024, 5:17 p.m. | OK | C++14 (GCC 6-32) | TESTS | 32 | 249 | 614400 | ||
273276194 | hexagonwarrior | F | July 29, 2024, 4:42 a.m. | OK | C++14 (GCC 6-32) | TESTS | 42 | 249 | 819200 | ||
273268072 | Yoralen | F | July 29, 2024, 3:06 a.m. | OK | C++14 (GCC 6-32) | TESTS | 36 | 249 | 1228800 | ||
273268921 | KellyWLJ | F | July 29, 2024, 3:15 a.m. | OK | C++17 (GCC 7-32) | TESTS | 36 | 125 | 1126400 | ||
273257653 | dalgu | F | July 29, 2024, 12:56 a.m. | OK | C++17 (GCC 7-32) | TESTS | 33 | 156 | 0 | ||
273227535 | Circling | F | July 28, 2024, 5:32 p.m. | OK | C++17 (GCC 7-32) | TESTS | 32 | 171 | 819200 | ||
273243118 | VasyaMer | F | July 28, 2024, 8:16 p.m. | OK | C++17 (GCC 7-32) | TESTS | 32 | 233 | 0 | ||
273273810 | AkiLotus | F | July 29, 2024, 4:13 a.m. | OK | C++17 (GCC 7-32) | TESTS | 41 | 250 | 0 | ||
273263305 | StenSoSmol | F | July 29, 2024, 2:11 a.m. | OK | C++17 (GCC 7-32) | TESTS | 33 | 264 | 819200 | ||
273225065 | usmanov.ie | F | July 28, 2024, 5:26 p.m. | OK | C++17 (GCC 7-32) | TESTS | 32 | 265 | 0 | ||
273256115 | wzc_IOI_czw | F | July 29, 2024, 12:26 a.m. | OK | C++17 (GCC 7-32) | TESTS | 33 | 265 | 409600 | ||
273272013 | _cly_ | F | July 29, 2024, 3:52 a.m. | OK | C++17 (GCC 7-32) | TESTS | 39 | 265 | 3686400 | ||
273253073 | pkhaustov | F | July 28, 2024, 11:13 p.m. | OK | C++17 (GCC 7-32) | TESTS | 33 | 280 | 0 | ||
273237179 | maxplus | F | July 28, 2024, 7:11 p.m. | OK | C++20 (GCC 13-64) | TESTS | 32 | 93 | 102400 | ||
273241921 | alexok2006 | F | July 28, 2024, 7:59 p.m. | OK | C++20 (GCC 13-64) | TESTS | 32 | 108 | 30515200 | ||
273265394 | historical | F | July 29, 2024, 2:35 a.m. | OK | C++20 (GCC 13-64) | TESTS | 33 | 109 | 0 | ||
273241503 | PinkieRabbit | F | July 28, 2024, 7:54 p.m. | OK | C++20 (GCC 13-64) | TESTS | 32 | 109 | 409600 | ||
273241428 | PinkieRabbit | F | July 28, 2024, 7:53 p.m. | OK | C++20 (GCC 13-64) | TESTS | 32 | 109 | 409600 | ||
273256191 | Legend__dy | F | July 29, 2024, 12:28 a.m. | OK | C++20 (GCC 13-64) | TESTS | 33 | 109 | 1638400 | ||
273245459 | luogu_bot5 | F | July 28, 2024, 8:55 p.m. | OK | C++20 (GCC 13-64) | TESTS | 32 | 124 | 409600 | ||
273243079 | luogu_bot3 | F | July 28, 2024, 8:16 p.m. | OK | C++20 (GCC 13-64) | TESTS | 32 | 124 | 409600 | ||
273243144 | alexok2006 | F | July 28, 2024, 8:17 p.m. | OK | C++20 (GCC 13-64) | TESTS | 32 | 124 | 30515200 | ||
273242715 | alexok2006 | F | July 28, 2024, 8:10 p.m. | OK | C++20 (GCC 13-64) | TESTS | 32 | 124 | 30515200 | ||
273267203 | 0x3F | F | July 29, 2024, 2:56 a.m. | OK | Go | TESTS | 35 | 749 | 5427200 | ||
273267909 | 0x3F | F | July 29, 2024, 3:04 a.m. | OK | Go | TESTS | 36 | 827 | 5427200 | ||
273268558 | 0x3F | F | July 29, 2024, 3:11 a.m. | OK | Go | TESTS | 36 | 2155 | 6553600 | ||
273268187 | 0x3F | F | July 29, 2024, 3:07 a.m. | OK | Go | TESTS | 36 | 2281 | 6758400 | ||
273278354 | dzhi | F | July 29, 2024, 5:07 a.m. | OK | Java 21 | TESTS | 42 | 468 | 3481600 | ||
273278546 | dzhi | F | July 29, 2024, 5:09 a.m. | OK | Java 21 | TESTS | 42 | 515 | 2457600 | ||
273226827 | Lilypad | F | July 28, 2024, 5:30 p.m. | OK | Java 21 | TESTS | 32 | 1515 | 716800 | ||
273248886 | anta.baka | F | July 28, 2024, 9:48 p.m. | OK | Java 21 | TESTS | 32 | 2046 | 1331200 | ||
273247768 | profchi | F | July 28, 2024, 9:28 p.m. | OK | Java 8 | TESTS | 32 | 1952 | 0 | ||
273220918 | etian6795 | F | July 28, 2024, 5:15 p.m. | OK | Java 8 | TESTS | 32 | 4030 | 0 | ||
273234955 | shilpabanerjee50 | F | July 28, 2024, 6:56 p.m. | OK | PyPy 2 | TESTS | 32 | 1749 | 20070400 | ||
273254293 | shash4321 | F | July 28, 2024, 11:42 p.m. | OK | PyPy 3-64 | TESTS | 33 | 530 | 149606400 | ||
273246115 | Joris_Perrenet | F | July 28, 2024, 9:04 p.m. | OK | PyPy 3-64 | TESTS | 32 | 593 | 33075200 | ||
273234789 | golomb | F | July 28, 2024, 6:55 p.m. | OK | PyPy 3-64 | TESTS | 32 | 609 | 12902400 | ||
273222357 | Captainfly | F | July 28, 2024, 5:19 p.m. | OK | PyPy 3-64 | TESTS | 32 | 639 | 30105600 | ||
273220779 | Acceon | F | July 28, 2024, 5:15 p.m. | OK | PyPy 3-64 | TESTS | 32 | 889 | 36044800 | ||
273264936 | Shirotsume | F | July 29, 2024, 2:30 a.m. | OK | PyPy 3-64 | TESTS | 33 | 1421 | 17817600 | ||
273273577 | zzczzzzz | F | July 29, 2024, 4:10 a.m. | OK | Rust 2021 | TESTS | 40 | 3780 | 3686400 |
Back to search problems