Common Board| Show all threads Hide all threads Show all messages Hide all messages | | help,wa#2. | William Chou | 1717. Eligibility Rules | 1 Dec 2018 15:23 | 3 | I use segment tree to solve this problems(O(n^2logn)). And I have checked my program with an solution(already accepted) for many times. All my answer is correct. But still wa#2. Sorry for my poor English. Please help me,Thank you. After I have correct my code. I got wa#85 now!!! faint! Who can help me? For WA #2 one should make sure that the Segment Tree is initialized to -INF. | | если не трудно,HELP ME Pleees ^_^ ♥♥♥ | Kety Pirozhkova | 1607. Taxi | 1 Dec 2018 15:10 | 3 | Что нужно поправить,чтобы эта программа реализовывала тест '60 100 300 1'?вообще она ломается на 10 тесте при сдаче, но после того как я посмотрела обсуждения и прогнала её по найденным тестам поняла что не могу реализовать только один выше сказанный ответ кстати (как я думаю) 298. вот тесты на которых пробовала. к стати я очень невнимательная, поэтому сильно на меня не ругаться ))) 150 50 1000 100 ответ - 450 1 4 2 2 ответ - 2 1 3 5 2 ответ - 4 2 1 1 1 ответ - 2 1 3 4 3 ответ - 4 1000 2 2000 3 ответ - 140 11 1 10 2 ответ - 11 4 3 6 1 ответ - 6 1 2 12 3 ответ - 6 var a,b,c,d:integer; begin read(a,b,c,d); if a>c then write(a) else begin while a<>c do begin a:=a+b; if (a>c-d)and(c>a) then c:=a else if a+b>c then a:=c else if a=c then break else c:=c-d; end; write(c); end; end. Заранее спасибо)♥_♥ Edited by author 28.12.2017 21:55 Edited by author 28.12.2017 21:56 Let's take a look at this simple test: 32 36 80 4 The process goes like this: 32 -> 80 -> 32+36=68 -> 80-4=76 -> 68+36=104>76, so the end result is 76. Now, let's take a look at how you handle it. a=32 b=36 c=80 d=4 a:=a+b; -> a = 68 now if (a>c-d)and(c>a) then c:=a -> 68>80-4 is false, so this doesn't trigger else if a+b>c then a:=c -> 68+36=104>80, a becomes 80 here. then, while a<>c is checked again, a = c = 80 at this point, so it jumps to write(c). However, answer is 76 and not 80. Hope this helps you to figure out the problem! 150 50 1000 100 Why in this test answer is 450 (not 500) ? | | Some hints | Fetisov Alex [USTU Frogs] | 1438. Time Limit Exceeded | 1 Dec 2018 01:43 | 4 | Some hints Fetisov Alex [USTU Frogs] 7 Apr 2008 12:41 I had WA4 because of this: AnD <=> and, NOt <=> not, etc. I had WA9 because of this: empty strings (only spaces) - this is not a command)) I had TLE 13 because of this: we should ignore as a command lines has only a label) Cool problem)) Good Luck) Edited by author 07.04.2008 12:41 Well, now you don't have AC :) I can also add that you should do some pre calculations to get access to the variables' values and labels' positions with constant time. Logarithmic complexity isn't enough to pass TL. >Well, now you don't have AC :) Test 14 was added by me recently, which is why~ The only hint i can give for it is that the code prevented TL #13, but did it in not exactly a proper way. Took some time to rewrite that crap and retake AC :) Still don't know what was wrong in TL 14 of the previous solution though. | | Почему при проверке выбрасывает "Wrong answer"? | Ilya | 1001. Reverse Root | 30 Nov 2018 13:56 | 2 | #include <iostream> #include <math.h> #include <iomanip> using namespace std; int main(int argc, char const *argv[]) { long number; double sqrts[256]; int k = 0; while ( cin >> number ) { sqrts[k] = sqrt(number); k++; } for ( int n = k - 1; n > -1; n-- ) { cout << fixed << setprecision(4) << sqrts[n] << endl; } return 0; } Edited by author 29.11.2018 20:32 http://acm.timus.ru/help.aspx?topic=cpp C and C++ programs are compiled on the server with the 32-bit Microsoft Visual C++ 2017 or MinGW GCC 7.1 or Clang 4.0.1. So sizeof(long)==4. You should run locally/debug programs using 32 bit compiler too. Btw, why do you think 256 sqrts is enough? How did you estimate it? | | WA на первом тесте pascalABC. Что не так ? *HELP* | Kety Pirozhkova | 1001. Reverse Root | 28 Nov 2018 21:20 | 1 | скорее всего ошибка с функцией Eof() ибо впервые ей пользуюсь и смутно представлю принцип работы. Если её нельзя использовать, то как найти конец вводимого файла? var s,sk:string; var i,fl,j,code:integer; var n:real; var a:array [1 ..256] of real; var f:array [1 ..256] of integer; begin while (Eof()<>True ) do begin readln(s); for i:=1 to length(s) do begin if (s[i]<>' ') and (fl=0) then begin fl:=1; sk:=sk+s[i]; end else if (s[i]<>' ') and (fl=1) then sk:=sk+s[i];
if (((s[i]=' ') and (fl=1)))or ((i=length(s))and(fl=1)) then begin fl:=0; val(sk,n,code); for j:=1 to 256 do if f[j]<>1 then begin a[j]:=sqrt(n); f[j]:=1; sk:=''; n:=0; break; end;
end; end;end; for i:=1 to 256 do if (f[i]=1) then writeln(a[i]:0:4); end. | | WA 43 | P.Sofia | 2102. Michael and Cryptography | 28 Nov 2018 19:18 | 1 | WA 43 P.Sofia 28 Nov 2018 19:18 Did anyone else got this before me? Let's try to find what's type of test it is.. | | Possibly k needs to be minimal | Md sabbir Rahman | 2103. Corporate Mail | 28 Nov 2018 16:09 | 1 | first I tried this problem with 1-0 bfs, but it was giving me wa5. when I coded it int dijkstra with edges of 0,1,2,3, I got AC. so is minimal k necessary? | | use python3.6 will be TLE | kenv07 | 2003. Simple Magic | 27 Nov 2018 12:34 | 1 | | | A simple python script to generate long test cases | Xitsa | 1654. Cipher Message | 27 Nov 2018 09:08 | 1 | import random letters = ['a' ,'b' ,'c' ,'d' ,'e' ,'f' ,'g' ,'h' ,'i' ,'j' ,'k' ,'l' ,'m' ,'n' ,'o' ,'p' ,'q' ,'r' ,'s' ,'t' ,'u' ,'v' ,'w' ,'x' ,'y' ,'z'] example = 'xitsa' while len(example) < 199999: letter = random.choice(letters) point = random.randrange(0, len(example)) example = example[:point] + letter + letter + example[point:] print(example) | | Есть ли неточность в условии ? | Gulliput | 1494. Monobilliards | 27 Nov 2018 00:08 | 1 | А вот эта фраза "Пока господин Чичиков играл, ревизор несколько раз подходил к столу и забирал из лузы последний закатившийся туда шар" может быть понята двояко. Либо буквально "последний закатившийся", и тогда после изъятия последнего закатившегося шара нельзя брать ещё, пока не появится следующий последний закатившийся (то есть до следующего забитого шара: потому что последний уже взят, и следующий шар в лузе - предпоследний закатившийся), либо имеется в виду просто верхний, который может быть последним из оставшихся неизъятыми, а не буквально "последним закатившимся". Так что же имеется в виду авторами задачи и, главное, тестов к ней ? Это важно, потому что я читал эту фразу буквально, а при таком прочтении обязательное условие относительно шаров, изъятых до конца игры - то, что они должны идти по возрастанию. В случае второго варианта этого условия нет. Я-то привык всегда понимать задание буквально, считая, что авторы задания чётко понимают смысл своих слов. | | What's wrong? | Avyatkin | 1355. Bald Spot Revisited | 26 Nov 2018 18:41 | 1 | Wrong answer on test 4: #include<iostream> using namespace std; //Разложение на простые множители числа n unsigned long long int PrimeFactorization(unsigned long long n) { unsigned long long int k(0); unsigned long long int m = (int)sqrt(n) + 1; for (int i(2); i <= m; i++) { if (n%i == 0) { while (n%i == 0) { n /= i; k++; } } if (n > 1 && i == m - 1) { k++; } } return k; } int main() { setlocale(LC_ALL, "rus"); unsigned long long int a, b; int n; cin >> n; unsigned long long int* ans = new unsigned long long int[n]; for (int i(0); i < n; i++) { cin >> a >> b; if ((b%a) == 0) { ans[i] = PrimeFactorization(b/a) + 1; } else ans[i] = 0; }
for (int i(0); i < n; i++) { cout << ans[i] << endl; } if (n == 0) cout << 0; return 0; } | | Help! Why do I get WA? | zhou MX | 1150. Page Numbers | 25 Nov 2018 19:42 | 4 | I think my program is right , but I get WA . program Ural_1150; // Digits const bit:array[1..10] of longint= (1,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000); var num:array[0..9] of longint; n,i,j,x:longint; begin readln(n); for i:=1 to 9 do begin x:=n mod bit[i+1] div bit[i]; for j:=1 to 9 do begin num[j]:=num[j]+n div bit[i+1]*bit[i]; if x>j then num[j]:=num[j]+bit[i] else if x=j then num[j]:=num[j]+n mod bit[i]+1; end; if n>=bit[i+1] then begin num[0]:=num[0]+n div bit[i+1]*bit[i]-bit[i]; if x>0 then num[0]:=num[0]+bit[i] else num[0]:=num[0]+n mod bit[i]+1; end; end; for i:=0 to 9 do writeln(num[i]); end. | | TLE Test #8 | Sadeko | 1054. Tower of Hanoi | 25 Nov 2018 02:17 | 1 | | | TL 12 | Arseniy | 2034. Caravans | 25 Nov 2018 00:30 | 2 | TL 12 Arseniy 23 Apr 2016 22:06 My O(N * log N + M) solutions gets TL What I'm doing wrong? Have somebody any tests? please! | | what is the meaning of this problem? | Abbos Bo'kaboyev | 2018. The Debut Album | 24 Nov 2018 19:14 | 2 | I am not able to understand the problem fully. In the first test why 221 or 122 are not included. But 212 is included. If somebody got this problem, please explain In the example, good albom can't contain two 2 together, because 2 > b = 1. | | WA#9 | dastan | 1786. Sandro's Biography | 24 Nov 2018 18:33 | 4 | WA#9 dastan 4 Jan 2012 22:56 I have true answers on all tests with this forum, but have WA#9! Help me! This is my code: #include <iostream> using namespace std; int main() { char str[201]; int c = 0; int cmax = 0; int index = 0; const char S[7] = {'S','a','n','d','r','o','\n'}; gets(str); for(int i=0;i<strlen(str)-5;i++) { if(str[i]=='S') c+=2; if(str[i]=='s') c++; if(str[i+1]=='a') c+=2; if(str[i+1]=='A') c++; if(str[i+2]=='n') c+=2; if(str[i+2]=='N') c++; if(str[i+3]=='d') c+=2; if(str[i+3]=='D') c++; if(str[i+4]=='r') c+=2; if(str[i+4]=='R') c++; if(str[i+5]=='o') c+=2; if(str[i+5]=='O') c++; if(c>cmax) { cmax = c; index = i; } } c = 0; if((str[index]=='s')||((int(str[index])<=90)&&(str[index]!='S'))) c++; else if(str[index]!='S') c+=2;
if((str[index+1]=='A')||((int(str[index+1])>90)&&(str[index+1]!='a'))) c++; else if(str[index+1]!='a') c+=2;
if((str[index+2]=='N')||((int(str[index+2])>90)&&(str[index+2]!='n'))) c++; else if(str[index+2]!='n') c+=2;
if((str[index+3]=='D')||((int(str[index+3])>90)&&(str[index+3]!='d'))) c++; else if(str[index+3]!='d') c+=2;
if((str[index+4]=='R')||((int(str[index+4])>90)&&(str[index+4]!='r'))) c++; else if(str[index+4]!='r') c+=2;
if((str[index+5]=='O')||((int(str[index+5])>90)&&(str[index+5]!='o'))) c++; else if(str[index+5]!='o') c+=2; cout<<c*5<<endl; return 0; } Try the test: sssssssssssssssssssssssssssssssssssssssssssssssaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaannnnnnnnnnnnnnnnnnnnnnnnnndroooooooooooooo Your program's answer is 30. The right answer is 15. ( 1.sssssssssssssssssssssssssssssssssssssssssssssssaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaannnnnnnnnnnnnnnnnnnnnnnsnndroooooooooooooo 2.sssssssssssssssssssssssssssssssssssssssssssssssaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaannnnnnnnnnnnnnnnnnnnnnnsandroooooooooooooo 3.sssssssssssssssssssssssssssssssssssssssssssssssaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaannnnnnnnnnnnnnnnnnnnnnnSandroooooooooooooo ) The wierd thing is that for "mmndro" the answer is right. :D I got the bug. In the first for, your c is always increasing, so your cmax will be wrong. Put "c=0" before to close the for. It should work perfect now. | | To admins Please add SBCL (Common Lisp) Language | bobby | | 24 Nov 2018 09:44 | 1 | There are a number of wonderful languages supported already, but it would be great if Common Lisp were added as well. Have there been any plans to do so? SBCL is the most popular -- and one of the oldest and still very actively maintained -- open source implementations of Common Lisp, and it is very, very, fast[0]. Could SBCL please be added to the list of supported languages? It would be really appreciated. [0]: https://github.com/sbcl/sbcl Edited by author 24.11.2018 09:46 | | C# solution thougths | Nehorowo | 1880. Psych Up's Eigenvalues | 23 Nov 2018 18:20 | 1 | u have 3 arrays, so. try to compare arr1 and arr2 and if u found matched numbers, then compare the second and the third arrays, if u got matched again - count var +1 in the end just writeline (count) Edited by author 23.11.2018 18:22 | | I don't know why wrong answer ? Can you help me ? please! | QUANGPHAM | 1001. Reverse Root | 23 Nov 2018 13:39 | 2 | #include <iostream> #include <iomanip> #include <math.h> using namespace std; int main(){ unsigned long long input; double array[4]; int dem = 0; while (dem < 4 && cin >> input ){ array[dem] = sqrt(input); dem++; } for ( int i = dem - 1; i >= 0; i--) cout << setprecision(4) << fixed << array[i] << endl; } there should not have a array that with 4 length, it may have 5 or 6 or 100...echo, there is no limit | | WA 19 | Md sabbir Rahman | 1807. Cartridges for Maxim | 23 Nov 2018 01:25 | 2 | WA 19 Md sabbir Rahman 22 Nov 2018 22:39 Can anyone please tell me what's in test 19? please? Btw I just checked the LCMs of all numbers from 1 to 31607 using OEIS and they matched, soI have no idea where the error is. |
|
|