Общий форумcan you give me 5th test, please input contains strings which size is 30. I had WA 29, these tests helped me: abaaa aab Answer: aa baaba abb Answer: aa bcbbc abcc Answer: abb Edited by author 18.10.2015 22:56 Kolega FrigATE Mister IPRIT Jogn Doe Jogn Doe2 Jogn Doe3 John Doe 4 John Doe 5 Flooding submissions were cleaned out Edited by author 18.10.2015 14:20 Why the "coolest" rout is 4? 4 + 7 + 8 = 19, isn't it? "Определим крутость маршрута как минимальную популярность группы среди всех улиц, по которым рокеры проедут". <deleted> Edited by author 17.10.2015 14:47 What is "Wrong answer - test 2", and how can i fix it? Edited by author 17.10.2015 11:58 Edited by author 17.10.2015 11:58 input x= 5 print x In 1st line('x = 5') delete one space Test 5: you should output the list of _initialized_to_this_moment_ variables and their values Pheeew, finally AC! After WA #3, which had a test like print 5 end , i added 4 lines to fix that, and immediately got WA5. Thanks to Fyodor, i immediately understood what i missed, in case like a = 1 goto x b = 2 x: goto x i initially printed Program terminated. Variables state: a: 1 b: 0 So, i fixed that too, and only printed out a: 1, but still was having WA5! Curiously enough, after a fix, which i didn't think would help, i finally got AC. In my program, i had this chunk of code: writeln('Program terminated. Variables state:'); { for i:=1 to vsz do if initialized[i] = 1 then writeln(vnames[i], ': ', vars[i]); } for i:=1 to vsz do begin val(vnames[i], j, xcode); if xcode <> 0 then begin if initialized[i] = 1 then writeln(vnames[i], ': ', vars[i]); end; end; The thing is, i threw everything into variable array, both constants and variables, like if i met A = 4 + -3, i throw A, 4, -3 into that array. Then, i go through every variable "name" and use standard val procedure to attempt to convert string into integer. "A" isn't a number, so it remains 0 initially, but "4" and "-3" successfully convert into numbers, so i give them values of 4 and -3 initially. But if i write in my program 4 = 100, then later on something like "A = A + 4" would actually add 100 to A. Soooo... Using that lower uncommented chunk, i go through variable names again, and convert them into numbers, to see, if they're supposed to be constants. If they are, i ignore them, and if they aren't, i check if they're initialized, and if they are, i print them. That gave me WA5. Test like 4 = 5 x: goto x would give Program terminated. Variables state: Then, i commented that lower chunk, and uncommented the upper chunk, so that no matter if "variable"'s name can be converted to number or not, i print it out anyway if it's initialized. So for test like 4 = 5 x: goto x it now gives Program terminated. Variables state: 4: 5 And that fix got me AC! Either stuff like 4 = 5 is present in 5th test, or i'm missing anything else... Well, that was fun to discover, haha~ I also implemented support for variable names equal to keywords, so things like "not = not not" or "not: not = not or not" or "print: print print" would be parsed adequately, but seems it wasn't really needed. P. S. In the end, it turned out that the Val function converts not only decimal, but also hexadecimal numbers, which is why i encountered this problem. Edited by author 22.10.2015 15:12 1)If a person has got satisfactory marks in any subject than answer will be "None". 2)If he has got marks greater than 5 in all sub than answer is "Named"; 3)If average score greater 4.5 than High; 4)Else common. I am not trying to spoil the question but I found statement little bit unclear.Hope thhis will help Есть кто нибудь которой решил с подсчётом количество инверсии. Edited by author 16.10.2015 11:01 I wa on it After hours and hours of struggle, i finally found out that test 3 is as simple as something like print 5 end No variables, no operations, just printing a number. Also, it was actually runtime error (out of bounds) for me, it's a sad thing it gave me WA instead... Edited by author 16.10.2015 06:43 if you get WA on test #2, then try to use unsigned char* instead char* I have done it with char s[], you don't have to use unsigned char s[] !!! I used scanf ... Edited by author 03.04.2010 00:08 I had WA2 with some test like this 'a' like '[a-]' YES Because there may be spaces in the input, "scanf("%s")" may not be accepted... 2 'like' like 'like' ''' '' ' like ''' ''%' YES YES Tests may also have spaces, so it is a confusing question to determine how to get the string and the pattern. I got 14 WA on this question, and finally AC. QWQ Edited by author 14.10.2015 20:17 Try this test: 2 1 1 3 answer: 2 3 1 4 I have wa#9,but my program does well in your data The case given here helped me. Notice that when you are selecting whether white part is to be selected or black part, and pushing the result in a vector or queue, due to DP, last part gets inserted first. So you have to consider that first result in the vector/queue is for the last pair of partition. May be this will help... 2 4 1 2 2 1 1 2 2 1 answer: 1 3 2 4 answer 1 2 3 4 is correct too. But I have wa3 from math import sqrt n = int(input()) l = list(map(int, input().split())) t = [] for i in range(n): for j in range(n): if l[i] == l[j]: t.append(l[i]) l = 0 for i in range(len(t)): if t[i] != l: print(int(sqrt(t.count(t[i]))),t[i], end=' ') l = t[i] что за тест в чем ошибка? I haven't idea how to approach this test? my code is simple O(n^4),but #9 test doesn' work: for (i=1;i<=n;i++) { for (j=1;j<=n;j++)
s[i][j]=s[i-1][j]+s[i][j-1]+a[i][j]-s[i-1][j-1];
} for (i=1;i<=n;i++) for (j=1;j<=n;j++) { for (k=i;k<=n;k++) { for (m=j;m<=n;m++) { sum=s[k][m]-s[i-1][m]-s[k][j-1]+s[i-1][j-1];
if (sum>max1) max1=sum;
} } } I had the same problem. Firstly I used array of short and there was overflow in sum (max possible sum is 127 * 100 * 100 = 1270000 > 32767). Then I changed type to int and got AC :) getting WA9 What can be the problem ? WA9 happens when in attempt of optimization you try to convert the name of an option into int64, but miserably fail at that. Like, (1..26)27^0 + (1..26)27^1 + (1..26)27^2 + ... I simply forgot the increment, so i had (1..26)27^0 + (1..26)27^0 + (1..26)27^0 + ... |
|