You are not logged in. Please login at www.codechef.com to post your questions!

×

# PETERSEN - Editorial

 4 My solution passed even though my code outputs "5050" for AAAA. Weak TCs? Solution Link answered 24 Nov '14, 00:35 3.4k●19●43●77 accept rate: 16% I missed that "lexicographically least" part completely, but fortunately no problem... (24 Nov '14, 05:52)
 1 Submitted over 10 times, tried covering all corner cases, still couldn't resolve the NZEC error, any leads? Any test cases to fail the code? http://ideone.com/0buFbJ (I put the code in ideone after the contest, hence not violating any rules) answered 24 Nov '14, 00:24 3★djvdm123 73●4 accept rate: 0% The NZEC might be due to stack overflow. Try a bottom-up approach without any recursion. (24 Nov '14, 14:43) @nisargshah95: I tried AAAA....(5000 times) to check for stack overflow on ideone, runs perfectly fine, guess that's not it. @kostya_by: any thoughts? Could you provide test cases used now that the contest is over? (24 Nov '14, 23:33) djvdm1233★
 0 I have a dp solution which is not getting submitted (WA). I've input many test cases and it is working fine for all of them. Approach: Since we know the letters, we just need to know whether it is taken from the inner or the outer ring. Let 1: outer ring, 2: inner ring dp1[i] = 2 tells that we are now at outer ring(1) and previous node was in the inner ring(2). Similar is the case of dp2[i]. So considering consecutive letters if they are same, we are switching levels dp2[i] = 1; dp1[i] = 2; if the modular difference between the two node is 1 we have moved in the outer ring dp1[i] = 1; if it is 2 we have moved in the inner ring dp2[i] = 2; dpX values are set only if previous nodes are reachable ie dpX[i-1] != -1 Later, the path is calculated by tracing back from dp1[n] and dp2[n] considering the letter at each position.  Order is checked only by the first node. Its giving correct answer for cases like "AAAA"(0505), "ABBECCD"(0169723), "D"(3), "AAB"(501), "AAAB"(0501). What am I missing? Code link: http://pastebin.com/RZhn0rmb answered 24 Nov '14, 04:31 37●3 accept rate: 33% pastebin.com, really? Why? (24 Nov '14, 05:13) I did not understand your approach with modular arithmetic thing, for example difference AA is 5, difference AD is 3... Your submitted code returns for 2 AABD AABE  only -1  http://ideone.com/p3WaH5 (24 Nov '14, 05:35)
 0 Hi during the testing I created list of basic test cases: http://ideone.com/lyXFvH Solution is @Shashwat.delhi's I just modified it such, that when line starts with '#' I print this line and continue with next - it's easier to navigate in test cases then... answered 24 Nov '14, 05:45 16.9k●49●115●225 accept rate: 11%
 0 Hi, I considered as two graphs one as outer and other as inner. There can by only one path after that we can determine after examining 1st three vertices in the string.Can someone please help me to find out where i am missing? here is my solution link: http://www.codechef.com/viewsolution/5452717 answered 24 Nov '14, 12:06 21●2 accept rate: 0% I have checked for all corner cases..My solution passed all test cases generated by betlista.. Could somebody help me where i am missing? Or provide the test cases used for evaluation? (25 Nov '14, 11:53)
 0 Please tell where does my code fails..... http://ideone.com/mBo1iD I have tried all corner cases. answered 26 Nov '14, 03:08 11●1 accept rate: 0% try: 1 CEA  (26 Nov '14, 03:40)
 0 Hii everybody.. m getting RTE(sigabrt) plz give me a test case 4 dis. answered 28 Nov '14, 15:43 1●1 accept rate: 0%
 0 Hi, I still can't access the tester and setter's solutions. Please help. On clicking the links, the following message is shown: This XML file does not appear to have any style information associated with it. The document tree is shown below. answered 06 Jan '15, 19:51 3★esemzv 21●2 accept rate: 0%
 0 Access denied to setter and tester solution answered 25 Mar '15, 20:46 415●1●14 accept rate: 8%
 -1 @djvdm123 First of all please mark your solutions secret or private on ideone from next time to avoid plagiarism answered 24 Nov '14, 00:35 85●2●9 accept rate: 0% 4 Well secret doesn't work (read the contest rules again) and if he made his solution private, he couldn't link it here... LOGIC (24 Nov '14, 00:38) xellos07★ 3 The ideone snippet was created after the contest ended, so it shouldn't be a problem. (24 Nov '14, 00:38)
 toggle preview community wiki:
Preview

### Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×15,852
×1,191
×513
×374
×54
×36

question asked: 24 Nov '14, 00:04

question was seen: 5,802 times

last updated: 29 Nov '18, 20:38