Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
Progremer help me please | Meni Packeou | 1354. Палиндром. Он же палиндром | 19 авг 2008 20:03 | 1 |
Edited by author 21.08.2008 15:52 |
Very good Online Judge and Forum | Madhav | 1354. Палиндром. Он же палиндром | 17 июн 2008 03:19 | 2 |
this forum is very very good.It helps us learns how to develop good test data.I used this forum to solve the problem.Very good test data.Excellent.It has checked the problem in many ways.Especially this problem is very good.Even though the logic is easy there were very good test data Edited by author 16.06.2008 16:00 I couldn't agree more. That's why so many people love timus! |
my hint | Anupam Ghosh,Bengal Engg and Sc Uni,MtechIT,2006-09,India | 1354. Палиндром. Он же палиндром | 23 апр 2008 17:34 | 1 |
my hint Anupam Ghosh,Bengal Engg and Sc Uni,MtechIT,2006-09,India 23 апр 2008 17:34 just use a stack to hold s2. |
If you have WA10 | Olzhas aka Whale2dy | 1354. Палиндром. Он же палиндром | 28 ноя 2007 23:59 | 5 |
And another thing. Use STL string - solution takes few lines. What is the answer? Edited by author 26.07.2007 08:00 the answer is: aaaabbbbaaaa This test I got true but I have WA4!!! |
WA 3 | Ignat Zakrevsky | 1354. Палиндром. Он же палиндром | 9 ноя 2007 14:07 | 3 |
WA 3 Ignat Zakrevsky 8 ноя 2007 18:43 3th test is AbabaAab AbabaAababA !!!!!! I Use this solution and got AC var n,i,j,k,f,r:longint; s,s2:ansistring; el:char; function prov(f,n:longint):boolean; var i,j:longint; begin prov:=true; i:=f+1; j:=n-1; while i<j do begin if s[i]<>s[j] then begin prov:=false; exit; end; i:=i+1; j:=j-1; end; end; begin readln(s); write(s); n:=length(s); if n=1 then begin write(s[1]); halt; end; el:=s[n]; if prov(1,n) then r:=1; for f:=2 to (n-r) do if s[f]=el then if prov(f,n) then begin for i:=(f-1) downto 1 do write(s[i]); Halt; end; i:=n-1; s:=s+s[i]; n:=n+1; write(s[n]); while not prov(1,n) do begin i:=i-1; s:=s+s[i]; n:=n+1; write(s[n]); end; halt; end. Edited by author 09.11.2007 13:00 Re: WA 3 Ignat Zakrevsky 9 ноя 2007 14:07 |
What is WA31? | azamat_ | 1354. Палиндром. Он же палиндром | 19 окт 2007 20:25 | 1 |
|
I wrote a simple algor, but i have WA5... | VALERO | 1354. Палиндром. Он же палиндром | 29 мар 2007 03:44 | 5 |
I want to take TL not WA ^) In what problem? All Tests on this forum i have already tested. Thanks for your help. Try test "A" - answer "AA" Thanks to all. I did it ^) Edited by author 02.10.2006 03:25 I have the same answer to this test, but I still WA5... Any tricks? When input data is already a palindrom you must change it. |
Time Limit Exceed on test 25.Why?Help me. | AKKAA | 1354. Палиндром. Он же палиндром | 8 фев 2007 00:15 | 3 |
Send your solution to snipious@mail.ru, I'll try to help ypu!!! May be your solution O(2 * N * N). I think it is uncorrect algoritm. |
WA #20 | Samurai | 1354. Палиндром. Он же палиндром | 8 фев 2007 00:13 | 2 |
WA #20 Samurai 14 ноя 2006 10:00 Have somebody wrong answer on this test? Yes. If length of (S1S2 % 2) == 0. My answer was S1. |
WA | rohit | 1354. Палиндром. Он же палиндром | 17 янв 2007 03:28 | 1 |
WA rohit 17 янв 2007 03:28 I keep getting WA#4 for this problem. I read all the threads and tried all the test data. I get correct answer for all the test data on my computer but not on the judge. On one of the threads it was given that test 4 has test data: 2101221012 I got the answer as 210122101221012 but I still get WA#4. Can anyone help me?? |
What can I use the KMP algorithm for ? | Dilyan | 1354. Палиндром. Он же палиндром | 28 авг 2006 12:50 | 4 |
not only in this problem. what can i use the KMP algorithm for? what kind of problems can i solve? You can try to solve Ural-1269. The problem is very difficult, use Aho-Corasik algo which is a modification of KMP for several substrings. And there are several problems I solved via finite automatons, in some of them you can use KMP. As for this very problem (Ural-1354) - O(N^2) solution is OK :) I'd like to know the solution to 1269. I use something I'd call trie-graph, and it works very well for 1158, but it takes up too much memory. Could you teach me the modified version of the KMP algo, or give me a link? As Dmitry Kovalioff stated before, O(N^2) solution works just fine. I found out empirically that 16 millions of operations fit just fine in one second. By the way, what was the jury idea? Was it really a trap task (seems hard with prefix functions, but quite simple with a little DP)? Or it's simply the time limit turned out to be too big? |
Finnishly I've got it | PSV | 1354. Палиндром. Он же палиндром | 19 авг 2006 14:34 | 3 |
There is a quite stupid algorithm, but You must to take maximum input value increase a bit. I change 10000 on 20000 an got AC! It's quite strange :( About two hour in this night a spend to check this bug :( 1 AC of 56. I am appove of you. I used STL string and had not such problem. Let admins check input data. PSV, add to your nickname [UPML KNU]. Edited by author 18.08.2006 20:23 |
I have WA#14. Can anyone help me? | Zubyk Taras(Khmelnitsky) | 1354. Палиндром. Он же палиндром | 28 май 2006 13:45 | 1 |
Help me, please. I shall be very grateful. HELP!!!!!!!!!!!!!!!! |
Hint for everybody who has WA #7 | Maxim Korchyomkin | 1354. Палиндром. Он же палиндром | 3 фев 2006 15:40 | 2 |
Try this test: a Right answer is: aa - Good luck. Thanx, this helped me very much! |
NUDELMAN VUNSH works(-) | Akshin Salimov | 1354. Палиндром. Он же палиндром | 1 фев 2006 02:19 | 1 |
Edited by author 01.02.2006 02:20 |
MGL | Ulzii_MGL | 1354. Палиндром. Он же палиндром | 23 янв 2006 14:20 | 1 |
MGL Ulzii_MGL 23 янв 2006 14:20 For test 'aba' right answer is 'ababa' 'saaasaaas'-> 'saaasaaasaaas' 'aa'->'aaa' 'babab'->'bababab' 'a'->'aa' Good luck! Edited by author 24.01.2006 15:42 |
In what a mistake? | matkir_ssau | 1354. Палиндром. Он же палиндром | 2 янв 2006 02:08 | 3 |
type kir=array[1..10000] of char; var m:kir; y,u,t,e,q,i,w:longint; r,ch:char; f2,f1:text; begin assign(f1,'input.txt'); reset(f1); i:=0; read(f1,r); while r in ['a'..'z','A'..'Z','0'..'9'] do begin inc(i); m[i]:=r; read(f1,r); end; close(f1); q:=i; w:=q div 2; for i:=q-1 downto w do begin u:=0; for e:=1 to q-i do begin if m[i-e]=m[i+e] then inc(u) else break; end; if (u>t) and (e=q-i) then begin t:=u;y:=i;end; end; if t<>0 then begin u:=y-t-1; for i:=1 to u do m[q+i]:=m[u-i+1]; q:=q+u; end else begin for i:=1 to q do m[q+i-1]:=m[q-i+1]; q:=q*2-1; end; i:=1; assign(f2,'output.txt'); rewrite(f2); while i<=q do begin write(f2,m[i]); inc(i); end; close(f2); end. Не надо использовать : assign(f2,'output.txt'); rewrite(f2); и тому подобное. И потом мне кажется тест вида AAA не пройдет!!!. And It seems to me is not necessary to write in Russian. |
Please help, how to read 10000 characters??? | Madiyar Tursunbayev | 1354. Палиндром. Он же палиндром | 28 дек 2005 21:36 | 3 |
read(f1,r); while r in ['a'..'z','A'..'Z','0'..'9'] do begin inc(i); m[i]:=r; read(f1,r); end; |
Help!!! WA!!! | <:=#|^ A∑∫C U∫U ^|#=:> ∫@μυη ∂(νι©τ¤®) | 1354. Палиндром. Он же палиндром | 4 ноя 2005 11:38 | 1 |
Help!!! WA!!! <:=#|^ A∑∫C U∫U ^|#=:> ∫@μυη ∂(νι©τ¤®) 4 ноя 2005 11:38 My code: ----------------------------------------------------------- program Task; {$APPTYPE CONSOLE} { Task #1354 } var s1: AnsiString; s2: AnsiString; function IsPalindrom(S: AnsiString): Boolean; var i: integer; begin IsPalindrom := True; for i := 1 to length(S) div 2 do if S[i] <> S[length(S) - i + 1] then begin IsPalindrom := False; break; end; end; function Revert(S: AnsiString): AnsiString; var i: integer; t: AnsiString; begin t := ''; for i := 1 to length(S) do t := t + S[length(s) - i + 1]; Revert := t; end; var i: integer; stop: boolean; begin Readln(s1); stop := false; i := 2; while not stop and (i <= length(s1)) do begin if IsPalindrom(Copy(s1,i,length(s1) - i + 1)) then begin s2 := Revert(Copy(s1,1,i - 1)); stop := true; end else inc(i); end; writeln(s1 + s2); end. ----------------------------------------------------------- I get Wrong Answer, but I think that my solution all right. WHY?? [Sorry for my bad English] P.S. AnsiString can consist 10000 symbols Edited by author 04.11.2005 11:40 |
HELP!!! WA4!! | test_programs | 1354. Палиндром. Он же палиндром | 6 июн 2005 02:44 | 2 |
{Why?} var S: string; ns: String; i: integer; j: integer; function Palindrom(st: string): boolean; var i: integer; b: boolean; begin b:=true; i:=1; while (i<=length(s) div 2) and b do begin if st[i]<>st[length(st)-i+1] then b:=false; inc(i); end; Palindrom:=b; end; function Revert(st: string): string; var temp: string; i: integer; begin temp:=''; for i:=length(st) downto 1 do temp:=temp+st[i]; revert:=temp; end; begin readln(s); i:=0; for j:=length(s)-2 downto 1 do if palindrom(Copy(s,j,length(s)-j+1)) then i:=j; if i=0 then begin ns:=Revert(Copy(s,1,length(s)-1)); writeln(s+ns); end else if i=1 then writeln(s+Copy(s,2,length(s)-1)) else begin ns:=Revert(Copy(s,1,i-1)); writeln(s+ns); end; end. 111 answer: 1111 do this massiv (read char) |