Buggy python submission (verdict: Time Limit Exceeded):
hlist = list(str(input()))
ch = 0
hh = 0
f = 0 #홍수구역인지 아닌지 판단
s = 0
slist = []
chlist = []
for i in range(len(hlist)):
    if (hlist[i] == '/'):
        ch += 1
    elif (hlist[i] == '\\' ):
        ch -= 1
    chlist.append(ch)
ch = 0
for i in range(len(hlist)):
    if (hlist[i] == '/'):
        ch += 1
    elif (hlist[i] == '\\' ):
        ch -= 1
    
    if (hh > max(chlist[i:])):
        hh = max(chlist[i:])
    elif (ch > hh):
        hh = ch
    elif (ch < hh):
        f = 1
    elif (ch == hh and chlist[i] == chlist[i-1] + 1):
        f = 0
        s += 1/2
        slist.append(s)
    
    if (f == 1):
        if (hlist[i] == '/'):
            s += (hh - ch + 1/2)
        elif (hlist[i] == '\\'):
            s += (hh - ch - 1/2)
        elif (hlist[i] == '_'):
            s += (hh - ch)
    elif (f == 0):
        s = 0

print(int(sum(slist)))
if len(slist) != 0:
    print(len(slist), end = ' ')
else:
    print(len(slist), end = '')
for i in range(len(slist)):
    if (i == len(slist) - 1):
        print(int((slist[i])), end = '')
    else:
        print(int((slist[i])), end = ' ')
print()


Fixed submission:
s=j=0
a=[];b=[];d=[]
for i,x in enumerate(input()):
    if x=='\\':a+=[i]
    elif x=='/' and a:
        j=a.pop()
        c=i-j;s+=c
        while b and b[-1]>j:c+=d.pop();b.pop()
        b+=[j];d+=[c]
print(s)
print(len(b),*(d))

Buggy python submission (verdict: Time Limit Exceeded):
hlist = list(str(input()))
ch = 0
hh = 0
f = 0 #홍수구역인지 아닌지 판단
s = 0
slist = []
chlist = []
for i in range(len(hlist)):
    if (hlist[i] == '/'):
        ch += 1
    elif (hlist[i] == '\\' ):
        ch -= 1
    chlist.append(ch)
for i in range(len(hlist)):
    ch = chlist[i]
    
    if (hh > max(chlist[i:])):
        hh = max(chlist[i:])
    elif (ch > hh):
        hh = ch
    elif (ch < hh):
        f = 1
    elif (ch == hh and chlist[i] == chlist[i-1] + 1):
        f = 0
        s += 1/2
        slist.append(s)
    
    if (f == 1):
        if (hlist[i] == '/'):
            s += (hh - ch + 1/2)
        elif (hlist[i] == '\\'):
            s += (hh - ch - 1/2)
        elif (hlist[i] == '_'):
            s += (hh - ch)
    elif (f == 0):
        s = 0

print(int(sum(slist)))
if len(slist) != 0:
    print(len(slist), end = ' ')
else:
    print(len(slist), end = '')
for i in range(len(slist)):
    if (i == len(slist) - 1):
        print(int((slist[i])), end = '')
    else:
        print(int((slist[i])), end = ' ')
print()


Fixed submission:
s=j=0
a=[];b=[];d=[]
for i,x in enumerate(input()):
    if x=='\\':a+=[i]
    elif x=='/' and a:
        j=a.pop()
        c=i-j;s+=c
        while b and b[-1]>j:c+=d.pop();b.pop()
        b+=[j];d+=[c]
print(s)
print(len(b),*(d))

Buggy python submission (verdict: Time Limit Exceeded):
hlist = list(str(input()))
ch = 0
hh = 0
f = 0 #홍수구역인지 아닌지 판단
s = 0
slist = []
chlist = [0]
for i in range(len(hlist)):
    if (hlist[i] == '/'):
        ch += 1
    elif (hlist[i] == '\\' ):
        ch -= 1
    chlist.append(ch)
for i in range(len(hlist)):
    ch = chlist[i+1]
    d = ch - chlist[i]
    if (hh > max(chlist[i+1:])):
        hh = max(chlist[i+1:])
    elif (ch > hh):
        hh = ch
    elif (ch < hh):
        s += ((hh - ch) + d * 0.5)
    elif (ch == hh and chlist[i+1] == chlist[i] + 1):
        f = 0
        s += 1/2
        slist.append(s)
        s = 0


print(int(sum(slist)))
if len(slist) != 0:
    print(len(slist), end = ' ')
else:
    print(len(slist), end = '')
for i in range(len(slist)):
    if (i == len(slist) - 1):
        print(int((slist[i])), end = '')
    else:
        print(int((slist[i])), end = ' ')
print()


Fixed submission:
s=j=0
a=[];b=[];d=[]
for i,x in enumerate(input()):
    if x=='\\':a+=[i]
    elif x=='/' and a:
        j=a.pop()
        c=i-j;s+=c
        while b and b[-1]>j:c+=d.pop();b.pop()
        b+=[j];d+=[c]
print(s)
print(len(b),*(d))

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
hlist = list(str(input()))
ch = 0
hh = 0
f = 0 #홍수구역인지 아닌지 판단
s = 0
slist = deque()
chlist = [0]
for i in range(len(hlist)):
    if (hlist[i] == '/'):
        ch += 1
    elif (hlist[i] == '\\' ):
        ch -= 1
    chlist.append(ch)
for i in range(len(hlist)):
    ch = chlist[i+1]
    d = ch - chlist[i]
    if (hh > max(chlist[i+1:])):
        hh = max(chlist[i+1:])
    elif (ch > hh):
        hh = ch
    elif (ch < hh):
        s += ((hh - ch) + d * 0.5)
    elif (ch == hh and chlist[i+1] == chlist[i] + 1):
        f = 0
        s += 1/2
        slist.append(int(s))
        s = 0


print(int(sum(slist)))
if len(slist) != 0:
    print(len(slist), end = ' ')
else:
    print(len(slist), end = '')
print(*slist)


Fixed submission:
s=j=0
a=[];b=[];d=[]
for i,x in enumerate(input()):
    if x=='\\':a+=[i]
    elif x=='/' and a:
        j=a.pop()
        c=i-j;s+=c
        while b and b[-1]>j:c+=d.pop();b.pop()
        b+=[j];d+=[c]
print(s)
print(len(b),*(d))