Submission #63013943


Source Code Expand

Copy
s=list(input())
l,r=0,1
while(r!=len(s)):
if(s[l]=='W' and s[r]=='A'):
s[l]='A'
s[r]='C'
if(l!=0):
while(s[l-1]=='W'):
l-=1
r-=1
s[l]='A'
s[r]='C'
if(l==0):
break
l+=1
r+=1
print(*s,sep=(''))
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
s=list(input())

l,r=0,1

while(r!=len(s)):
    if(s[l]=='W' and s[r]=='A'):
        s[l]='A'
        s[r]='C'
        if(l!=0):
            while(s[l-1]=='W'):
                l-=1
                r-=1
                s[l]='A'
                s[r]='C'
                if(l==0):
                    break
    l+=1
    r+=1

print(*s,sep=(''))

Submission Info

Submission Time
Task C - Debug
User gomaazarasi
Language Python (PyPy 3.10-v7.3.12)
Score 300
Code Size 361 Byte
Status AC
Exec Time 100 ms
Memory 115532 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 30
Set Name Test Cases
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt
Case Name Status Exec Time Memory
example_00.txt AC 54 ms 76560 KB
example_01.txt AC 56 ms 76288 KB
example_02.txt AC 54 ms 76668 KB
hand_00.txt AC 90 ms 95364 KB
hand_01.txt AC 98 ms 115388 KB
hand_02.txt AC 89 ms 95644 KB
hand_03.txt AC 95 ms 115532 KB
hand_04.txt AC 54 ms 76284 KB
hand_05.txt AC 54 ms 76612 KB
hand_06.txt AC 97 ms 105732 KB
random_00.txt AC 94 ms 97784 KB
random_01.txt AC 95 ms 97424 KB
random_02.txt AC 91 ms 95640 KB
random_03.txt AC 91 ms 96408 KB
random_04.txt AC 93 ms 96176 KB
random_05.txt AC 100 ms 107376 KB
random_06.txt AC 96 ms 105952 KB
random_07.txt AC 95 ms 101872 KB
random_08.txt AC 94 ms 101688 KB
random_09.txt AC 96 ms 105968 KB
random_10.txt AC 92 ms 96888 KB
random_11.txt AC 96 ms 105044 KB
random_12.txt AC 95 ms 100380 KB
random_13.txt AC 92 ms 100144 KB
random_14.txt AC 94 ms 106636 KB
random_15.txt AC 97 ms 111468 KB
random_16.txt AC 98 ms 113144 KB
random_17.txt AC 95 ms 108336 KB
random_18.txt AC 90 ms 98192 KB
random_19.txt AC 93 ms 103276 KB


2025-03-24 (Mon)
14:10:44 +00:00