Divide by Zero 2021 and Codeforces Round 714 (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
1513 Divide by Zero 2021 and Codeforces Round 714 (Div. 2) FINISHED False 7200 119028263 April 11, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 15325 ) B AND Sequences PROGRAMMING bitmasks combinatorics constructive algorithms

B"A sequence of n non-negative integers ( n ge 2 ) a_1, a_2, ... , a_n is called good if for all i from 1 to n-1 the following condition holds true: a_1 : & : a_2 : & : ... : & : a_i = a_{i+1} : & : a_{i+2} : & : ... : & : a_n, where & denotes the bitwise AND operation. You are given an array a of size n ( n geq 2 ). Find the number of permutations p of numbers ranging from 1 to n , for which the sequence a_{p_1} , a_{p_2} , ... , a_{p_n} is good. Since this number can be large, output it modulo 10^9+7 . The first line contains a single integer t ( 1 <= q t <= q 10^4 ), denoting the number of test cases. The first line of each test case contains a single integer n ( 2 <= n <= 2 cdot 10^5 ) -- the size of the array. The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 0 <= a_i <= 10^9 ) -- the elements of the array. It is guaranteed that the sum of n over all test cases doesn't exceed 2 cdot 10^5 . Output t lines, where the i -th line contains the number of good permutations in the i -th test case modulo 10^9 + 7 . In the first test case, since all the numbers are equal, whatever permutation we take, the sequence is good. There are a total of 6 permutations possible with numbers from 1 to 3 : [1,2,3] , [1,3,2] , [2,1,3] , [2,3,1] , [3,1,2] , [3,2,1] . In the second test case, it can be proved that no permutation exists for which the sequence is good. In the third test case, there are a total of 36 permutations for which the sequence is good. One of them is the permutation [1,5,4,2,3] which results in the sequence s=[0,0,3,2,0] . This is a good sequence because "...

Tutorials

