Grakn Forces 2020

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
1408 Grakn Forces 2020 FINISHED False 9900 135789863 Sept. 30, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 10061 ) B Arrays Sum PROGRAMMING constructive algorithms greedy math

B"You are given a non-decreasing array of non-negative integers a_1, a_2, ldots, a_n . Also you are given a positive integer k . You want to find m non-decreasing arrays of non-negative integers b_1, b_2, ldots, b_m , such that: Find the minimum possible value of m , or report that there is no possible m . The first line contains one integer t ( 1 <= q t <= q 100 ): the number of test cases. The first line of each test case contains two integers n , k ( 1 <= q n <= q 100 , 1 <= q k <= q n ). The second line contains n integers a_1, a_2, ldots, a_n ( 0 <= q a_1 <= q a_2 <= q ldots <= q a_n <= q 100 , a_n > 0 ). For each test case print a single integer: the minimum possible value of m . If there is no such m , print -1 . In the first test case, there is no possible m , because all elements of all arrays should be equal to 0 . But in this case, it is impossible to get a_4 = 1 as the sum of zeros. In the second test case, we can take b_1 = [3, 3, 3] . 1 is the smallest possible value of m . In the third test case, we can take b_1 = [0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2] and b_2 = [0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2] . It's easy to see, that a_i = b_{1, i} + b_{2, i} for all i and the number of different elements in b_1 and in b_2 is equal to 3 (so it is at most 3 ). It can be proven that 2 is the smallest possible value of m . "...

Tutorials

