#799. RGB咒语T2
RGB咒语T2
No submission language available for this problem.
题目描述
表示的三种颜色为三原色。
蜗牛老师发现,只要是一串由组成的字符串都包含有颜色能量,这种能量能让学生在参加CSP的时候,获得超能力。
现在蜗牛老师会给你一个只有字符组成的字符串,这个字符串的能量值与某些三元组有关。
如果存在三元组,满足两两互不相等,且 ,每个三元组就代表1个能量值,现在蜗牛老师想知道,对于给定的字符串,一共有多少能量值
输入格式
第一行一个整数。
第二行一个字符串。
输出格式
一行一个整数,表示你的答案
样例数据
input
4
RRGB
output
1
三元组(1,3,4)满足
样例数据
input
39
RBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB
output
1800
数据规模与约定
20% 数据保证
60% 数据保证
100% 数据保证
时间限制:
空间限制:
Background
Special for beginners, ^_^
Description
Given two integers x and y, print the sum.
Format
Input
Two integers x and y, satisfying .
Output
One integer, the sum of x and y.
Samples
123 500
623
Limitation
1s, 1024KiB for each test case.