| Show all threads Hide all threads Show all messages Hide all messages |
| More tests | Danil Dushistov | 1881. Long problem statement | 30 Jun 2022 14:03 | 10 |
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 |
| Is given problem test case is right??? | codefresher | 1119. Metro | 29 Jun 2022 20:47 | 2 |
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??? |
| How to distribute safe places for mages properly and effectively on python | MikhailOrlov | 1952. To Kill the Dragon | 26 Jun 2022 21:36 | 1 |
Is there any mathematical algorithm or i need to check every way mages can go |
| Start station position can be greater, than finish station position. | Igor Parfenov | 1031. Railway Tickets | 23 Jun 2022 20:48 | 1 |
This firstly happens in 8th test. |
| WA 33. What is this wrong? | Vsevolod | 1820. Ural Steaks | 23 Jun 2022 08:57 | 1 |
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) |
| why wrong answer | M. A. Murad | 1086. Cryptography | 23 Jun 2022 00:12 | 1 |
#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; } |
| the program gives the correct answer, but test 8 is not passed | Teplotehnik | 1005. Stone Pile | 22 Jun 2022 20:54 | 3 |
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; } |
| To those who got WA#6 | hbmhalley | 1029. Ministry | 22 Jun 2022 17:18 | 3 |
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. |
| Unable to find why compilation error | Tasin | 2056. Scholarship | 22 Jun 2022 12:16 | 1 |
#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; } |
| Crash on 3 test | Koshmarik | 1036. Lucky Tickets | 22 Jun 2022 08:43 | 5 |
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 |
| Solution is simple | Igor Parfenov | 1961. Cantonese Dialect | 20 Jun 2022 02:05 | 1 |
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. |
| Some tests here | Georgiy Platonov | 1356. Something Easier | 19 Jun 2022 19:04 | 3 |
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 |
| WA5 | __Andrewy__ | 2152. Tax Fees | 18 Jun 2022 20:05 | 3 |
WA5 __Andrewy__ 19 Mar 2022 14:57 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 Re: WA5 __Andrewy__ 19 Mar 2022 17:11 How to solve problem without long arithmetics? Re: WA5 Nikita Pashmentov (Vologda ML, MIPT) 18 Jun 2022 20:05 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 |
| Python Wrong answer test#1 | Evgen1yK | 1001. Reverse Root | 17 Jun 2022 14:38 | 2 |
I'm just learning python. Can you please tell me where could be the error? import math data = input() length = len(data) list = [] i = 0 while i < length: if data[i] != " " and data[i] != "\n": end_index = i for j in range(i + 1, length): if data[j] == " " or data[i] == "\n": break end_index += 1 list.insert(0, int(data[i:end_index + 1])) i = end_index + 1 else: i += 1 for e in list: value = round(math.sqrt(e), 4) print(f'{value:.4f}') You only need to write about 3 lines of python code to solve this. try: help(str.split) help(reversed) help(str.join) |
| WA#25 | Artem Khizha [DNU] | 1088. Ilya Murometz | 12 Jun 2022 18:26 | 2 |
WA#25 Artem Khizha [DNU] 17 Aug 2010 02:19 If you're unlucky and get WA#25 (just like I did), try a test: > 2 4 5 1 1 1 The answer should be NO. This obvious test helped me to fix a little bug, so I decided to share. |
| WA 25? | Heorhii | 1500. Pass Licenses | 11 Jun 2022 20:11 | 1 |
WA 25? Heorhii 11 Jun 2022 20:11 My program passes all tests created by me, so I don't know what could be the problem with it |
| Proof | andreyDagger | 1578. Mammoth Hunt | 11 Jun 2022 17:48 | 1 |
Proof andreyDagger 11 Jun 2022 17:48 Why can we always choose the farthest point? Suppose the opposite. Let we have 3 adjacent points in our way, which make obtuse angle. Let's call them A, B and C. angle ABC is obtuse, that means that |AC|>|AB| and |AC|>|BC|. But that's impossible because our algorithm chooses the farthest point, but B is not the farthest, C is further than B. Contradiction. Edited by author 11.06.2022 17:49 Edited by author 11.06.2022 17:49 |
| WA15 | andreyDagger | 1578. Mammoth Hunt | 11 Jun 2022 17:40 | 1 |
WA15 andreyDagger 11 Jun 2022 17:40 I had X[2000], then I changed it to X[2002] and got AC |
| I got accepted with a wrong program | georg | 2143. Victoria! | 10 Jun 2022 15:47 | 1 |
Test: 99 10 ***|_|*** .*.|_|*** *.*|_|*** ***|_|*** .*.|_|*** *.*|_|*** and so on (block of 3 rows repeated 33 times). My program hangs out on this test (takes infinite time), but I got accepted. |
| Strange approach | andreyDagger | 1483. Table Football | 8 Jun 2022 21:18 | 2 |
It's obvious that answer for first team is n - 1 How to get answer for second team. Of course total number of points do not exceed 3 * (n * (n - 1) / 2), because we played n * (n - 1) / 2 matches, and in every match summary points not exceed 3. Assume looser team got k points, that mean that total number of points >= k * n. But k * n can't be greater than 3 * n * (n - 1) / 2, so: k * n <= 3 * n * (n - 1) / 2, then k <= 3 * (n - 1) / 2. Answer is 3 * (n - 1) / 2. But how to prove that we can make such competition where k is the smallest value and we have (n - 1) values that are not less? Edited by author 08.06.2022 21:21 |