Saleh127

Untitled

Apr 12th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. int main()
  5. {
  6. ll b,c=0,i,j,k;
  7. string a;
  8. cin>>b;
  9. cin>>a;
  10. for(i=0;i<b;i++)
  11. {
  12. for(j=i+1;j<b;j++)
  13. {
  14. for(k=j+1;k<b;k++)
  15. {
  16. if(a[i]!=a[j] && a[i]!=a[k] && a[j]!=a[k] && (j-i)!=(k-j))
  17. {
  18. c++;
  19. }
  20. }
  21. }
  22. }
  23. printf("%lld\n",c);
  24. return 0;
  25. }
Add Comment
Please, Sign In to add comment