×

# Can anyone help me with A Few Laughing Men from ACM-ICPC Asia-Amritapuri Onsite Replay Contest 2017 ?

 0 Hello friends can someone tell me how to approach this problem ? I am getting WA. Here is my latest submission. If it's too messy, here is the approach I used : for __ in range(readInt()): n = readInt() arr = readInts() brr = readInts() last,f,count = -1,1,0 for i in range(n): if arr[i]==1 and last==-1: last = brr[i] elif arr[i]==1: if last<=brr[i]: last = brr[i] else: count+=1 if count>1: f = 0 break if f: print "#laughing_arjun" else: print "#itsnot_arjun"  asked 02 May '18, 18:40 318●1●10 accept rate: 1% 1 The seq should be strictly increasing,secondly consider this case 1 1 1 1 1 5 3 4 (02 May '18, 20:42) But the code is working correctly for the above test case and as far as strictly increasing series is considered I agree with you. (02 May '18, 21:43)

 1 One hint is that think about the removal of elements. Spoiler below View Content answered 02 May '18, 23:17 6★sdssudhu 1.1k●3●10 accept rate: 15% Got it . Thanks :) (03 May '18, 10:59)
 toggle preview community wiki:
Preview

By Email:

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:

×2,719
×2,363
×1,110
×1,070
×356

question asked: 02 May '18, 18:40

question was seen: 273 times

last updated: 03 May '18, 10:59