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 |
---|---|---|---|---|---|---|
1967 | Codeforces Round 942 (Div. 1) | FINISHED | False | 9000 | 17335499 | April 30, 2024, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1779 ) | C | Fenwick Tree | PROGRAMMING | bitmasks brute force combinatorics data structures dp math trees | 2300 |
B"Let operatorname{lowbit}(x) denote the value of the lowest binary bit of x , e.g. operatorname{lowbit}(12)=4 , operatorname{lowbit}(8)=8 . For an array a of length n , if an array s of length n satisfies s_k= <= ft( sum limits_{i=k- operatorname{lowbit}(k)+1}^{k}a_i right) bmod 998 ,244 ,353 for all k , then s is called the Fenwick Tree of a . Let's denote it as s=f(a) . For a positive integer k and an array a , f^k(a) is defined as follows: f^k(a)= begin{cases} f(a)& textrm{if }k=1 f(f^{k-1}(a))& textrm{otherwise.} end{cases} You are given an array b of length n and a positive integer k . Find an array a that satisfies 0 <= a_i < 998 ,244 ,353 and f^k(a)=b . It can be proved that an answer always exists. If there are multiple possible answers, you may print any of them. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^4 ). The description of the test cases follows. The first line of each test case contains two positive integers n ( 1 <= q n <= q 2 cdot 10^5 ) and k ( 1 <= k <= 10^9 ), representing the length of the array and the number of times the function f is performed. The second line of each test case contains an array b_1, b_2, ldots, b_n ( 0 <= b_i < 998 ,244 ,353 ). It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, print a single line, containing a valid array a of length n . In the first test case, it can be seen that f^1([1,1,1,1,1,1,1,1])=[1,2,1,4,1,2,1,8] . In the second test case, it can be seen that f^2([1,2,3,4,5,6])=f^1([1,3,3,10,5,11])=[1,4,3,17,5,16] . "... |
Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
258921623 | Kyte | C | April 30, 2024, 5:02 p.m. | OK | C++14 (GCC 6-32) | TESTS | 30 | 156 | 2457600 | 2300 | |
259110721 | zhengqingyuan | C | May 2, 2024, 11:03 a.m. | OK | C++14 (GCC 6-32) | TESTS | 30 | 171 | 819200 | 2300 | |
259011362 | sell_gram_wind | C | May 1, 2024, 1:18 p.m. | OK | C++14 (GCC 6-32) | TESTS | 30 | 171 | 4812800 | 2300 | |
260972909 | susmitha_seeta | C | May 14, 2024, 6:45 p.m. | OK | C++14 (GCC 6-32) | TESTS | 30 | 171 | 8089600 | 2300 | |
259597901 | WSD33 | C | May 5, 2024, 7:29 a.m. | OK | C++14 (GCC 6-32) | TESTS | 30 | 187 | 9625600 | 2300 | |
258898497 | Max_s_xaM | C | April 30, 2024, 3:39 p.m. | OK | C++14 (GCC 6-32) | TESTS | 30 | 187 | 10137600 | 2300 | |
258966486 | sunumbrella | C | May 1, 2024, 5:35 a.m. | OK | C++14 (GCC 6-32) | TESTS | 30 | 202 | 0 | 2300 | |
258939739 | sammyuri | C | April 30, 2024, 8:41 p.m. | OK | C++14 (GCC 6-32) | TESTS | 30 | 202 | 0 | 2300 | |
258999283 | eggegg185 | C | May 1, 2024, 11:13 a.m. | OK | C++14 (GCC 6-32) | TESTS | 30 | 202 | 1638400 | 2300 | |
259069760 | Chenly | C | May 2, 2024, 1:30 a.m. | OK | C++14 (GCC 6-32) | TESTS | 30 | 202 | 3276800 | 2300 | |
258965436 | sg0071729 | C | May 1, 2024, 5:24 a.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 139 | 102400 | 2300 | |
259093067 | Vermeil | C | May 2, 2024, 7:16 a.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 140 | 819200 | 2300 | |
259556102 | DobromirAngelov | C | May 4, 2024, 8:04 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 155 | 1638400 | 2300 | |
258906426 | NTT | C | April 30, 2024, 4:05 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 155 | 3788800 | 2300 | |
263333713 | flashmt | C | May 30, 2024, 3:46 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 156 | 0 | 2300 | |
258924596 | Sempr | C | April 30, 2024, 5:38 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 156 | 0 | 2300 | |
260743892 | Yugi.Hacker | C | May 13, 2024, 5:12 a.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 156 | 819200 | 2300 | |
258989378 | zc2707 | C | May 1, 2024, 9:24 a.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 156 | 819200 | 2300 | |
261760061 | arnavsingh_047 | C | May 20, 2024, 9:56 a.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 156 | 8089600 | 2300 | |
259069057 | xiaoziyao | C | May 2, 2024, 1:15 a.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 156 | 50073600 | 2300 | |
259359902 | N_z__ | C | May 3, 2024, 1:02 p.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 77 | 102400 | 2300 | |
259288093 | Golem__ | C | May 3, 2024, 2:22 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 78 | 1024000 | 2300 | |
259072586 | Golem__ | C | May 2, 2024, 2:34 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 93 | 1024000 | 2300 | |
258886518 | QAQAutoMaton | C | April 30, 2024, 3:10 p.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 93 | 5017600 | 2300 | |
261015037 | LaoMang | C | May 15, 2024, 7:08 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 108 | 1638400 | 2300 | |
261265895 | GaoYusong | C | May 17, 2024, 2:10 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 109 | 0 | 2300 | |
259938210 | kjhhjki | C | May 8, 2024, 1:38 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 109 | 0 | 2300 | |
259880765 | camc | C | May 7, 2024, 1:20 p.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 109 | 0 | 2300 | |
259707770 | esum | C | May 6, 2024, 5:46 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 109 | 0 | 2300 | |
258955907 | VinnySJ | C | May 1, 2024, 3:02 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 109 | 0 | 2300 | |
258901309 | Gassa | C | April 30, 2024, 3:48 p.m. | OK | D | TESTS | 30 | 296 | 10752000 | 2300 | |
258884539 | hos.lyric | C | April 30, 2024, 3:06 p.m. | OK | D | TESTS | 30 | 374 | 24371200 | 2300 | |
258940318 | rainboy | C | April 30, 2024, 8:51 p.m. | OK | GNU C11 | TESTS | 30 | 936 | 921600 | 2300 | |
258924780 | chro4896 | C | April 30, 2024, 5:39 p.m. | OK | GNU C11 | TESTS | 30 | 1155 | 3276800 | 2300 | |
259735743 | yud08 | C | May 6, 2024, 10:45 a.m. | OK | GNU C11 | TESTS | 30 | 1687 | 4812800 | 2300 | |
258998240 | nguyenquocthao00 | C | May 1, 2024, 11:02 a.m. | OK | Go | TESTS | 30 | 109 | 13619200 | 2300 | |
259288702 | nguyenquocthao00 | C | May 3, 2024, 2:33 a.m. | OK | Go | TESTS | 30 | 109 | 14745600 | 2300 | |
260492783 | nguyenquocthao00 | C | May 11, 2024, 6:21 a.m. | OK | Go | TESTS | 30 | 140 | 13619200 | 2300 | |
258998801 | nguyenquocthao00 | C | May 1, 2024, 11:08 a.m. | OK | Go | TESTS | 30 | 156 | 14643200 | 2300 | |
263399816 | nguyenquocthao00 | C | May 31, 2024, 2:24 a.m. | OK | Go | TESTS | 30 | 296 | 38604800 | 2300 | |
259278254 | profchi | C | May 2, 2024, 10:38 p.m. | OK | Java 21 | TESTS | 30 | 452 | 3072000 | 2300 | |
258924692 | FierteDeCeylan | C | April 30, 2024, 5:39 p.m. | OK | Java 21 | TESTS | 30 | 592 | 921600 | 2300 | |
259647591 | chinatest | C | May 5, 2024, 2:48 p.m. | OK | Java 8 | TESTS | 30 | 1499 | 0 | 2300 | |
258892087 | bruhopen | C | April 30, 2024, 3:23 p.m. | OK | Kotlin 1.9 | TESTS | 30 | 468 | 13516800 | 2300 | |
258895894 | Tlatoani | C | April 30, 2024, 3:32 p.m. | OK | Kotlin 1.9 | TESTS | 30 | 561 | 20787200 | 2300 | |
261786968 | wangchaohui | C | May 20, 2024, 1:34 p.m. | OK | Kotlin 1.9 | TESTS | 30 | 2312 | 21196800 | 2300 | |
260114573 | radhikapillai25 | C | May 9, 2024, 11:44 a.m. | OK | PyPy 3 | TESTS | 30 | 999 | 28262400 | 2300 | |
258895119 | chinerist | C | April 30, 2024, 3:30 p.m. | OK | PyPy 3-64 | TESTS | 30 | 265 | 32358400 | 2300 | |
258964320 | Little_Sheep_Yawn | C | May 1, 2024, 5:12 a.m. | OK | PyPy 3-64 | TESTS | 30 | 265 | 42291200 | 2300 | |
258921076 | codicon | C | April 30, 2024, 5:01 p.m. | OK | PyPy 3-64 | TESTS | 30 | 280 | 31539200 | 2300 | |
258905136 | xxh1999 | C | April 30, 2024, 4 p.m. | OK | PyPy 3-64 | TESTS | 30 | 327 | 36761600 | 2300 | |
259411364 | titia | C | May 3, 2024, 7:38 p.m. | OK | PyPy 3-64 | TESTS | 30 | 374 | 30822400 | 2300 | |
258931408 | el_tunel | C | April 30, 2024, 6:37 p.m. | OK | PyPy 3-64 | TESTS | 30 | 421 | 25395200 | 2300 | |
258932222 | el_tunel | C | April 30, 2024, 6:48 p.m. | OK | PyPy 3-64 | TESTS | 30 | 421 | 26009600 | 2300 | |
259830967 | 1_2_3_4_5_9 | C | May 7, 2024, 5:56 a.m. | OK | PyPy 3-64 | TESTS | 30 | 421 | 48332800 | 2300 | |
260715482 | hichabe.aya | C | May 12, 2024, 9:27 p.m. | OK | PyPy 3-64 | TESTS | 30 | 453 | 26009600 | 2300 | |
259268470 | naruto7uzumaki | C | May 2, 2024, 7:51 p.m. | OK | PyPy 3-64 | TESTS | 30 | 453 | 26009600 | 2300 | |
259065261 | n685 | C | May 1, 2024, 11:17 p.m. | OK | Rust 2021 | TESTS | 30 | 92 | 4300800 | 2300 | |
259297157 | BetterThanNobita | C | May 3, 2024, 4:33 a.m. | OK | Rust 2021 | TESTS | 30 | 93 | 1228800 | 2300 | |
261580552 | Svlad_Cjelli | C | May 18, 2024, 9:05 p.m. | OK | Rust 2021 | TESTS | 30 | 140 | 4198400 | 2300 | |
258904785 | qwerty787788 | C | April 30, 2024, 3:59 p.m. | OK | Rust 2021 | TESTS | 30 | 249 | 25088000 | 2300 | |
260614080 | chishtiawais511 | C | May 12, 2024, 5:50 a.m. | OK | Rust 2021 | TESTS | 30 | 2749 | 13414400 | 2300 |
Back to search problems