Submission #40859376


Source Code Expand




### copy below### 
def run():
    N = int(input())
    S = str(input())
    left = 0
    right = 0
    ans = -1
    flag = False
    while(right < N):
        if(S[right] == '-'):
            if(flag and left != right - 1):
                ans = max(ans,right - 1 - left)
            elif(not flag ):
                flag = True
                if(left != right):
                    ans = max(ans,right - left)
                
            left = right
        right+=1
    if(left!=right - 1 and flag): 
        ans = max(ans , right - left - 1)
    return ans
print(run())

Submission Info

Submission Time
Task C - Dango
User tamtam484
Language Python (3.8.2)
Score 300
Code Size 605 Byte
Status AC
Exec Time 62 ms
Memory 9404 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 29
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_small_03.txt, 01_small_04.txt, 01_small_05.txt, 01_small_06.txt, 01_small_07.txt, 02_random_08.txt, 02_random_09.txt, 02_random_10.txt, 02_random_11.txt, 02_random_12.txt, 02_random_13.txt, 02_random_14.txt, 02_random_15.txt, 02_random_16.txt, 03_handmade_17.txt, 03_handmade_18.txt, 03_handmade_19.txt, 03_handmade_20.txt, 03_handmade_21.txt, 03_handmade_22.txt, 03_handmade_23.txt, 03_handmade_24.txt, 03_handmade_25.txt, 03_handmade_26.txt, 03_handmade_27.txt, 03_handmade_28.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 24 ms 8868 KiB
00_sample_01.txt AC 19 ms 8876 KiB
00_sample_02.txt AC 17 ms 9024 KiB
01_small_03.txt AC 23 ms 9028 KiB
01_small_04.txt AC 17 ms 8928 KiB
01_small_05.txt AC 24 ms 8888 KiB
01_small_06.txt AC 17 ms 9104 KiB
01_small_07.txt AC 17 ms 9028 KiB
02_random_08.txt AC 54 ms 9184 KiB
02_random_09.txt AC 42 ms 9160 KiB
02_random_10.txt AC 50 ms 9136 KiB
02_random_11.txt AC 30 ms 9124 KiB
02_random_12.txt AC 29 ms 9064 KiB
02_random_13.txt AC 27 ms 9004 KiB
02_random_14.txt AC 18 ms 9124 KiB
02_random_15.txt AC 27 ms 9140 KiB
02_random_16.txt AC 40 ms 9036 KiB
03_handmade_17.txt AC 31 ms 9120 KiB
03_handmade_18.txt AC 25 ms 8976 KiB
03_handmade_19.txt AC 24 ms 9200 KiB
03_handmade_20.txt AC 39 ms 9208 KiB
03_handmade_21.txt AC 38 ms 9292 KiB
03_handmade_22.txt AC 49 ms 9156 KiB
03_handmade_23.txt AC 38 ms 9288 KiB
03_handmade_24.txt AC 62 ms 9404 KiB
03_handmade_25.txt AC 39 ms 9140 KiB
03_handmade_26.txt AC 35 ms 9068 KiB
03_handmade_27.txt AC 34 ms 9016 KiB
03_handmade_28.txt AC 30 ms 9036 KiB