roz.cpp: In function 'int main()':
roz.cpp:25:19: warning: array subscript has type 'char' [-Wchar-subscripts]
    else D[str[i+1]] = max(D[str[i+1]]-1,-1);
                   ^
roz.cpp:25:37: warning: array subscript has type 'char' [-Wchar-subscripts]
    else D[str[i+1]] = max(D[str[i+1]]-1,-1);
                                     ^
roz.cpp:26:19: warning: array subscript has type 'char' [-Wchar-subscripts]
    A[i] = D[str[i]];
                   ^
roz.cpp:27:41: warning: array subscript has type 'char' [-Wchar-subscripts]
    if (str[i]!=a) res = max(res,D[str[i]]-1);
                                         ^
roz.cpp:33:19: warning: array subscript has type 'char' [-Wchar-subscripts]
    else D[str[i-1]] = max(D[str[i-1]]-1,-1);
                   ^
roz.cpp:33:37: warning: array subscript has type 'char' [-Wchar-subscripts]
    else D[str[i-1]] = max(D[str[i-1]]-1,-1);
                                     ^
roz.cpp:34:47: warning: array subscript has type 'char' [-Wchar-subscripts]
    if (str[i]!=a) res = max({res,A[i]+D[str[i]]-1,D[str[i]]-1});
                                               ^
roz.cpp:34:59: warning: array subscript has type 'char' [-Wchar-subscripts]
    if (str[i]!=a) res = max({res,A[i]+D[str[i]]-1,D[str[i]]-1});
                                                           ^
roz.cpp:13:16: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&n);
                ^
roz.cpp:14:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%s",str);
                 ^