Submission #487172


Source Code Expand

sentence = raw_input().split()

def A():
    flag = 0
    num = 0
    N = len(sentence)
    for i in range(N):
        if sentence[N-1-i] != 'not':
            flag = 1
            num = 0
        elif sentence[N-1-i] == 'not' and flag == 1:
            if num == 0:
                num = 1
            elif num == 1:
                num = 0
                flag = 0
                del sentence[N-1-i]
                del sentence[N-1-i]
                return True
                break
    
    return False

while A():
    pass

ans = ""
for i in range(len(sentence)):
    if i == len(sentence)-1:
        ans = ans + sentence[i]
    else:
        ans = ans + sentence[i] + ' '

print ans

Submission Info

Submission Time
Task A - 二重否定除去法則
User tsb2b
Language Python (2.7.3)
Score 100
Code Size 727 Byte
Status AC
Exec Time 61 ms
Memory 3504 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 19
Set Name Test Cases
All scrambled_00.txt, scrambled_01.txt, scrambled_02.txt, scrambled_03.txt, scrambled_04.txt, scrambled_05.txt, scrambled_06.txt, scrambled_07.txt, scrambled_08.txt, scrambled_09.txt, scrambled_10.txt, scrambled_11.txt, scrambled_12.txt, scrambled_13.txt, scrambled_14.txt, scrambled_15.txt, scrambled_16.txt, scrambled_17.txt, scrambled_18.txt
Case Name Status Exec Time Memory
scrambled_00.txt AC 54 ms 3380 KB
scrambled_01.txt AC 54 ms 3364 KB
scrambled_02.txt AC 53 ms 3388 KB
scrambled_03.txt AC 56 ms 3384 KB
scrambled_04.txt AC 53 ms 3380 KB
scrambled_05.txt AC 59 ms 3376 KB
scrambled_06.txt AC 55 ms 3504 KB
scrambled_07.txt AC 59 ms 3384 KB
scrambled_08.txt AC 61 ms 3308 KB
scrambled_09.txt AC 53 ms 3328 KB
scrambled_10.txt AC 55 ms 3376 KB
scrambled_11.txt AC 55 ms 3308 KB
scrambled_12.txt AC 54 ms 3380 KB
scrambled_13.txt AC 55 ms 3376 KB
scrambled_14.txt AC 55 ms 3380 KB
scrambled_15.txt AC 55 ms 3384 KB
scrambled_16.txt AC 55 ms 3380 KB
scrambled_17.txt AC 56 ms 3384 KB
scrambled_18.txt AC 55 ms 3384 KB