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 |
---|---|---|---|---|---|---|
1992 | Codeforces Round 957 (Div. 3) | FINISHED | False | 8100 | 16471463 | July 11, 2024, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 5943 ) | F | Valuable Cards | PROGRAMMING | dp greedy number theory two pointers |
B'In his favorite cafe Kmes once again wanted to try the herring under a fur coat. Previously, it would not have been difficult for him to do this, but the cafe recently introduced a new purchasing policy. Now, in order to make a purchase, Kmes needs to solve the following problem: n cards with prices for different positions are laid out in front of him, on the i -th card there is an integer a_i , among these prices there is no whole positive integer x . Kmes is asked to divide these cards into the minimum number of bad segments (so that each card belongs to exactly one segment). A segment is considered bad if it is impossible to select a subset of cards with a product equal to x . All segments, in which Kmes will divide the cards, must be bad. Formally, the segment (l, r) is bad if there are no indices i_1 < i_2 < ldots < i_k such that l <= i_1, i_k <= r , and a_{i_1} cdot a_{i_2} ldots cdot a_{i_k} = x . Help Kmes determine the minimum number of bad segments in order to enjoy his favorite dish. The first line contains a single integer t ( 1 <= t <= 10^3 ) -- the number of test cases. The first line of each set of input data gives you 2 integers n and x ( 1 <= n <= 10^5, 2 <= x <= 10^5 ) -- the number of cards and the integer, respectively. The second line of each set of input data contains n integers a_i ( 1 <= a_i <= 2 cdot 10^5, a_i neq x ) -- the prices on the cards. It is guaranteed that the sum of n over all sets of test data does not exceed 10^5 . For each set of input data, output the minimum number of bad segments. '... |
Shayan's Video Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
270068786 | A1ternate | F | July 11, 2024, 6:14 p.m. | OK | C# 10 | TESTS | 18 | 484 | 14438400 | ||
270115493 | HKUST_ZJH | F | July 12, 2024, 4:41 a.m. | OK | C++14 (GCC 6-32) | TESTS | 22 | 78 | 1228800 | ||
270116321 | Judgement_Core | F | July 12, 2024, 4:50 a.m. | OK | C++14 (GCC 6-32) | TESTS | 22 | 93 | 64102400 | ||
270106839 | i_loveMaiPhuong | F | July 12, 2024, 3:04 a.m. | OK | C++14 (GCC 6-32) | TESTS | 22 | 124 | 819200 | ||
270071012 | ggmxwg | F | July 11, 2024, 6:32 p.m. | OK | C++14 (GCC 6-32) | TESTS | 18 | 140 | 0 | ||
270100548 | NaraFluorine | F | July 12, 2024, 1:47 a.m. | OK | C++14 (GCC 6-32) | TESTS | 22 | 171 | 2867200 | ||
270051961 | contest_virus | F | July 11, 2024, 5:21 p.m. | OK | C++14 (GCC 6-32) | TESTS | 18 | 171 | 6860800 | ||
270101462 | 3449 | F | July 12, 2024, 2 a.m. | OK | C++14 (GCC 6-32) | TESTS | 22 | 171 | 7987200 | ||
270093261 | Junz_LJL | F | July 11, 2024, 11:45 p.m. | OK | C++14 (GCC 6-32) | TESTS | 22 | 187 | 17100800 | ||
270108561 | lucky_clover_ | F | July 12, 2024, 3:21 a.m. | OK | C++14 (GCC 6-32) | TESTS | 22 | 202 | 102400 | ||
270108501 | shufentainanle | F | July 12, 2024, 3:20 a.m. | OK | C++14 (GCC 6-32) | TESTS | 22 | 250 | 819200 | ||
270111121 | shivansh_1720 | F | July 12, 2024, 3:48 a.m. | OK | C++17 (GCC 7-32) | TESTS | 22 | 93 | 0 | ||
270096358 | planes | F | July 12, 2024, 12:45 a.m. | OK | C++17 (GCC 7-32) | TESTS | 22 | 93 | 0 | ||
270069990 | rockhopper130 | F | July 11, 2024, 6:24 p.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 93 | 0 | ||
270052923 | z5359122 | F | July 11, 2024, 5:26 p.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 93 | 0 | ||
270070556 | onetap | F | July 11, 2024, 6:28 p.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 93 | 819200 | ||
270054375 | masa.dobric | F | July 11, 2024, 5:36 p.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 93 | 819200 | ||
270101399 | ToanLe | F | July 12, 2024, 1:59 a.m. | OK | C++17 (GCC 7-32) | TESTS | 22 | 108 | 409600 | ||
270093378 | Rostcraft | F | July 11, 2024, 11:48 p.m. | OK | C++17 (GCC 7-32) | TESTS | 22 | 109 | 0 | ||
270070218 | puspendra_09 | F | July 11, 2024, 6:26 p.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 109 | 0 | ||
270050779 | zap4eg | F | July 11, 2024, 5:14 p.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 124 | 102400 | ||
270094823 | Ycfhnnd | F | July 12, 2024, 12:16 a.m. | OK | C++20 (GCC 13-64) | TESTS | 22 | 62 | 0 | ||
270069354 | wlaten | F | July 11, 2024, 6:18 p.m. | OK | C++20 (GCC 13-64) | TESTS | 18 | 62 | 0 | ||
270081679 | 7misha | F | July 11, 2024, 8:18 p.m. | OK | C++20 (GCC 13-64) | TESTS | 22 | 62 | 204800 | ||
270103259 | NguyenDucHien | F | July 12, 2024, 2:23 a.m. | OK | C++20 (GCC 13-64) | TESTS | 22 | 62 | 512000 | ||
270075288 | SkillZz_ | F | July 11, 2024, 7:09 p.m. | OK | C++20 (GCC 13-64) | TESTS | 22 | 77 | 0 | ||
270053694 | korokseeds | F | July 11, 2024, 5:31 p.m. | OK | C++20 (GCC 13-64) | TESTS | 18 | 77 | 0 | ||
270094510 | thisislike_fan | F | July 12, 2024, 12:10 a.m. | OK | C++20 (GCC 13-64) | TESTS | 22 | 77 | 819200 | ||
270103943 | Cai-Guang | F | July 12, 2024, 2:32 a.m. | OK | C++20 (GCC 13-64) | TESTS | 22 | 77 | 1638400 | ||
270054724 | zengjun | F | July 11, 2024, 5:38 p.m. | OK | C++20 (GCC 13-64) | TESTS | 18 | 77 | 2048000 | ||
270053676 | zengjun | F | July 11, 2024, 5:31 p.m. | OK | C++20 (GCC 13-64) | TESTS | 18 | 77 | 2048000 | ||
270077679 | man-ray | F | July 11, 2024, 7:33 p.m. | OK | Java 21 | TESTS | 22 | 452 | 1126400 | ||
270113167 | minibin | F | July 12, 2024, 4:12 a.m. | OK | Java 21 | TESTS | 22 | 499 | 512000 | ||
270055984 | vinay_panwar | F | July 11, 2024, 5:47 p.m. | OK | Java 21 | TESTS | 18 | 656 | 716800 | ||
270079099 | BlizGale | F | July 11, 2024, 7:48 p.m. | OK | Java 21 | TESTS | 22 | 702 | 921600 | ||
270089095 | aishwarykesarwani | F | July 11, 2024, 10:12 p.m. | OK | Java 21 | TESTS | 22 | 733 | 1024000 | ||
270050634 | Dukkha | F | July 11, 2024, 5:13 p.m. | OK | Java 21 | TESTS | 18 | 828 | 2252800 | ||
270080680 | SweetAsCocaine | F | July 11, 2024, 8:06 p.m. | OK | Java 21 | TESTS | 22 | 936 | 1843200 | ||
270073373 | PlayDate | F | July 11, 2024, 6:52 p.m. | OK | Java 21 | TESTS | 22 | 1015 | 1228800 | ||
270068791 | Utsav82 | F | July 11, 2024, 6:14 p.m. | OK | Java 21 | TESTS | 18 | 1031 | 1126400 | ||
270067546 | Utsav82 | F | July 11, 2024, 6:04 p.m. | OK | Java 21 | TESTS | 18 | 1156 | 512000 | ||
270109872 | vjudge.3 | F | July 12, 2024, 3:34 a.m. | OK | Java 8 | TESTS | 22 | 359 | 0 | ||
270103019 | rujuldwivedi | F | July 12, 2024, 2:20 a.m. | OK | Java 8 | TESTS | 22 | 405 | 0 | ||
270078904 | BlizGale | F | July 11, 2024, 7:46 p.m. | OK | Java 8 | TESTS | 22 | 452 | 0 | ||
270117101 | Jay08 | F | July 12, 2024, 4:59 a.m. | OK | Java 8 | TESTS | 38 | 483 | 42496000 | ||
270079050 | BlizGale | F | July 11, 2024, 7:47 p.m. | OK | Java 8 | TESTS | 22 | 562 | 0 | ||
270066313 | Yousef_Badr | F | July 11, 2024, 5:55 p.m. | OK | Java 8 | TESTS | 18 | 577 | 0 | ||
270112019 | achyut88 | F | July 12, 2024, 3:58 a.m. | OK | Java 8 | TESTS | 22 | 578 | 0 | ||
270117604 | tirthgohil1410 | F | July 12, 2024, 5:04 a.m. | OK | Java 8 | TESTS | 38 | 593 | 0 | ||
270054506 | vatsal_04 | F | July 11, 2024, 5:36 p.m. | OK | Java 8 | TESTS | 18 | 640 | 0 | ||
270071484 | NerfThis | F | July 11, 2024, 6:36 p.m. | OK | Java 8 | TESTS | 22 | 3093 | 73625600 | ||
270093184 | the_last_smilodon | F | July 11, 2024, 11:43 p.m. | OK | PyPy 3 | TESTS | 22 | 390 | 8601600 | ||
270094483 | random__person | F | July 12, 2024, 12:10 a.m. | OK | PyPy 3 | TESTS | 22 | 437 | 8908800 | ||
270068007 | DarkTemplarDrop | F | July 11, 2024, 6:08 p.m. | OK | PyPy 3-64 | TESTS | 18 | 327 | 13516800 | ||
270079008 | kkkk1234 | F | July 11, 2024, 7:47 p.m. | OK | PyPy 3-64 | TESTS | 22 | 328 | 13107200 | ||
270090850 | william0 | F | July 11, 2024, 10:47 p.m. | OK | PyPy 3-64 | TESTS | 22 | 343 | 13209600 | ||
270098265 | keroru | F | July 12, 2024, 1:15 a.m. | OK | PyPy 3-64 | TESTS | 22 | 358 | 14745600 | ||
270093164 | the_last_smilodon | F | July 11, 2024, 11:43 p.m. | OK | PyPy 3-64 | TESTS | 22 | 359 | 12595200 | ||
270078615 | gardengnome | F | July 11, 2024, 7:43 p.m. | OK | PyPy 3-64 | TESTS | 22 | 359 | 13107200 | ||
270093073 | the_last_smilodon | F | July 11, 2024, 11:41 p.m. | OK | PyPy 3-64 | TESTS | 22 | 359 | 15052800 | ||
270120033 | 429d51579a491c57 | F | July 12, 2024, 5:28 a.m. | OK | PyPy 3-64 | TESTS | 38 | 374 | 12390400 | ||
270055246 | adwmos | F | July 11, 2024, 5:41 p.m. | OK | PyPy 3-64 | TESTS | 18 | 374 | 13004800 | ||
270055256 | sriragt | F | July 11, 2024, 5:41 p.m. | OK | PyPy 3-64 | TESTS | 18 | 374 | 13107200 | ||
270062341 | nandhagk1729 | F | July 11, 2024, 5:48 p.m. | OK | Python 3 | TESTS | 18 | 1561 | 10342400 | ||
270103932 | the_fool | F | July 12, 2024, 2:32 a.m. | OK | Python 3 | TESTS | 22 | 1577 | 10547200 | ||
270071032 | nandhagk1729 | F | July 11, 2024, 6:32 p.m. | OK | Python 3 | TESTS | 18 | 1593 | 10342400 | ||
270116758 | ___a_s_1_2___ | F | July 12, 2024, 4:55 a.m. | OK | Python 3 | TESTS | 38 | 1656 | 12390400 | ||
270051633 | Heartbeateffect | F | July 11, 2024, 5:19 p.m. | OK | Python 3 | TESTS | 18 | 1843 | 11878400 | ||
270097988 | twoo.zyy | F | July 12, 2024, 1:11 a.m. | OK | Python 3 | TESTS | 22 | 1890 | 10342400 | ||
270054833 | adwmos | F | July 11, 2024, 5:39 p.m. | OK | Python 3 | TESTS | 18 | 2109 | 10240000 | ||
270111062 | JUBHAI | F | July 12, 2024, 3:47 a.m. | OK | Rust 2021 | TESTS | 22 | 124 | 0 | ||
270110557 | JUBHAI | F | July 12, 2024, 3:41 a.m. | OK | Rust 2021 | TESTS | 22 | 139 | 0 | ||
270069202 | Cheshulko | F | July 11, 2024, 6:17 p.m. | OK | Rust 2021 | TESTS | 18 | 280 | 3174400 |
Back to search problems