# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
161847 | boolodifjenula | Imena (COCI16_imena) | Cpython 3 | 27 ms | 3468 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
N=int(input())
S=input()
S+=" "
p=0
z=0
for i in range(len(S)):
#print(p)
if i==0 and S[i] in "QWERTZUIOPASDFGHJKLYXCVBNM" or p==0 and S[i] in "QWERTZUIOPASDFGHJKLYXCVBNM" and S[i-1]==" ":
p=1
continue
if p==1 and S[i]==" ":
z+=1
p=0
if p==1 and S[i] in "!?." and S[i+1]==" ":
p=0
print(z+1)
z=0
continue
if p==0 and S[i] in "!?." and S[i+1]==" ":
print(z)
z=0
continue
if p==1 and bool(S[i] in "qwertzuiopasdfghjklyxcvbnm!?.")==0:
p=0
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |