buggy_code stringlengths 11 625k | fixed_code stringlengths 17 625k | bug_type stringlengths 2 4.45k | language int64 0 8 | token_count int64 5 200k |
|---|---|---|---|---|
#include <iostream>
//#include <set>
//#include <map>
//#include <iomanip>
//#include <algorithm>
//#include <numeric>
//#include <queue>
//#include <stack>
//#include <math.h>
//#include <vector>
#include <string>
//#include <list>
//#include <deque>
//#include <unordered_map>
typedef long long LL;
// typedef long dou... | #include <iostream>
//#include <set>
//#include <map>
//#include <iomanip>
//#include <algorithm>
//#include <numeric>
//#include <queue>
//#include <stack>
//#include <math.h>
//#include <vector>
#include <string>
//#include <list>
//#include <deque>
//#include <unordered_map>
typedef long long LL;
// typedef long dou... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 233 |
// C
#include <cassert>
#include <ccomplex>
#include <cctype>
#include <cerrno>
#include <cfenv>
#include <cfloat>
#include <cinttypes>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdalign>
#include <cstdarg>
#include <cstdbool>
#include <cs... | // C
#include <cassert>
#include <ccomplex>
#include <cctype>
#include <cerrno>
#include <cfenv>
#include <cfloat>
#include <cinttypes>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdalign>
#include <cstdarg>
#include <cstdbool>
#include <cs... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 571 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
string S;
cin >> N >> S;
long long num_r = 0, num_g = 0, num_b = 0;
for (int i = 0; i < N; i++) {
if (S[i] == 'R') {
num_r++;
} else if (S[i] == 'G') {
num_g++;
} else {
num_b++;
}
}
// i < j <
int al... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
string S;
cin >> N >> S;
long long num_r = 0, num_g = 0, num_b = 0;
for (int i = 0; i < N; i++) {
if (S[i] == 'R') {
num_r++;
} else if (S[i] == 'G') {
num_g++;
} else {
num_b++;
}
}
long long all = num... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 201 |
#include <bits/stdc++.h>
using namespace std;
#define FASTIO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define rep(... | #include <bits/stdc++.h>
using namespace std;
#define FASTIO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define rep(... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 227 |
def main():
n = int(input())
s = input()
r,g,b = 0,0,0
for i in s:
if i == 'r': r += 1
elif i == 'g': g += 1
elif i == 'b': b += 1
ans = r*g*b
for j in range(n):
for i in range(j):
k = j+(j-i)
if k < n:
if s[i] == s[j] or s... |
def main():
n = int(input())
s = input()
r,g,b = 0,0,0
for i in s:
if i == 'R': r += 1
elif i == 'G': g += 1
elif i == 'B': b += 1
ans = r*g*b
for j in range(n):
for i in range(j):
k = j+(j-i)
if k < n:
if s[i] == s[j] or s... | [["-", 8, 196, 0, 57, 15, 666, 0, 557, 0, 6], ["+", 8, 196, 0, 57, 15, 666, 0, 557, 0, 6], ["-", 0, 57, 75, 665, 15, 666, 0, 557, 0, 6], ["+", 0, 57, 75, 665, 15, 666, 0, 557, 0, 6]] | 5 | 150 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string str;
int i, j, k, N, ans, Rn = 0, Gn = 0, Bn = 0;
cin >> N >> str;
for (i = 0; i < N; i++) {
if (str.at(i) == 'R')
Rn++;
if (str.at(i) == 'G')
Gn++;
if (str.at(i) == 'B')
Bn++;
}
ans = Rn * Gn * Bn;
for (j = ... | #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
int i, j, k, N;
long long ans, Rn = 0, Gn = 0, Bn = 0;
cin >> N >> str;
for (i = 0; i < N; i++) {
if (str.at(i) == 'R')
Rn++;
if (str.at(i) == 'G')
Gn++;
if (str.at(i) == 'B')
Bn++;
}
ans = Rn * Gn * Bn;
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 224 |
n = int(input())
s = input()
nr = s.count("R")
ng = s.count("G")
nb = s.count("B")
count = nr * ng * nb
for i in range(n-3):
for j in range(i+1, (n+i+1)//2):
if s[i] == s[j]:continue
else:
k = 2*j - i # k - j = j - i
if s[i] == s[k]:continue
if s[j] == s[k]:con... | n = int(input())
s = input()
nr = s.count("R")
ng = s.count("G")
nb = s.count("B")
count = nr * ng * nb
for i in range(n-2):
for j in range(i+1, (n+i+1)//2):
if s[i] == s[j]:continue
else:
k = 2*j - i # k - j = j - i
if s[i] == s[k]:continue
if s[j] == s[k]:con... | [["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 133 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
int numR = 0, numG = 0, numB = 0;
string S;
uint64_t ans = 0;
cin >> N;
cin >> S;
for (int i = 0; i < N; i++) {
if (S[i] == 'R')
numR++;
if (S[i] == 'G')
numG++;
if (S[i] == 'B')
numB++;
}
ans = numR * num... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
int numR = 0, numG = 0, numB = 0;
string S;
uint64_t ans = 0;
cin >> N;
cin >> S;
for (int i = 0; i < N; i++) {
if (S[i] == 'R')
numR++;
if (S[i] == 'G')
numG++;
if (S[i] == 'B')
numB++;
}
ans = numR * num... | [["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 48], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 108]] | 1 | 202 |
//#include <bits/stdc++.h>
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
////////////////////////////////////////////////////////////////
int main(void) {
int N;
cin >> N;
string S;
cin >> S;
vector<int> s_int(N, -1);
ll r_num = 0, g_num = 0, b_num = 0;
for (int i = 0; i < N; i++) ... | //#include <bits/stdc++.h>
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
////////////////////////////////////////////////////////////////
int main(void) {
int N;
cin >> N;
string S;
cin >> S;
vector<int> s_int(N, -1);
ll r_num = 0, g_num = 0, b_num = 0;
for (int i = 0; i < N; i++) ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 277 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
cin >> n;
cin >> s;
int sa, sb, sc;
sa = 0;
sb = 0;
sc = 0;
s = " " + s;
for (int i = 1; i <= n; i++) {
if (s[i] == 'R')
sa++;
if (s[i] == 'G')
sb++;
if (s[i] == 'B')
sc++;
}
long long an... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
cin >> n;
cin >> s;
long long sa, sb, sc;
sa = 0;
sb = 0;
sc = 0;
s = " " + s;
for (int i = 1; i <= n; i++) {
if (s[i] == 'R')
sa++;
if (s[i] == 'G')
sb++;
if (s[i] == 'B')
sc++;
}
long l... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 208 |
#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);
#define MAXN 4003
#define ll long long
#define ii pair<int, int>
#define vi vector<int>
#define vii vector<ii>
#define si set<int>
#define pb push_back
#define SZ(v) int(v.size())
#define FORINT(i, m, n) for (int i = m; i < n; i++)
#define FOR(i, n) FORIN... | #include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);
#define MAXN 4003
#define ll long long
#define ii pair<int, int>
#define vi vector<int>
#define vii vector<ii>
#define si set<int>
#define pb push_back
#define SZ(v) int(v.size())
#define FORINT(i, m, n) for (int i = m; i < n; i++)
#define FOR(i, n) FORIN... | [["-", 36, 36, 36, 36, 0, 30, 0, 43, 49, 22], ["-", 36, 36, 36, 36, 0, 30, 0, 43, 0, 21], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 0, 35], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 78], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 49, 22]] | 1 | 461 |
// Copyright © 2020 Diego Garcia Rodriguez del Campo. All rights reserved.
#include <bits/stdc++.h>
#define MAX 200005
#define optimiza_io \
cin.tie(0); \
ios_base::sync_with_stdio(0);
#defin... | // Copyright © 2020 Diego Garcia Rodriguez del Campo. All rights reserved.
#include <bits/stdc++.h>
#define MAX 200005
#define optimiza_io \
cin.tie(0); \
ios_base::sync_with_stdio(0);
#defin... | [["-", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 78]] | 1 | 277 |
#include <bits/stdc++.h>
#define REP(i, a, b) for (long long i = a; i <= b; ++i)
#define ll long long
#define N 4010
using namespace std;
ll a, b, c, n, m, ans, num;
char s[N];
inline ll read() {
ll s = 0, w = 1;
char ch = getchar();
for (; ch < '0' || ch > '9'; ch = getchar())
w *= ch == '-' ? -1 : 1;
fo... | #include <bits/stdc++.h>
#define REP(i, a, b) for (long long i = a; i <= b; ++i)
#define ll long long
#define N 4010
using namespace std;
ll a, b, c, n, m, num;
char s[N];
inline ll read() {
ll s = 0, w = 1;
char ch = getchar();
for (; ch < '0' || ch > '9'; ch = getchar())
w *= ch == '-' ? -1 : 1;
for (; ... | [["-", 36, 36, 36, 36, 0, 30, 0, 43, 49, 22], ["-", 36, 36, 36, 36, 0, 30, 0, 43, 0, 21], ["-", 0, 7, 8, 57, 64, 1, 0, 27, 28, 22], ["+", 0, 7, 8, 57, 64, 1, 0, 27, 28, 22]] | 1 | 328 |
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
// Begin Header {{{
#define all(x) (x).begin(), (x).end()
#define lli long long int
#define rep(i, n) for (int i = 0; i < n; i++)
#define loop(i, j, n) for (int i = j; i < n; i++)
using name... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
// Begin Header {{{
#define all(x) (x).begin(), (x).end()
#define lli long long int
#define rep(i, n) for (int i = 0; i < n; i++)
#define loop(i, j, n) for (int i = j; i < n; i++)
using name... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 78]] | 1 | 200 |
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int main() {
int n;
string s;
cin >> n >> s;
int r = 0, g = 0, b = 0;
for (char c : s) {
if (c == 'R')
r++;
else if (c == 'G')
g++;
else
b++;
}
LL res = r * g * b;
for (int i = 0; i < n; i++) {
for (i... | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int main() {
int n;
string s;
cin >> n >> s;
LL r = 0, g = 0, b = 0;
for (char c : s) {
if (c == 'R')
r++;
else if (c == 'G')
g++;
else
b++;
}
LL res = r * g * b;
for (int i = 0; i < n; i++) {
for (in... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 38], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 13]] | 1 | 180 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
int main() {
int n, ans = 1;
string s;
cin >> n >> s;
vector<int> co(3, 0);
rep(i, n) {
if (s.at(i) == 'R')
co[0]++;
if (s.at(i) == 'G')
co[1]++;
if (s.at(i) == 'B')
co[2]++;
}
rep(i, ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
int main() {
long long n, ans = 1;
string s;
cin >> n >> s;
vector<int> co(3, 0);
rep(i, n) {
if (s.at(i) == 'R')
co[0]++;
if (s.at(i) == 'G')
co[1]++;
if (s.at(i) == 'B')
co[2]++;
}
r... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 224 |
n=int(input())
s=input()
count=0
r_list=[]
g_list=[]
b_list=[]
for i in range(len(s)):
if s[i]=="R":
r_list.append(i)
elif s[i]=="G":
g_list.append(i)
elif s[i]=="B":
b_list.append(i)
for i in range(1,len(s)-1):
if n%2==0:
if i<n//2:
for j in range(1,i+1):
... | n=int(input())
s=input()
count=0
r_list=[]
g_list=[]
b_list=[]
for i in range(len(s)):
if s[i]=="R":
r_list.append(i)
elif s[i]=="G":
g_list.append(i)
elif s[i]=="B":
b_list.append(i)
for i in range(1,len(s)-1):
if n%2==0:
if i<n//2:
for j in range(1,i+1):
... | [["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 444 |
N = int(input())
S = input()
ans, gap = S.count('R') * S.count('G') * S.count('B'), 1
while gap * 2 + 1 < N:
ans -= sum([1 for i in range(N - gap * 2)
if {'R', 'G', 'B'} == {S[i], S[i + gap], S[i + 2 * gap]}])
gap += 1
print(ans)
| N = int(input())
S = input()
ans, gap = S.count('R') * S.count('G') * S.count('B'), 1
while gap * 2 + 1 <= N:
ans -= sum([1 for i in range(N - gap * 2)
if {'R', 'G', 'B'} == {S[i], S[i + gap], S[i + 2 * gap]}])
gap += 1
print(ans)
| [["-", 36, 36, 0, 656, 0, 52, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 52, 15, 666, 667, 19]] | 5 | 117 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr int inf = 0x3f3f3f3f;
constexpr ll linf = 0x3f3f3f3f3f3f3f3fLL;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n;
cin >> n;
string s;
cin >> s;
int r = count(s.begin(), s.end(), 'R');
int g = count(s.begin(), s.e... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr int inf = 0x3f3f3f3f;
constexpr ll linf = 0x3f3f3f3f3f3f3f3fLL;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n;
cin >> n;
string s;
cin >> s;
ll r = count(s.begin(), s.end(), 'R');
ll g = count(s.begin(), s.end... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 231 |
n = int(input())
s = input()
count = {"R":0,"G":0,"B":0}
for c in s:
count[c] += 1
r,g,b = count.values()
ans = r*g*b
for i in range(1,(n-1)//2+1): #1から
for rgb in zip(s,s[i:],s[i*2:]): #rgbに連続した三つのリストの要素を入れ込む
if len(set(rgb)) == 3: #リストrgbをセットにまとめ、長さが
ans -=1 | n = int(input())
s = input()
count = {"R":0,"G":0,"B":0}
for c in s:
count[c] += 1
r,g,b = count.values()
ans = r*g*b
for i in range(1,(n-1)//2+1): #1から
for rgb in zip(s,s[i:],s[i*2:]): #rgbに連続した三つのリストの要素を入れ込む
if len(set(rgb)) == 3: #リストrgbをセットにまとめ、長さが
ans -=1
print(ans) | [["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 120 |
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <string>
#include <utility>
#include <vector>
typedef long long ll;
using namespace std;
int main(void) {
int n, i, j;
string s;
cin >> n >> s;
int r, g, b;
r = g = b ... | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <string>
#include <utility>
#include <vector>
typedef long long ll;
using namespace std;
int main(void) {
int n, i, j;
string s;
cin >> n >> s;
ll r, g, b;
r = g = b =... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 52, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 27, 28, 22]] | 1 | 237 |
#include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define ll unsigned long long int
#define pp long long int
#include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define ff first
#define ss second
#define file_se_input \
freop... | #include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define ll unsigned long long int
#define pp long long int
#include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define ff first
#define ss second
#define file_se_input \
freop... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 514 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(void) {
int N;
string S;
cin >> N;
cin >> S;
int r = 0, g = 0, b = 0;
for (int i = 0; i < N; i++) {
if (S[i] == 'R')
r++;
if (S[i] == 'G')
g++;
if (S[i] == 'B')
b++;
}
ll total = r * g * b;
for ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(void) {
int N;
string S;
cin >> N;
cin >> S;
ll r = 0, g = 0, b = 0;
for (int i = 0; i < N; i++) {
if (S[i] == 'R')
r++;
if (S[i] == 'G')
g++;
if (S[i] == 'B')
b++;
}
ll total = r * g * b;
for (... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 207 |
n = int(input())
s = str(input())
ans = s.count("R")*s.count("G")*s.count("B")
for i in range(n-2):
for j in range(i+1, n-1):
k = int(2*j -i )
if k <= n-1:
if s[i] != s[j] and s[k] != s[i] and s[i] != s[k]:
ans -= 1
print(ans) | n = int(input())
s = str(input())
ans = s.count("R")*s.count("G")*s.count("B")
for i in range(n-2):
for j in range(i+1, n-1):
k = int(2*j -i)
if k <= n-1:
if s[i] != s[j] and s[k] != s[i] and s[j] != s[k]:
ans -= 1
print(ans) | [["-", 0, 57, 15, 679, 12, 666, 0, 206, 206, 22], ["+", 0, 57, 15, 679, 12, 666, 0, 206, 206, 22]] | 5 | 123 |
#include <bits/stdc++.h>
using namespace std;
int n, i, j, r, b, g, ans;
string s;
int main() {
cin >> n;
cin >> s;
for (i = 0; i < s.size(); i++)
if (s[i] == 'R')
r++;
else if (s[i] == 'B')
b++;
else
g++;
ans = r * b * g;
for (i = 1; i <= n; i++)
for (j = i + 2; j <= n; j+... | #include <bits/stdc++.h>
using namespace std;
long long n, i, j, r, b, g, ans;
string s;
int main() {
cin >> n;
cin >> s;
for (i = 0; i < s.size(); i++)
if (s[i] == 'R')
r++;
else if (s[i] == 'B')
b++;
else
g++;
ans = r * b * g;
for (i = 1; i <= n; i++)
for (j = i + 2; j <=... | [["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 0, 30, 0, 43, 39, 86, 0, 96]] | 1 | 197 |
#include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
string s;
cin >> s;
vector<int> r;
vector<int> g;
vector<int> b;
for (int i = 0; i < n; ++i) {
if (s[i] == 'R')
... | #include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
string s;
cin >> s;
vector<int> r;
vector<int> g;
vector<int> b;
for (int i = 0; i < n; ++i) {
if (s[i] == 'R')
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 233 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int n;
string s;
cin >> n >> s;
int r = 0, g = 0, b = 0;
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
r++;
else if (s[i] == 'G')
g++;
else
b++;
}
int all = r * g * b;
int sub = 0;
for (int... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int n;
string s;
cin >> n >> s;
ll r = 0, g = 0, b = 0;
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
r++;
else if (s[i] == 'G')
g++;
else
b++;
}
ll all = r * g * b;
ll sub = 0;
for (int i ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 210 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
string s;
cin >> s;
vector<int> R, B, G;
for (int i = 0; i < n; i++) {
if (s[i] == 'R') {
R.push_back(i + 1);
} else if (s[i] == 'B') {
B.push_back(i + 1);
} else {
G.push_back(i + 1);
}
}
// f... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
string s;
cin >> s;
vector<int> R, B, G;
for (int i = 0; i < n; i++) {
if (s[i] == 'R') {
R.push_back(i + 1);
} else if (s[i] == 'B') {
B.push_back(i + 1);
} else {
G.push_back(i + 1);
}
}
long... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35]] | 1 | 256 |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
char[] c = sc.next().toCharArray();
int cR = 0;
int cG = 0;
int cB = 0;
for (int i = 0; i < n; i++) {
if (c[i] == 'R') {
cR++;
... | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
char[] c = sc.next().toCharArray();
long cR = 0;
long cG = 0;
long cB = 0;
for (int i = 0; i < n; i++) {
if (c[i] == 'R') {
cR++;
... | [["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]] | 3 | 261 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()
#define bit(x) (1L << (x))
using ll = long long;
using namespace std;
template <typename T> vector<T> make_v(size_t a, T b) {
return vector<T>(a, b);
}
template <typename... Ts> auto make_v(size_t a, Ts...... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()
#define bit(x) (1L << (x))
using ll = long long;
using namespace std;
template <typename T> vector<T> make_v(size_t a, T b) {
return vector<T>(a, b);
}
template <typename... Ts> auto make_v(size_t a, Ts...... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 386 |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
String[] S = sc.nextLine().split("");
sc.close();
long r = 0;
long g = 0;
long b = 0;
for (String s : S) {
if (s.equals("R")) {
r... | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
String[] S = sc.next().split("");
sc.close();
long r = 0;
long g = 0;
long b = 0;
for (String s : S) {
if (s.equals("R")) {
r++;
... | [["-", 0, 503, 49, 200, 51, 492, 500, 492, 141, 22], ["+", 0, 503, 49, 200, 51, 492, 500, 492, 141, 22]] | 3 | 256 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
string s;
cin >> N >> s;
int R = 0, G = 0, B = 0;
for (int i = 0; i < N; i++) {
if (s.at(i) == 'R') {
R++;
} else if (s.at(i) == 'G') {
G++;
} else {
B++;
}
}
int count = 0;
for (int i = 0; i < N - 2; ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
string s;
cin >> N >> s;
int64_t R = 0, G = 0, B = 0;
for (int i = 0; i < N; i++) {
if (s.at(i) == 'R') {
R++;
} else if (s.at(i) == 'G') {
G++;
} else {
B++;
}
}
int count = 0;
for (int i = 0; i < N -... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 216 |
#include <iostream>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using P = pair<int, int>;
#include <algorithm>
#include <map>
#include <math.h>
#include <queue>
int main() {
int n;
string s;
int rc(0), gc(0), bc(0);
cin >> n >> s;
rep(i, n) {
... | #include <iostream>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using P = pair<int, int>;
#include <algorithm>
#include <map>
#include <math.h>
#include <queue>
int main() {
ll n;
string s;
ll rc(0), gc(0), bc(0);
cin >> n >> s;
rep(i, n) {
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 225 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
int main() {
int n;
string s;
cin >> n >> s;
int r = 0, g = 0, b = 0;
rep(i, n) {
if (s[i] == 'R')
r++;
else if (s[i] == 'G')
g++;
else
b++;
}
long long ans = r * g * b;
rep(i, n... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
int main() {
int n;
string s;
cin >> n >> s;
long long r = 0, g = 0, b = 0;
rep(i, n) {
if (s[i] == 'R')
r++;
else if (s[i] == 'G')
g++;
else
b++;
}
long long ans = r * g * b;
re... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 179 |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int N;
string S;
cin >> N >> S;
int red = 0;
int blue = 0;
int green = 0;
for (int i = 0; i < N; i++) {
if (S[i] == 'R') {
red++;
} else if (S[i] == 'G') {
green++;
} else {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int N;
string S;
cin >> N >> S;
int red = 0;
int blue = 0;
int green = 0;
for (int i = 0; i < N; i++) {
if (S[i] == 'R') {
red++;
} else if (S[i] == 'G') {
green++;
} else {
... | [["+", 49, 50, 51, 16, 31, 16, 31, 74, 0, 24], ["+", 31, 16, 31, 74, 39, 77, 39, 86, 0, 96], ["+", 49, 50, 51, 16, 31, 16, 31, 74, 0, 25]] | 1 | 223 |
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#def... | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#def... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 278 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
string S;
cin >> S;
int R = 0;
int G = 0;
int B = 0;
long long sum = 0;
for (int i = 0; i < N; i++) {
if (S.at(i) == 'R') {
R = R + 1;
} else if (S.at(i) == 'G') {
G = G + 1;
} else {
B = B + 1;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
string S;
cin >> S;
long long R = 0;
long long G = 0;
long long B = 0;
long long sum = 0;
for (int i = 0; i < N; i++) {
if (S.at(i) == 'R') {
R = R + 1;
} else if (S.at(i) == 'G') {
G = G + 1;
} else {
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 267 |
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int N;
string S;
cin >> N;
cin >> S;
string R(1, 'R');
string G(1, 'G');
string B(1, 'B');
long int c, cm;
vector<int> r(0), g(0), b(0);
for (int i = 0; i < N; i++) {
if (S[i] == R[0]) {
r.push_back... | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int N;
string S;
cin >> N;
cin >> S;
string R(1, 'R');
string G(1, 'G');
string B(1, 'B');
unsigned int c, cm;
vector<int> r(0), g(0), b(0);
for (int i = 0; i < N; i++) {
if (S[i] == R[0]) {
r.push_... | [["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 87]] | 1 | 381 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
char S[N];
int r = 0;
int g = 0;
int b = 0;
for (int l = 0; l < N; l++) {
cin >> S[l];
if (S[l] == 'R') {
r++;
} else if (S[l] == 'G') {
g++;
} else {
b++;
}
}
long long ans = 0;
ans = ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
char S[N];
long long r = 0;
int g = 0;
int b = 0;
for (int l = 0; l < N; l++) {
cin >> S[l];
if (S[l] == 'R') {
r++;
} else if (S[l] == 'G') {
g++;
} else {
b++;
}
}
long long ans = 0;
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 228 |
n = int(input())
s = input()
r = s.count('R')
g = s.count('G')
b = s.count('B')
ans = r*g*b
for i in range(n):
for j in range(i+1, n):
if s[i] != s[j] and s[i] != s[int((i+j)/2)] and s[int((i+j)/2)] != s[j]:
ans -= 1
print(ans) | n = int(input())
s = input()
r = s.count('R')
g = s.count('G')
b = s.count('B')
ans = r*g*b
for i in range(n):
for j in range(i+2, n, 2):
if s[i] != s[j] and s[i] != s[int((i+j)/2)] and s[int((i+j)/2)] != s[j]:
ans -= 1
print(ans) | [["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]] | 5 | 126 |
#include <iostream>
#include <string>
using namespace std;
int main() {
int N;
string S;
cin >> N >> S;
// Count OKs
int Rs = 0;
int Gs = 0;
int Bs = 0;
for (int i = 0; i < N; i++) {
if (S[i] == 'R')
Rs++;
if (S[i] == 'G')
Gs++;
if (S[i] == 'B')
Bs++;
}
// Count NGs... | #include <iostream>
#include <string>
using namespace std;
int main() {
int N;
string S;
cin >> N >> S;
// Count OKs
long Rs = 0;
long Gs = 0;
long Bs = 0;
for (int i = 0; i < N; i++) {
if (S[i] == 'R')
Rs++;
if (S[i] == 'G')
Gs++;
if (S[i] == 'B')
Bs++;
}
// Count ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 224 |
import math
n = int(input())
s = input()
R, G, B = s.count("R"), s.count("G"), s.count("B")
ans = R * G * B
for i in range(n):
for j in range(n // 2):
c1 = i
c2 = i + j
c3 = i + j * 2
if c3 >= n: continue
if c1 == c2 == c3: continue
if s[c1] != s[c2] and s[c2] != s... | import math
n = int(input())
s = input()
R, G, B = s.count("R"), s.count("G"), s.count("B")
ans = R * G * B
for i in range(n):
for j in range(n):
c1 = i
c2 = i + j
c3 = i + j * 2
if c3 >= n: break
if c1 == c2 == c3: continue
if s[c1] != s[c2] and s[c2] != s[c3] and... | [["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 676], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["-", 8, 196, 0, 57, 64, 196, 0, 116, 0, 117], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94]] | 5 | 141 |
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(void) {
int N;
string s;
int r, g, b;
int i, j, k;
long long sum;
int ij;
r = 0;
g = 0;
b = 0;
cin >> N;
cin >> s;
for (i = 0; i < N; i++) {
if (s[i] == 'R') {
r++;
} else i... | #include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(void) {
int N;
string s;
long long r, g, b;
int i, j, k;
long long sum;
int ij;
r = 0;
g = 0;
b = 0;
cin >> N;
cin >> s;
for (i = 0; i < N; i++) {
if (s[i] == 'R') {
r++;
} ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]] | 1 | 294 |
// O7Oo7oO7O
#include <bits/stdc++.h>
#define IOS \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
using namespace std;
... | // O7Oo7oO7O
#include <bits/stdc++.h>
#define IOS \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
using namespace std;
... | [["-", 31, 16, 31, 23, 0, 74, 39, 77, 39, 40], ["+", 31, 16, 31, 23, 0, 74, 39, 77, 39, 78], ["-", 31, 16, 12, 23, 0, 74, 39, 77, 39, 40], ["+", 31, 16, 12, 23, 0, 74, 39, 77, 39, 78], ["-", 51, 16, 12, 23, 0, 74, 39, 77, 39, 40], ["+", 51, 16, 12, 23, 0, 74, 39, 77, 39, 78]] | 1 | 298 |
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
#define ll long long int
//#define d double
#define F first
#define S second
#define FastIO ios_base::sync_with_stdio(false), cin.tie(0)
#define fix std::fixed << setprecision(10)
const int M = 1e9 + 7;
#define f(n) for (int i = 0; i < n; i++)
#defin... | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
#define ll long long int
//#define d double
#define F first
#define S second
#define FastIO ios_base::sync_with_stdio(false), cin.tie(0)
#define fix std::fixed << setprecision(10)
const int M = 1e9 + 7;
#define f(n) for (int i = 0; i < n; i++)
#defin... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 703 |
#include <iostream>
#include <set>
#include <string>
int main() {
char a[4010];
int n;
std::cin >> n;
int r = 0, g = 0, b = 0;
for (int i = 1; i <= n; ++i) {
std::cin >> a[i];
if (a[i] == 'R')
++r;
else if (a[i] == 'G')
++g;
else if (a[i] == 'B')
++b;
}
long long int ... | #include <iostream>
#include <set>
#include <string>
int main() {
char a[4010];
int n;
std::cin >> n;
int r = 0, g = 0, b = 0;
for (int i = 1; i <= n; ++i) {
std::cin >> a[i];
if (a[i] == 'R')
++r;
else if (a[i] == 'G')
++g;
else if (a[i] == 'B')
++b;
}
long long int ... | [["+", 49, 50, 51, 16, 31, 16, 31, 16, 12, 13], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 48]] | 1 | 208 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll INF = 100000000;
#define rep(i, n) for (ll i = 0; i < (n); i++)
int main() {
ll n;
cin >> n;
string s;
cin >> s;
ll ans1 = 0, ans2 = 0, r = 0, g = 0, b = 0;
rep(i, n) {
if (s[i] == 'R')
r++;
i... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll INF = 100000000;
#define rep(i, n) for (ll i = 0; i < (n); i++)
int main() {
ll n;
cin >> n;
string s;
cin >> s;
ll ans1 = 0, ans2 = 0, r = 0, g = 0, b = 0;
rep(i, n) {
if (s[i] == 'R')
r++;
i... | [["+", 31, 16, 31, 16, 31, 23, 0, 16, 31, 22], ["+", 31, 16, 31, 16, 31, 23, 0, 16, 17, 18], ["+", 31, 16, 31, 16, 31, 23, 0, 16, 12, 22], ["+", 51, 16, 31, 16, 31, 16, 31, 23, 0, 25], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 17, 98], ["+", 51, 16, 31, 16, 31, 16, 12, 23, 0, 24]] | 1 | 226 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i < (n); ++i)
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int inf = 1001001001;
const int mod = 100000... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i < (n); ++i)
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int inf = 1001001001;
const int mod = 100000... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 679 |
/*D - RGB Triplets*/
#include <bits/stdc++.h>
using namespace std;
using Long = long long;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
string cad;
int tam;
cin >> tam >> cad;
vector<int> acumR(tam);
vector<int> acumG(tam);
vector<int> acumB(tam);
int ans = 0;
for (i... | /*D - RGB Triplets*/
#include <bits/stdc++.h>
using namespace std;
using Long = long long;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
string cad;
int tam;
cin >> tam >> cad;
vector<Long> acumR(tam);
vector<Long> acumG(tam);
vector<Long> acumB(tam);
Long ans = 0;
fo... | [["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 78], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 612 |
*,S = $<.read.split
X,Y,Z,t,a,b = [],[],[],0,S[0]
S.size.times {|i| if a == s=S[i]; X<<i elsif s == b||=s; Y<<i else Z<<i end }
[X,Y,Z].permutation {|x,y,z|
b,ys,zs,s = 0,y.size,z.size,S[z[0]]
x.each_with_index {|i,a|
k = z[c=0]
b += 1 until i < y[b] rescue break
b.upto(ys-1) {|b|
l = (j=y[b])*2... | *,S = $<.read.split
X,Y,Z,t,a,b = [],[],[],0,S[0]
S.size.times {|i| if a == s=S[i]; X<<i elsif s == b||=s; Y<<i else Z<<i end }
[X,Y,Z].permutation {|x,y,z|
b,ys,zs,s = 0,y.size,z.size,S[z[0]||0]
x.each_with_index {|i,a|
k = z[c=0]
b += 1 until i < y[b] rescue break
b.upto(ys-1) {|b|
l = (j=y[b]... | [["-", 36, 36, 36, 36, 0, 493, 0, 768, 0, 769], ["+", 36, 36, 36, 36, 0, 493, 0, 768, 0, 769]] | 4 | 73 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n) for (int i = 1; i <= n; i++)
typedef long long ll;
string t = "RGB";
int main() {
int n;
cin >> n;
string s;
cin >> s;
vector<vector<int>> v(3, vector<int>(n, 0));
vector<map<int, int>> mp(3);
r... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n) for (int i = 1; i <= n; i++)
typedef long long ll;
string t = "RGB";
int main() {
int n;
cin >> n;
string s;
cin >> s;
vector<vector<ll>> v(3, vector<ll>(n, 0));
vector<map<int, int>> mp(3);
rep... | [["-", 0, 77, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 77, 39, 344, 3, 347, 0, 77, 39, 78], ["-", 0, 2, 63, 346, 3, 347, 0, 77, 39, 40], ["+", 0, 2, 63, 346, 3, 347, 0, 77, 39, 78], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 379 |
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <s... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <s... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 533 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int n;
string s;
cin >> n >> s;
vector<vector<ll>> cnt(4, vector<ll>(n));
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
cnt[1][i]++, s[i] = 1;
if (s[i] == 'G')
cnt[2][i]++, s[i] = 2;
if (s[i] == 'B')
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int n;
string s;
cin >> n >> s;
vector<vector<ll>> cnt(4, vector<ll>(n));
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
cnt[1][i]++, s[i] = 1;
if (s[i] == 'G')
cnt[2][i]++, s[i] = 2;
if (s[i] == 'B')
... | [["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 25], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]] | 1 | 356 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int S;
cin >> S;
string N;
cin >> N;
int r = 0, g = 0, b = 0;
for (int i = 0; i < N.size(); i++) {
if (N.at(i) == 'R')
r++;
else if (N.at(i) == 'G')
g++;
else
b++;
}
int ans = r * g * b;
for (int i = 0; i < N.siz... | #include <bits/stdc++.h>
using namespace std;
int main() {
int S;
cin >> S;
string N;
cin >> N;
long long int r = 0, g = 0, b = 0;
for (int i = 0; i < N.size(); i++) {
if (N.at(i) == 'R')
r++;
else if (N.at(i) == 'G')
g++;
else
b++;
}
long long int ans = r * g * b;
for (... | [["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 217 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
string S;
cin >> N >> S;
int R = 0, G = 0, B = 0;
for (int i = 0; i < N; i++) {
if (S.at(i) == 'R')
R++;
else if (S.at(i) == 'G')
G++;
else
B++;
}
int64_t total = R * G * B;
for (int i = 0; i < N; i++) {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
string S;
cin >> N >> S;
int64_t R = 0, G = 0, B = 0;
for (int i = 0; i < N; i++) {
if (S.at(i) == 'R')
R++;
else if (S.at(i) == 'G')
G++;
else
B++;
}
int64_t total = R * G * B;
for (int i = 0; i < N; i++) {... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 203 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string str;
cin >> n >> str;
long long int r = 0, g = 0, b = 0;
for (int i = 0; i < n; i++) {
if (str[i] == 'R')
r++;
else if (str[i] == 'G')
g++;
else
b++;
}
long long int ans = r * g * b;
long long int... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string str;
cin >> n >> str;
long long int r = 0, g = 0, b = 0;
for (int i = 0; i < n; i++) {
if (str[i] == 'R')
r++;
else if (str[i] == 'G')
g++;
else
b++;
}
long long int ans = r * g * b;
long long int... | [["-", 0, 7, 15, 16, 12, 16, 31, 16, 12, 13], ["+", 0, 7, 15, 16, 12, 16, 31, 16, 12, 22]] | 1 | 204 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
cin >> n >> s;
long long int cnt = 0;
int r = 0, g = 0, b = 0;
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
r++;
if (s[i] == 'G')
g++;
if (s[i] == 'B')
b++;
}
long long int ans = r * g * b;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
cin >> n >> s;
long long int cnt = 0;
long long int r = 0, g = 0, b = 0;
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
r++;
if (s[i] == 'G')
g++;
if (s[i] == 'B')
b++;
}
long long int ans = r * ... | [["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 226 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
#define rep2(i, s, n) for (int i = s; i < n; ++i)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define tmax(a, b, c) max(a, max(b, c))
#define tmin(a, b, c) min(a, min(b, ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
#define rep2(i, s, n) for (int i = s; i < n; ++i)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define tmax(a, b, c) max(a, max(b, c))
#define tmin(a, b, c) min(a, min(b, ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 522 |
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
int n;
cin >> n;
string s;
cin >> s;
int sumr[n] = {}, sumg[n] = {}, sumb[n] = {};
if (s[0] == 'R') {
sumr[0] = 1;
sumg[0] = 0;
sumb[0] = 0;
}
if (s[0] == 'G') {
sumg[0] = 1;
sumr[0] = 0;
sumb[0... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
int n;
cin >> n;
string s;
cin >> s;
int sumr[n] = {}, sumg[n] = {}, sumb[n] = {};
if (s[0] == 'R') {
sumr[0] = 1;
sumg[0] = 0;
sumb[0] = 0;
}
if (s[0] == 'G') {
sumg[0] = 1;
sumr[0] = 0;
sumb[0... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 752 |
#include <bits/stdc++.h>
using namespace std;
int64_t pairs(string s, int n) {
int64_t sum = 0;
int64_t r = 0;
int64_t g = 0;
int64_t b = 0;
for (int i = 0; i < n; i++) {
if (s.at(i) == 'R') {
r++;
} else if (s.at(i) == 'G') {
g++;
} else if (s.at(i) == 'B') {
b++;
}
}
... | #include <bits/stdc++.h>
using namespace std;
int64_t pairs(string s, int n) {
int64_t sum = 0;
int64_t r = 0;
int64_t g = 0;
int64_t b = 0;
for (int i = 0; i < n; i++) {
if (s.at(i) == 'R') {
r++;
} else if (s.at(i) == 'G') {
g++;
} else if (s.at(i) == 'B') {
b++;
}
}
... | [["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72]] | 1 | 260 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long LL;
int main() {
int N;
cin >> N;
string S;
cin >> S;
int r = 0, g = 0, b = 0;
rep(i, N) {
if (S[i] == 'R')
r++;
if (S[i] == 'G')
g++;
if (S[i] == 'B')
b++;
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long LL;
int main() {
int N;
cin >> N;
string S;
cin >> S;
LL r = 0, g = 0, b = 0;
rep(i, N) {
if (S[i] == 'R')
r++;
if (S[i] == 'G')
g++;
if (S[i] == 'B')
b++;
}... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 197 |
N = int(input())
S = input()
R = S.count('R')
G = S.count('G')
B = N-R-G
ans = R*G*B
for d in range(1,N//2):
for i in range(N):
if i + d*2 >= N: break
a,b,c = S[i],S[i+d],S[i+d+d]
if a!=b and b!=c and c!=a:
ans -= 1
print(ans) | N = int(input())
S = input()
R = S.count('R')
G = S.count('G')
B = N-R-G
ans = R*G*B
for d in range(1,N//2+1):
for i in range(N):
if i + d*2 >= N: break
a,b,c = S[i],S[i+d],S[i+d+d]
if a!=b and b!=c and c!=a:
ans -= 1
print(ans) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 123 |
// -----------------------------------
// Author : MatsuTaku
// Country : Japan
// Created : 04/16/20 07:31:34
// -----------------------------------
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
int n;
cin >> n;
s... | // -----------------------------------
// Author : MatsuTaku
// Country : Japan
// Created : 04/16/20 07:31:34
// -----------------------------------
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
int n;
cin >> n;
s... | [["+", 49, 50, 51, 16, 31, 16, 31, 74, 0, 24], ["+", 51, 16, 31, 16, 31, 74, 39, 77, 39, 78], ["+", 49, 50, 51, 16, 31, 16, 31, 74, 0, 25]] | 1 | 224 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, s, n) for (int i = (s); i < (n); i++)
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
string s;
int n;
cin >> n >> s;
int r = 0, g = 0, b = 0;
rep(i, 0, n) {
if (s[i] == 'R')
r++;
if (s[i] == 'G')
g++;
if (s[i] =... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, s, n) for (int i = (s); i < (n); i++)
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
string s;
int n;
cin >> n >> s;
long long r = 0, g = 0, b = 0;
rep(i, 0, n) {
if (s[i] == 'R')
r++;
if (s[i] == 'G')
g++;
if (... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 222 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, s, n) for (int i = (s); i < (n); i++)
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
string s;
int n;
cin >> n >> s;
int r = 0, g = 0, b = 0;
rep(i, 0, n) {
if (s[i] == 'R')
r++;
if (s[i] == 'G')
g++;
if (s[i] =... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, s, n) for (int i = (s); i < (n); i++)
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
string s;
int n;
cin >> n >> s;
long long r = 0, g = 0, b = 0;
rep(i, 0, n) {
if (s[i] == 'R')
r++;
if (s[i] == 'G')
g++;
if (... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 236 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
cin >> n >> s;
int r = 0, g = 0, b = 0;
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
r++;
if (s[i] == 'G')
g++;
if (s[i] == 'B')
b++;
}
int ans = r * g * b;
for (int i = 0; i < n; i++) {
fo... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
cin >> n >> s;
long long r = 0, g = 0, b = 0;
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
r++;
if (s[i] == 'G')
g++;
if (s[i] == 'B')
b++;
}
long long ans = r * g * b;
for (int i = 0; i < n; i... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 196 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
const int INF = 1 << 30;
const ll LLINF = 1LL << 62;
int mod = 1000000007;
int main(void) {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int ans = 0;
int N;
cin >> N;
string S;
cin >> S... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
const int INF = 1 << 30;
const ll LLINF = 1LL << 62;
int mod = 1000000007;
int main(void) {
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll ans = 0;
int N;
cin >> N;
string S;
cin >> S;... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 403 |
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
const int INFint = 2e9 + 1;
const ll INFll = 2e18 + 1;
ll MOD = 1e9 + 7;
int main() {
int N;
string s;
cin >> N >> s;
int cntr(0), cntg(0), cntb(0);
for (int i(0); i < N; i++) {
if (s[i] == 'R')
cntr++;
if (s[i] == 'G')
... | #include <bits/stdc++.h>
using ll = long long;
using namespace std;
const int INFint = 2e9 + 1;
const ll INFll = 2e18 + 1;
ll MOD = 1e9 + 7;
int main() {
int N;
string s;
cin >> N >> s;
ll cntr(0), cntg(0), cntb(0);
for (int i(0); i < N; i++) {
if (s[i] == 'R')
cntr++;
if (s[i] == 'G')
c... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 234 |
n = int(input())
s = input()
ans = s.count("R") * s.count("G") * s.count("B")
cnt = 0
for i in range(n-3):
i_ = s[i]
for j in range(i+1, n-1):
if s[j] == i_: continue
k = 2 * j - i
j_ = s[j]
if k >= n or s[k] == i_ or s[k] == j_: continue
cnt += 1
print(ans - cnt) | n = int(input())
s = input()
ans = s.count("R") * s.count("G") * s.count("B")
cnt = 0
for i in range(n):
i_ = s[i]
for j in range(i+1, n):
if s[j] == i_: continue
k = 2 * j - i
j_ = s[j]
if k >= n or s[k] == i_ or s[k] == j_: continue
cnt += 1
print(ans - cnt) | [["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 125 |
#include <bits/stdc++.h>
using namespace std;
int main() {
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
int n;
cin >> n;
string s;
cin >> s;
int nr = 0;
int ng = 0;
int nb = 0;
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
nr++;
else if (s[i] == 'G')... | #include <bits/stdc++.h>
using namespace std;
int main() {
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
int n;
cin >> n;
string s;
cin >> s;
int nr = 0;
int ng = 0;
int nb = 0;
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
nr++;
else if (s[i] == 'G')... | [["+", 49, 50, 51, 16, 31, 16, 31, 16, 31, 13], ["+", 49, 50, 51, 16, 31, 16, 31, 16, 17, 48]] | 1 | 200 |
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<int, int>;
int main() {
int n;
cin >> n;
string s;
cin >> s;
int r = 0, g = 0, b = 0;
rep(i, n) {
if (s[i] == 'R')
... | #include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<int, int>;
int main() {
int n;
cin >> n;
string s;
cin >> s;
ll r = 0, g = 0, b = 0;
rep(i, n) {
if (s[i] == 'R')
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 226 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, x, n) for (int i = x; i < (n); i++)
#define all(n) begin(n), end(n)
struct cww {
cww() {
ios::sync_with_stdio(false);
cin.tie(0);
}
} star;
const long long INF = numeric_limits<long long>::max();
us... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, x, n) for (int i = x; i < (n); i++)
#define all(n) begin(n), end(n)
struct cww {
cww() {
ios::sync_with_stdio(false);
cin.tie(0);
}
} star;
const long long INF = numeric_limits<long long>::max();
us... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 333 |
n=int(input())
s=input()
r=s.count("R")
g=s.count("G")
b=s.count("B")
ans=r*g*b
for i in range(n):
for d in range(n):
j=i+d
k=j+d
if k>=n:
break
if s[i]!=s[j] & s[j]!=s[k] & s[k]!=s[i]:
ans-=1
print(ans) | n=int(input())
s=input()
r=s.count("R")
g=s.count("G")
b=s.count("B")
ans=r*g*b
for i in range(n):
for d in range(n):
j=i+d
k=j+d
if k>=n:
break
if (s[i]!=s[j]) & (s[j]!=s[k]) & (s[k]!=s[i]):
ans-=1
print(ans) | [["+", 0, 57, 15, 657, 31, 657, 31, 23, 0, 24], ["+", 0, 57, 15, 657, 31, 657, 31, 23, 0, 25], ["+", 0, 57, 15, 657, 31, 657, 12, 23, 0, 24], ["+", 0, 57, 15, 657, 31, 657, 12, 23, 0, 25], ["+", 8, 196, 0, 57, 15, 657, 12, 23, 0, 24], ["+", 8, 196, 0, 57, 15, 657, 12, 23, 0, 25]] | 5 | 120 |
N = int(input())
S = input()
r = S.count('R')
g = S.count('G')
b = S.count('B')
max = r * g * b
count = 0
for i in range(N-2):
for j in range(i+1, N-1):
k = 2 * j - i
if k > N - 1:
break
if S[i] != S[j] and S[j] != S[k] and S[i] == S[k]:
count += 1
print(max - count) | N = int(input())
S = input()
r = S.count('R')
g = S.count('G')
b = S.count('B')
max = r * g * b
count = 0
for i in range(N-2):
for j in range(i+1, N-1):
k = 2 * j - i
if k > N - 1:
break
if S[i] != S[j] and S[j] != S[k] and S[i] != S[k]:
count += 1
print(max - count) | [["-", 8, 196, 0, 57, 15, 679, 12, 666, 667, 60], ["+", 8, 196, 0, 57, 15, 679, 12, 666, 667, 79]] | 5 | 132 |
n = int(input())
str = input()
r = str.count('R')
g = str.count('G')
b = str.count('B')
sum = r * g * b
for i in range(n-2):
for j in range(i+1, n-1):
k = 2 * j - i
if k < n:
if str[i] == str[j] or str[i] == str[k] or str[j] == str[k] :
sum -= 1
print(sum) | n = int(input())
str = input()
r = str.count('R')
g = str.count('G')
b = str.count('B')
sum = r * g * b
for i in range(n-2):
for j in range(i+1, n-1):
k = 2 * j - i
if k < n:
if str[i] != str[j] and str[i] != str[k] and str[j] != str[k] :
sum -= 1
print(sum) | [["-", 0, 57, 15, 679, 31, 679, 31, 666, 667, 60], ["+", 0, 57, 15, 679, 31, 679, 31, 666, 667, 79], ["-", 64, 196, 0, 57, 15, 679, 31, 679, 17, 354], ["+", 64, 196, 0, 57, 15, 679, 31, 679, 17, 355], ["-", 0, 57, 15, 679, 31, 679, 12, 666, 667, 60], ["+", 0, 57, 15, 679, 31, 679, 12, 666, 667, 79], ["-", 0, 57, 64, 19... | 5 | 124 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<char> S(N);
int count_R = 0, count_G = 0, count_B = 0;
for (int i = 0; i < N; i++) {
cin >> S.at(i);
if (S.at(i) == 'R')
count_R++;
else if (S.at(i) == 'G')
count_G++;
else if (S.at(i) == 'B')
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<char> S(N);
long long count_R = 0, count_G = 0, count_B = 0;
for (int i = 0; i < N; i++) {
cin >> S.at(i);
if (S.at(i) == 'R')
count_R++;
else if (S.at(i) == 'G')
count_G++;
else if (S.at(i) == 'B')... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 25], ["+", 0, 57, 15, 339, 51, 16, 12, 23, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 12, 23, 0, 25]] | 1 | 291 |
n = int(input())
s = input()
kumikazu = s.count('R')*s.count('B')*s.count('G')
for i in range(n-2):
for j in range(i+1,n-1):
k = 2*j-i
if k >= n:
if (s[i] != s[j]) and (s[i] != s[k]) and (s[j] != s[k]):
kumikazu -= 1 | n = int(input())
s = input()
kumikazu = s.count('R')*s.count('B')*s.count('G')
for i in range(n-2):
for j in range(i+1, n-1):
k = 2*j-i
if k >= n:
break
if (s[i] != s[j]) and (s[i] != s[k]) and (s[j] != s[k]):
kumikazu -= 1
print(kumikazu)
| [["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 117 |
#include <iostream>
#include <string>
using namespace std;
/* 方針
* 条件1(S_i != S_j ...)を満たす組の数はR,G,Bの数をr,g,bとしたときrgb通りある
* 条件2(j-i != k-j)を満たさないもの
*
*
*/
int main() {
int n, i, j, k, r = 0, g = 0, b = 0, count = 0;
int sum = 0;
cin >> n;
char str[n];
cin >> str;
//各文字のカウント
for (i = 0; i < n; i++) {... | #include <iostream>
#include <string>
using namespace std;
/* 方針
* 条件1(S_i != S_j ...)を満たす組の数はR,G,Bの数をr,g,bとしたときrgb通りある
* 条件2(j-i != k-j)を満たさないもの
*
*/
int main() {
int n, i, j, k;
long int r = 0, g = 0, b = 0, count = 0, sum = 0;
cin >> n;
char str[n];
cin >> str;
//各文字のカウント
for (i = 0; i < n; i++)... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21]] | 1 | 229 |
/*▄███████▀▀▀▀▀▀███████▄
░▐████▀▒ЗАПУСКАЕМ▒▀██████▄
░███▀▒▒▒▒▒ДЯДЮ▒▒▒▒▒▒▀█████
░▐██▒▒▒▒▒БОГДАНА▒▒▒▒▒████▌
░▐█▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████▌
░░█▒▄▀▀▀▀▀▄▒▒▄▀▀▀▀▀▄▒▐███▌
░░░▐░░░▄▄░░▌▐░░░▄▄░░▌▐███▌
░▄▀▌░░░▀▀░░▌▐░░░▀▀░░▌▒▀▒█▌
░▌▒▀▄░░░░▄▀▒▒▀▄░░░▄▀▒▒▄▀▒▌
░▀▄▐▒▀▀▀▀▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒█
░░░▀▌▒▄██▄▄▄▄████▄▒▒▒▒█▀
░░░░▄█████████████ █▒▒▐▌
░░... | /*▄███████▀▀▀▀▀▀███████▄
░▐████▀▒ЗАПУСКАЕМ▒▀██████▄
░███▀▒▒▒▒▒ДЯДЮ▒▒▒▒▒▒▀█████
░▐██▒▒▒▒▒БОГДАНА▒▒▒▒▒████▌
░▐█▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████▌
░░█▒▄▀▀▀▀▀▄▒▒▄▀▀▀▀▀▄▒▐███▌
░░░▐░░░▄▄░░▌▐░░░▄▄░░▌▐███▌
░▄▀▌░░░▀▀░░▌▐░░░▀▀░░▌▒▀▒█▌
░▌▒▀▄░░░░▄▀▒▒▀▄░░░▄▀▒▒▄▀▒▌
░▀▄▐▒▀▀▀▀▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒█
░░░▀▌▒▄██▄▄▄▄████▄▒▒▒▒█▀
░░░░▄█████████████ █▒▒▐▌
░░... | [["+", 36, 36, 36, 36, 0, 30, 0, 58, 141, 22], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 112, 0, 148]] | 1 | 958 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int len;
cin >> len;
string s;
cin >> s;
int red = 0, green = 0, blue = 0;
for (int i = 0; i < len; i++) {
if (s[i] == 'R')
red++;
else if (s[i] == 'G')
green++;
else
blue++;
}
int total = red * blue * green;
if (... | #include <bits/stdc++.h>
using namespace std;
#define int long long int
signed main() {
int len;
cin >> len;
string s;
cin >> s;
int red = 0, green = 0, blue = 0;
for (int i = 0; i < len; i++) {
if (s[i] == 'R')
red++;
else if (s[i] == 'G')
green++;
else
blue++;
}
int total... | [["+", 36, 36, 36, 36, 0, 30, 0, 58, 0, 148], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 0, 30, 0, 14, 39, 86, 0, 156]] | 1 | 216 |
#include <iostream>
#include <set>
#include <string>
using namespace std;
int main() {
int N;
string S;
cin >> N >> S;
int r, g, b, rg, gb, br, rgb;
r = g = b = rg = gb = br = rgb = 0;
for (int i = 0; i < N; i++) {
if (S[i] == 'R') {
r++;
rg += g;
br += b;
rgb += gb;
} else ... | #include <iostream>
#include <set>
#include <string>
using namespace std;
int main() {
int N;
string S;
cin >> N >> S;
long r, g, b, rg, gb, br, rgb;
r = g = b = rg = gb = br = rgb = 0;
for (int i = 0; i < N; i++) {
if (S[i] == 'R') {
r++;
rg += g;
br += b;
rgb += gb;
} else... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 271 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < (int)b; i++)
#define all(v) v.begin(), v.end()
const int MOD = 1e9 + 7;
const int INF = 1e9;
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122
int main() {
int n;
cin >> n;
string s;
cin >> s;
int r = 0, g = ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < (int)b; i++)
#define all(v) v.begin(), v.end()
const int MOD = 1e9 + 7;
const int INF = 1e9;
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122
int main() {
int n;
cin >> n;
string s;
cin >> s;
ll r = 0, g = 0... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 231 |
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
int main() {
auto getNextIndex = [](const std::string &str, int pos, char c) {
size_t size = str.find(c, pos);
if (size == std::string::npos)
return -1;
return static_cast<int>(size);
};
int result = 0;
int n;
st... | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
int main() {
auto getNextIndex = [](const std::string &str, int pos, char c) {
size_t size = str.find(c, pos);
if (size == std::string::npos)
return -1;
return static_cast<int>(size);
};
long long int result = 0;
in... | [["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 359 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = (0); i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define rng(x) (x).begin(), (x).end()
#define rrng(x) (x).rbegin(), (x).rend()
#define limit(... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = (0); i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define rng(x) (x).begin(), (x).end()
#define rrng(x) (x).rbegin(), (x).rend()
#define limit(... | [["+", 49, 50, 51, 16, 31, 16, 31, 74, 0, 24], ["+", 51, 16, 31, 16, 31, 74, 39, 77, 39, 78], ["+", 49, 50, 51, 16, 31, 16, 31, 74, 0, 25]] | 1 | 745 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
char S[N];
int r = 0;
int g = 0;
int b = 0;
for (int i = 0; i < N; i++) {
cin >> S[i];
if (S[i] == 'R')
r++;
else if (S[i] == 'G')
g++;
else if (S[i] == 'B')
b++;
}
long long ans = r * g * b;... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
char S[N];
long long r = 0;
long long g = 0;
long long b = 0;
for (int i = 0; i < N; i++) {
cin >> S[i];
if (S[i] == 'R')
r++;
else if (S[i] == 'G')
g++;
else if (S[i] == 'B')
b++;
}
long lon... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 222 |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <numeric>
#include <queue>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repk(i, k, n) for (int i = k; i < n; i++)
#define ll long long
int main() {
int n;
string s;
... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <numeric>
#include <queue>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repk(i, k, n) for (int i = k; i < n; i++)
#define ll long long
int main() {
int n;
string s;
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 205 |
#include <bits/stdc++.h>
using namespace std;
#define sz(x) int(x.size())
#define pii pair<int, int>
#define Task "abc"
#define For(i, a, b) for (int i = (a), _b = (b); i <= b; ++i)
#define Debug(X) cout << #X << " = " << X << '\n'
#define All(x) (x).begin(), (x).end()
#define mp make_pair
typedef unsigned long long ... | #include <bits/stdc++.h>
using namespace std;
#define sz(x) int(x.size())
#define pii pair<int, int>
#define Task "abc"
#define For(i, a, b) for (int i = (a), _b = (b); i <= b; ++i)
#define Debug(X) cout << #X << " = " << X << '\n'
#define All(x) (x).begin(), (x).end()
#define mp make_pair
typedef unsigned long long ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 372 |
#include "bits/stdc++.h"
#include <numeric>
#define rep(i, a) for (int i = 0; i < (a); ++i)
#define REP(i, a, b) for (int i = (a); i < (b); ++i)
#define vi vector<int>
#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0, a1, a2, a3, a4, x, ...) x
#define debug_1(x1) cerr << #x1 << ": " << x1 << endl
#define debug_2(x1, x2... | #include "bits/stdc++.h"
#include <numeric>
#define rep(i, a) for (int i = 0; i < (a); ++i)
#define REP(i, a, b) for (int i = (a); i < (b); ++i)
#define vi vector<int>
#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0, a1, a2, a3, a4, x, ...) x
#define debug_1(x1) cerr << #x1 << ": " << x1 << endl
#define debug_2(x1, x2... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 367 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define Rep(i, m, n) for (int i = (m); i < (n); i++)
#define debug(a, b) cout << "debug : " << a << " , " << b << endl
#define ll long long
const ll INF = 1LL << 60;
const ll mod = 1E9 + 7;
int main() {
int n;
cin >> n;
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define Rep(i, m, n) for (int i = (m); i < (n); i++)
#define debug(a, b) cout << "debug : " << a << " , " << b << endl
#define ll long long
const ll INF = 1LL << 60;
const ll mod = 1E9 + 7;
int main() {
int n;
cin >> n;
... | [["+", 0, 11, 12, 16, 31, 16, 31, 74, 0, 24], ["+", 12, 16, 31, 16, 31, 74, 39, 77, 39, 78], ["+", 0, 11, 12, 16, 31, 16, 31, 74, 0, 25]] | 1 | 242 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
const ll LongINF = 1e13 + 7;
const int INF = 1e9 + 7;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
const ll LongINF = 1e13 + 7;
const int INF = 1e9 + 7;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
... | [["+", 0, 30, 0, 14, 8, 9, 0, 58, 0, 148], ["+", 0, 30, 0, 14, 8, 9, 0, 58, 51, 59], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]] | 1 | 511 |
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
int n;
string s;
cin >> n >> s;
ll ans = 0;
//暴力时间过不去,所以最大只能采用n^2的算法
// for(int i=0;i<n-2;i++){
// for(int j=i+1;j<n... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
int n;
string s;
cin >> n >> s;
ll ans = 0;
//暴力时间过不去,所以最大只能采用n^2的算法
// for(int i=0;i<n-2;i++){
// for(int j=i+1;j<n... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 228 |
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
using namespace std;
#define range(a) a.begin(), a.end()
#define rep(i, c) for (int i = 0; i <... | #include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
using namespace std;
#define range(a) a.begin(), a.end()
#define rep(i, c) for (int i = 0; i <... | [["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 78]] | 1 | 287 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
cin >> n >> s;
vector<int> color(n);
vector<vector<int>> cnt(3, vector<int>(n, 0));
for (int i = 0; i < n; ++i) {
if (s.at(i) == 'R') {
color.at(i) = 0;
cnt.at(0).at(i)++;
} else if (s.at(i) == 'G') {
co... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
cin >> n >> s;
vector<int> color(n);
vector<vector<int>> cnt(3, vector<int>(n, 0));
for (int i = 0; i < n; ++i) {
if (s.at(i) == 'R') {
color.at(i) = 0;
cnt.at(0).at(i)++;
} else if (s.at(i) == 'G') {
co... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 480 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define reps(i, n) for (int i = 1; i <= n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
#define rreps(i, n) for (int i = n; i >= 1; i--)
#define mrep(i, from, n) for (int i = from; i < n; i++)
#define mreps(i, from, ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define reps(i, n) for (int i = 1; i <= n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
#define rreps(i, n) for (int i = n; i >= 1; i--)
#define mrep(i, from, n) for (int i = from; i < n; i++)
#define mreps(i, from, ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 540 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, m, n) for (int i = m + 1; i <= n; i++)
int main() {
int n;
string s;
cin >> n >> s;
long tot = 0;
int r = 0, g = 0, b = 0;
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
r++;
if (s[i] == 'G')
g++;
if (s[i] == 'B')
b+... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, m, n) for (int i = m + 1; i <= n; i++)
int main() {
int n;
string s;
cin >> n >> s;
long tot = 0;
long r = 0, g = 0, b = 0;
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
r++;
if (s[i] == 'G')
g++;
if (s[i] == 'B')
b... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 216 |
// using no_way as a way
// using no_limitation as a limitation
// #pragma comment(linker, "/stack:200000000")
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
c... | // using no_way as a way
// using no_limitation as a limitation
// #pragma comment(linker, "/stack:200000000")
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
c... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 382 |
char *p, S[9999];
i, j;
c[99], t;
main() {
for (gets(S), gets(p = S); *p; c[*p++]++)
for (j = 2e3; j--;)
t -= (*p ^ p[j] ^ p[-j]) > 86;
printf("%ld", 1L * c[66] * c[71] * c[82] + t);
} | char *p, S[9999];
i, j;
c[99], t;
main() {
for (gets(S), gets(p = S); *p; c[*p++]++)
for (j = 2e3; j--;)
t -= (*p ^ p[j] ^ p[j + j]) > 86;
printf("%ld", 1L * c[66] * c[71] * c[82] + t);
} | [["-", 31, 23, 0, 16, 12, 69, 71, 91, 17, 33], ["+", 31, 23, 0, 16, 12, 69, 71, 16, 31, 22], ["+", 31, 23, 0, 16, 12, 69, 71, 16, 17, 72]] | 0 | 107 |
char S[9999];
i, j;
c[99], t;
main(N) {
for (scanf("%d%s", &N, S); i < N; c[S[i++]]++)
for (j = N; j--;)
t -= (S[i] ^ S[i + j] ^ S[i + j + j]) == 87;
printf("%ld", 1L * c[66] * c[71] * c[82] + t);
} | char S[99999];
i, j;
c[99], t;
main(N) {
for (scanf("%d%s", &N, S); i < N; c[S[i++]]++)
for (j = N; j--;)
t -= (S[i] ^ S[i + j] ^ S[i + j + j]) == 87;
printf("%ld", 1L * c[66] * c[71] * c[82] + t);
} | [["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13]] | 0 | 114 |
#include <stdio.h>
int main() {
int n;
scanf("%d", &n);
char s[n];
scanf("%s", &s);
int f, r, g, b;
r = 0;
g = 0;
b = 0;
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
r++;
if (s[i] == 'G')
g++;
if (s[i] == 'B')
b++;
}
f = r * g * b;
for (int i = 0; i < n; i++) {
... | #include <stdio.h>
int main() {
int n;
scanf("%d", &n);
char s[n];
scanf("%s", &s);
unsigned long long int f, r, g, b;
r = 0;
g = 0;
b = 0;
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
r++;
if (s[i] == 'G')
g++;
if (s[i] == 'B')
b++;
}
f = r * g * b;
for (int i =... | [["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 87], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 51, 16, 12, 16, 31, 69, 341, 342, 0, 22], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 22], ["-", 51, 16, 12, 16, 12, 69, 341, 342, 0, 22], ["+", 51, 16, 12, 16, 12, 69, 341, 342, 0, 22], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", ... | 1 | 231 |
#include <algorithm>
#include <iostream>
#include <math.h>
#include <memory>
#include <string>
#include <vector>
typedef long long ll;
int main() {
int a = 0;
int n;
char s[4000];
std::cin >> n >> s;
int r = 0;
int g = 0;
int b = 0;
int k = 0;
for (int i = 0; i < n; i++) {
if (s[i] == 'R') {
... | #include <algorithm>
#include <iostream>
#include <math.h>
#include <memory>
#include <string>
#include <vector>
typedef long long ll;
int main() {
int a = 0;
int n;
char s[4000];
std::cin >> n >> s;
ll r = 0;
ll g = 0;
ll b = 0;
ll k = 0;
for (int i = 0; i < n; i++) {
if (s[i] == 'R') {
r++... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 239 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.