Was the verdict "Wrong Answer" or "Runtime Error"?
[/quote]
sir its "wrong answer"...........

Moderator: Board moderators
You may try these cases:raj wrote: sir its "wrong answer"...........
Code: Select all
10 0 6 4 12 21 16 20 13 12 9
9 4 6 -1 2 -4 0 1 6 -2
8 7 1 2 9 4 6 2 -1
2 2 1
Code: Select all
Jolly
Jolly
Jolly
Jolly
Take your time to read the problem statement carefully. I think it has a very good, clear explanation.raj wrote:SIR IF U HAVE TIME THEN PLEASE CAN U KINDLY EXPLAIN........HOW THE OUTPUTS CAME FROM INPUTS.........
Code: Select all
8 7 1 2 9 4 6 2 -1
Code: Select all
new sequence -> 6 1 7 5 2 4 3
original sequence -> 7 1 2 9 4 6 2 -1
Code: Select all
accepted
It seems that you're still misunderstanding the problem.raj wrote: thanks sir for your advice but
sir i saw all the inputs that u wrote and including various inputs and all of them are correct.........
but the online judge says it wrong answer ?? please kindly see my code![]()
Code: Select all
5 1 2 3 4 5
Code: Select all
Not jolly
I don't think I'm very good at giving advice (I try), but I'd say for now just focus on improving your reading comprehension, and work on your patience and general attitude towards problem solving as well.raj wrote: can u sir please give me any extraordinary advice how to overcome it.........
I'd very much appreciate some AC output on that. I know I can use (http://www.uvatoolkit.com/problemssolve.php) but it doesn't work for this large input and it says "0 4 2 3" is a jolly jumper for n=4, which I don't think is right.gr81 wrote:0
4 1 2 3 4
4 1 4 2 3
5 1 4 2 -1 6
10 1 2 3 4 5 6 7 8 9 10
10 1 2 4 7 11 16 22 29 37 46
10 -1 -2 -4 -7 -11 -16 -22 -29 -37 -46
10 -1 -1 -4 -7 -11 -16 -22 -29 -37 -46
1 1
2 1 2
2 2 1
4 0 4 2 3
4 1 3 2 4
1 2
6 1 4 3 7 5 10
1 1
5 3 4 2 3 5
1 10
4 1 4 2 3
5 1 4 2 -1 6
6 3 2 4 3 2 1
1 4
0
4 2342342234234234 34234235434534554 67574523423 23425346546546546546
9 10 5 1 4 6 12 19 27 26
4 1 4 2 3
5 1 4 2 -1 6
6 3 2 4 3 2 1
4 1 3 0 -1
4 1 3 2 -2
1 2000
2 1999 1998
3 1 2 4
3 4 2 1
3 104 102 101
3 -5 -7 -6
3 4 1 3
200 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
10 1 2 3 4 5 6 7 8 9 10
10 1 2 4 7 11 16 22 29 37 46
10 -1 -2 -4 -7 -11 -16 -22 -29 -37 -46
10 -1 -1 -4 -7 -11 -16 -22 -29 -37 -46
1 1
2 1 2
2 2 1
4 0 4 2 3
4 1 3 2 4
1 2
6 1 4 3 7 5 10
5 3 4 2 3 5
9 5 6 4 1 -3 2 8 15 7
9 10 5 1 4 6 12 19 27 36
9 10 5 1 4 6 12 19 27 26
2 0 257
2 1 4000
Code: Select all
#include <stdio.h>
#include <math.h>
#include <string.h>
int main()
{
int n, i, x, is_jolly, sequence[3010], diff[1600];
while (scanf("%d", &n) != EOF)
{
memset(sequence, 0, sizeof sequence);
memset(diff, 0, sizeof diff);
is_jolly = 1;
for (i = 0; i < n; i++)
{
scanf("%d", &x);
sequence[i] = x;
}
for (i = 0; i < n - 1; i++)
{
if (abs(sequence[i] - sequence[i + 1]) > 3000)
continue;
diff[abs(sequence[i] - sequence[i + 1])] = 1;
}
for (i = 1; i < n - 1; i++)
{
if (!diff[i])
{
is_jolly = 0;
break;
}
}
if (is_jolly)
{
printf("Jolly\n");
}
else
{
printf("Not jolly\n");
}
}
return 0;
}
There might be something strange in the way you access uvatoolkit. I just went and tried the following input:Munchor wrote: (..)I'd very much appreciate some AC output on that. I know I can use (http://www.uvatoolkit.com/problemssolve.php) but it doesn't work for this large input and it says "0 4 2 3" is a jolly jumper for n=4, which I don't think is right.
Anyways, I'm getting a runtime error (which might be because I'm accessing an index that is not in the array, but I have checks for >3000, so I don't know how the RE could be happening), does anybody have any idea? problemsolve.php also says "1 3 2 4" is a jolly jumper for n = 4, but once again I don't think it is and so does my program. I think the tool may not be working correctly.
Code: Select all
4 0 4 2 3
4 1 3 2 4
Code: Select all
Not jolly
Not jolly
Code: Select all
2 4 -4
2 4 2
Code: Select all
Not jolly
Not jolly
Code: Select all
<Removed After Got accepted>
In my machine your program doesn't print the correct answers for the sample test cases, but you may see something different in your own system because there's a bug related to uninitialized positions of memory. Think about the behavior of this line of code:hello wrote: WhY WA......?.... I have tested so many inputs from here..... Can anyone give me some new.....
Code: Select all
sort(arr1,arr1+num);