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 <algorithm>
#include <stdio.h>
using namespace std;
typedef long long llong;
#define MAX 4000
const llong mod = 1000000000 + 7;
int main() {
int N;
char S[MAX];
int Rlen = 0, Glen = 0, Blen = 0;
llong ans = 0;
scanf("%d", &N);
scanf("%s", S);
for (int i = 0; i < N; i++) {
switch (S[i]) {... | #include <algorithm>
#include <stdio.h>
using namespace std;
typedef unsigned long long llong;
#define MAX 4000
const llong mod = 1000000000 + 7;
int main() {
int N;
char S[MAX];
llong Rlen = 0, Glen = 0, Blen = 0;
llong ans = 0;
scanf("%d", &N);
scanf("%s", S);
for (int i = 0; i < N; i++) {
swit... | [["+", 36, 36, 0, 30, 0, 134, 39, 86, 0, 87], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 1 | 232 |
#include <fstream>
#include <iostream>
#include <stdio.h>
using std::cin;
using std::cout;
using std::endl;
using std::terminate;
void solve() {
int n;
cin >> n;
char s[n + 1];
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... | #include <fstream>
#include <iostream>
#include <stdio.h>
using std::cin;
using std::cout;
using std::endl;
using std::terminate;
void solve() {
int n;
cin >> n;
char s[n + 1];
cin >> s;
long nR = 0;
long nG = 0;
long nB = 0;
for (int i = 0; i < n; ++i) {
if (s[i] == 'R') {
nR++;
} else... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 312 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
int main() {
int n;
cin >> n;
vector<char> s(n + 1);
for (int i = 1; i <= n; i++)
cin >> s[i];
int r = 0, b = 0, g = 0;
for (int i = 1... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
int main() {
int n;
cin >> n;
vector<char> s(n + 1);
for (int i = 1; i <= n; i++)
cin >> s[i];
ll r = 0, b = 0, g = 0;
for (int i = 1;... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 251 |
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main() {
int N;
cin >> N;
ll ans = 0;
int k;
... | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main() {
int N;
cin >> N;
ll ans = 0;
int k;
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 244 |
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define PI acos(-1)
#define Rep(i, n) for (int i = 0; i < (int)(n); i++)
#define BitRep(i, n) for (int i = 0; i < (int)(1 << n); i++)
#define All(vec) vec.begin(), vec.end()
#define Sum(vec) accumulate(vec.begin(), vec.end(), ... | #include "bits/stdc++.h"
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define PI acos(-1)
#define Rep(i, n) for (int i = 0; i < (int)(n); i++)
#define BitRep(i, n) for (int i = 0; i < (int)(1 << n); i++)
#define All(vec) vec.begin(), vec.end()
#define Sum(vec) accumulate(vec.begin(), vec.end(), ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 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 | 279 |
#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) {
if (x % y == 0)
return y;
else
return gcd(y, x % y);
}
int main() {
/* A
int n;
cin >> n;
bool check = false;
for(int i=0;i<3;i++){
if(n%10 == 7)check = true;
n/=10;
}
cout << ((check)? "Yes": "No") << endl;*/
... | #include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) {
if (x % y == 0)
return y;
else
return gcd(y, x % y);
}
int main() {
/* A
int n;
cin >> n;
bool check = false;
for(int i=0;i<3;i++){
if(n%10 == 7)check = true;
n/=10;
}
cout << ((check)? "Yes": "No") << endl;*/
... | [["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 39, 344, 3, 347, 0, 77, 39, 86, 0, 96]] | 1 | 253 |
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
int main() {
int N;
cin >> N;
string s;
cin >> s;
i... | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
int main() {
int N;
cin >> N;
string s;
cin >> s;
l... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 237 |
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();
int r = 0;
int g = 0;
int b = 0;
for (int i = 0; i < n; i++) {
if (s.charAt(i) == 'R')
r++;
else if (s.char... | 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();
int r = 0;
int g = 0;
int b = 0;
for (int i = 0; i < n; i++) {
if (s.charAt(i) == 'R')
r++;
else if (s.char... | [["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96], ["+", 0, 503, 49, 200, 51, 16, 12, 74, 0, 24], ["+", 49, 200, 51, 16, 12, 74, 39, 506, 0, 96], ["+", 0, 503, 49, 200, 51, 16, 12, 74, 0, 25]] | 3 | 236 |
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define REP(i, n) for (auto i = 0; i < n; ++i)
#define REPR(i, n) for ... | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define REP(i, n) for (auto i = 0; i < n; ++i)
#define REPR(i, n) for ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 338 |
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
int n;
cin >> n;
string s;
cin >> s;
int b = 0;
for (auto c : s)
if (c == 'B')
++b;
int ans = 0;
for (int i = 0; i < n; ++i) {
if (s[i] != 'R')
continue;
for (int j = 0; j < n; ++j) {
... | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
int n;
cin >> n;
string s;
cin >> s;
int b = 0;
for (auto c : s)
if (c == 'B')
++b;
long long ans = 0;
for (int i = 0; i < n; ++i) {
if (s[i] != 'R')
continue;
for (int j = 0; j < n; ++j... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 223 |
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
int n, r = 0, b = 0, g = 0;
string s;
cin >> n >> s;
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
r++;
else if (s[i] == 'B')
b++;
else
g++;
}
long long ans = r * g * b;
for (int i = 0; i < n; i++)... | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
long long n, r = 0, b = 0, g = 0;
string s;
cin >> n >> s;
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
r++;
else if (s[i] == 'B')
b++;
else
g++;
}
long long ans = r * g * b;
for (int i = 0; i < n... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 193 |
#include <bits/stdc++.h>
#define lli long long int
#define inf 2147483647
#define infll LLONG_MAX
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define Yes() cout << "Yes" << endl
#define No() cout << "No" << endl
#define YES() cout << "YES" << endl
#define NO(... | #include <bits/stdc++.h>
#define lli long long int
#define inf 2147483647
#define infll LLONG_MAX
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define Yes() cout << "Yes" << endl
#define No() cout << "No" << endl
#define YES() cout << "YES" << endl
#define NO(... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 252 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using uint = unsigned;
using pcc = pair<char, char>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
using tuplis = array<ll, 3>;
template <class T> using p... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using uint = unsigned;
using pcc = pair<char, char>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
using tuplis = array<ll, 3>;
template <class T> using p... | [["-", 75, 76, 0, 9, 0, 1, 0, 2, 63, 22], ["-", 0, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["-", 0, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 0, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["-", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35]] | 1 | 3,742 |
#include <iostream>
#include <string>
using namespace std;
int main() {
int r(0), g(0), b(0);
int n;
cin >> n;
string s;
cin >> s;
for (int i = 0; i < n; ++i) {
if (s[i] == 'R')
++r;
else if (s[i] == 'G')
++g;
else
++b;
}
long long ans = r * g * b;
for (int i = 0; i < ... | #include <iostream>
#include <string>
using namespace std;
int main() {
long long r(0), g(0), b(0);
long long n;
cin >> n;
string s;
cin >> s;
for (int i = 0; i < n; ++i) {
if (s[i] == 'R')
++r;
else if (s[i] == 'G')
++g;
else
++b;
}
long long ans = r * g * b;
for (int... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 199 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
int main() {
int n;
cin >> n;
string s;
cin >> s;
vector<int> a(3);
rep(i, s.size()) {
if (s.at(i) == 'R') {
a.at(0)++;
}
if (s.at(i) == 'G') {
a.at(1)++;
}
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
int main() {
ll n;
cin >> n;
string s;
cin >> s;
vector<ll> a(3);
rep(i, s.size()) {
if (s.at(i) == 'R') {
a.at(0)++;
}
if (s.at(i) == 'G') {
a.at(1)++;
}
i... | [["-", 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], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 78], ["-", 0, 7, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 7, 8, 9, ... | 1 | 255 |
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <ctype.h>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
typedef long long ll;
int m... | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <ctype.h>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
typedef long long ll;
int m... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 238 |
// c++ -std=gnu++14 a.cpp
#include <algorithm>
#include <bitset>
#include <climits>
#include <complex>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#in... | // c++ -std=gnu++14 a.cpp
#include <algorithm>
#include <bitset>
#include <climits>
#include <complex>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#in... | [["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 78]] | 1 | 1,058 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
int main() {
int n;
string s;
cin >> n >> s;
int rnum = 0;
int gnum = 0;
int bnum = 0;
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
rnum++;
else if (s[i] == 'G')
gnum+... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
int main() {
int n;
string s;
cin >> n >> s;
ll rnum = 0;
ll gnum = 0;
ll bnum = 0;
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
rnum++;
else if (s[i] == 'G')
gnum++;
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 224 |
#include <bits/stdc++.h>
#define rep(i, s, n) for (int i = s; i < n; i++)
#define rp(i, n) for (int i = 0; i < n; i++)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define all_acc(x) (x).begin(), (x).end(), 0LL
#define int long long
#define absSort(v) ... | #include <bits/stdc++.h>
#define rep(i, s, n) for (int i = s; i < n; i++)
#define rp(i, n) for (int i = 0; i < n; i++)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define all_acc(x) (x).begin(), (x).end(), 0LL
#define int long long
#define absSort(v) ... | [["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 72], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 48], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 488 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(0)... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(0)... | [["+", 49, 50, 51, 16, 31, 16, 31, 16, 31, 13], ["+", 49, 50, 51, 16, 31, 16, 31, 16, 17, 48]] | 1 | 255 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
using namespace std;
using ll = long long;
template <class T> inline bool chmax(T &a, T b) {
if (... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
using namespace std;
using ll = long long;
template <class T> inline bool chmax(T &a, T b) {
if (... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 293 |
#include <iostream>
#include <set>
#include <string>
using namespace std;
void input(int &N, set<int> &R_INDEX, set<int> &G_INDEX, set<int> &B_INDEX) {
char c;
for (int i = 0; i < N; i++) {
cin >> c;
switch (c) {
case 'R':
R_INDEX.insert(i);
break;
case 'G':
G_INDEX.insert(i);
... | #include <iostream>
#include <set>
#include <string>
using namespace std;
void input(int &N, set<int> &R_INDEX, set<int> &G_INDEX, set<int> &B_INDEX) {
char c;
for (int i = 0; i < N; i++) {
cin >> c;
switch (c) {
case 'R':
R_INDEX.insert(i);
break;
case 'G':
G_INDEX.insert(i);
... | [["+", 36, 36, 0, 30, 0, 14, 39, 86, 0, 96], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 387 |
import sys
input = sys.stdin.readline
def main():
n= int(input())
s = str(input().rstrip())
r= s.count('R')
g=s.count('G')
b = s.count('B')
ans = 0
for i in range(2):
for j in range(i+1, (n+i+1)//2):
k = 2*j-i
t = {s[i], s[j], s[k]}
if len(t) ==3:
... | import sys
input = sys.stdin.readline
def main():
n= int(input())
s = str(input().rstrip())
r= s.count('R')
g=s.count('G')
b = s.count('B')
ans = 0
for i in range(n-2):
for j in range(i+1, (n+i+1)//2):
k = 2*j-i
t = {s[i], s[j], s[k]}
if len(t) ==3... | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33]] | 5 | 151 |
#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
#define idfc \
ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
//:/
#define pb emplace_back
#define mp make_pair
#define nt _ll128
#define ld long double
l... | #include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
#define idfc \
ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
//:/
#define pb emplace_back
#define mp make_pair
#define nt _ll128
#define ld long double
l... | [["-", 0, 14, 8, 9, 0, 37, 0, 16, 17, 79], ["+", 0, 14, 8, 9, 0, 37, 0, 16, 17, 60]] | 1 | 458 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using PP = pair<int, P>;
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define rep0(i, n) for (int i = 0; i < (n); i++)
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
retur... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using PP = pair<int, P>;
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define rep0(i, n) for (int i = 0; i < (n); i++)
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
retur... | [["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 78]] | 1 | 360 |
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(void) {
int N;
string S;
cin >> N;
cin >> S;
vector<int> a(N);
for (int i = 0; i < N; i++) {
if (S[i] == 'R')
a[i] = 0;
if (S[i] == 'G')
a[i] = 1;
if (S[i] == 'B')
a[i] = 2;
}
vector<int... | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(void) {
int N;
string S;
cin >> N;
cin >> S;
vector<int> a(N);
for (int i = 0; i < N; i++) {
if (S[i] == 'R')
a[i] = 0;
if (S[i] == 'G')
a[i] = 1;
if (S[i] == 'B')
a[i] = 2;
}
vector<lon... | [["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 39, 344, 3, 347, 0, 77, 39, 86, 0, 96], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 271 |
#include <stdio.h>
int n;
char s[4040];
int main()
{
scanf("%d", &n);
scanf("%s", 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++) {
for (... | #include <stdio.h>
int n;
char s[4040];
int main()
{
scanf("%d", &n);
scanf("%s", 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++;
}
long long ans = 1ll * 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], ["+", 49, 50, 51, 16, 31, 16, 31, 16, 31, 13], ["+", 49, 50, 51, 16, 31, 16, 31, 16, 17, 48], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 1 | 212 |
#include <iostream>
#include <string>
using namespace std;
int main() {
int N;
string s;
cin >> N;
cin >> s;
int nr = 0, ng = 0, nb = 0;
for (int i = 0; i < N; ++i) {
switch (s[i]) {
case 'R':
nr++;
break;
case 'G':
ng++;
break;
case 'B':
nb++;
break;
... | #include <iostream>
#include <string>
using namespace std;
int main() {
int N;
string s;
cin >> N;
cin >> s;
int nr = 0, ng = 0, nb = 0;
for (int i = 0; i < N; ++i) {
switch (s[i]) {
case 'R':
nr++;
break;
case 'G':
ng++;
break;
case 'B':
nb++;
break;
... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 215 |
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repi(i, a, b) for (int i = int(a); i < (b); i++)
#define repr(i, b, a) for (int i = int(b); i >= (a); i--)
#define all(x) x.begin(), x.end()
const ll mod = 1e9 + ... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repi(i, a, b) for (int i = int(a); i < (b); i++)
#define repr(i, b, a) for (int i = int(b); i >= (a); i--)
#define all(x) x.begin(), x.end()
const ll mod = 1e9 + ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 406 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
signed main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n;
string s;
cin >> n >> s;
map<char, int> mp;
for (int i = 0; i < n; ++i)
++mp[s[i]];
ll ans = mp['R'] * mp['G'] * mp['B'];
for (int i = 0; i < n; ++i) {
for (... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
signed main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n;
string s;
cin >> n >> s;
map<char, ll> mp;
for (int i = 0; i < n; ++i)
++mp[s[i]];
ll ans = mp['R'] * mp['G'] * mp['B'];
for (int i = 0; i < n; ++i) {
for (i... | [["-", 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>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
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 < (n); i++)
using namespace std;
using ll = long long;
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 | 218 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
int main() {
int N;
cin >> N;
string S;
cin >> S;
//各文字の累積和
vector<int> Rv(N), Gv(N), Bv(N);
int R = 0, G = 0, B = 0;
rep(i, N) {
if (S[i] == 'R')
R++;
if (S[i] == 'G')
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
int main() {
int N;
cin >> N;
string S;
cin >> S;
//各文字の累積和
vector<int> Rv(N), Gv(N), Bv(N);
int R = 0, G = 0, B = 0;
rep(i, N) {
if (S[i] == 'R')
R++;
if (S[i] == 'G')
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 462 |
import collections
n=int(input())
S=input()
s=collections.Counter(S)
print(s)
ans=s['R']*s['G']*s['B']
for i in range(n):
for d in range(n):
j=i+d
k=j+d
if k>n-1:
break
if S[i]!=S[j] and S[j]!=S[k] and S[k]!=S[i]:
ans-=1
print(ans) | #162D
#RGB Triplets
import collections
n=int(input())
S=input()
s=collections.Counter(S)
ans=s['R']*s['G']*s['B']
for i in range(n):
for d in range(n):
j=i+d
k=j+d
if k>n-1:
break
if S[i]!=S[j] and S[j]!=S[k] and S[k]!=S[i]:
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 | 121 |
#include <bits/stdc++.h>
using namespace std;
int main(void) {
int n, r = 0, g = 0, b = 0;
string s;
cin >> n;
cin >> s;
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
r++;
else if (s[i] == 'G')
g++;
else
b++;
}
int ans = r * g * b;
for (int i = 0; i < n; i++) {
for (in... | #include <bits/stdc++.h>
using namespace std;
int main(void) {
long long n, r = 0, g = 0, b = 0;
string s;
cin >> n;
cin >> s;
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
r++;
else if (s[i] == 'G')
g++;
else
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 | 186 |
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b)... | #include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b)... | [["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 78]] | 1 | 286 |
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b)... | #include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b)... | [["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 78]] | 1 | 263 |
import java.io.*;
import java.util.*;
public class Main {
static StringTokenizer st;
static BufferedReader br;
static PrintWriter out;
static int parent[];
public static void main(String[] args) throws IOException {
br = new BufferedReader(new InputStreamReader(System.in));
int N = nextInt();
... | import java.io.*;
import java.util.*;
public class Main {
static StringTokenizer st;
static BufferedReader br;
static PrintWriter out;
static int parent[];
public static void main(String[] args) throws IOException {
br = new BufferedReader(new InputStreamReader(System.in));
int N = nextInt();
... | [["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]] | 3 | 388 |
from collections import Counter
n = int(input())
s = input()
cnt = Counter(s)
ans = cnt['R'] * cnt['G'] * cnt['B']
for i in range(n):
for j in range(n):
k = 2 * j - i
if k > n-1:
break
if 1 < j < k and s[i] != s[j] and s[j] != s[k] and s[i] != s[k]:
ans -= 1
print(... | from collections import Counter
n = int(input())
s = input()
cnt = Counter(s)
ans = cnt['R'] * cnt['G'] * cnt['B']
for i in range(n):
for j in range(n):
k = 2 * j - i
if k > n-1:
break
if i < j < k and s[i] != s[j] and s[j] != s[k] and s[i] != s[k]:
ans -= 1
print(... | [["-", 15, 679, 31, 679, 31, 679, 31, 666, 0, 612], ["+", 15, 679, 31, 679, 31, 679, 31, 666, 0, 22]] | 5 | 120 |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
int n, r = 0, g = 0, b = 0;
string s;
ll cnt1 = 0;
cin >> n >> s;
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
r++;
else if (s[i] == 'G')
g++;
else if (s[i] == 'B')
b++;
}
cnt1 = r * g * b;
... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ll n, r = 0, g = 0, b = 0;
string s;
ll cnt1 = 0;
cin >> n >> s;
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
r++;
else if (s[i] == 'G')
g++;
else if (s[i] == 'B')
b++;
}
cnt1 = r * g * b;
f... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 209 |
N = int(input())
S = input()
count_R = 0
count_G = 0
count_B = 0
count = 0
for i in range(N):
if S[i] == 'R':
count_R = count_R+1
elif S[i] == 'G':
count_G = count_G+1
else:
count_B = count_B+1
count = count_R*count_G*count_B
for i in range(N):
for j in range(i+1,N):
if S[i] !... | N = int(input())
S = input()
count_R = 0
count_G = 0
count_B = 0
count = 0
for i in range(N):
if S[i] == 'R':
count_R = count_R+1
elif S[i] == 'G':
count_G = count_G+1
else:
count_B = count_B+1
count = count_R*count_G*count_B
for i in range(N):
for j in range(i+1,N):
if S[i] !... | [["-", 64, 196, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 12, 22], ["-", 0, 57, 64, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 57, 64, 196, 0, 57, 15, 666, 667, 20]] | 5 | 153 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
int main() {
ll n;
string s;
cin >> n;
cin >> s;
int len = s.size();
int r = 0;
int g = 0;
int b = 0;
for (int i = 0; i < len; i++) {
if (s[i] == 'R')
r++;
if (s[i]... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
int main() {
ll n;
string s;
cin >> n;
cin >> s;
int len = s.size();
ll r = 0;
ll g = 0;
ll b = 0;
for (int i = 0; i < len; i++) {
if (s[i] == 'R')
r++;
if (s[i] ==... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 227 |
N = int(input())
S = list(input())
R = [0]*N
G = [0]*N
B = [0]*N
for i in range(N):
if S[i]=="R":
R[i] += 1
elif S[i] == "G":
G[i] += 1
else:
B[i] += 1
ans = sum(R)*sum(G)*sum(B)
for i in range(N):
for j in range(i+1,min((N+3)//2,N)):
k = 2*j-i
if k<N:
... | N = int(input())
S = list(input())
R = [0]*N
G = [0]*N
B = [0]*N
for i in range(N):
if S[i]=="R":
R[i] += 1
elif S[i] == "G":
G[i] += 1
else:
B[i] += 1
ans = sum(R)*sum(G)*sum(B)
for i in range(N):
for j in range(i+1,min((N+i+3)//2,N)):
k = 2*j-i
if k<N:
... | [["+", 0, 657, 31, 23, 0, 657, 31, 657, 12, 22], ["+", 3, 4, 0, 657, 31, 23, 0, 657, 17, 72]] | 5 | 182 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
typedef pair<int, int> P;
ll Mod = 1000000007;
int main() {
int N;
string S;
cin >> N >> S;
int R = 0;
int G = 0;
int B = 0;
for (int i = 0; i < N; i++) {
if (S[i] == 'R') {
R++;
} else if (S[i] == 'G') {
G++;
} el... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
typedef pair<int, int> P;
ll Mod = 1000000007;
int main() {
int N;
string S;
cin >> N >> S;
ll R = 0;
ll G = 0;
ll B = 0;
for (int i = 0; i < N; i++) {
if (S[i] == 'R') {
R++;
} else if (S[i] == 'G') {
G++;
} else ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 217 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll N;
cin >> N;
string S;
cin >> S;
ll ans = 0;
ll R = 0;
ll G = 0;
ll B = 0;
for (int i = 0; i < N; i++) {
if (S[i] == 'R') {
R++;
} else if (S[i] == 'G') {
G++;
} else {
B++;
}
}
an... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll N;
cin >> N;
string S;
cin >> S;
ll ans = 0;
ll R = 0;
ll G = 0;
ll B = 0;
for (int i = 0; i < N; i++) {
if (S[i] == 'R') {
R++;
} else if (S[i] == 'G') {
G++;
} else {
B++;
}
}
an... | [["-", 0, 7, 15, 16, 12, 16, 31, 23, 0, 24], ["-", 15, 16, 12, 16, 31, 23, 0, 16, 17, 33], ["-", 15, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["-", 0, 7, 15, 16, 12, 16, 31, 23, 0, 25], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 85], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 215 |
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, s, n) for (int i = s; i < (n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class ... | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, s, n) for (int i = s; i < (n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class ... | [["-", 8, 9, 0, 57, 64, 1, 0, 27, 28, 22], ["+", 8, 9, 0, 57, 64, 1, 0, 27, 28, 22]] | 1 | 344 |
// g++ .cpp && ./a.out
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef pair<int, int> p;
typedef long long ll;
const int mod = 1000000007;
const int inf = 1000000007;
int main() {
int n;
string s;
cin >> n >> s;
int cnt = 0;
vector<int> cntR(n);
vecto... | // g++ .cpp && ./a.out
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef pair<int, int> p;
typedef long long ll;
const int mod = 1000000007;
const int inf = 1000000007;
int main() {
int n;
string s;
cin >> n >> s;
ll cnt = 0;
vector<ll> cntR(n);
vector<... | [["-", 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], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 598 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
string s;
cin >> s;
vector<vector<int>> suff(n + 1, vector<int>(3, 0));
suff[n] = {0, 0, 0};
for (int i = n - 1; i >= 0; i--) {
suff[i] = suff[i + 1];
if (s[i] == 'R')
suff[i][0]++;
if (s[i] == 'G')
suff[i]... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
string s;
cin >> s;
vector<vector<int>> suff(n + 1, vector<int>(3, 0));
suff[n] = {0, 0, 0};
for (int i = n - 1; i >= 0; i--) {
suff[i] = suff[i + 1];
if (s[i] == 'R')
suff[i][0]++;
if (s[i] == 'G')
suff[i]... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 381 |
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(1, n):
j = i + d
k = j + d
if k > n:
break
if s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:
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(1, n):
j = i + d
k = j + d
if k >= n:
break
if s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:
ans -= 1
print(ans) | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]] | 5 | 122 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL << 62
#define inf 1000000007
bool c[4002];
int main() {
ll n;
cin >> n;
string s;
cin >> s;
ll R = 0, B = 0, G = 0;
vector<ll> a, b;
for (ll i = 0; i < n; i++) {
if (s[i] == 'B') {
c[i] = true;
} else if (s[... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL << 62
#define inf 1000000007
bool c[20002];
int main() {
ll n;
cin >> n;
string s;
cin >> s;
ll R = 0, B = 0, G = 0;
vector<ll> a, b;
for (ll i = 0; i < n; i++) {
if (s[i] == 'B') {
c[i] = true;
} else if (s... | [["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13]] | 1 | 348 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
cin >> n >> s;
vector<long long int> color(3);
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
color[0] += 1;
if (s[i] == 'G')
color[1] += 1;
if (s[i] == 'B')
color[2] += 1;
}
long long int ans = co... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
cin >> n >> s;
vector<long long int> color(3);
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
color[0] += 1;
if (s[i] == 'G')
color[1] += 1;
if (s[i] == 'B')
color[2] += 1;
}
long long int ans = co... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 220 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
int n;
cin >> n;
string s;
cin >> s;
vector<int> a(n);
int rn = 0, gn = 0, bn = 0;
rep(i, n) {
if (s[i] == 'R') {
a[i] = 0;
rn++;
} ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
int n;
cin >> n;
string s;
cin >> s;
vector<int> a(n);
ll rn = 0, gn = 0, bn = 0;
rep(i, n) {
if (s[i] == 'R') {
a[i] = 0;
rn++;
} e... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 216 |
n = int(input())
s = input()
r = []
g = []
b = [0]*4000
for i,j in enumerate(s):
if j == 'R':
r.append(i)
if j == 'G':
g.append(i)
if j == 'B':
b[i] += 1
cnt = len(r)*len(g)*sum(b)
for i in r:
for j in g:
if b[2*j-i] == 1 :
cnt -= 1
if b[2*i-j] == 1 :
cnt -= 1
if (i+j)%2 == 0... | n = int(input())
s = input()
r = []
g = []
b = [0]*40000
for i,j in enumerate(s):
if j == 'R':
r.append(i)
if j == 'G':
g.append(i)
if j == 'B':
b[i] += 1
cnt = len(r)*len(g)*sum(b)
for i in r:
for j in g:
if b[2*j-i] == 1 :
cnt -= 1
if b[2*i-j] == 1 :
cnt -= 1
if (i+j)%2 == ... | [["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]] | 5 | 164 |
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define mod 1000000007
using namespace std;
ll binpow(ll x, ll y) /* (x^y)%p in O(log y) */ {
ll res = 1;
while (y > 0) {
if (y & 1)
res = (res * x);
y = y >> 1;
x = (x * x);
}
return res;
}
ull binpowmod(ull x, ull y... | #include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define mod 1000000007
using namespace std;
ll binpow(ll x, ll y) /* (x^y)%p in O(log y) */ {
ll res = 1;
while (y > 0) {
if (y & 1)
res = (res * x);
y = y >> 1;
x = (x * x);
}
return res;
}
ull binpowmod(ull x, ull y... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 7, 8, 9, 0, 57, 64, 116, 0, 117], ["+", 0, 7, 8, 9, 0, 57, 64, 93, 0, 94], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 78]] | 1 | 609 |
#include <bits/stdc++.h>
using namespace std;
// TYPEDEF
// ----------------------------------------
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> Pair;
typedef vector<ll> vll;
typedef vector<vector<ll>> Graph;
typedef vector<string> vs;
typedef vector<pair<ll, ll>> Pll;
// REPEAT
// ------------... | #include <bits/stdc++.h>
using namespace std;
// TYPEDEF
// ----------------------------------------
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> Pair;
typedef vector<ll> vll;
typedef vector<vector<ll>> Graph;
typedef vector<string> vs;
typedef vector<pair<ll, ll>> Pll;
// REPEAT
// ------------... | [["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]] | 1 | 634 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define MOD 1000000007
int main() {
int n;
cin >> n;
st... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define MOD 1000000007
int main() {
int n;
cin >> n;
st... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 233 |
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long ll;
typedef pair<ll, ll> PLL;
typedef vector<int> VI;
typedef vector<char> VC;
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<ll> VLL;
typedef vector<PLL> VP;
const static int INF = 1000000000;
const stat... | #include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long ll;
typedef pair<ll, ll> PLL;
typedef vector<int> VI;
typedef vector<char> VC;
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<ll> VLL;
typedef vector<PLL> VP;
const static int INF = 1000000000;
const stat... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 8, 9, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 695 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <queue>
using namespace std;
// int fie[4003][8][8003];
int main() {
int N;
string S;
cin >> N >> S;
int cou[3] = {0};
for (int i = 0; i < N; i++) {
if (S[i] == 'R')
cou[0]++;
if (S[i] == 'G')
cou[1]++;
... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <queue>
using namespace std;
// int fie[4003][8][8003];
int main() {
int N;
string S;
cin >> N >> S;
long long int cou[3] = {0, 0, 0};
for (int i = 0; i < N; i++) {
if (S[i] == 'R')
cou[0]++;
if (S[i] == 'G')
... | [["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 21]] | 1 | 239 |
#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 5;
typedef long long ll;
int main() {
ll N;
cin >> N;
string s;
cin >> 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++;
}
}
... | #include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 5;
typedef long long ll;
int main() {
ll N;
cin >> N;
string s;
cin >> 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++;
}
}
... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 217 |
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define all(a) (a).begin(), (a).end()
#define MOD 1000000007
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector... | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define all(a) (a).begin(), (a).end()
#define MOD 1000000007
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 277 |
n = int(input())
s = input()
R=[]
G=[]
B=[]
for i in range(n):
if s[i] == "R":
R.append(i)
elif s[i] == "G":
G.append(i)
else:
B.append(i)
ans = len(R)*len(G)*len(B)
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]) an... | n = int(input())
s = input()
R=[]
G=[]
B=[]
for i in range(n):
if s[i] == "R":
R.append(i)
elif s[i] == "G":
G.append(i)
else:
B.append(i)
ans = len(R)*len(G)*len(B)
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]) an... | [["-", 15, 679, 31, 679, 31, 23, 0, 666, 667, 60], ["+", 15, 679, 31, 679, 31, 23, 0, 666, 667, 79], ["-", 15, 679, 31, 679, 12, 23, 0, 666, 667, 60], ["+", 15, 679, 31, 679, 12, 23, 0, 666, 667, 79], ["-", 0, 57, 15, 679, 12, 23, 0, 666, 667, 60], ["+", 0, 57, 15, 679, 12, 23, 0, 666, 667, 79]] | 5 | 169 |
#include <bits/stdc++.h>
using namespace std;
int main(void) {
int n;
cin >> n;
string s;
cin >> s;
vector<int> r, g, b;
for (int i = 0; i < n; i++) {
switch (s[i]) {
case 'R':
r.push_back(i);
break;
case 'G':
g.push_back(i);
break;
case 'B':
b.push_back(i);
... | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int n;
cin >> n;
string s;
cin >> s;
vector<int> r, g, b;
for (int i = 0; i < n; i++) {
switch (s[i]) {
case 'R':
r.push_back(i);
break;
case 'G':
g.push_back(i);
break;
case 'B':
b.push_back(i);
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 301 |
n = int(input())
s = str(input())
r = 0
g = 0
b = 0
for i in range(n):
if s[i] == "R":
r += 1
elif s[i] == "G":
g += 1
else:
b += 1
p = r*g*b
for i in range(n-2):
for j in range(int(n/2)):
if i + 2*j >n-1:
break
if s[i] != s[i+j] and s[i] != s[i+2*j] a... | n = int(input())
s = str(input())
r = 0
g = 0
b = 0
for i in range(n):
if s[i] == "R":
r += 1
elif s[i] == "G":
g += 1
else:
b += 1
p = r*g*b
for i in range(n-2):
for j in range(int(n/2)+1):
if i + 2*j >n-1:
break
if s[i] != s[i+j] and s[i] != s[i+2*j]... | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 156 |
/*
ID: learnin7
TASK: test
LANG: C++
*/
/* LANG can be C++11 or C++14 for those more recent releases */
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios_base::sync_with_stdio(0);
// ofstream fout ("test.out");
// ifstream fin ("test.in");
// fin >> a >> b;
// fout << a+b... | /*
ID: learnin7
TASK: test
LANG: C++
*/
/* LANG can be C++11 or C++14 for those more recent releases */
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios_base::sync_with_stdio(0);
// ofstream fout ("test.out");
// ifstream fin ("test.in");
// fin >> a >> b;
// fout << a+b... | [["-", 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 all(x) (x).begin(), (x).end()
using namespace std;
using str = string;
using ll = long long;
using vi = vector<int>;
using vii = vector<vi>;
int main() {
int N;
cin >> N;
str S;
cin >> S;
int R = 0, B = 0, G = 0;
for (int i = 0; i < N; i++) {
if (S[i] == 'R')
R++... | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
using str = string;
using ll = long long;
using vi = vector<int>;
using vii = vector<vi>;
int main() {
int N;
cin >> N;
str S;
cin >> S;
int R = 0, B = 0, G = 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], ["+", 12, 16, 31, 16, 31, 16, 31, 74, 0, 24], ["+", 31, 16, 31, 16, 31, 74, 39, 77, 39, 78], ["+", 12, 16, 31, 16, 31, 16, 31, 74, 0, 25]] | 1 | 235 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef pair<ll, ll> LP;
typ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef pair<ll, ll> LP;
typ... | [["-", 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;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef pair<ll, ll> LP;
typ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef pair<ll, ll> LP;
typ... | [["+", 0, 7, 8, 9, 0, 57, 64, 116, 0, 117], ["+", 0, 7, 8, 9, 0, 57, 64, 116, 0, 35]] | 1 | 267 |
#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++;
}
b = N - r - g;
int ans = r * g * b;
for (int i = 0; i < N; i++) {
for... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
string s;
cin >> N >> s;
long 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++;
}
b = N - r - g;
long int ans = 0;
ans = r * g * b;
for (int i = 0; ... | [["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35]] | 1 | 209 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for (ll i = a; (i) < (b); ++(i))
#define RFOR(i, a, b) for (ll i = a; (i) >= (b); --(i))
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define ALL(v) v.begin(), v.end()
#define UNIQ(v) ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for (ll i = a; (i) < (b); ++(i))
#define RFOR(i, a, b) for (ll i = a; (i) >= (b); --(i))
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define ALL(v) v.begin(), v.end()
#define UNIQ(v) ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35]] | 1 | 310 |
n = int(input())
s = str(input())
r = s.count('R')
g = s.count('G')
b = s.count('B')
cnt = r * g * b
for i in range(n // 2 - 1):
for j in range(n - (i + 1) * 2):
if s[j] != s[j+i+1] and s[j+i+1] != s[j+2*(i+1)] and s[j] != s[j+2*(i+1)]:
cnt -= 1
print(cnt)
| n = int(input())
s = str(input())
r = s.count('R')
g = s.count('G')
b = s.count('B')
cnt = r * g * b
for i in range(n // 2):
for j in range(n - (i + 1) * 2):
if s[j] != s[j+i+1] and s[j+i+1] != s[j+2*(i+1)] and s[j] != s[j+2*(i+1)]:
cnt -= 1
print(cnt)
| [["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 143 |
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int gcd(int a, int b) { //最大公約数の算出
if (b == 0) {
return a;
}
return gcd(b, a % b);
}
int main(void) {
int n;
string s;
cin >> n;
cin >> s;
ll p = 0;
int a = 0, b = 0, c = 0;
for (int i = 0; i < n; i++)... | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int gcd(int a, int b) { //最大公約数の算出
if (b == 0) {
return a;
}
return gcd(b, a % b);
}
int main(void) {
int n;
string s;
cin >> n;
cin >> s;
ll p = 0;
ll a = 0, b = 0, c = 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 | 271 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
int r, b, g;
int i, j;
long long k, ans;
cin >> n >> s;
r = b = g = 0;
for (i = 0; i < n; ++i) {
if (s[i] == 'R')
++r;
if (s[i] == 'B')
++b;
if (s[i] == 'G')
++g;
}
ans = r * b * g;
for (... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
long long r, b, g;
int i, j;
long long k, ans;
cin >> n >> s;
r = b = g = 0;
for (i = 0; i < n; ++i) {
if (s[i] == 'R')
++r;
if (s[i] == 'B')
++b;
if (s[i] == 'G')
++g;
}
ans = r * b * g;
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 215 |
#include <algorithm>
#include <cfenv>
#include <cmath>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define vint vector<ll>
#defin... | #include <algorithm>
#include <cfenv>
#include <cmath>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define vint vector<ll>
#defin... | [["-", 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], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 78], ["-", 0, 7, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 7, 8, 9, ... | 1 | 246 |
N=int(input())
S=input()
rgb={"R":0,"G":0,"B":0}
for s in S:
rgb[s]+=1
ans=rgb["R"]*rgb["G"]*rgb["B"]
for dist in range(N//2):
left=0
while left+dist*2<N:
if len(set([S[left],S[left+dist],S[left+dist*2]]))==3:
ans-=1
left+=1
print(ans)
| N=int(input())
S=input()
rgb={"R":0,"G":0,"B":0}
for s in S:
rgb[s]+=1
ans=rgb["R"]*rgb["G"]*rgb["B"]
for dist in range(1,N//2+1):
left=0
while left+dist*2<N:
if len(set([S[left],S[left+dist],S[left+dist*2]]))==3:
ans-=1
left+=1
print(ans)
| [["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 131 |
n = int(input())
s = input()
from collections import Counter
rgb = dict(Counter(s))
if len(dict) < 3:
print('0')
else:
p = rgb['R'] * rgb['G'] * rgb['B']
for i in range(1, (len(s)-1)//2 + 1):
for j in range(len(s) - 2*i):
if {s[j], s[j + i], s[j + 2*i]} == {'R', 'G', 'B'}:
... | n = int(input())
s = input()
from collections import Counter
rgb = dict(Counter(s))
if len(rgb) < 3:
print('0')
else:
p = rgb['R'] * rgb['G'] * rgb['B']
for i in range(1, (len(s)-1)//2 + 1):
for j in range(len(s) - 2*i):
if {s[j], s[j + i], s[j + 2*i]} == {'R', 'G', 'B'}:
... | [["-", 0, 57, 15, 666, 0, 652, 3, 4, 0, 22], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 22]] | 5 | 145 |
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
int main() {
int n;
string s;
cin >> n >> s;
vector<int> a(n);
rep(i, n) {
if (s[i] == ... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
int main() {
int n;
string s;
cin >> n >> s;
vector<int> a(n);
rep(i, n) {
if (s[i] == ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 247 |
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2")
#include <bits/stdc++.h>
using namespace std;
auto clk = clock();
#define fastio \
ios_base::sync_with_stdio(0); \
cin.tie(0); ... | #pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2")
#include <bits/stdc++.h>
using namespace std;
auto clk = clock();
#define fastio \
ios_base::sync_with_stdio(0); \
cin.tie(0); ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 824 |
from collections import Counter
n=int(input())
s_=input()
s=Couter(s_)
rgb = s['R'] * s['G'] * s['B']
cnt=0
for i in range(len(s_)):
for j in range(i+1,len(s_)):
h=j-i+j
if h<n:
if s_[i]!=s_[j] and s_[h]!=s_[j] and s_[i]!=s_[h]:
cnt+=1
print(rgb-cnt)
| from collections import Counter
n=int(input())
s_=input()
s=Counter(s_)
rgb = s['R'] * s['G'] * s['B']
cnt=0
for i in range(len(s_)):
for j in range(i+1,len(s_)):
h=j-i+j
if h<n:
if s_[i]!=s_[j] and s_[h]!=s_[j] and s_[i]!=s_[h]:
cnt+=1
print(rgb-cnt)
| [["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22]] | 5 | 126 |
#include <iostream>
#include <string>
using namespace std;
int main() {
int n;
cin >> n;
string s;
cin >> s;
int r = 0, g = 0, b = 0;
for (char c : s) {
if (c == 'R')
++r;
else if (c == 'G')
++g;
else if (c == 'B')
++b;
}
long long ans = r * g * b;
for (int i = 0; i < n;... | #include <iostream>
#include <string>
using namespace std;
int main() {
int n;
cin >> n;
string s;
cin >> s;
int r = 0, g = 0, b = 0;
for (char c : s) {
if (c == 'R')
++r;
else if (c == 'G')
++g;
else if (c == 'B')
++b;
}
long long ans = (long long)r * g * b;
for (int i ... | [["+", 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 | 190 |
#include <algorithm>
#include <cstring>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
int main() {
int n;
string s;
cin >> n >> s;
long long ans = 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... | #include <algorithm>
#include <cstring>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
int main() {
int n;
string s;
cin >> n >> s;
long long ans = 0;
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++;
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 207 |
#include <iostream>
#include <string>
#include <vector>
using namespace std;
void A() {
// 入力
string N;
cin >> N;
// 出力
if (N.find("7") != string::npos)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
void B() {
// 入力
int N;
cin >> N;
long long int ans = 0;
// "Fizz", "Buzz", "Fiz... | #include <iostream>
#include <string>
#include <vector>
using namespace std;
void A() {
// 入力
string N;
cin >> N;
// 出力
if (N.find("7") != string::npos)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
void B() {
// 入力
int N;
cin >> N;
long long int ans = 0;
// "Fizz", "Buzz", "Fiz... | [["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 87], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 514 |
#include <iostream>
#include <string>
#include <vector>
using namespace std;
void A() {
// 入力
string N;
cin >> N;
// 出力
if (N.find("7") != string::npos)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
void B() {
// 入力
int N;
cin >> N;
long long int ans = 0;
// "Fizz", "Buzz", "Fiz... | #include <iostream>
#include <string>
#include <vector>
using namespace std;
void A() {
// 入力
string N;
cin >> N;
// 出力
if (N.find("7") != string::npos)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
void B() {
// 入力
int N;
cin >> N;
long long int ans = 0;
// "Fizz", "Buzz", "Fiz... | [["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 87], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 498 |
#include <bits/stdc++.h>
#define ll long long
#define rep(i, l, r) for (ll i = (l); (i) < (r); (i)++)
using namespace std;
// TLE2
int main() {
ll n;
cin >> n;
string s;
cin >> s;
vector<int> alp(26, 0);
rep(i, 0, n) alp[s[i] - 'A']++;
ll ans = alp['R' - 'A'] * alp['G' - 'A'] * alp['B' - 'A'];
rep(i, 0,... | #include <bits/stdc++.h>
#define ll long long
#define rep(i, l, r) for (ll i = (l); (i) < (r); (i)++)
using namespace std;
int main() {
ll n;
cin >> n;
string s;
cin >> s;
vector<ll> alp(26, 0);
rep(i, 0, n) alp[s[i] - 'A']++;
ll ans = alp['R' - 'A'] * alp['G' - 'A'] * alp['B' - 'A'];
rep(i, 0, n - 1) {... | [["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 78], ["-", 8, 9, 0, 9, 0, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 9, 0, 9, 0, 43, 39, 78], ["-", 0, 16, 12, 16, 31, 69, 341, 342, 0, 22], ["+", 0, 16, 12, 16, 31, 69, 341, 342, 0, 22], ["-", 0, 16, 12, 16, 12, 69, 341, 342, 0, 22], ["+", ... | 1 | 190 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = Integer.parseInt(scan.next());
String s = scan.next();
scan.close();
String[] str = s.split("");
int[] strCount = new int[3];
for (String a : str) {
... |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = Integer.parseInt(scan.next());
String s = scan.next();
scan.close();
String[] str = s.split("");
int[] strCount = new int[3];
for (String a : str) {
... | [["+", 49, 200, 51, 16, 31, 16, 31, 74, 0, 24], ["+", 51, 16, 31, 16, 31, 74, 39, 506, 0, 96], ["+", 49, 200, 51, 16, 31, 16, 31, 74, 0, 25]] | 3 | 286 |
#include <stdio.h>
#include <stdlib.h>
int main() {
long i, j, k, ans, n, r, g, b;
char *s;
char si, sj, sk;
scanf("%ld", &n);
s = malloc(n * sizeof(char));
scanf("%s", s);
for (i = 0, r = 0, g = 0, b = 0; i < n; i++) {
if (s[i] == 'R')
r++;
else if (s[i] == 'G')
g++;
else if (s[... | #include <stdio.h>
#include <stdlib.h>
int main() {
long i, j, k, ans, n, r, g, b;
char *s;
char si, sj, sk;
scanf("%ld", &n);
s = malloc(n * sizeof(char));
scanf("%s", s);
for (i = 0, r = 0, g = 0, b = 0; i < n; i++) {
if (s[i] == 'R')
r++;
else if (s[i] == 'G')
g++;
else if (s[... | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 242 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
int main() {
uint64_t Ans = 0; // 回答:
int N;
cin >> N; // 文字列数:1~4000
string S;
cin >> S; // 対象文字列
int R, G, B; // 各色の個数
R = 0;
G = 0;
B = 0;
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
int main() {
uint64_t Ans = 0; // 回答:
int N;
cin >> N; // 文字列数:1~4000
string S;
cin >> S; // 対象文字列
uint64_t R, G, B; // 各色の個数
R = 0;
G = 0;
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 217 |
N=int(input())
S=str(input())
r=S.count('R')
g=S.count('G')
b=S.count('B')
ans=r*g*b
dib=0
m=0
for i in range(N-2):
m=(N-i)//2+1
for j in range(i+1,m):
dib=j-i
if j+dib<=N-1:
if S[i]!=S[j] and S[i]!=S[j+dib] and S[j]!=S[j+dib]:
ans=ans-1
... | N=int(input())
S=str(input())
r=S.count('R')
g=S.count('G')
b=S.count('B')
ans=r*g*b
dib=0
m=0
for i in range(N-2):
m=(N+i)//2+1
for j in range(i+1,m):
dib=j-i
if j+dib<=N-1:
if S[i]!=S[j] and S[i]!=S[j+dib] and S[j]!=S[j+dib]:
ans=ans-1
... | [["-", 12, 657, 31, 657, 31, 23, 0, 657, 17, 33], ["+", 12, 657, 31, 657, 31, 23, 0, 657, 17, 72]] | 5 | 150 |
n = gets.to_i
s = gets.strip
count = 0
0.upto(n-2) do |i|
(i+1).upto(n-1) do |j|
k = 2 * j - i
next if k >= n
if s[i] != s[j] && s[i] != s[k] && s[j] != s[k]
count += 1
end
end
end
r = s.count { |c| c == 'R' }
g = s.count { |c| c == 'G' }
b = s.count { |c| c == 'B' }
puts r * g * b - coun... | n = gets.to_i
s = gets.strip.chars
count = 0
0.upto(n-2) do |i|
(i+1).upto(n-1) do |j|
k = 2 * j - i
next if k >= n
if s[i] != s[j] && s[i] != s[k] && s[j] != s[k]
count += 1
end
end
end
r = s.count { |c| c == 'R' }
g = s.count { |c| c == 'G' }
b = s.count { |c| c == 'B' }
puts r * g... | [["+", 36, 36, 0, 493, 0, 662, 12, 652, 17, 131], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 735, 22]] | 4 | 142 |
from collections import Counter
n = int(input())
s = input()
c = Counter(s)
ans = c['R'] * c['G'] * c['B']
for d in range(1, n//2):
i = 0
j = d
k = 2*d
while k < n:
if s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
ans -= 1
i += 1
j += 1
k += 1
print(ans)... | from collections import Counter
n = int(input())
s = input()
c = Counter(s)
ans = c['R'] * c['G'] * c['B']
for d in range(1, n//2 + 1):
i = 0
j = d
k = 2*d
while k < n:
if s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
ans -= 1
i += 1
j += 1
k += 1
print(... | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 120 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
cin >> n >> s;
int r = count(begin(s), end(s), 'R');
int g = count(begin(s), end(s), 'G');
int b = count(begin(s), end(s), 'B');
auto ans = r * g * b;
for (int j = 1; j < n; j++) {
for (int i = 0; i < j; i++) {
int k ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
cin >> n >> s;
auto r = count(begin(s), end(s), 'R');
auto g = count(begin(s), end(s), 'G');
auto b = count(begin(s), end(s), 'B');
auto ans = r * g * b;
for (int j = 1; j < n; j++) {
for (int i = 0; i < j; i++) {
int... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 361, 0, 190]] | 1 | 183 |
#include <bits/stdc++.h>
using namespace std;
using namespace std;
using ll = long long;
using ld = long double;
using p = pair<int, int>;
using Graph = vector<vector<char>>;
#define rep(i, n) for (int i = 0; i < n; i++)
int dx[4]{-1, 0, 1, 0};
int dy[4]{0, 1, 0, -1};
int main() {
int N;
string S;
cin >> N >> S;
... | #include <bits/stdc++.h>
using namespace std;
using namespace std;
using ll = long long;
using ld = long double;
using p = pair<int, int>;
using Graph = vector<vector<char>>;
#define rep(i, n) for (int i = 0; i < n; i++)
int dx[4]{-1, 0, 1, 0};
int dy[4]{0, 1, 0, -1};
int main() {
int N;
string S;
cin >> N >> S;
... | [["-", 49, 50, 51, 16, 12, 23, 0, 16, 12, 13], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 12, 22], ["-", 0, 57, 64, 9, 0, 57, 64, 9, 0, 46], ["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 46]] | 1 | 320 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i, n) for (ll i = 0; i < n; ++i)
int main(void) {
int N;
cin >> N;
string S;
cin >> S;
int r = 0, g = 0, b = 0;
REP(i, N) {
if (S[i] == 'R')
r++;
else if (S[i] == 'G')
g++;
else
b++;
}
ll res = ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i, n) for (ll i = 0; i < n; ++i)
int main(void) {
int N;
cin >> N;
string S;
cin >> S;
ll r = 0, g = 0, b = 0;
REP(i, N) {
if (S[i] == 'R')
r++;
else if (S[i] == 'G')
g++;
else
b++;
}
ll res = r... | [["-", 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 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();
ty... | #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();
ty... | [["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 78]] | 1 | 525 |
#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstring>
#include <functional>
#include <iostream>
#include <limits>
#include <numeric>
#include <stdlib.h>
#include <type_traits>
using namespace std;
int main() {
int n;
cin >> n;
string s;
cin >> s;
unsigned long long int c = 0;
in... | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstring>
#include <functional>
#include <iostream>
#include <limits>
#include <numeric>
#include <stdlib.h>
#include <type_traits>
using namespace std;
int main() {
int n;
cin >> n;
string s;
cin >> s;
unsigned long long int c = 0;
lo... | [["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 230 |
#include <math.h>
#include <stdio.h>
int main(void) {
int i, j, k = 0, a, b = 0, g = 0, r = 0, result = 0;
char n[4001];
scanf("%d", &a);
scanf("%s", n);
for (i = 0; i < a; i++) {
if (n[i] == 'B')
b++;
if (n[i] == 'G')
g++;
if (n[i] == 'R')
r++;
}
result = b * g * r;
f... | #include <math.h>
#include <stdio.h>
int main(void) {
long int i, j, k, a, b = 0, g = 0, r = 0, result = 0;
char n[4001];
scanf("%ld", &a);
scanf("%s", n);
for (i = 0; i < a; i++) {
if (n[i] == 'B')
b++;
if (n[i] == 'G')
g++;
if (n[i] == 'R')
r++;
}
result = b * g * r;
... | [["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 224 |
import collections
n = int(input())
s = input()
res = 0
# for i in range(0, n):
# for j in range(i+1,n):
# if s[i] != s[j]:
# for k in range(j+1,n):
# if j-i!=k-j and s[i] != s[k] and s[j] != s[k]:
# res += 1
#
# print(res)
num = collections.Counter(s)
# prin... | import collections
n = int(input())
s = input()
res = 0
# for i in range(0, n):
# for j in range(i+1,n):
# if s[i] != s[j]:
# for k in range(j+1,n):
# if j-i!=k-j and s[i] != s[k] and s[j] != s[k]:
# res += 1
#
# print(res)
num = collections.Counter(s)
# prin... | [["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 22]] | 5 | 170 |
#include <bits/stdc++.h>
#define INF 1e9
#define all(v) v.begin(), v.end()
#define rall(v) v.begin(), v.end(), std::greater<int>()
#define rep(i, n) for (int i = 0; i < n; i++)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define max(v) *max_element(v.begin(), v.end())
#define min(v) *min_element(v... | #include <bits/stdc++.h>
#define INF 1e9
#define all(v) v.begin(), v.end()
#define rall(v) v.begin(), v.end(), std::greater<int>()
#define rep(i, n) for (int i = 0; i < n; i++)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define max(v) *max_element(v.begin(), v.end())
#define min(v) *min_element(v... | [["-", 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;
typedef long long ll;
int main(void) {
int n;
string s;
cin >> n >> s;
ll c = 0, s1 = 0, s2 = 0, s3 = 0;
for (int i = 0; i < n; i++) {
char p = s[i];
if (p == 'R')
s1++;
if (p == 'G')
s2++;
if (p == 'B')
s3++;
}
c += s1 * s2 *... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(void) {
int n;
string s;
cin >> n >> s;
ll c = 0, s1 = 0, s2 = 0, s3 = 0;
for (int i = 0; i < n; i++) {
char p = s[i];
if (p == 'R')
s1++;
if (p == 'G')
s2++;
if (p == 'B')
s3++;
}
c += s1 * s2 *... | [["-", 31, 16, 12, 16, 12, 69, 341, 342, 0, 22], ["+", 31, 16, 12, 16, 12, 69, 341, 342, 0, 22]] | 1 | 207 |
#include "bits/stdc++.h"
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
int n, r = 0, g = 0, b = 0;
char s[4002] = {};
long long sum = 0;
cin >> n;
rep(a, n) {
cin >> s[a + 1];
if (s[a + 1] == 'R') {
r++;
} else if (s[a + 1] == 'G') {
g++;
} els... | #include "bits/stdc++.h"
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
int n, r = 0, g = 0, b = 0;
char s[4002] = {};
long sum = 0;
cin >> n;
rep(a, n) {
cin >> s[a + 1];
if (s[a + 1] == 'R') {
r++;
} else if (s[a + 1] == 'G') {
g++;
} else if ... | [["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 12, 16, 31, 16, 31, 16, 31, 74, 0, 24], ["+", 31, 16, 31, 74, 39, 77, 39, 86, 0, 96], ["+", 12, 16, 31, 16, 31, 16, 31, 74, 0, 25]] | 1 | 237 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
typedef unsigned long long u_ll;
typedef pair<int, int> pair_;
const int INF = 1001001001;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
int k;
int gcd(int a, int b) {
if (b =... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
typedef unsigned long long u_ll;
typedef pair<int, int> pair_;
const int INF = 1001001001;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
int k;
int gcd(int a, int b) {
if (b =... | [["-", 15, 339, 51, 16, 12, 69, 341, 342, 0, 22], ["+", 15, 339, 51, 16, 12, 69, 341, 342, 0, 22]] | 1 | 367 |
import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
String S1 = sc.next();
char[] S = S1.toCharArray();
int num_r = 0, num_g = 0, num_b = 0;
for (int i = 0; i < N; i++) {
if (S[i] == 'R') {
num_r... | import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
String S1 = sc.next();
char[] S = S1.toCharArray();
long num_r = 0, num_g = 0, num_b = 0;
for (int i = 0; i < N; i++) {
if (S[i] == 'R') {
num_... | [["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]] | 3 | 237 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.