Grakn Forces -- Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
94341879 hos.lyric B Sept. 30, 2020, 4:56 p.m. OK D TESTS 24 31 0
94348505 daut-dlang B Sept. 30, 2020, 5:50 p.m. OK D TESTS 24 46 0
94349101 ruban B Sept. 30, 2020, 5:55 p.m. OK Delphi TESTS 24 30 7065600
94332439 avi_p B Sept. 30, 2020, 4:09 p.m. OK GNU C11 TESTS 24 30 0
94362996 physics0523 B Sept. 30, 2020, 11:01 p.m. OK GNU C11 TESTS 24 30 0
94337772 flayer_hunter B Sept. 30, 2020, 4:35 p.m. OK GNU C11 TESTS 24 31 0
94348375 rakesh_roy_plabon B Sept. 30, 2020, 5:49 p.m. OK GNU C11 TESTS 24 31 0
94333038 akash456 B Sept. 30, 2020, 4:12 p.m. OK GNU C11 TESTS 24 31 0
94349556 yao11617 B Sept. 30, 2020, 5:59 p.m. OK GNU C++11 TESTS 24 15 0
94364255 zlt1117 B Sept. 30, 2020, 11:57 p.m. OK GNU C++11 TESTS 24 15 0
94372857 OMG_link B Oct. 1, 2020, 4:18 a.m. OK GNU C++11 TESTS 24 15 0
94367674 Obsidian B Oct. 1, 2020, 2:06 a.m. OK GNU C++11 TESTS 24 15 0
94364970 leukocyte B Oct. 1, 2020, 12:32 a.m. OK GNU C++11 TESTS 24 15 0
94351396 18380120126 B Sept. 30, 2020, 6:21 p.m. OK GNU C++11 TESTS 24 15 0
94332316 ZHUHAORENQaQ B Sept. 30, 2020, 4:08 p.m. OK GNU C++11 TESTS 24 15 409600
94363581 Karry5307 B Sept. 30, 2020, 11:26 p.m. OK GNU C++11 TESTS 24 15 1638400
94372725 tianxiawoyou B Oct. 1, 2020, 4:16 a.m. OK GNU C++11 TESTS 24 15 16076800
94372743 gyh20 B Oct. 1, 2020, 4:16 a.m. OK GNU C++11 TESTS 24 15 16076800
94334845 Srisai B Sept. 30, 2020, 4:20 p.m. OK GNU C++14 TESTS 24 30 0
94348710 smurf B Sept. 30, 2020, 5:52 p.m. OK GNU C++14 TESTS 24 30 0
94338969 gopalnandan2676 B Sept. 30, 2020, 4:40 p.m. OK GNU C++14 TESTS 24 30 102400
94332086 yatharth_ B Sept. 30, 2020, 4:07 p.m. OK GNU C++14 TESTS 24 30 102400
94333730 bhardwaj.anshit1379 B Sept. 30, 2020, 4:15 p.m. OK GNU C++14 TESTS 24 30 102400
94351900 marton.antoni B Sept. 30, 2020, 6:28 p.m. OK GNU C++14 TESTS 24 30 102400
94370767 Mahmudul_Hasan_Munna B Oct. 1, 2020, 3:27 a.m. OK GNU C++14 TESTS 24 30 102400
94372083 ZeroScar B Oct. 1, 2020, 4:02 a.m. OK GNU C++14 TESTS 24 30 102400
94378171 rj7555555 B Oct. 1, 2020, 5:55 a.m. OK GNU C++14 TESTS 24 30 102400
94375606 ustadji23 B Oct. 1, 2020, 5:14 a.m. OK GNU C++14 TESTS 24 30 204800
94338733 cfop2357 B Sept. 30, 2020, 4:39 p.m. OK GNU C++17 TESTS 24 30 0
94366859 Joy_Dee B Oct. 1, 2020, 1:41 a.m. OK GNU C++17 TESTS 24 30 0
94357625 Saq B Sept. 30, 2020, 8:05 p.m. OK GNU C++17 TESTS 24 30 0
94356991 inderjeet162000 B Sept. 30, 2020, 7:53 p.m. OK GNU C++17 TESTS 24 30 0
94332260 dhruva_shashi B Sept. 30, 2020, 4:08 p.m. OK GNU C++17 TESTS 24 30 102400
94344801 Amar011 B Sept. 30, 2020, 5:11 p.m. OK GNU C++17 TESTS 24 30 102400
94347980 TeaPot B Sept. 30, 2020, 5:46 p.m. OK GNU C++17 TESTS 24 30 102400
94348961 HarshKumar B Sept. 30, 2020, 5:53 p.m. OK GNU C++17 TESTS 24 30 102400
94369652 rpcodes B Oct. 1, 2020, 3 a.m. OK GNU C++17 TESTS 24 30 102400
94372899 PaliLo B Oct. 1, 2020, 4:19 a.m. OK GNU C++17 TESTS 24 30 102400
94348872 shubham__36 B Sept. 30, 2020, 5:53 p.m. OK GNU C++17 (64) TESTS 24 15 0
94347957 brunomont B Sept. 30, 2020, 5:46 p.m. OK GNU C++17 (64) TESTS 24 15 0
94346864 _____Not_For_That___ B Sept. 30, 2020, 5:19 p.m. OK GNU C++17 (64) TESTS 24 15 0
94344721 ali_oli B Sept. 30, 2020, 5:11 p.m. OK GNU C++17 (64) TESTS 24 15 0
94333484 Mellor B Sept. 30, 2020, 4:14 p.m. OK GNU C++17 (64) TESTS 24 15 0
94353956 madlogic B Sept. 30, 2020, 6:58 p.m. OK GNU C++17 (64) TESTS 24 15 0
94353051 Felerius B Sept. 30, 2020, 6:44 p.m. OK GNU C++17 (64) TESTS 24 15 0
94350412 tanimania B Sept. 30, 2020, 6:09 p.m. OK GNU C++17 (64) TESTS 24 15 0
94350384 ishank162 B Sept. 30, 2020, 6:08 p.m. OK GNU C++17 (64) TESTS 24 15 0
94349478 Arceus03 B Sept. 30, 2020, 5:58 p.m. OK GNU C++17 (64) TESTS 24 15 0
94340960 smalex69 B Sept. 30, 2020, 4:51 p.m. OK Go TESTS 24 46 1024000
94355809 Russell_Emerine B Sept. 30, 2020, 7:31 p.m. OK Haskell TESTS 24 31 102400
94349990 clyring B Sept. 30, 2020, 6:04 p.m. OK Haskell TESTS 24 31 102400
94360185 sushant-kun B Sept. 30, 2020, 9:08 p.m. OK Java 11 TESTS 24 170 0
94357770 lucasr B Sept. 30, 2020, 8:08 p.m. OK Java 11 TESTS 24 171 0
94373712 DreamInfinite B Oct. 1, 2020, 4:37 a.m. OK Java 11 TESTS 24 171 0
94371714 _apurv_ B Oct. 1, 2020, 3:52 a.m. OK Java 11 TESTS 24 171 0
94371438 Ste B Oct. 1, 2020, 3:45 a.m. OK Java 11 TESTS 24 171 0
94368258 srjvastri8 B Oct. 1, 2020, 2:23 a.m. OK Java 11 TESTS 24 171 0
94364457 Apfeloxid B Oct. 1, 2020, 12:08 a.m. OK Java 11 TESTS 24 171 0
94356893 brijeshujcbm B Sept. 30, 2020, 7:51 p.m. OK Java 11 TESTS 24 171 0
94355909 habibulka B Sept. 30, 2020, 7:33 p.m. OK Java 11 TESTS 24 171 0
94355784 aimeemontero B Sept. 30, 2020, 7:30 p.m. OK Java 11 TESTS 24 171 0
94344352 adityavikram B Sept. 30, 2020, 5:09 p.m. OK Java 8 TESTS 24 108 0
94334370 rachitpts.2454 B Sept. 30, 2020, 4:18 p.m. OK Java 8 TESTS 24 108 0
94376028 xoszm B Oct. 1, 2020, 5:21 a.m. OK Java 8 TESTS 24 109 0
94375128 xoszm B Oct. 1, 2020, 5:06 a.m. OK Java 8 TESTS 24 109 0
94365124 cwise B Oct. 1, 2020, 12:38 a.m. OK Java 8 TESTS 24 109 0
94359452 YahiaSherif B Sept. 30, 2020, 8:49 p.m. OK Java 8 TESTS 24 109 0
94358311 polyakoff B Sept. 30, 2020, 8:21 p.m. OK Java 8 TESTS 24 109 0
94352125 SecondThread B Sept. 30, 2020, 6:31 p.m. OK Java 8 TESTS 24 109 0
94371772 Pranay2516 B Oct. 1, 2020, 3:53 a.m. OK Java 8 TESTS 24 109 0
94376137 kumarpritam863 B Oct. 1, 2020, 5:23 a.m. OK Java 8 TESTS 24 109 0
94351121 elizarov B Sept. 30, 2020, 6:17 p.m. OK Kotlin TESTS 24 140 204800
94353391 Musin B Sept. 30, 2020, 6:49 p.m. OK Kotlin TESTS 24 140 1331200
94353486 Musin B Sept. 30, 2020, 6:50 p.m. OK Kotlin TESTS 24 140 1331200
94353441 Musin B Sept. 30, 2020, 6:50 p.m. OK Kotlin TESTS 24 140 1331200
94348367 bekzats B Sept. 30, 2020, 5:49 p.m. OK Kotlin TESTS 24 155 102400
94340679 ostroumov B Sept. 30, 2020, 4:49 p.m. OK Kotlin TESTS 24 155 1331200
94341004 sid9406 B Sept. 30, 2020, 4:51 p.m. OK Kotlin TESTS 24 155 1843200
94342241 braher B Sept. 30, 2020, 4:58 p.m. OK Mono C# TESTS 24 77 4505600
94357835 ustaritz B Sept. 30, 2020, 8:10 p.m. OK MS C++ 2017 TESTS 24 31 0
94340375 songjunwei B Sept. 30, 2020, 4:48 p.m. OK MS C++ 2017 TESTS 24 31 0
94341343 Myao B Sept. 30, 2020, 4:53 p.m. OK MS C++ 2017 TESTS 24 46 0
94349059 qing_lin B Sept. 30, 2020, 5:54 p.m. OK MS C++ 2017 TESTS 24 46 0
94332929 EMBailey B Sept. 30, 2020, 4:11 p.m. OK MS C++ 2017 TESTS 24 46 0
94358139 xsc B Sept. 30, 2020, 8:17 p.m. OK MS C++ 2017 TESTS 24 46 102400
94348462 ap1008 B Sept. 30, 2020, 5:49 p.m. OK PyPy 2 TESTS 24 93 204800
94356655 realnimish B Sept. 30, 2020, 7:47 p.m. OK PyPy 2 TESTS 24 108 2150400
94358172 realnimish B Sept. 30, 2020, 8:17 p.m. OK PyPy 2 TESTS 24 109 204800
94348721 Hitikkumar B Sept. 30, 2020, 5:52 p.m. OK PyPy 2 TESTS 24 109 204800
94333894 YESMAths B Sept. 30, 2020, 4:15 p.m. OK PyPy 2 TESTS 24 109 307200
94357014 alexwice B Sept. 30, 2020, 7:53 p.m. OK PyPy 2 TESTS 24 109 1433600
94375876 snape_here B Oct. 1, 2020, 5:19 a.m. OK PyPy 2 TESTS 24 265 7884800
94353992 vvedant99 B Sept. 30, 2020, 6:58 p.m. OK PyPy 3 TESTS 24 124 1536000
94336232 codecunt7 B Sept. 30, 2020, 4:27 p.m. OK PyPy 3 TESTS 24 124 1536000
94349814 ndb1996 B Sept. 30, 2020, 6:02 p.m. OK PyPy 3 TESTS 24 140 1228800
94350986 The_Apurv_Rathore B Sept. 30, 2020, 6:15 p.m. OK PyPy 3 TESTS 24 140 1331200
94350860 codingfantasies B Sept. 30, 2020, 6:14 p.m. OK PyPy 3 TESTS 24 140 1331200
94349813 eepsilon B Sept. 30, 2020, 6:02 p.m. OK PyPy 3 TESTS 24 140 1331200
94349281 nocreative1 B Sept. 30, 2020, 5:57 p.m. OK PyPy 3 TESTS 24 140 1331200
94348498 uttharapally.chandra B Sept. 30, 2020, 5:50 p.m. OK PyPy 3 TESTS 24 140 1331200
94344246 nicolehedblom B Sept. 30, 2020, 5:09 p.m. OK PyPy 3 TESTS 24 140 1331200
94342223 janbar B Sept. 30, 2020, 4:58 p.m. OK PyPy 3 TESTS 24 140 1331200
94348562 nwi B Sept. 30, 2020, 5:50 p.m. OK Python 2 TESTS 24 186 0
94351784 ranjithm2001 B Sept. 30, 2020, 6:26 p.m. OK Python 3 TESTS 24 93 0
94338824 dazlersan1 B Sept. 30, 2020, 4:40 p.m. OK Python 3 TESTS 24 93 307200
94375635 rohit523 B Oct. 1, 2020, 5:15 a.m. OK Python 3 TESTS 24 108 307200
94359910 mrblood B Sept. 30, 2020, 9:01 p.m. OK Python 3 TESTS 24 108 307200
94359602 vovannomberwone B Sept. 30, 2020, 8:52 p.m. OK Python 3 TESTS 24 108 307200
94348496 Vishu2908 B Sept. 30, 2020, 5:50 p.m. OK Python 3 TESTS 24 108 307200
94340630 faroukfaiz B Sept. 30, 2020, 4:49 p.m. OK Python 3 TESTS 24 108 307200
94336630 ankit022 B Sept. 30, 2020, 4:29 p.m. OK Python 3 TESTS 24 108 307200
94332186 mishra307 B Sept. 30, 2020, 4:07 p.m. OK Python 3 TESTS 24 108 307200
94350733 garineakhil26 B Sept. 30, 2020, 6:12 p.m. OK Python 3 TESTS 24 109 0
94351899 simanman B Sept. 30, 2020, 6:28 p.m. OK Ruby TESTS 24 483 204800

remove filters

Back to search problems