|
|
Общий форумWhy output is 2 , I think it should be 22 , because the worm started from the first sheet of vol 1 and goes until last sheet of vol 2 . so it's path is 10+1+1+10 = 22 No comments if "NO COMMENTS" why you write this? information - Zero You should know, that answer "No comments" is identical to "Read the problem statement" You could have written explanation or something instead of writing no comments. Its like making fun of the guy, like jewish do. Try to put two books in a bookshelf, and see the reason for no comments :D what answer will be for test like this: 10 1 3 1 zero? >what answer will be for test like this: >10 1 3 1 Answer is 34. No for the case 10 1 3 1 Answer is 12 No for the case 10 1 3 1 Answer is 12 No. You are wrong. My ACed solusion also gave 34. Even if you solve it by hand it is the same result. Because books are [from first ][][ to last] There are 4 symbols of [ and ] that are book covers. So, three books and 4 covers of the books that worm had gnawed. You seem to be an anti-Semite! Jewish are not guilty of your stupidity Are there no moderators here? Hateful comments should be instantly removed and the idiots who post them should be temporarily or permanently banned! Think of the reputation of this otherwise great site! Ok, the problem statement doesn't clarify that this book is an LTR language (left to right, e.g. English) book.Shuch a crucial info shouldn't be left to the assumptions of the reader. Предусмотрена ли функция удаления аккаунта? Каким образом это можно сделать? The following changes have been made to the problem: - The checking program strictly checks that the initial formatting is preserved, for example it rejects outputs with additional empty lines before or after the text. - Missing limitations added to the problem statements: - The words in the text to correct are no longer than 16 characters. - The lines in the text to correct are no longer than 80 characters. - The cumulative length of all lines doesn't exceed 10000 characters. - New tests have been added. - Time limit has been reduced to 0.5 sec. - All solutions have been rejudged. 44% of authors have lost their accepted solutions. 1. Input: 7122 2119 2. Input: 7122 2120 My AC program outputs next: > 1. Input: 7122 2119 Output: 4923 > 2. Input: 7122 2120 Output: 2501 > 1. Input: 7122 2119 5003 > 2. Input: 7122 2120 2501 > 1. Input: 7122 2119 5003 > 2. Input: 7122 2120 2501 I'm too ! List of posible solutions (I think) 7122 2119 Base 5003 12119 => 2119 Base 2966 21190 => 2119 Base 2965 21192 => 2119 Base 2964 21194 => 2119 Base 2963 21196 => 2119 Base 2962 21198 => 2119 (1) Base 423 16354 => 54 (2) Why 1 or 2 dont can be solutions?, there is something I am not seeing? Edited by author 08.07.2022 19:57 почему если сначала for k.. for (i=n-1; i >= 0; i--) inc() то ва12 а если for(i = n-1; i >=0; i--) for k... inc() то АС? надеюсь кто-нибудь понял.. Edited by author 08.07.2022 14:59 Can be solved using two DFS calls and tree rerooting in O(N) while maintaining a DP array where DP[node] = sum for all paths from node to all the nodes in its subtree (considering 1 as the initial root). Tree rerooting can be used to calculate the sum for all nodes. Why is there such a big difference between these two compilers and how do I know if I have solved this problem, it just feels like I wrote really dirty code and it somehow worked. i dont have any idea why wa5.. Edited by author 02.07.2022 22:06 g++ 9.2 - mle 7 visual c++ - AC 2 11 12 aaaa bb ccc ddddddddddd eeeeeeee ff jjjjj hhhh iiiii jjjjjjjjjj kk lll Correct answer: 4 2 11 10 aaaa bb ccc ddddddddddd eeeeeeee ff jjjjj hhhh iiiii jjjjjjjjjj Correct answer: 3 2 100 12 aaaa bb ccc ddddddddddd eeeeeeee ff jjjjj hhhh iiiii jjjjjjjjjj kk lll Correct answer: 1 1 11 12 aaaa bb ccc ddddddddddd eeeeeeee ff jjjjj hhhh iiiii jjjjjjjjjj kk lll Correct answer: 7 2 13 8 aaaa bb ccccc ddddddddddddd eeeeeeee ffff jjjjj hhhhhhh Correct answer: 2 1 1 1 a Correct answer: 1 I have correct answer at all tests, but i got WA #4 i have similar problem with the WA#4 anyone can help me??? If you have WA#4, then you didn't count last partially filled line. I have correct answer at all tests, but i got WA #5... Can anyone help me? try 2 3 4 aaa aaa aaa aaa CA-2 Before I found this testcasei got WA5 then i found my mistake with this test and got AC. Good luck! Thanks!I find my mistake in last test. Maybe it will help you, try this test: 3 6 5 aaaaaa bbb cc dddd ee Correct answer is 2, after recovering this mistake I get trought WA#4 The problem test case is: 3 2 3 1 1 3 2 1 2 but is it right?? My observation finds: 3 2 3 1 1 3 2 2 1 plz help me??? Is there any mathematical algorithm or i need to check every way mages can go This firstly happens in 8th test. a,b=map(int, input().split()) if a==1: print(2) exit() if (a*2)//b<a*2/b: print(a*2//b+1) else: print(a*2//b) #include<stdio.h> int main(){ int testCase,i,j,l; scanf("%d",&testCase); for(l=0;l<testCase;l++){ int k=0,count; scanf("%d",&count); int pnumber=0; for(j=2;k<count;j++){ int flag=0; for(i=2;i*i<=j;i++){ if(j%i==0){ flag=1; break; } } if(flag){ }else{ pnumber=j; k++; } } printf("%d",pnumber); } return 0; } I don’t understand what the problem is when passing the test 8. everything works for me Edited by author 22.06.2022 22:21 try this: 8 6 7 9 13 18 24 31 50 expected: 0 My program do this #include <iostream> int main() { int temp = 0, maxtemp=0, even = 0, midle = 0, different = 0, maxdifferent = 0; int arrayA[100]; int sizeArray; std::cin >> sizeArray; for (int i = 0; i < sizeArray; i++) { std::cin >> arrayA[i]; } for (int i = 0; i < sizeArray; i++) { for (int j = i; j < sizeArray; j++) { if (arrayA[i] < arrayA[j]) { temp = arrayA[i]; arrayA[i] = arrayA[j]; arrayA[j] = temp; }; }; }; for (int i = 0; i < sizeArray; i++) { midle += arrayA[i]; }; even = midle % 2; maxdifferent= different= midle = midle / 2 +even; if (sizeArray != 1) { for (int i = 0; i < sizeArray; i++) { different = midle; for (int j = i; j < sizeArray; j++) { if (different >= arrayA[j]) { temp += arrayA[j]; different -= arrayA[j]; }; }; if (maxdifferent > different) { maxdifferent = different; }; }; }; maxdifferent = 2* maxdifferent -even; std::cout << maxdifferent; } Maybe you have to make a larger array to put the answer. thank you very much,, I've been stuck in this problem for weeks because of this. #include<stdio.h> int main() { int n,i,sum = 0; float res; scanf("%d",& n); int arr[n];
for(i = 1; i <= n; i++) { scanf("%d",&arr[i]); sum += arr[i]; } for(i = 1 ; i <= n; i++) { if(arr[i] == 3) { printf("None\n"); break; } }
res = (float)sum / n; if(res == 5) printf("Named\n"); else if(res >= 4.5) printf("High\n"); else if ((res < 4.5 && res >= 4)) printf("Common\n");
return 0; } Have anybody crash on 3 test? It's interesting, that my friend decided this problem and on tests with n>50 we have the same answer. I had. You must add in your programm something like this: if(sum/9>2*n){ printf("0"); return 0; } thanks. I just found my forgotten! my program cannot print 0 'zero' ( - -") Why is this condition required? The recursive formula takes care of this.. Without this condition my code gets WA3.. And when I add it, it gets AC.. Could you plz give a test case where this condition is really required, where the DP formula fails..?? I don't think it's DP formula's fault Perhaps when you are deleting leading zero, you haven't judge if the point is >= 0 |
|
|