Divide by Zero 2021 and Codeforces Round #714 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
112747552 W_34 B April 12, 2021, 5:18 a.m. OK GNU C++11 TESTS 16 31 819200
112731970 xuchi B April 12, 2021, 12:09 a.m. OK GNU C++11 TESTS 16 31 819200
112740081 Reisen_ B April 12, 2021, 2:40 a.m. OK GNU C++11 TESTS 16 46 819200
112730553 Dreamfarer B April 11, 2021, 10:53 p.m. OK GNU C++11 TESTS 16 46 3993600
112701736 Tryna1 B April 11, 2021, 4:11 p.m. OK GNU C++11 TESTS 16 46 6451200
112702415 Leonard B April 11, 2021, 4:13 p.m. OK GNU C++11 TESTS 16 61 819200
112741020 msu.727 B April 12, 2021, 3:06 a.m. OK GNU C++11 TESTS 16 61 3993600
112703977 hardik-23 B April 11, 2021, 4:18 p.m. OK GNU C++11 TESTS 16 62 819200
112732096 DongGuaTang B April 12, 2021, 12:15 a.m. OK GNU C++11 TESTS 16 62 1638400
112742543 dongdziz B April 12, 2021, 3:42 a.m. OK GNU C++11 TESTS 16 62 1638400
112747097 Newplayers12 B April 12, 2021, 5:11 a.m. OK GNU C++14 TESTS 16 62 819200
112711889 ArminAzimi B April 11, 2021, 5:08 p.m. OK GNU C++14 TESTS 16 62 819200
112721550 KoftaIQ B April 11, 2021, 6:59 p.m. OK GNU C++14 TESTS 16 62 819200
112741120 93wilsonlu B April 12, 2021, 3:09 a.m. OK GNU C++14 TESTS 16 62 819200
112722589 Ola.Abdallah B April 11, 2021, 7:16 p.m. OK GNU C++14 TESTS 16 62 1638400
112741279 _Ruri_ B April 12, 2021, 3:13 a.m. OK GNU C++14 TESTS 16 62 1638400
112746143 Fury20 B April 12, 2021, 4:54 a.m. OK GNU C++14 TESTS 16 62 2355200
112721270 Alpha_215 B April 11, 2021, 6:55 p.m. OK GNU C++14 TESTS 16 62 2457600
112732597 carre B April 12, 2021, 12:41 a.m. OK GNU C++14 TESTS 16 62 2457600
112718092 kelvin_0179 B April 11, 2021, 6:10 p.m. OK GNU C++14 TESTS 16 62 4812800
112725585 ChNBSQNF B April 11, 2021, 8:11 p.m. OK GNU C++17 TESTS 16 46 105676800
112745081 nauynix B April 12, 2021, 4:34 a.m. OK GNU C++17 TESTS 16 62 819200
112702446 windy7926778 B April 11, 2021, 4:13 p.m. OK GNU C++17 TESTS 16 62 819200
112722191 Akib_2612 B April 11, 2021, 7:09 p.m. OK GNU C++17 TESTS 16 62 819200
112739925 adityasonani B April 12, 2021, 2:35 a.m. OK GNU C++17 TESTS 16 62 1638400
112741585 mTvTm B April 12, 2021, 3:21 a.m. OK GNU C++17 TESTS 16 62 1638400
112711548 Bit_Master_2205 B April 11, 2021, 5:06 p.m. OK GNU C++17 TESTS 16 62 1638400
112750582 GeekGrave B April 12, 2021, 6:04 a.m. OK GNU C++17 TESTS 16 62 1638400
112747761 shubham84 B April 12, 2021, 5:22 a.m. OK GNU C++17 TESTS 16 62 1638400
112726701 mukim B April 11, 2021, 8:37 p.m. OK GNU C++17 TESTS 16 62 2355200
112731309 paulll B April 11, 2021, 11:32 p.m. OK GNU C++17 (64) TESTS 16 46 819200
112743788 adityateltia22 B April 12, 2021, 4:08 a.m. OK GNU C++17 (64) TESTS 16 46 1638400
112719948 rananjay23 B April 11, 2021, 6:35 p.m. OK GNU C++17 (64) TESTS 16 46 1638400
112721988 TAHMID37 B April 11, 2021, 7:06 p.m. OK GNU C++17 (64) TESTS 16 46 1638400
112748996 an_da B April 12, 2021, 5:41 a.m. OK GNU C++17 (64) TESTS 16 46 1638400
112726349 RohitKotha10 B April 11, 2021, 8:29 p.m. OK GNU C++17 (64) TESTS 16 46 1638400
112745618 _MSH_ B April 12, 2021, 4:44 a.m. OK GNU C++17 (64) TESTS 16 46 2457600
112711840 no_obie B April 11, 2021, 5:08 p.m. OK GNU C++17 (64) TESTS 16 46 3174400
112715167 izlyforever B April 11, 2021, 5:36 p.m. OK GNU C++17 (64) TESTS 16 61 819200
112748021 Codurr B April 12, 2021, 5:26 a.m. OK GNU C++17 (64) TESTS 16 61 1638400
112731034 iamavalon B April 11, 2021, 11:19 p.m. OK Java 11 TESTS 16 187 0
112729875 akokoz B April 11, 2021, 10:16 p.m. OK Java 11 TESTS 16 187 0
112749999 BiggEr. B April 12, 2021, 5:56 a.m. OK Java 11 TESTS 16 218 3174400
112728646 tusharpruth B April 11, 2021, 9:32 p.m. OK Java 11 TESTS 16 218 3379200
112708418 dauom B April 11, 2021, 4:31 p.m. OK Java 11 TESTS 16 233 0
112702301 dwoolley3 B April 11, 2021, 4:13 p.m. OK Java 11 TESTS 16 233 3174400
112713653 ypa B April 11, 2021, 5:21 p.m. OK Java 11 TESTS 16 233 5529600
112718247 Log_ZOOM B April 11, 2021, 6:12 p.m. OK Java 11 TESTS 16 233 5529600
112718226 future_me B April 11, 2021, 6:12 p.m. OK Java 11 TESTS 16 233 11776000
112723038 future_me B April 11, 2021, 7:24 p.m. OK Java 11 TESTS 16 233 11776000
112725666 Akram-Adel B April 11, 2021, 8:13 p.m. OK Java 8 TESTS 16 140 12390400
112733018 tiwariabhishek B April 12, 2021, 1:01 a.m. OK Java 8 TESTS 16 155 11161600
112719461 nandit B April 11, 2021, 6:29 p.m. OK Java 8 TESTS 16 171 0
112746703 gssakash B April 12, 2021, 5:04 a.m. OK Java 8 TESTS 16 171 11366400
112722124 singhdhanwant B April 11, 2021, 7:08 p.m. OK Java 8 TESTS 16 171 11776000
112703017 guru1603 B April 11, 2021, 4:15 p.m. OK Java 8 TESTS 16 171 14643200
112712281 VishuTomar B April 11, 2021, 5:11 p.m. OK Java 8 TESTS 16 186 11366400
112702973 Khater B April 11, 2021, 4:15 p.m. OK Java 8 TESTS 16 186 14336000
112748995 Charigardash B April 12, 2021, 5:41 a.m. OK Java 8 TESTS 16 186 19046400
112704087 mareshkau B April 11, 2021, 4:19 p.m. OK Java 8 TESTS 16 187 11161600
112712123 DMN B April 11, 2021, 5:10 p.m. OK Mono C# TESTS 16 124 31641600
112702252 Willemkmetsch B April 11, 2021, 4:13 p.m. OK MS C++ 2017 TESTS 16 93 7987200
112743012 Albertplus007 B April 12, 2021, 3:51 a.m. OK MS C++ 2017 TESTS 16 187 819200
112715947 svr2kos2 B April 11, 2021, 5:44 p.m. OK MS C++ 2017 TESTS 16 233 1536000
112711244 Myao B April 11, 2021, 5:05 p.m. OK MS C++ 2017 TESTS 16 249 3174400
112722826 zhangminchen B April 11, 2021, 7:20 p.m. OK MS C++ 2017 TESTS 16 249 3174400
112745411 WCmidschool B April 12, 2021, 4:40 a.m. OK MS C++ 2017 TESTS 16 249 16281600
112722728 zhangminchen B April 11, 2021, 7:18 p.m. OK MS C++ 2017 TESTS 16 311 8806400
112742422 Bulysky B April 12, 2021, 3:40 a.m. OK MS C++ 2017 TESTS 16 420 3276800
112733964 sakapon B April 12, 2021, 1:41 a.m. OK .NET Core C# TESTS 16 124 24985600
112733842 sakapon B April 12, 2021, 1:35 a.m. OK .NET Core C# TESTS 16 171 35635200
112704704 sakapon B April 11, 2021, 4:20 p.m. OK .NET Core C# TESTS 16 186 35328000
112725371 tennisru B April 11, 2021, 8:07 p.m. OK Node.js TESTS 16 264 27238400
112709584 lebron87 B April 11, 2021, 4:34 p.m. OK PyPy 2 TESTS 16 420 33484800
112749056 uttharapally.chandra B April 12, 2021, 5:42 a.m. OK PyPy 3 TESTS 16 187 19865600
112749292 uttharapally.chandra B April 12, 2021, 5:45 a.m. OK PyPy 3 TESTS 16 187 19865600
112743227 phantomxxx B April 12, 2021, 3:55 a.m. OK PyPy 3 TESTS 16 202 19456000
112717957 skp_r B April 11, 2021, 6:08 p.m. OK PyPy 3 TESTS 16 218 17920000
112713802 codicon B April 11, 2021, 5:22 p.m. OK PyPy 3 TESTS 16 218 22732800
112728641 nitin4184 B April 11, 2021, 9:32 p.m. OK PyPy 3 TESTS 16 248 28876800
112730901 nitish420 B April 11, 2021, 11:12 p.m. OK PyPy 3 TESTS 16 296 32768000
112749220 uttharapally.chandra B April 12, 2021, 5:44 a.m. OK PyPy 3 TESTS 16 327 19046400
112711460 not_tehlka B April 11, 2021, 5:06 p.m. OK PyPy 3 TESTS 16 327 37580800
112722429 Kira_1234 B April 11, 2021, 7:13 p.m. OK PyPy 3 TESTS 16 342 18432000
112717436 ganstey B April 11, 2021, 6:02 p.m. OK Python 3 TESTS 16 218 16588800
112723300 eugalt B April 11, 2021, 7:28 p.m. OK Python 3 TESTS 16 218 19353600
112713001 eugalt B April 11, 2021, 5:16 p.m. OK Python 3 TESTS 16 218 20582400
112745696 KendaG B April 12, 2021, 4:46 a.m. OK Python 3 TESTS 16 249 17510400
112711868 rahin1301 B April 11, 2021, 5:08 p.m. OK Python 3 TESTS 16 249 17817600
112743784 mkawa2 B April 12, 2021, 4:08 a.m. OK Python 3 TESTS 16 249 20480000
112716563 giant-mammoth B April 11, 2021, 5:51 p.m. OK Python 3 TESTS 16 265 19660800
112726389 bansaldeven9 B April 11, 2021, 8:30 p.m. OK Python 3 TESTS 16 280 16486400
112705185 bhupat2000 B April 11, 2021, 4:22 p.m. OK Python 3 TESTS 16 280 17408000
112732849 utsamagoots B April 12, 2021, 12:54 a.m. OK Python 3 TESTS 16 295 16588800
112747880 ssvb B April 12, 2021, 5:23 a.m. OK Ruby 3 TESTS 16 967 19148800

remove filters

Back to search problems