K-Reverse not getting Accepted

Not getting AC, tried corner cases as well.
Here’s the code. link

hey @raghav6, the order of input is not correct in your code. You should take N then K then N-elements. But you are taking N then N-elements then K.
Modified Code: https://ide.codingblocks.com/s/90687

1 Like

Getting wrong answer @Gaurav13998 :roll_eyes:

hey @raghav6, I run the modified code at https://hack.codingblocks.com/contests/c/457/116 .
It is passing all the testcases.

Hi @Gaurav13998, The Link you’ve shared is different I think. Because I’ve this question in my problem section.
K-Reverse

hey @raghav6, sorry I consider the wrong code.
now coming to this question, your code is absolutely correct. The problem statement is wrongly described.
this is the testcase:
6
8
1 2 3 4 5 6 7 8
3
100
15 72 45 13 54 9 36 92 42 17 95 58 23 55 60 62 44 80 82 65 69 43 85 75 59 19 77 86 6 34 1 24 26 56 61 100 38 57 37 84 4 30 51 28 90 87 49 31 11 83 79 33 2 89 27 91 3 74 25 22 94 47 93 29 78 52 67 63 5 32 10 48 99 76 66 41 46 97 88 71 40 35 12 50 96 68 98 81 53 7 64 20 8 14 21 39 70 16 18 73
4
100
1 87 60 16 85 34 55 36 52 5 74 9 57 50 38 73 13 31 99 26 32 28 79 66 84 46 77 44 43 45 71 23 82 40 4 67 89 93 3 70 48 47 64 21 22 83 41 96 20 98 19 12 24 68 61 25 80 78 97 33 58 94 53 49 59 90 35 11 92 54 65 69 95 62 76 14 18 17 86 7 42 29 6 88 81 75 15 37 27 100 63 10 51 39 30 91 2 56 8 72
5
100
66 7 15 89 51 25 68 24 94 28 38 85 49 77 96 40 21 26 36 97 81 78 98 76 9 22 48 100 71 80 43 37 57 60 45 44 18 95 64 58 1 74 69 86 6 33 27 83 55 50 3 84 88 62 17 63 65 99 2 13 23 31 54 12 41 4 70 11 93 75 91 87 39 32 46 29 92 5 42 16 67 53 34 35 61 59 52 19 20 8 56 82 90 10 72 30 14 79 47 73
6
100
51 3 73 64 39 28 60 61 77 95 12 48 57 71 49 6 67 96 5 52 66 80 99 55 1 68 54 100 25 70 65 79 36 2 8 19 90 72 44 91 22 30 10 15 34 82 63 93 62 37 13 88 16 41 45 27 43 75 38 86 83 50 14 59 46 89 21 18 76 11 74 85 9 78 31 33 24 35 32 69 42 7 40 17 29 4 92 23 87 53 26 47 98 81 94 20 58 84 56 97
7
100
15 12 4 93 71 23 3 22 54 63 34 45 97 7 58 100 96 39 43 30 10 47 50 95 2 46 86 61 53 40 64 90 6 98 76 70 74 99 75 33 68 19 94 24 5 9 89 67 32 55 25 65 29 92 28 38 77 36 85 44 18 57 79 37 8 81 83 73 27 69 20 56 26 62 84 78 88 35 51 48 52 66 72 21 16 31 17 60 59 42 91 41 13 49 87 11 82 1 80 14
8

I have modified your code according to this format only https://ide.codingblocks.com/s/91808

Thank you @Gaurav13998

hey @raghav6 , if your query is resolved. Please mark this doubt as resolved and rate me on the basis of your experience.
rating option will appear when to mark this doubt as resolved

Done, already. @Gaurav13998

1 Like