Common Board1)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 + ... It's too funy! I forgot to check one little moment if(goods[v[0].s] == 0){ time++; v.pop_front(); continue; } Or try this test: 1 1 of hell 3 1 of lol 2 of azaz 3 of bug Answer: 3, but my old programm gives 5 LOL, Good Luck! My problem is not this that gives the correct answer, but despite that WA9 Try this: 1 1 of a 3 1 of a 1 of a 1 of b Correct answer is 3. Почему не проходит тест? Вроде все правильно WA in Case #6. Could you give me the case? Edited by author 11.10.2015 17:59 Edited by author 11.10.2015 17:44 Just print: 1)2*n-1 2)1 2 ... n 3)n n-1 ... 2 It's work, but why? example 4 1 2 3 4 4 3 2 original 4->3->2->1->2->3->4 They don't meet They meet at the 6th point(3 = 3). Why do you need to print that 1 at the beginning? You don't need it. 2 3 4 4 3 2 also works fine. But 3 2 1 3 2 (or 2 3 4 2 3) is shorter. Please help me, what is wrong with my solution.... Const MaxN = 100000; Var b : array[1..MaxN] of boolean; c : array[1..2,1..MaxN] of longint; c_num,n,m,i,x,y : longint; BEGIN Readln(n,m); Fillchar(b,sizeof(b),true); Fillchar(c,sizeof(c),0); c_num := 0; For i := 1 to m do begin Read(x,y); if b[x] and b[y] then Begin Inc(c_num); c[1][c_num] := x; c[2][c_num] := y; b[x] := false; b[y] := false; End; End; Writeln(c_num); For i := 1 to C_num do Begin Writeln(c[1][i],' ',c[2][i]); End; END. Try such test... :) 4 3 2 3 1 2 3 4 Correct answer is 2 1 2 3 4 I don't think, that greedy is a good idea... Try this one 4 3 1 2 1 3 3 4 Correct Answer: 2 1 2 3 4 Кто решил,напишите пару тестов. import sys def wall_scaner(amount, wall): count = 0 high = 0 mid_number = '' while count < int(amount) - 2: summ = 0 unit = wall[count:count + 3] for i in unit: summ += int(i) if summ > high: high = summ mid_number = count + 2 count += 1 return high, mid_number data1 = sys.stdin.readline() data2 = sys.stdin.readline() amount = ''.join(data1.split()) wall = ''.join(data2.split()) answer = wall_scaner(amount, wall) print(answer[0], answer[1]) plz tell me what's wrong this code always return right format and answer for me ты считаешь тройки одинаковых рядом цифр, а по заданию это не нужно. Нужно найти суммарный максимум из рядом стоящих не обязательно это будут 777 может и 845 n = int(input()) sp = list(map(int, (input().split()))) ind = 0 MAX = sum(sp[:2]) for i in range(n - 2): if sum(sp[i:i+3]) > MAX: MAX = sum(sp[i:i+3]) ind = sp.index(sp[i]) + 2 print(MAX, ind) Edited by author 08.10.2015 18:07 What's wrong? Please, answer me. #include <iostream> #include <vector> using namespace std; int main() { bool z; vector <int> so(0), st(0); unsigned int a; cin >> a; while (so.size() < a) { int soe; cin >> soe; so.push_back(soe); } unsigned int b; cin >> b; while (st.size() < b) { int ste; cin >> ste; st.push_back(ste); } for (unsigned int i = 0; i < so.size(); i++) for (unsigned int j = 0; j < st.size(); j++) { if (so[i] + st[j] == 10000) { z = true; } } if (z == true) { cout << "YES" << endl; } else { cout << "NO" << endl; } } Edited by author 24.10.2015 04:23 |
|