Show all threads Hide all threads Show all messages Hide all messages |
Page 4 |
WA 25 test | D4nick | 1354. Palindrome. Again Palindrome | 15 May 2023 21:51 | 1 |
WpKRwvgKenn output shold be "WpKRwvgKenneKgvwRKpW" not "WpKRwvgKennneKgvwRKpW" |
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 ! |
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 |
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 |
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 |
Page 3 |
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 |
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 |
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? |
CE what is my code problem ? | Aliaga Shirinov | 1354. Palindrome. Again Palindrome | 26 Nov 2013 13:58 | 1 |
#include <iostream> #include <vector> #include <math.h> #include <cstdio> #include <algorithm> #include <string> using namespace std; int main() { long long m,h = 0,i,t,l,n,f; string a,s; cin >> a; s = a; for(i = a.length()-1 ;i >= 0 ;i--) s[h] = a[i],h++; f = s.length()-2; i = 0; n = f; while(n >= 1 && m != 0) { t = n; m = 0; while(i <= n - (n / 2) - 1) { if(s[i] != s[t]) { m = 1; break; } i++; t--; } n--; i = 0; } if(m == 0) n++; for(i = 0 ;i < a.length() ;i++) cout << a[i]; for(i = n + 1 ;i < s.length() ;i++) cout << s[i]; cout << endl; return 0; } |
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 |
!!!!!help!!!!! WA #20 | STAVASD | 1354. Palindrome. Again Palindrome | 17 Mar 2013 02:54 | 4 |
Could anyone tell me test #20? Try: No = NoN Noo = NooN Nooo = NoooN Also, make sure you cater for: t = tt tt = ttt ttt = tttt (can't just add an empty string) Thanks, this helped me!! :) Edited by author 17.03.2013 03:17 |
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. |
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? |
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 |