Submission #19459138


Source Code Expand

Copy
N = int(input())
S = input()
ans = 0

for i in range(N-1):
  a = S[:i+1]
  b = S[i+1:]
  
  count = 0
  for j in range(26):
    x = chr(97+j) in a
    y = chr(97+j) in b
    
    count += x * y
  
  ans = max(ans, count)
  
print(ans)

Submission Info

Submission Time
Task B - Cut and Count
User kju
Language Python (3.8.2)
Score 200
Code Size 251 Byte
Status AC
Exec Time 25 ms
Memory 9128 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 25
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All sample_01.txt, sample_02.txt, sample_03.txt, sample_01.txt, sample_02.txt, sample_03.txt, subtask_1_01.txt, subtask_1_02.txt, subtask_1_03.txt, subtask_1_04.txt, subtask_1_05.txt, subtask_1_06.txt, subtask_1_07.txt, subtask_1_08.txt, subtask_1_09.txt, subtask_1_10.txt, subtask_1_11.txt, subtask_1_12.txt, subtask_1_13.txt, subtask_1_14.txt, subtask_1_15.txt, subtask_1_16.txt, subtask_1_17.txt, subtask_1_18.txt, subtask_1_19.txt
Case Name Status Exec Time Memory
sample_01.txt AC 19 ms 9084 KB
sample_02.txt AC 19 ms 9088 KB
sample_03.txt AC 18 ms 8868 KB
subtask_1_01.txt AC 23 ms 8976 KB
subtask_1_02.txt AC 19 ms 8972 KB
subtask_1_03.txt AC 17 ms 9012 KB
subtask_1_04.txt AC 25 ms 8868 KB
subtask_1_05.txt AC 23 ms 9088 KB
subtask_1_06.txt AC 23 ms 8876 KB
subtask_1_07.txt AC 24 ms 8868 KB
subtask_1_08.txt AC 18 ms 9084 KB
subtask_1_09.txt AC 24 ms 8872 KB
subtask_1_10.txt AC 19 ms 8952 KB
subtask_1_11.txt AC 19 ms 8876 KB
subtask_1_12.txt AC 19 ms 8868 KB
subtask_1_13.txt AC 22 ms 9008 KB
subtask_1_14.txt AC 18 ms 8868 KB
subtask_1_15.txt AC 19 ms 8976 KB
subtask_1_16.txt AC 24 ms 8872 KB
subtask_1_17.txt AC 22 ms 8964 KB
subtask_1_18.txt AC 20 ms 8996 KB
subtask_1_19.txt AC 20 ms 9128 KB