|
|
back to boardShow all messages Hide all messagesthis input help me pass test #3 lossiblossible lossible answ: ______lossible Thanks, this test help me too))), but now i have TLE on test5 TL5 RedRick [TSOGU] 2 Nov 2009 09:24 I use hash, but I have TL#5 too, how I can pass this test? help me. Re: TL5 RedRick [TSOGU] 2 Nov 2009 18:12 Yes! finally I got AC =) may it help somebody: look attentively on this code for (int i = 0;i<strlen(s);i++) { ... } and this int l = strlen(s); for (int i = 0;i<l;i++) { ... } Edited by author 02.11.2009 18:12 Edited by author 02.11.2009 18:14 are you sure this is test 3 ? perhaps i can't really understand the description because it works just fine but it always breaks on test 3... can someone help with these intervals or... i don't know give some tests to try abcx abcxx abcxx abc abcx abc x My programm gives answ "I HAVE FAILED!!!" for test abcx abcxx abcxx abc abcx abc x Is it rigth answer??? sorry.i found my mistake.Now i have wa7 And what is now your answer for a test? And check may be you put a trailling space at the end... Why the answer for the input lossiblossible lossible is ______lossible instead of lossibl______e ? Edited by author 05.03.2016 04:02 Edited by author 05.03.2016 04:03 Lucas Lustosa Madureira, No. Edited by author 20.06.2016 20:59 s = input() sl = input().split() result = '' _delete = lambda ls: ''.join({' ': ' '}.get(lc, '_') for lc in ls) def delete(ls): global s, result try: pos = s.index(ls) except: print('I HAVE FAILED!!!') exit() result += _delete(s[:pos]) s = s[pos:] result += ls s = s[len(ls):] is_first = True for ls in sl: if is_first: is_first = False else: delete(' ') delete(ls) print(result+_delete(s)) It's WA3 too Edited by author 20.06.2016 20:58 |
|
|