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 135876311 Sept. 30, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 12537 ) A Circle Coloring PROGRAMMING constructive algorithms

B"You are given three sequences: a_1, a_2, ldots, a_n ; b_1, b_2, ldots, b_n ; c_1, c_2, ldots, c_n . For each i , a_i neq b_i , a_i neq c_i , b_i neq c_i . Find a sequence p_1, p_2, ldots, p_n , that satisfy the following conditions: In other words, for each element, you need to choose one of the three possible values, such that no two adjacent elements (where we consider elements i,i+1 adjacent for i<n and also elements 1 and n ) will have equal value. It can be proved that in the given constraints solution always exists. You don't need to minimize/maximize anything, you need to find any proper sequence. The first line of input contains one integer t ( 1 <= q t <= q 100 ): the number of test cases. The first line of each test case contains one integer n ( 3 <= q n <= q 100 ): the number of elements in the given sequences. The second line contains n integers a_1, a_2, ldots, a_n ( 1 <= q a_i <= q 100 ). The third line contains n integers b_1, b_2, ldots, b_n ( 1 <= q b_i <= q 100 ). The fourth line contains n integers c_1, c_2, ldots, c_n ( 1 <= q c_i <= q 100 ). It is guaranteed that a_i neq b_i , a_i neq c_i , b_i neq c_i for all i . For each test case, print n integers: p_1, p_2, ldots, p_n ( p_i in {a_i, b_i, c_i } , p_i neq p_{i mod n + 1} ). If there are several solutions, you can print any. In the first test case p = [1, 2, 3] . It is a correct answer, because: All possible correct answers to this test case are: [1, 2, 3] , [1, 3, 2] , [2, 1, 3] , [2, 3, 1] , [3, 1, 2] , [3, 2, 1] . In the second test case p = [1, 2, 1, 2] . In this sequence p_1 = a_1 , p_2 = a_2 , p_3 = a_3 , p_4 = a_4 . Also we can see, that no two adjacent elements of the sequence are equal. In the third test case p = [1, 3, 4, 3, "...

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
94332457 hos.lyric A Sept. 30, 2020, 4:09 p.m. OK D TESTS 15 46 0
94365945 fpc_coder A Oct. 1, 2020, 1:11 a.m. OK FPC TESTS 15 61 0
94333370 ashishsah51 A Sept. 30, 2020, 4:13 p.m. OK GNU C11 TESTS 15 46 0
94378588 3434194763HieuPT A Oct. 1, 2020, 6:02 a.m. OK GNU C11 TESTS 15 46 0
94341546 ManasviJain A Sept. 30, 2020, 4:54 p.m. OK GNU C11 TESTS 15 46 0
94373830 fahimalhasan2019 A Oct. 1, 2020, 4:40 a.m. OK GNU C11 TESTS 15 62 0
94332993 k_santosh27 A Sept. 30, 2020, 4:11 p.m. OK GNU C11 TESTS 15 62 0
94375073 kmyiu A Oct. 1, 2020, 5:05 a.m. OK GNU C++11 TESTS 15 15 0
94364551 LYC_music A Oct. 1, 2020, 12:13 a.m. OK GNU C++11 TESTS 15 15 0
94366404 HHU-DengLun A Oct. 1, 2020, 1:28 a.m. OK GNU C++11 TESTS 15 15 7987200
94371472 fr200110217102 A Oct. 1, 2020, 3:46 a.m. OK GNU C++11 TESTS 15 30 0
94368482 rain_Isle A Oct. 1, 2020, 2:29 a.m. OK GNU C++11 TESTS 15 30 0
94367317 Daniel_Jiang A Oct. 1, 2020, 1:55 a.m. OK GNU C++11 TESTS 15 30 0
94367046 martinmxq A Oct. 1, 2020, 1:47 a.m. OK GNU C++11 TESTS 15 30 0
94340975 Yukikaze_ A Sept. 30, 2020, 4:51 p.m. OK GNU C++11 TESTS 15 30 0
94377957 Dragon_hao A Oct. 1, 2020, 5:52 a.m. OK GNU C++11 TESTS 15 30 0
94336692 nebulyu A Sept. 30, 2020, 4:29 p.m. OK GNU C++11 TESTS 15 30 4198400
94375023 pseudo-code A Oct. 1, 2020, 5:04 a.m. OK GNU C++14 TESTS 15 30 0
94333170 MD0 A Sept. 30, 2020, 4:12 p.m. OK GNU C++14 TESTS 15 30 0
94367926 The_undru_03 A Oct. 1, 2020, 2:13 a.m. OK GNU C++14 TESTS 15 30 0
94369435 PacificTwilight A Oct. 1, 2020, 2:54 a.m. OK GNU C++14 TESTS 15 30 102400
94375084 aman_5311 A Oct. 1, 2020, 5:05 a.m. OK GNU C++14 TESTS 15 30 204800
94371635 Manila1 A Oct. 1, 2020, 3:50 a.m. OK GNU C++14 TESTS 15 30 204800
94353891 dhairyas2412 A Sept. 30, 2020, 6:57 p.m. OK GNU C++14 TESTS 15 30 204800
94351597 md_1999 A Sept. 30, 2020, 6:24 p.m. OK GNU C++14 TESTS 15 30 204800
94336106 lookinfointern A Sept. 30, 2020, 4:26 p.m. OK GNU C++14 TESTS 15 30 512000
94378511 siddhantvatsa A Oct. 1, 2020, 6 a.m. OK GNU C++14 TESTS 15 31 0
94377466 toxic_hack A Oct. 1, 2020, 5:44 a.m. OK GNU C++17 TESTS 15 15 0
94355638 S7a2a7d A Sept. 30, 2020, 7:28 p.m. OK GNU C++17 TESTS 15 30 0
94376733 prathmesh_99 A Oct. 1, 2020, 5:32 a.m. OK GNU C++17 TESTS 15 30 0
94376238 ayush_the_demon_slayer A Oct. 1, 2020, 5:25 a.m. OK GNU C++17 TESTS 15 30 0
94366200 mohammad_rakib A Oct. 1, 2020, 1:21 a.m. OK GNU C++17 TESTS 15 30 0
94365314 -Beyond- A Oct. 1, 2020, 12:45 a.m. OK GNU C++17 TESTS 15 30 0
94364578 kaede2020 A Oct. 1, 2020, 12:15 a.m. OK GNU C++17 TESTS 15 30 0
94360405 Kripton2005 A Sept. 30, 2020, 9:15 p.m. OK GNU C++17 TESTS 15 30 0
94359210 Sss...Sleeep A Sept. 30, 2020, 8:43 p.m. OK GNU C++17 TESTS 15 30 0
94355068 kitesho A Sept. 30, 2020, 7:17 p.m. OK GNU C++17 TESTS 15 30 0
94355434 Nah1d A Sept. 30, 2020, 7:24 p.m. OK GNU C++17 (64) TESTS 15 15 0
94373971 little_magicman A Oct. 1, 2020, 4:43 a.m. OK GNU C++17 (64) TESTS 15 15 0
94374676 john__wick A Oct. 1, 2020, 4:56 a.m. OK GNU C++17 (64) TESTS 15 15 0
94350547 marksman_ A Sept. 30, 2020, 6:10 p.m. OK GNU C++17 (64) TESTS 15 30 0
94333268 vmadhu99 A Sept. 30, 2020, 4:13 p.m. OK GNU C++17 (64) TESTS 15 30 0
94361920 Kaunta A Sept. 30, 2020, 10:11 p.m. OK GNU C++17 (64) TESTS 15 30 0
94368940 israil445 A Oct. 1, 2020, 2:40 a.m. OK GNU C++17 (64) TESTS 15 30 0
94358428 smax A Sept. 30, 2020, 8:23 p.m. OK GNU C++17 (64) TESTS 15 30 0
94355515 lucid_dreamer A Sept. 30, 2020, 7:25 p.m. OK GNU C++17 (64) TESTS 15 30 0
94351810 Misbaul A Sept. 30, 2020, 6:27 p.m. OK GNU C++17 (64) TESTS 15 30 0
94349304 takezawa A Sept. 30, 2020, 5:57 p.m. OK Go TESTS 15 46 0
94350869 Russell_Emerine A Sept. 30, 2020, 6:14 p.m. OK Haskell TESTS 15 31 102400
94363662 tigershark22 A Sept. 30, 2020, 11:29 p.m. OK Java 11 TESTS 15 186 0
94372079 jpark9013 A Oct. 1, 2020, 4:02 a.m. OK Java 11 TESTS 15 186 0
94362244 Apfeloxid A Sept. 30, 2020, 10:25 p.m. OK Java 11 TESTS 15 187 0
94352708 Agnimandur A Sept. 30, 2020, 6:39 p.m. OK Java 11 TESTS 15 187 0
94348740 B_live_it A Sept. 30, 2020, 5:52 p.m. OK Java 11 TESTS 15 187 0
94348030 skittles1412 A Sept. 30, 2020, 5:47 p.m. OK Java 11 TESTS 15 187 0
94372955 anshum_it_is A Oct. 1, 2020, 4:21 a.m. OK Java 11 TESTS 15 202 0
94366081 srjvastri8 A Oct. 1, 2020, 1:16 a.m. OK Java 11 TESTS 15 202 0
94354049 aimeemontero A Sept. 30, 2020, 6:59 p.m. OK Java 11 TESTS 15 202 0
94351109 nalin_1000101 A Sept. 30, 2020, 6:17 p.m. OK Java 11 TESTS 15 217 3072000
94364565 tushar24 A Oct. 1, 2020, 12:14 a.m. OK Java 8 TESTS 15 108 0
94374992 kumarpritam863 A Oct. 1, 2020, 5:04 a.m. OK Java 8 TESTS 15 109 0
94371734 Pranay2516 A Oct. 1, 2020, 3:53 a.m. OK Java 8 TESTS 15 109 0
94367370 hassanU A Oct. 1, 2020, 1:57 a.m. OK Java 8 TESTS 15 109 0
94367177 js9556 A Oct. 1, 2020, 1:51 a.m. OK Java 8 TESTS 15 109 0
94357983 YahiaSherif A Sept. 30, 2020, 8:13 p.m. OK Java 8 TESTS 15 109 0
94357511 polyakoff A Sept. 30, 2020, 8:03 p.m. OK Java 8 TESTS 15 109 0
94355285 subhash.yadav A Sept. 30, 2020, 7:21 p.m. OK Java 8 TESTS 15 109 0
94352147 ragnarok001 A Sept. 30, 2020, 6:31 p.m. OK Java 8 TESTS 15 109 0
94378412 gvsharma4 A Oct. 1, 2020, 5:59 a.m. OK Java 8 TESTS 15 124 0
94356908 xsc A Sept. 30, 2020, 7:51 p.m. OK MS C++ 2017 TESTS 15 46 0
94341735 islamahmed022 A Sept. 30, 2020, 4:55 p.m. OK MS C++ 2017 TESTS 15 46 0
94340939 Start_Learning A Sept. 30, 2020, 4:51 p.m. OK MS C++ 2017 TESTS 15 46 0
94337976 semihpirpir A Sept. 30, 2020, 4:36 p.m. OK MS C++ 2017 TESTS 15 46 0
94335079 Torehalt A Sept. 30, 2020, 4:21 p.m. OK MS C++ 2017 TESTS 15 46 0
94333295 songjunwei A Sept. 30, 2020, 4:13 p.m. OK MS C++ 2017 TESTS 15 46 0
94331098 Omlette A Sept. 30, 2020, 4:02 p.m. OK MS C++ 2017 TESTS 15 46 0
94358920 dominotim A Sept. 30, 2020, 8:36 p.m. OK MS C++ 2017 TESTS 15 46 102400
94356489 alexwice A Sept. 30, 2020, 7:43 p.m. OK PyPy 2 TESTS 15 109 2150400
94356631 realnimish A Sept. 30, 2020, 7:46 p.m. OK PyPy 2 TESTS 15 140 819200
94343040 snape_here A Sept. 30, 2020, 5:02 p.m. OK PyPy 2 TESTS 15 187 7782400
94351358 FlakeLCR A Sept. 30, 2020, 6:20 p.m. OK PyPy 3 TESTS 15 155 1638400
94341677 chirag_j_rana A Sept. 30, 2020, 4:55 p.m. OK PyPy 3 TESTS 15 155 1740800
94351504 FlakeLCR A Sept. 30, 2020, 6:22 p.m. OK PyPy 3 TESTS 15 155 1843200
94351190 vvedant99 A Sept. 30, 2020, 6:18 p.m. OK PyPy 3 TESTS 15 155 2457600
94356927 skate1512 A Sept. 30, 2020, 7:51 p.m. OK PyPy 3 TESTS 15 170 3072000
94350682 plourde27 A Sept. 30, 2020, 6:12 p.m. OK PyPy 3 TESTS 15 171 2252800
94370600 BluePegasus1256 A Oct. 1, 2020, 3:23 a.m. OK PyPy 3 TESTS 15 171 2560000
94373850 rajbit A Oct. 1, 2020, 4:40 a.m. OK PyPy 3 TESTS 15 171 2764800
94366193 MilkyW A Oct. 1, 2020, 1:21 a.m. OK PyPy 3 TESTS 15 171 2867200
94368623 _DON_ A Oct. 1, 2020, 2:32 a.m. OK PyPy 3 TESTS 15 171 3174400
94352659 301_anky A Sept. 30, 2020, 6:38 p.m. OK Python 3 TESTS 15 108 307200
94341414 aanchaltiwari__ A Sept. 30, 2020, 4:54 p.m. OK Python 3 TESTS 15 108 307200
94332221 msp1451 A Sept. 30, 2020, 4:08 p.m. OK Python 3 TESTS 15 108 307200
94378121 harshil.gupta95 A Oct. 1, 2020, 5:54 a.m. OK Python 3 TESTS 15 109 307200
94377607 killer_12 A Oct. 1, 2020, 5:47 a.m. OK Python 3 TESTS 15 109 307200
94357378 Tanish08 A Sept. 30, 2020, 8 p.m. OK Python 3 TESTS 15 109 307200
94348908 sh1194 A Sept. 30, 2020, 5:53 p.m. OK Python 3 TESTS 15 109 307200
94341732 kartikm31 A Sept. 30, 2020, 4:55 p.m. OK Python 3 TESTS 15 109 307200
94337847 Voz_bonita A Sept. 30, 2020, 4:35 p.m. OK Python 3 TESTS 15 109 307200
94336742 guptasaanika A Sept. 30, 2020, 4:30 p.m. OK Python 3 TESTS 15 109 307200

remove filters

Back to search problems