Common Boardi dont have any idea why wa5.. Edited by author 02.07.2022 22:06 g++ 9.2 - mle 7 visual c++ - AC Что происходит в последнее время в интернете с передачей дом 2? Непонятная регистрация по телефону которую неизвестно как пройти, уже полмесяца не могу нормально смотреть выпуски, а по телевизору просто нету времени, работу то не бросишь... Подскажите, где Вы смотрите свежие серии в текущих условиях? И как пройти эту непонятную регистрацию? Спасибо. 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??? a=[int(i) for i in input().split()] for i in a[::-1]: print(f"{float(i)**0.5:.4f}") Is there any mathematical algorithm or i need to check every way mages can go This firstly happens in 8th test. #include<stdio.h> #include<math.h> int main(){ unsigned long long int a,b,c,d; double Sqrt,Sqrt1,Sqrt2,Sqrt3; scanf("%llu %llu %llu %llu",&a,&b,&c,&d); Sqrt=sqrt(a); Sqrt1=sqrt(b); Sqrt2=sqrt(c); Sqrt3=sqrt(d); printf(" %0.4lf %0.4lf %0.4lf %0.4lf",Sqrt,Sqrt1,Sqrt2,Sqrt3); } Edited by author 23.06.2022 13:46 Edited by author 23.06.2022 13:46 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 The solution is just a very little more difficult, that the first, which comes to mind. I tried firstly to count these probabilities (those are C(M, m) * C(N-M, n-m) / C(N, n)), but seems, it is impossible with these constraints. Here are some test cases and my AC prog's answers 1000000000 999999929 71 999999000 999998981 19 999000999 3 5 999000991 405 3 5 397 101 101 1001 3 7 991 10001 5 23 9973 100001 3 7 99991 1000001 5 13 999983 10000001 3 7 9999991 100000001 5 7 99999989 555555555 3 11 555555541 191919191 5 23 191919163 838383838 838383779 59 123456789 5 23 123456761 987654321 987654319 2 987654319 987654319 101010101 3 19 101010079 Good luck Thanks for this testset, helped me find the bug :) The same, in a more reusable format: 18 1000000000 999999000 999000999 405 101 1001 10001 100001 1000001 10000001 100000001 555555555 191919191 838383838 123456789 987654321 987654319 101010101 71 999999929 19 999998981 3 5 999000991 3 5 397 101 3 7 991 3 31 9967 3 7 99991 3 19 999979 3 7 9999991 3 67 99999931 3 11 555555541 3 61 191919127 59 838383779 3 29 123456757 2 987654319 987654319 3 19 101010079 i use python so long arithmetics is not problem for me i use greedy algo and try to replace digit to 9 i want to see test How to solve problem without long arithmetics? The main idea of this test following in sorting relative fees instead of absolute fees. Simple example: 2 1 10 10 1 1 999990 1 100 1 The first package has huge absolute value of fees ((999999 - 10) * 1), but it adds only 9 credits to the initial fees. Edited by author 18.06.2022 20:06 Let a[1], ... , a[n] be the sequence written by the friend and pref[i] be the xor of the prefix a[1...i]. Then a question (l, r, t) (which means the parity of the number of ones on the segment from l to r is t) can be represented as (pref[r] xor pref[l - 1] = t). Let's build a graph with two vertices for each prefix (thus, there will be 2 * (n + 1) vertices). Using compression, we actually need only at most 2 * m vertices (where m is the number of questions). Let the vertices corresponding to the prefix i be f0(i) and f1(i). Now, let's add all edges f0(i) ~ f1(i). For a question (pref[r] xor pref[l - 1] = t) if t = 1, we add two edges f0(l - 1) ~ f0(r) and f1(l - 1) ~ f1(r), else if t = 0, we add edges f0(l - 1) ~ f1(r) and f1(l - 1) ~ f0(r). To check whether a sequence of questions from 1 to x is achievable we just need to check whether our current graph is bipartite. This can be done by simply doing dfs after each question. Nice! Can you please elaborate in a few words? I actually didn't get the significance of having two vertices for each prefix and how it's solving the problem. what is wrong with my program? I used Python code below: n = input() list = n.split() n = int(list[0]) k = len(list[1]) if (n < k): p = k else: p = n
i=2 num = n - k if (n>=1 and n<=10) and (k>=1 and k<=20) and (num > 0): if((n%k) == 0): while(num>k): p = p*num num = n-i*k i=i+1 p = p*k else: while(num>(n%k)): p = p*num num = n-i*k i=i+1 p = p*(n%k) print(p) Edited by author 17.06.2022 20:39 |
|