Show all threads Hide all threads Show all messages Hide all messages |
WA 25 test | D4nick | 1354. Palindrome. Again Palindrome | 15 May 2023 21:51 | 1 |
WpKRwvgKenn output shold be "WpKRwvgKenneKgvwRKpW" not "WpKRwvgKennneKgvwRKpW" |
For those, who has WA4, WA7. | Alibi | 1354. Palindrome. Again Palindrome | 10 Apr 2022 18:29 | 4 |
WA4: s1 is already palindrome. ex: aba ababa WA7: s1 consist of only one character. ex: a aa |
if you have WA12 or WA20 try this tests | D4nick | 1354. Palindrome. Again Palindrome | 25 Nov 2020 01:37 | 1 |
abbb answer: abbba abbbb answer: abbbba Edited by author 25.11.2020 01:48 Edited by author 25.11.2020 01:50 |
To those who are solving this using hashing/kmp | guilty spark | 1354. Palindrome. Again Palindrome | 28 Sep 2020 21:05 | 1 |
An easy and simple o(n) solution exists. pretty basic |
WA8 but passes ALL tests in discussion | Ulugbek#& | 1354. Palindrome. Again Palindrome | 6 Apr 2020 13:16 | 2 |
has anybody got WA8 too? I tried all tests in forum but it didn't help :( Be careful when you implement Manacher's algorithm, when you copy the ready part for the second part, don't forget making all the needed changes, I forgot changing just one sign ! |
do you know what test 12 is? | STAVASD | 1354. Palindrome. Again Palindrome | 1 Apr 2020 19:22 | 4 |
once I've solved this exercise, but know a vontto make my algorithm better. I've forced whith WA#12. Could you tell me this test? I've solved it!!))) if you have the same problem, try test: 1233345333 ansver: 12333453335433321 |
If you WA#5 using hashing... | Myrcella | 1354. Palindrome. Again Palindrome | 22 Jun 2019 18:41 | 1 |
It may be caused by conflicts... (Sorry for my poor English |
Maybe this will help you! | niabbf | 1354. Palindrome. Again Palindrome | 12 Feb 2019 19:14 | 5 |
I've been wa on this case for a long time: abaabaaba The right answer is abaabaabaaba Can anyone please suggest the test case which might give me WA35... I have used string , also tried with character array... and KMP algorithm ..... please do reply Edited by author 27.08.2018 13:31 Aren't 'abaabaaba' a palindrome? |
For everyone who has WA7 | olpetOdessaONU [1 2/3] | 1354. Palindrome. Again Palindrome | 23 Apr 2018 13:46 | 4 |
Try this test: a Your output should be: aa Good luck! Thank you! You is good man! |
What? | Rabbit Girl ♥ | 1354. Palindrome. Again Palindrome | 22 Dec 2017 13:19 | 1 |
What? Rabbit Girl ♥ 22 Dec 2017 13:19 |
I'm not sure that input string's len less or equal 10k (WA25) | achpile | 1354. Palindrome. Again Palindrome | 27 Jul 2017 16:20 | 1 |
I had WA25 when used char[20002]; After changed to char[30002] got AC. |
No subject | JamesBond_007 | 1354. Palindrome. Again Palindrome | 22 Nov 2016 09:50 | 1 |
Help me WA4? #include <iostream> #include <string> #include <string.h> #include <algorithm> using namespace std; string S, ss, s; int k, l, r, mid; int main(){ cin >> S; int n = S.size(); if(n == 1){ cout << S; return 0; } for (int i = n - 1; i >= 0; i --){ k = n - i; if(i - k >= 0){ ss = S.substr(i, k); s = S.substr(i - k, k); reverse(s.begin(), s.end()); //cout << ss << ' ' << s << endl; if(ss == s){ l = i - k; mid = i; r = i + k; continue; } } k --; if(i - k >= 0){ ss = S.substr(i + 1, k); s = S.substr(i - k, k); reverse(s.begin(), s.end()); //cout << ss << ' ' << s << endl; if(ss == s){ l = i - k; mid = i; r = i + k; } } } //cout << l << ' ' << r << endl; if(!l && !r || (l == 0 && r == n - 1)){ s = S.substr(0, n - 1); cout << S; reverse(s.begin(), s.end()); cout << s; } else{ s = S.substr(0, l); reverse(s.begin(), s.end()); cout << S << s; } return 0; } |
WA 19 | Nairi | 1354. Palindrome. Again Palindrome | 5 Nov 2016 17:58 | 1 |
WA 19 Nairi 5 Nov 2016 17:58 Hello, I've not found a topic about this test. Does anyone know what is it? I'm just searching from the half of the string to find where can be the center of a palindom. Thank you |
Giving WA #35 | paarth | 1354. Palindrome. Again Palindrome | 24 Jul 2016 09:35 | 3 |
Can anyone please suggest the test case which might give me WA35... I have used string , also tried with character array... and KMP algorithm ..... please do reply My solution was rejudged and I got WA 35 :) They added tests against hashes modulo 2^64. |
WHAT IS WA#4 | Buni_Real | 1354. Palindrome. Again Palindrome | 6 Jun 2016 00:17 | 7 |
ADMINSTRATOR HELP PLEASE !!!!!!!!!!!! IT'S MY COD var a:array [1..20010] of char; i,j,k,n,w:integer; r:char; s:string; f:boolean; g:text; t:integer; procedure solve; label 1; var e:integer; begin f:=false; t:=0; for k:=1 to n+i do if (a[k]<>a[n+i-k+1]) then goto 1; f:=true; 1: end; {IMPORTANT PART} Begin assign(g,'input.txt'); reset(g); while not eof(g) do begin readln(g,s); n:=0; for i:=1 to length(s) do begin n:=n+1; a[n]:=s[i]; end; i:=0; repeat solve; if not(f) then begin i:=i+1; for j:=n+i downto n+1 do begin a[j]:=a[j-1]; end; a[n+1]:=a[i]; solve; end; until f; end; // close(g); for j:=1 to n+i do write(a[j]); readln;readln; end. REAL MADRID LUCK THE BEST CLUB Me too!!! program Ural1354; var s:string; a,b,l:longint; begin readln(s); l:=length(s); a:=1; while a<l do begin if s[a]<>s[l] then begin s:=s+' '; for b:=length(s) downto l+2 do s[b]:=s[b-1]; inc(l); s[l]:=s[a]; end; inc(a);dec(l); end; writeln(s); end. You are to find a nonempty word S2 if the input is palindrome... Test#4 abaabaaba ans: abaabaaba //for WA4, because S2 must be not empty! abaabaabaaba //for AC Edited by author 25.11.2011 17:57 I have the same answer, but still get WA4. What the problem? That's not the answer my friend. This is correct: abaabaaba abaababaaba As you see, your solution add three characters. Mine add only two. Greetings! nope, you should print S1 S2, as you see in your answer there is not clearly S1 |
WA4 | b2soft | 1354. Palindrome. Again Palindrome | 5 Oct 2015 05:35 | 1 |
WA4 b2soft 5 Oct 2015 05:35 Tested with already palindrome (as said before), any ideas? For input: aba it will write: ababa and for: abba -> abbabba |
Does anyone tried this problem with Hashing?? | reinier | 1354. Palindrome. Again Palindrome | 17 Jun 2015 19:30 | 2 |
I've tried this problem with hashing but I get WA on test 12. Anyone else has tried this with Hashing?? or even better get AC Yeah, got AC with hashing :) Edited by author 17.06.2015 19:31 |
WA 5 | Aaa Ppp | 1354. Palindrome. Again Palindrome | 23 Jul 2014 19:13 | 3 |
WA 5 Aaa Ppp 3 Mar 2012 08:33 Hi, Does anyone know what the test case is? I've tried my solution against the following, and they seem to be correct. A little lost right now. "No", "OnLine", "AbabaAab", "abaabaaba", "2101221012", "122212221", "A", "AA", "aba", "saaasaaas", "babab" Solutions ========= NoN OnLineniLnO AbabaAababA abaabaabaaba 210122101221012 1222122212221 AA AAA ababa saaasaaasaaas bababab Thanks! Edited by author 03.03.2012 08:35 Re: WA 5 Kommander [SESC UrFU] 23 Jul 2014 19:13 try test qwertew Answer is qwertewetrewq or not qwertewq |
For Haskell programmers: '\r' character in input | b108 | 1354. Palindrome. Again Palindrome | 8 Jan 2014 21:53 | 1 |
I have WA#1 but algo was right. I use this construction: import qualified Data.ByteString.Char8 as C8 ... input <- C8.getLine C8.putStr $ result input ---------- But I have always WA#1. At my PC (Linux) I have right answers. then i tried: input' <- C8.getLine let input = if (C8.index input' (-1 + C8.length input')) == '\r' then C8.init input' else input' -------- So, i removed last character '\r' from line if it exists. And after this my code was accepted! |
WA9 | Mamuka Sakhelashvili [Freeuni] | 1354. Palindrome. Again Palindrome | 9 Dec 2013 01:44 | 1 |
WA9 Mamuka Sakhelashvili [Freeuni] 9 Dec 2013 01:44 Could you tell me what is test N9? |