problem_id stringlengths 6 6 | language stringclasses 2
values | original_status stringclasses 3
values | original_src stringlengths 19 243k | changed_src stringlengths 19 243k | change stringclasses 3
values | i1 int64 0 8.44k | i2 int64 0 8.44k | j1 int64 0 8.44k | j2 int64 0 8.44k | error stringclasses 270
values | stderr stringlengths 0 226k |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02714 | C++ | Time Limit Exceeded | #include <algorithm>
#include <array>
#include <iostream>
#include <math.h>
#include <sstream>
#include <string>
#include <string>
#include <vector>
using ll = long long;
using namespace std;
int main() {
int N;
cin >> N;
string s;
cin >> s;
vector<int> r, g, b;
for (int i = 0; i < N; i++) {
if (s[i] ==... | #include <algorithm>
#include <array>
#include <iostream>
#include <math.h>
#include <sstream>
#include <string>
#include <string>
#include <vector>
using ll = long long;
using namespace std;
int main() {
int N;
cin >> N;
string s;
cin >> s;
vector<int> r, g, b;
for (int i = 0; i < N; i++) {
if (s[i] ==... | replace | 28 | 36 | 28 | 37 | TLE | |
p02714 | C++ | Time Limit Exceeded | // INCLUDE
//------------------------------------------
#include <bits/stdc++.h>
// DEFINE
//------------------------------------------
#define ll long long
#define ld long double
#define ALLv(a) (a).begin(), (a).end()
#define ALL(a, n) (a), (a) + n
#define vi vector<long long>
#define vd vector<long double>
#define vs... | // INCLUDE
//------------------------------------------
#include <bits/stdc++.h>
// DEFINE
//------------------------------------------
#define ll long long
#define ld long double
#define ALLv(a) (a).begin(), (a).end()
#define ALL(a, n) (a), (a) + n
#define vi vector<long long>
#define vd vector<long double>
#define vs... | replace | 34 | 47 | 34 | 48 | TLE | |
p02714 | C++ | Runtime Error | /*
ID: wangjun30
LANG: C++11
TASK:
*/
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#... | /*
ID: wangjun30
LANG: C++11
TASK:
*/
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#... | replace | 36 | 37 | 36 | 37 | 0 | |
p02714 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define int long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define inf 1e18 //(10^18
#define pqmax priority_queue<i... | #include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define int long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define inf 1e18 //(10^18
#define pqmax priority_queue<i... | replace | 46 | 54 | 46 | 61 | TLE | |
p02714 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
int main(void) {
int n;
cin >> n;
string s;
cin >> s;
map<char, int> mp;
mp['R'] = 0;
mp['G'] = 1;
mp['B'] = 2;
vector<vector<int>> colors(3, vector<int>());
for (in... | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
int main(void) {
int n;
cin >> n;
string s;
cin >> s;
map<char, int> mp;
mp['R'] = 0;
mp['G'] = 1;
mp['B'] = 2;
vector<vector<int>> colors(3, vector<int>());
for (in... | replace | 25 | 44 | 25 | 35 | TLE | |
p02714 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < n; i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define inf LLONG_MAX
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
int main() {
ll n;
cin >> n;
string s;
cin >>... | #include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < n; i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define inf LLONG_MAX
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
int main() {
ll n;
cin >> n;
string s;
cin >>... | replace | 31 | 39 | 31 | 58 | TLE | |
p02714 | C++ | Time Limit Exceeded | #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')
... | replace | 28 | 41 | 28 | 36 | TLE | |
p02714 | C++ | Runtime Error | // garnab27
#include <bits/stdc++.h>
#define MP make_pair
#define PB push_back
#define ll int64_t
#define F first
#define S second
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
using namespace std;
ll modex(ll a, ll b, ll p) {
ll res = 1;
a %= p;
while (b > 0) {
if (b & 1)
res = ... | // garnab27
#include <bits/stdc++.h>
#define MP make_pair
#define PB push_back
#define ll int64_t
#define F first
#define S second
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
using namespace std;
ll modex(ll a, ll b, ll p) {
ll res = 1;
a %= p;
while (b > 0) {
if (b & 1)
res = ... | replace | 35 | 36 | 35 | 38 | 0 | |
p02714 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
string S;
cin >> N >> S;
vector<int> r;
vector<int> g;
vector<int> b;
for (int i = 0; i < N; i++) {
if (S[i] == 'R')
r.push_back(i);
else if (S[i] == 'G')
g.push_back(i);
else if (S[i] == 'B')
b.push_back(i);... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
string S;
cin >> N >> S;
vector<int> r;
vector<int> g;
vector<int> b;
for (int i = 0; i < N; i++) {
if (S[i] == 'R')
r.push_back(i);
else if (S[i] == 'G')
g.push_back(i);
else if (S[i] == 'B')
b.push_back(i);... | replace | 25 | 26 | 25 | 26 | 0 | |
p02714 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
string s;
cin >> s;
long long r = 0, g = 0, b = 0;
for (int i = 0; i < n; i++) {
if (s.at(i) == 'R')
r++;
if (s.at(i) == 'G')
g++;
if (s.at(i) == 'B')
b++;
}
int exc = 0;
for (int i = 1; i <= n... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
string s;
cin >> s;
long long r = 0, g = 0, b = 0;
for (int i = 0; i < n; i++) {
if (s.at(i) == 'R')
r++;
if (s.at(i) == 'G')
g++;
if (s.at(i) == 'B')
b++;
}
int exc = 0;
for (int i = 0; i < n;... | replace | 20 | 25 | 20 | 25 | TLE | |
p02714 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <numeric>
#include <set>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
int biggerI(vector<int> &v, int val, int offset = 0) {
int left = offset;
if (v[left] >= val)
return left;
int right = v.size();
if (v[right - 1] < val)
... | #include <algorithm>
#include <iostream>
#include <numeric>
#include <set>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
int biggerI(vector<int> &v, int val, int offset = 0) {
int left = offset;
if (offset >= v.size())
return v.size();
if (v[left] >= val)
return left;
i... | insert | 11 | 11 | 11 | 13 | 0 | |
p02714 | C++ | Time Limit Exceeded | #define _DEBUG 1
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef _DEBUG
#define dump(x) cerr << #x << "=" << x << endl
#define dump2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define dump3(x, y, z) ... | #define _DEBUG 1
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef _DEBUG
#define dump(x) cerr << #x << "=" << x << endl
#define dump2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define dump3(x, y, z) ... | replace | 43 | 48 | 43 | 47 | TLE | |
p02714 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(v) begin(v), end(v)
#define fi first
#define se second
template <typename A, typename B> inline bool chmax(A &a, B b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
... | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(v) begin(v), end(v)
#define fi first
#define se second
template <typename A, typename B> inline bool chmax(A &a, B b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
... | replace | 31 | 32 | 31 | 32 | 0 | |
p02714 | C++ | Time Limit Exceeded | #define _USE_MATH_DEFINES
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
// #include <tuple>
#define INF INT_MAX >> ... | #define _USE_MATH_DEFINES
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
// #include <tuple>
#define INF INT_MAX >> ... | replace | 52 | 62 | 52 | 57 | TLE | |
p02714 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <vector>
using namespace std;
typedef long long ll;
ll count(vector<int> &R, vector<int> &G, vector<int> &B) {
ll sum = 0;
for (int i = 0; i < R.size(); i++) {
for (int j = 0; j < G.size(); j++) {... | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <vector>
using namespace std;
typedef long long ll;
ll count(vector<int> &R, vector<int> &G, vector<int> &B) {
ll sum = 0;
for (int i = 0; i < R.size(); i++) {
for (auto j = std::lower_bound(G.beg... | replace | 13 | 23 | 13 | 19 | TLE | |
p02714 | C++ | Runtime Error | #include <cstring>
#include <iostream>
using namespace std;
typedef long long ll;
bool red[4005];
bool green[4005];
bool blue[4005];
int rr[10005];
int gg[10005];
int bb[10005];
int main() {
int n;
cin >> n;
string s;
cin >> s;
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
red[i] = true;
... | #include <cstring>
#include <iostream>
using namespace std;
typedef long long ll;
bool red[10005];
bool green[10005];
bool blue[10005];
int rr[10005];
int gg[10005];
int bb[10005];
int main() {
int n;
cin >> n;
string s;
cin >> s;
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
red[i] = true;
... | replace | 6 | 9 | 6 | 9 | 0 | |
p02714 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define PI acos(-1)
#define pcnt __builtin_popcountll
#define rng(a) a.begin(), a.end()
#define sz(x) (int)(x).size()
#define v(T) vector<T>
#define vv(T) v(v(T))
#define fi first
#define se second
using namespace std;
typedef long long ll;
typed... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define PI acos(-1)
#define pcnt __builtin_popcountll
#define rng(a) a.begin(), a.end()
#define sz(x) (int)(x).size()
#define v(T) vector<T>
#define vv(T) v(v(T))
#define fi first
#define se second
using namespace std;
typedef long long ll;
typed... | replace | 73 | 74 | 73 | 75 | 0 | |
p02714 | C++ | Runtime Error | // God put a smile upon your face <3
#include <bits/stdc++.h>
#define slld(longvalue) scanf("%lld", &longvalue)
#define ll long long
#define ull unsigned long long
#define pll pair<long long, long long>
#define fastio \
ios_base::sync_with_stdio(fals... | // God put a smile upon your face <3
#include <bits/stdc++.h>
#define slld(longvalue) scanf("%lld", &longvalue)
#define ll long long
#define ull unsigned long long
#define pll pair<long long, long long>
#define fastio \
ios_base::sync_with_stdio(fals... | insert | 52 | 52 | 52 | 55 | 0 | |
p02714 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int N;
char S[4000];
long long int count = 0;
long long int r, g, b;
r = 0;
g = 0;
b = 0;
long long int set, ans;
cin >> N;
cin >> S;
for (int i = 0; i < N; i++) {
if (S[i] == 'R') {
r++;
}
}
for (int i = 0; i < N; i++) {
... | #include <iostream>
using namespace std;
int main() {
int N;
char S[4000];
long long int count = 0;
long long int r, g, b;
r = 0;
g = 0;
b = 0;
long long int set, ans;
cin >> N;
cin >> S;
for (int i = 0; i < N; i++) {
if (S[i] == 'R') {
r++;
}
}
for (int i = 0; i < N; i++) {
... | replace | 36 | 38 | 36 | 38 | 0 | |
p02714 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
string S;
cin >> N;
cin >> S;
int sum = 0;
for (int i = 0; i < N - 2; i++) {
for (int j = i + 1; j < N - 1; j++) {
for (int k = j + 1; k < N; k++) {
if (S.at(j) != S.at(k) && S.at(i) != S.at(k) && S.at(j) != S.at(i)) {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
string s;
cin >> N >> s;
long long int r, g, b;
r = 0, g = 0, b = 0;
for (char ch : s) {
if (ch == 'R')
r++;
else if (ch == 'G')
g++;
else if (ch == 'B')
b++;
}
long long int sum = r * g * b;
for (int i = 0... | replace | 4 | 16 | 4 | 22 | TLE | |
p02714 | C++ | Time Limit Exceeded | #pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll N, i, j, k, ans;
string S;
cin >> N >> S;
ans = 0;
for (i = 0; i < N - 2; i++) {
for (j = i + 1; j < N - 1; j++) {
f... | #pragma GCC target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll N, i, j, k, ans;
string S;
cin >> N >> S;
ans = 0;
for (i = 0; i < N - 2; i++) {
for (j = i... | replace | 0 | 3 | 0 | 3 | TLE | |
p02714 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
unordered_map<char, int> mp;
const int N = 40010;
int a[4][N];
int main() {
int n;
string s;
cin >> n >> s;
mp['R'] = 1, mp['G'] = 2, mp['B'] = 3;
s = " " + s;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= 3; j++)
a[j][i] = a[j][i - 1];
a[mp[... | #include <bits/stdc++.h>
using namespace std;
unordered_map<char, int> mp;
const int N = 40010;
int a[4][N];
int main() {
int n;
string s;
cin >> n >> s;
mp['R'] = 1, mp['G'] = 2, mp['B'] = 3;
s = " " + s;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= 3; j++)
a[j][i] = a[j][i - 1];
a[mp[... | replace | 22 | 23 | 22 | 26 | 0 | |
p02714 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
cin >> n;
cin >> s;
int t = 0;
for (int i = 0; i < n; ++i) {
for (int j = i; j < n; ++j) {
if (s[i] == s[j]) {
continue;
}
for (int k = j; k < n; ++k) {
if (s[i] == s[k]) {
continue... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
cin >> n;
cin >> s;
long long rt = 0;
long long gt = 0;
long long bt = 0;
for (int i = 0; i < n; i++) {
if (s[i] == 'R') {
rt += 1;
}
if (s[i] == 'G') {
gt += 1;
}
if (s[i] == 'B') {
bt ... | replace | 10 | 33 | 10 | 32 | TLE | |
p02714 | C++ | Runtime Error | // agrawal117
// chahatagrawal117
#include <bits/stdc++.h>
#define endl '\n'
#define mod 1000000007
typedef long long int ll;
using namespace std;
#define MAX 100005
vector<ll> v[4];
int idx(char a, char b) {
if (b == 'R')
swap(a, b);
if (a == 'R' && b == 'G')
return 3;
if (a == 'R' && b == 'B')
retur... | // agrawal117
// chahatagrawal117
#include <bits/stdc++.h>
#define endl '\n'
#define mod 1000000007
typedef long long int ll;
using namespace std;
#define MAX 100005
vector<ll> v[4];
int idx(char a, char b) {
if (b == 'R')
swap(a, b);
if (a == 'R' && b == 'G')
return 3;
if (a == 'R' && b == 'B')
retur... | replace | 44 | 45 | 44 | 45 | 0 | |
p02714 | C++ | Runtime Error | #include <bits/stdc++.h>
#define pb push_back
#define pii pair<ll, ll>
#define nyan "(=^・ω・^=)"
#define read_input freopen("in.txt", "r", stdin)
#define print_output freopen("out.txt", "w", stdout)
typedef long long ll;
typedef long double ld;
using namespace std;
const ll maxn = 4e3 + 10;
ll pre[4][maxn], a[maxn];
l... | #include <bits/stdc++.h>
#define pb push_back
#define pii pair<ll, ll>
#define nyan "(=^・ω・^=)"
#define read_input freopen("in.txt", "r", stdin)
#define print_output freopen("out.txt", "w", stdout)
typedef long long ll;
typedef long double ld;
using namespace std;
const ll maxn = 4e3 + 10;
ll pre[4][maxn], a[maxn];
l... | replace | 52 | 53 | 52 | 54 | 0 | |
p02714 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int N;
string A;
int B[10005];
int pre[10005][5];
long long ans;
int main() {
cin >> N >> A;
for (int i = 0; i < N; i++) {
B[i + 1] = (A[i] == 'R' ? 1 : A[i] == 'G' ? 2 : 3);
pre[i + 1][B[i + 1]] = 1;
}
for (int i = 1; i <= N; i++) {
for (int j = 1; j ... | #include <bits/stdc++.h>
using namespace std;
int N;
string A;
int B[10005];
int pre[10005][5];
long long ans;
int main() {
cin >> N >> A;
for (int i = 0; i < N; i++) {
B[i + 1] = (A[i] == 'R' ? 1 : A[i] == 'G' ? 2 : 3);
pre[i + 1][B[i + 1]] = 1;
}
for (int i = 1; i <= N; i++) {
for (int j = 1; j ... | replace | 21 | 22 | 21 | 22 | TLE | |
p02714 | C++ | Runtime Error | /*
PAIN demands to be felt
so do RE, TLE, MLE, SIGSEV & WA
*/
#include <bits/stdc++.h>
using namespace std;
#define CIN \
ios::sync_with_stdio(0); \
cin.tie(0); ... | /*
PAIN demands to be felt
so do RE, TLE, MLE, SIGSEV & WA
*/
#include <bits/stdc++.h>
using namespace std;
#define CIN \
ios::sync_with_stdio(0); \
cin.tie(0); ... | insert | 30 | 30 | 30 | 32 | 0 | |
p02714 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define f first
#define s second
#define pb push_back
#define mod 1000000007
#define mp make_pair
#define fast
#define f first
#define s second
#define endl "\n"
#define pie 3.1415926535
#define IOS ... | #pragma GCC target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define f first
#define s second
#define pb push_back
#define mod 1000000007
#define mp make_pair
#define fast
#define ... | insert | 0 | 0 | 0 | 3 | TLE | |
p02714 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int n;
cin >> n;
string s;
cin >> s;
std::map<int, int> r;
std::map<int, int> g;
std::map<int, int> b;
for (int i = 0; i < n; i++) {
if (s[i] == 'R') {
r.emplace(i + 1, 1);
} else if (s[i] == 'G') {
g.emplace(i + 1, 1);
... | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int n;
cin >> n;
string s;
cin >> s;
std::map<int, int> r;
std::map<int, int> g;
std::map<int, int> b;
for (int i = 0; i < n; i++) {
if (s[i] == 'R') {
r.emplace(i + 1, 1);
} else if (s[i] == 'G') {
g.emplace(i + 1, 1);
... | replace | 22 | 23 | 22 | 23 | TLE | |
p02714 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<ll> vll;
#define PI (2 * acos(0.0))
#define eps 1e-9
#define pb push_back
#define endl "\n"
#define watch(x) cout << (#x) << " ... | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<ll> vll;
#define PI (2 * acos(0.0))
#define eps 1e-9
#define pb push_back
#define endl "\n"
#define watch(x) cout << (#x) << " ... | replace | 88 | 89 | 88 | 89 | 0 | |
p02714 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
cin >> n >> s;
vector<int> v[3];
for (int i = 0; i < n; ++i) {
if (s[i] == 'R')
v[0].push_back(i);
if (s[i] == 'G')
v[1].push_back(i);
if (s[i] == 'B')
v[2].push_back(i);
}
auto check = [&](vect... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
cin >> n >> s;
vector<int> v[3];
for (int i = 0; i < n; ++i) {
if (s[i] == 'R')
v[0].push_back(i);
if (s[i] == 'G')
v[1].push_back(i);
if (s[i] == 'B')
v[2].push_back(i);
}
auto check = [&](vect... | replace | 31 | 32 | 31 | 32 | 0 | |
p02714 | Python | Time Limit Exceeded | N = int(input())
S = input()
exc = 0
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 = j + (j - i)
if N - 1 < k:
continue
if S[k] != S[i] and S[k] != S[j] and S[i] != S[j]:
ans -= 1
print(ans)
| N = int(input())
S = [s for s in 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 = j + (j - i)
if N - 1 < k:
continue
if S[k] != S[i] and S[k] != S[j] and S[i] != S[j]:
ans -= 1
print(ans)
| replace | 1 | 3 | 1 | 2 | TLE | |
p02714 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
long long N;
string s;
int main() {
cin >> N;
cin >> s;
long long total = 0;
for (int i = 0; i <= N - 3; i++) {
for (int j = i + 1; j <= N - 2; j++) {
if (s[i] == s[j]) {
continue;
}
for (int k = j + 1; k <= N - 1; k++) {
if (s[... | #include <bits/stdc++.h>
using namespace std;
long long N;
string s;
int main() {
cin >> N;
cin >> s;
long long 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++;
}
}
long long total = r * g * b;
for (in... | replace | 7 | 18 | 7 | 24 | TLE | |
p02714 | C++ | Time Limit Exceeded | #pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) \
; \
for (int i = 0; i ... | #pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) \
; \
for (int i = 0; i ... | replace | 16 | 18 | 16 | 27 | TLE | |
p02714 | Python | Time Limit Exceeded | n = int(input())
s = input()
rr = 0
gg = 0
bb = 0
for i in range(n):
if s[i] == "R":
rr += 1
if s[i] == "G":
gg += 1
if s[i] == "B":
bb += 1
ans = rr * gg * bb
for i in range(n):
for j in range(n):
if j - i >= 0 and j + i < n:
if s[j - i] != s[j] and s[j] !=... | n = int(input())
s = input()
rr = 0
gg = 0
bb = 0
for i in range(n):
if s[i] == "R":
rr += 1
if s[i] == "G":
gg += 1
if s[i] == "B":
bb += 1
ans = rr * gg * bb
for j in range(n):
for i in range(min(j + 1, n - j)):
if s[j - i] != s[j] and s[j] != s[j + i] and s[j + i] !=... | replace | 15 | 20 | 15 | 19 | TLE | |
p02714 | Python | Time Limit Exceeded | N = int(input())
S = input()
# N = 39
# S = 'RBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB'
n_R = S.count("R")
n_G = S.count("G")
n_B = S.count("B")
ans = n_R * n_G * n_B
for a in range(N - 2):
# a = 2
for b in range(1, N // 2 + 1):
# b = 3
i = a
j = a + b
k = a + 2 * b
if ... | N = int(input())
S = input()
# N = 39
# S = 'RBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB'
n_R = S.count("R")
n_G = S.count("G")
n_B = S.count("B")
ans = n_R * n_G * n_B
for b in range(1, N // 2 + 1):
# b = 2
for a in range(N - 2 * b):
# a = 1
i = a
j = a + b
k = a + 2 * b
... | replace | 11 | 15 | 11 | 15 | TLE | |
p02714 | Python | Runtime Error | from collections import Counter
from copy import copy
n = int(input())
s = input()
total_cnt = dict(Counter(s))
cnt = [total_cnt]
for i, c in enumerate(s):
curr_cnt = copy(cnt[-1])
curr_cnt[c] -= 1
cnt.append(curr_cnt)
res = 0
for i, c1 in enumerate(s):
for j in range(i + 1, n - 1):
c2 = s[j]... | from collections import Counter
from copy import copy
n = int(input())
s = input()
total_cnt = dict(Counter(s))
if len(total_cnt) < 3:
print(0)
exit()
cnt = [total_cnt]
for i, c in enumerate(s):
curr_cnt = copy(cnt[-1])
curr_cnt[c] -= 1
cnt.append(curr_cnt)
res = 0
for i, c1 in enumerate(s):
... | insert | 7 | 7 | 7 | 11 | 0 | |
p02714 | Python | Runtime Error | import sys
from collections import Counter
def input():
return sys.stdin.readline().strip()
sys.setrecursionlimit(20000000)
MOD = 10**9 + 7
INF = float("inf")
def main():
N = int(input())
S = input()
C = Counter(S)
r = C.get("R")
g = C.get("G")
b = C.get("B")
answer = r * g * b
... | import sys
from collections import Counter
def input():
return sys.stdin.readline().strip()
sys.setrecursionlimit(20000000)
MOD = 10**9 + 7
INF = float("inf")
def main():
N = int(input())
S = input()
C = Counter(S)
r = C.get("R", 0)
g = C.get("G", 0)
b = C.get("B", 0)
answer = r *... | replace | 18 | 21 | 18 | 21 | 0 | |
p02714 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t N;
string S;
cin >> N;
cin >> S;
vector<int64_t> R, G, B;
for (int64_t i = 0LL; i < N; i++) {
if (S.at(i) == 'R') {
R.push_back(i);
}
if (S.at(i) == 'G') {
G.push_back(i);
}
if (S.at(i) == 'B') {
B.push... | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t N;
string S;
cin >> N;
cin >> S;
vector<int64_t> R, G, B;
for (int64_t i = 0LL; i < N; i++) {
if (S.at(i) == 'R') {
R.push_back(i);
}
if (S.at(i) == 'G') {
G.push_back(i);
}
if (S.at(i) == 'B') {
B.push... | replace | 26 | 34 | 26 | 52 | TLE | |
p02714 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll n;
cin >> n;
string s;
cin >> s;
ll r = 0, g = 0, b = 0, ans = 0;
for (ll i = 0; i < n - 2; ++i) {
for (ll j = i + 1; j < n - 1; ++j) {
for (ll k = j + 1; k < n; ++k) {
if ((s[i] != s[j] && s[i] != s[k] ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll n;
cin >> n;
string s;
cin >> s;
ll r = 0, g = 0, b = 0, ans = 0;
for (ll i = 0; i < n; ++i) {
if (s[i] == 'R')
r++;
else if (s[i] == 'G')
g++;
else
b++;
}
ans = r * g * b;
for (ll i = ... | replace | 12 | 18 | 12 | 30 | TLE | |
p02714 | C++ | Time Limit Exceeded | #pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
#include <bits/stdc++.h>
int main() {
int n;
string s;
cin >> n >> s;
long res = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < i; j++) {
if (s[i] == s[j])
continue;
for (int k = 0; k < j; k++)
... | #pragma GCC target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
#include <bits/stdc++.h>
int main() {
int n;
string s;
cin >> n >> s;
long res = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < i; j++) {
if (... | insert | 0 | 0 | 0 | 1 | TLE | |
p02714 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
string S;
cin >> N >> S;
int ans = 0;
for (int i = 0; i < N; i++) {
for (int j = i + 1; j < N; j++) {
if (S.at(i) != S.at(j)) {
int x = j - i;
for (int k = j + 1; k < N; k++) {
if (S.at(i) != S.at(k) && S.at... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n;
string s;
cin >> n >> s;
long long r = 0, g = 0, b = 0;
for (long long i = 0; i < n; i++) {
if (s[i] == 'R')
r++;
else if (s[i] == 'G')
g++;
else if (s[i] == 'B')
b++;
}
long long ans = r * g * b;
for ... | replace | 4 | 18 | 4 | 24 | TLE | |
p02714 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
typedef long long ll;
ll n;
char s[4444];
ll SR[4444], SB[4444], SG[4444];
ll Out;
int main() {
scanf("%lld", &n);
scanf("%s", s + 1);
for (int i = 1; i <= n; i++) {
SR[i] = SR[i - 1];
SB[i] = SB[i - 1];
SG[i] = SG[i - 1];
if (s[i] == 'R')
SR[i]++;
... | #include <algorithm>
#include <cstdio>
typedef long long ll;
ll n;
char s[444444];
ll SR[444444], SB[444444], SG[444444];
ll Out;
int main() {
scanf("%lld", &n);
scanf("%s", s + 1);
for (int i = 1; i <= n; i++) {
SR[i] = SR[i - 1];
SB[i] = SB[i - 1];
SG[i] = SG[i - 1];
if (s[i] == 'R')
SR[... | replace | 5 | 7 | 5 | 7 | 0 | |
p02714 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
char c;
vector<int> R, G, B;
cin >> N;
for (int i = 1; i <= N; i++) {
cin >> c;
switch (c) {
case 'R':
R.push_back(i);
break;
case 'G':
G.push_back(i);
break;
case 'B':
B.push_back(i);
bre... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
char c;
vector<int> R, G, B;
cin >> N;
for (int i = 1; i <= N; i++) {
cin >> c;
switch (c) {
case 'R':
R.push_back(i);
break;
case 'G':
G.push_back(i);
break;
case 'B':
B.push_back(i);
bre... | insert | 49 | 49 | 49 | 51 | 0 | |
p02714 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= n; i++)
#define rep2(i, n) for (int i = 0; i <= n; i++)
#define repr(i, a, n) for (int i = a; i < n; i++)
#define all(a) a.begin(), a.end()
#define P pair<long long, ... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= n; i++)
#define rep2(i, n) for (int i = 0; i <= n; i++)
#define repr(i, a, n) for (int i = a; i < n; i++)
#define all(a) a.begin(), a.end()
#define P pair<long long, ... | replace | 53 | 55 | 53 | 55 | 0 | |
p02714 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vec = vector<int>;
#define rep(i, n) for (int(i) = 0; (i) < (n); ++(i))
#define rrep(i, n) for (int(i) = (n); (i) >= 0; --(i))
#define Sort(a) sort(a.begin(), a.end())
#define gSort(a) sort(a.begin(), a.end(), greater<int>())
#define pout(n, a)... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vec = vector<int>;
#define rep(i, n) for (int(i) = 0; (i) < (n); ++(i))
#define rrep(i, n) for (int(i) = (n); (i) >= 0; --(i))
#define Sort(a) sort(a.begin(), a.end())
#define gSort(a) sort(a.begin(), a.end(), greater<int>())
#define pout(n, a)... | replace | 22 | 31 | 22 | 46 | TLE | |
p02714 | C++ | Time Limit Exceeded | #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);
}
}
int... | #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... | replace | 18 | 29 | 18 | 29 | TLE | |
p02714 | C++ | Runtime Error | #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 {
... | #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 {
... | replace | 28 | 31 | 28 | 33 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 4) >= this->size() (which is 4)
|
p02714 | Python | Time Limit Exceeded | def main():
N = int(input())
S = input()
cnt = 0
for i in range(N):
for j in range(i + 1, N):
for k in range(j + 1, N):
if j - i == k - j:
if S[j] != S[i] and S[i] != S[k] and S[k] != S[j]:
cnt += 1
print(S.count("R") * ... | def main():
N = int(input())
S = input()
cnt = 0
for i in range(N):
for j in range(i + 1, N):
k = 2 * j - i
if k >= N:
continue
if S[j] != S[i] and S[i] != S[k] and S[k] != S[j]:
cnt += 1
print(S.count("R") * S.count("B") * ... | replace | 6 | 10 | 6 | 11 | TLE | |
p02714 | Python | Time Limit Exceeded | n = int(input())
s = input()
ans = 0
for i in range(len(s)):
one = s[i]
for j in range(i + 1, len(s)):
if s[j] == one:
continue
dis1 = j - i
two = s[j]
for k in range(j + 1, len(s)):
if s[k] == one or s[k] == two:
continue
else:... | n = int(input())
s = input()
ans = s.count("R") * s.count("G") * s.count("B")
for i in range(n):
for j in range(i + 1, n):
k = 2 * j - i
# 三個目が範囲内 かつ 三文字違う かつ 距離が同じはダメ
if (
k < n
and (s[i] != s[j] and s[j] != s[k] and s[i] != s[k])
and j - i == k - j
... | replace | 2 | 17 | 2 | 15 | TLE | |
p02714 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using ll = long long;
using namespace std;
int n;
string s;
vector<int> v[3];
int idx(int b, int a, int i) { // 在 v[b] 中寻找第一个不小于 v[a][i] 的下标
return upper_bound(v[b].begin(), v[b].end(), v[a][i]) - v[b].begin();
}
ll cal(int a, int b, int c) {
ll ret = 0;
for (int i = 0; i < v[a].size()... | #include <bits/stdc++.h>
using ll = long long;
using namespace std;
int n;
string s;
vector<int> v[3];
inline int idx(int b, int a,
int i) { // 在 v[b] 中寻找第一个不小于 v[a][i] 的下标
return upper_bound(v[b].begin(), v[b].end(), v[a][i]) - v[b].begin();
}
ll cal(int a, int b, int c) {
ll ret = 0;
for (int ... | replace | 8 | 9 | 8 | 10 | TLE | |
p02714 | C++ | Runtime Error | #include <bits/stdc++.h>
#define speed \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
#define int long long
using namespac... | #include <bits/stdc++.h>
#define speed \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
#define int long long
using namespac... | replace | 9 | 10 | 9 | 10 | 0 | |
p02714 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
int N;
cin >> N;
string S;
cin >> S;
vector<int> RED;
vector<int> GR;
vector<int> BLUE;
rep(i, S.size()) {
if (S[i] == 'R') {
RED.push_back(i);
} else if (S[i] == 'G') {
GR.push_b... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
int N;
cin >> N;
string S;
cin >> S;
vector<int> RED;
vector<int> GR;
vector<int> BLUE;
rep(i, S.size()) {
if (S[i] == 'R') {
RED.push_back(i);
} else if (S[i] == 'G') {
GR.push_b... | replace | 21 | 28 | 21 | 40 | TLE | |
p02714 | Python | Runtime Error | def main():
from collections import Counter
n, s = int(input()), input()
c = Counter(s)
d = list(c.values())
ans = d[0] * d[1] * d[2]
rgb = {"R", "G", "B"}
for i in range(1, n // 2 + 1):
for j in range(i):
x = s[j::i]
for a, b, c in zip(x, x[1:], x[2:]):
... | def main():
from collections import Counter
n, s = int(input()), input()
c = Counter(s)
d = list(c.values())
if len(d) < 3:
print(0)
exit()
ans = d[0] * d[1] * d[2]
rgb = {"R", "G", "B"}
for i in range(1, n // 2 + 1):
for j in range(i):
x = s[j::i]
... | replace | 6 | 7 | 6 | 9 | 0 | |
p02714 | Python | Time Limit Exceeded | n = int(input())
s = list(input())
tot = 0
R = [i for i, x in enumerate(s) if x == "R"]
G = [i for i, x in enumerate(s) if x == "G"]
B = [i for i, x in enumerate(s) if x == "B"]
tot += len(R) * len(G) * len(B)
for i in range(len(R)):
for j in range(len(G)):
for k in range(len(B)):
if (
... | n = int(input())
s = list(input())
tot = 0
tot += s.count("R") * s.count("G") * s.count("B")
for i in range(n):
for j in range(i + 1, n):
k = 2 * j - i
if k < n and s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
tot -= 1
print(tot)
| replace | 3 | 16 | 3 | 9 | TLE | |
p02714 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define MOD (long long int)(1e9 + 7)
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n) for (int i = 1; i <= (int)(n); i++)
#define REP(i, n) for (int i = n - 1; i >= 0; i--)
#define REPS(i, n) for (int i = n; i > 0; i--)
#defin... | #include <bits/stdc++.h>
using namespace std;
#define MOD (long long int)(1e9 + 7)
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n) for (int i = 1; i <= (int)(n); i++)
#define REP(i, n) for (int i = n - 1; i >= 0; i--)
#define REPS(i, n) for (int i = n; i > 0; i--)
#defin... | replace | 56 | 68 | 56 | 65 | TLE | |
p02714 | Python | Time Limit Exceeded | N = int(input())
S = 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):
if S[i] != S[j]:
x = 2 * j - i
if x <= N - 1 and S[i] != S[x] and S[x] != S[j]:
ans -= 1
print(ans)
| N = int(input())
S = 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):
if S[i] != S[j]:
x = 2 * j - i
if x < N and S[i] != S[x] and S[x] != S[j]:
ans -= 1
print(ans)
| replace | 8 | 9 | 8 | 9 | TLE | |
p02714 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
string a;
cin >> a;
int ans = 0;
for (int i = 0; i < n - 2; i++) {
for (int j = i + 1; j < n - 1; j++) {
if (a[i] != a[j]) {
for (int k = j + 1; k < n; k++) {
if (a[k] != a[i] && a[k] != a[j] && k + i !=... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
string a;
cin >> a;
long long int r = 0, g = 0, b = 0;
for (int i = 0; i < n; i++) {
if (a[i] == 'R')
r++;
else if (a[i] == 'G')
g++;
else
b++;
}
long long int ans = r * g * b;
for (int i = 0; i ... | replace | 8 | 17 | 8 | 25 | TLE | |
p02714 | C++ | Runtime Error | // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
typedef long long ll;
#define pb push_back
#define mii map<int, int>
#define mll map<ll, ll>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vd vector<double>
#define vll vector<ll>
#define fi first
#define se second
#define si set<in... | // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
typedef long long ll;
#define pb push_back
#define mii map<int, int>
#define mll map<ll, ll>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vd vector<double>
#define vll vector<ll>
#define fi first
#define se second
#define si set<in... | replace | 31 | 32 | 31 | 32 | 0 | |
p02714 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cout << setprecision(10) << fixed;
int n;
string s;
cin >> n >> s;
vector<int> a[3];
map<char, int> mp = {{'R', 0}, {'G', 1}, {'B', 2}};
for (int i = 0; i < n; ++i) {
a[mp[s[i]]].push_back(i);
}
long long ans = ... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cout << setprecision(10) << fixed;
int n;
string s;
cin >> n >> s;
vector<int> a[3];
map<char, int> mp = {{'R', 0}, {'G', 1}, {'B', 2}};
for (int i = 0; i < n; ++i) {
a[mp[s[i]]].push_back(i);
}
long long ans = ... | replace | 17 | 24 | 17 | 27 | TLE | |
p02714 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#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)
using namespace std;
using ll = long long;
int main() {
int n;
cin >> n;
string s;
cin >> s;
vector<int> r, g, b;
rep(i, n) {
if (s[i] == 'R')
... | #include <bits/stdc++.h>
#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)
using namespace std;
using ll = long long;
int main() {
int n;
cin >> n;
string s;
cin >> s;
vector<int> r, g, b;
rep(i, n) {
if (s[i] == 'R')
... | replace | 24 | 33 | 24 | 33 | TLE | |
p02714 | C++ | Runtime Error | #include <bits/stdc++.h>
#define pb push_back
#define ll long long
using namespace std;
vector<int> r, g, b;
char s[4005];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
cin >> n >> s;
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
r.pb(i);
else if (s[i] == 'G')
... | #include <bits/stdc++.h>
#define pb push_back
#define ll long long
using namespace std;
vector<int> r, g, b;
char s[4005];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
cin >> n >> s;
for (int i = 0; i < n; i++) {
if (s[i] == 'R')
r.pb(i);
else if (s[i] == 'G')
... | replace | 21 | 31 | 21 | 25 | 0 | |
p02714 | C++ | Time Limit Exceeded | #include <algorithm>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <string>
#include <vector>
const int MOD = 1e9 + 7;
typedef long long ll;
using namespace std;
int main() {
int n;
ll ans = 0;
string s;
cin >> n >> s;
vector<int> r;
vect... | #include <algorithm>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <string>
#include <vector>
const int MOD = 1e9 + 7;
typedef long long ll;
using namespace std;
int main() {
int n;
ll ans = 0;
string s;
cin >> n >> s;
vector<int> r;
vect... | replace | 31 | 39 | 31 | 44 | TLE | |
p02714 | Python | Time Limit Exceeded | #!/usr/bin/env python3
def main():
N = int(input())
S = input()
ans = 0
for i in range(N):
for j in range(i, N):
for k in range(j, N):
if (
1
and S[i] != S[j]
and S[i] != S[k]
and S[j] !=... | #!/usr/bin/env python3
def main():
N = int(input())
S = input()
res = 0
R, G, B = S.count("R"), S.count("G"), S.count("B")
for i in range(N - 2):
for j in range(i + 1, N - 1):
k = j + j - i
if k >= N:
continue
if S[i] != S[j] and S[i] != S... | replace | 5 | 18 | 5 | 15 | TLE | |
p02715 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <vector>
using namespace std;
typedef vector... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <vector>
using namespace std;
typedef vector... | replace | 89 | 90 | 89 | 90 | 0 | |
p02715 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>... | replace | 43 | 44 | 43 | 44 | 0 | |
p02715 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
#define int long long
#define REP(i, n) for (int i = 0; i < n; i++)
#define pb push_back
#define mp make_pair
#define Pii pair<int, int>
#define Pid pair<int, double>
#define Pdd pair<double, do... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
#define int long long
#define REP(i, n) for (int i = 0; i < n; i++)
#define pb push_back
#define mp make_pair
#define Pii pair<int, int>
#define Pid pair<int, double>
#define Pdd pair<double, do... | replace | 22 | 24 | 22 | 29 | TLE | |
p02715 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstdio>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define RE... | #include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstdio>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define RE... | replace | 101 | 102 | 101 | 102 | 0 | |
p02715 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define inf 1001001001
#define mod 1000000007
#define pi 3.141592653589793
typedef vector<int> vi;
typedef vector<ll> vl;
ll gcd(ll a, ll b) {
if (b > a)
swap(a, b);
if (b == 0)
return a;... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define inf 1001001001
#define mod 1000000007
#define pi 3.141592653589793
typedef vector<int> vi;
typedef vector<ll> vl;
ll gcd(ll a, ll b) {
if (b > a)
swap(a, b);
if (b == 0)
return a;... | replace | 54 | 63 | 54 | 55 | TLE | |
p02715 | C++ | Runtime Error | #include <bits/stdc++.h>
// #define DEBUG
#ifdef DEBUG
using std::endl;
std::ifstream cin("input.txt");
std::ofstream cout("output.txt");
#endif // DEBUG
#ifndef DEBUG
using namespace std;
#endif // DEBUG
template <class T> void print_vect(T v) {
for (int i = 0; i < v.size(); i++)
cout << v[i] << " ";
cout <... | #include <bits/stdc++.h>
// #define DEBUG
#ifdef DEBUG
using std::endl;
std::ifstream cin("input.txt");
std::ofstream cout("output.txt");
#endif // DEBUG
#ifndef DEBUG
using namespace std;
#endif // DEBUG
template <class T> void print_vect(T v) {
for (int i = 0; i < v.size(); i++)
cout << v[i] << " ";
cout <... | replace | 73 | 74 | 73 | 74 | 0 | |
p02715 | Python | Time Limit Exceeded | from collections import defaultdict
N, K = [int(i) for i in input().split()]
mod = 10**9 + 7
dd = defaultdict(int)
ans = 0
for i in range(K, 0, -1):
dd[i] = (K // i) ** N
for temp in range(i * 2, K + 1, i):
dd[i] -= dd[temp]
ans += dd[i] * i
ans %= mod
print(ans)
| from collections import defaultdict
N, K = [int(i) for i in input().split()]
mod = 10**9 + 7
dd = defaultdict(int)
ans = 0
for i in range(K, 0, -1):
dd[i] = pow(K // i, N, mod)
for temp in range(i * 2, K + 1, i):
dd[i] -= dd[temp]
ans += dd[i] * i
ans %= mod
print(ans)
| replace | 8 | 9 | 8 | 9 | TLE | |
p02715 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define maxn 100010
const int MOD = 1000000007;
int pw(int a, int b, int m = MOD) {
if (b == 0)
return 1;
if (b & 1)
return a * pw(a, b - 1) % m;
return pw(a * a % m, b / 2);
}
void solve() {
int n, k;
cin >> n >... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define maxn 100010
const int MOD = 1000000007;
int pw(int a, int b, int m = MOD) {
if (b == 0)
return 1;
if (b & 1)
return a * pw(a, b - 1) % m;
return pw(a * a % m, b / 2);
}
void solve() {
int n, k;
cin >> n >... | replace | 21 | 22 | 21 | 22 | 0 | |
p02715 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mo = 1000000007;
ll modpow(ll a, ll n, ll mod) {
ll ret = 1;
while (n > 0) {
if (n & 1)
ret = ret * a % mod;
a = a * a % mod;
n >>= 1;
}
return ret;
}
ll MOD(ll a, ll mod) {
ll temp = a % mod;
if (temp < 0)
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mo = 1000000007;
ll modpow(ll a, ll n, ll mod) {
ll ret = 1;
while (n > 0) {
if (n & 1)
ret = ret * a % mod;
a = a * a % mod;
n >>= 1;
}
return ret;
}
ll MOD(ll a, ll mod) {
ll temp = a % mod;
if (temp < 0)
... | replace | 28 | 29 | 28 | 29 | 0 | |
p02715 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
///////////////////////////////////////////
const long long int INF = 1LL << 60;
const long long int Mod = 1000000007;
using ll = long long int;
using ci = const int;
using vi = vector<int>;
using Vi = vector<long long int>;
using P = pair<int, int>;
using PLL = pair<ll, ll... | #include "bits/stdc++.h"
using namespace std;
///////////////////////////////////////////
const long long int INF = 1LL << 60;
const long long int Mod = 1000000007;
using ll = long long int;
using ci = const int;
using vi = vector<int>;
using Vi = vector<long long int>;
using P = pair<int, int>;
using PLL = pair<ll, ll... | replace | 142 | 143 | 142 | 143 | 0 | |
p02715 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
ll modpow(ll a, ll n) {
ll res = 1;
while (n > 0) {
if (n & 1)
res = res * a % MOD;
a = a * a % MOD;
n >>= 1;
}
return res;
}
int main() {
ll N, K;
cin >> N >> K;
ll ans = 0;
ll num[N + 1]... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
ll modpow(ll a, ll n) {
ll res = 1;
while (n > 0) {
if (n & 1)
res = res * a % MOD;
a = a * a % MOD;
n >>= 1;
}
return res;
}
int main() {
ll N, K;
cin >> N >> K;
ll ans = 0;
ll num[K + 1]... | replace | 21 | 22 | 21 | 22 | 0 | |
p02715 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long long mpow(long long x, int n) {
long long r = 1;
while (n > 0) {
if (n & 1)
r = r * x % 1000000007;
x = x * x % 1000000007;
n >>= 1;
}
return r;
}
int main() {
int n, k;
cin >> n >> k;
long long sumg = 0;
vector<long long> cntg(k);
... | #include <bits/stdc++.h>
using namespace std;
long long mpow(long long x, int n) {
long long r = 1;
while (n > 0) {
if (n & 1)
r = r * x % 1000000007;
x = x * x % 1000000007;
n >>= 1;
}
return r;
}
int main() {
int n, k;
cin >> n >> k;
long long sumg = 0;
long long cntg[100010];
f... | replace | 19 | 20 | 19 | 20 | 0 | |
p02715 | Python | Runtime Error | # YouTube解説
MOD = 1000000007
n, k = [int(x) for x in input().split()]
d = [0] * (k + 1)
for i in range(0, k + 1):
d[i] = pow(k // i, n, MOD)
for i in range(k, 0, -1): # 大きいほうから
for j in range(i * 2, k + 1, i): # iの倍数
# d[6] = d'[6] - d[12] - d[18] ...
d[i] -= d[j]
d[i] %= MOD
ans = 0... | # YouTube解説
MOD = 1000000007
n, k = [int(x) for x in input().split()]
d = [0] * (k + 1)
for i in range(1, k + 1):
d[i] = pow(k // i, n, MOD)
for i in range(k, 0, -1): # 大きいほうから
for j in range(i * 2, k + 1, i): # iの倍数
# d[6] = d'[6] - d[12] - d[18] ...
d[i] -= d[j]
d[i] %= MOD
ans = 0... | replace | 5 | 6 | 5 | 6 | ZeroDivisionError: integer division or modulo by zero | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02715/Python/s098159754.py", line 7, in <module>
d[i] = pow(k // i, n, MOD)
ZeroDivisionError: integer division or modulo by zero
|
p02715 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
using ll = long long;
ll mypow(ll a, ll b) {
ll res = a;
for (int i = 1; i < b; ++i) {
res = (res * a) % mod;
}
return res;
}
int main() {
ll N, K;
cin >> N >> K;
ll res = 0;
ll cnt[100001] = {};
for (ll i = K; i > 0; --i) {... | #include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
using ll = long long;
ll mypow(ll a, ll b) {
ll res = 1;
while (b > 0) {
if (b & 1) {
res = (res * a) % mod;
}
a = (a * a) % mod;
b >>= 1;
}
return res;
}
int main() {
ll N, K;
cin >> N >> K;
ll res = 0;
ll c... | replace | 8 | 11 | 8 | 15 | TLE | |
p02715 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define each(i, c) for (auto &i : c)
#define mkp(a, b) make_pair(a, b)
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> Pll;
const ll MOD = 1e9 + 7;
template <typename P, typename Q>
ostream &operator<<(ostream &os, pair<P, Q> p) {
os << "(" <... | #include <bits/stdc++.h>
using namespace std;
#define each(i, c) for (auto &i : c)
#define mkp(a, b) make_pair(a, b)
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> Pll;
const ll MOD = 1e9 + 7;
template <typename P, typename Q>
ostream &operator<<(ostream &os, pair<P, Q> p) {
os << "(" <... | replace | 108 | 109 | 108 | 109 | 0 | |
p02715 | C++ | Runtime Error | // https://atcoder.jp/contests/abc162/tasks/abc162_e
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
... | // https://atcoder.jp/contests/abc162/tasks/abc162_e
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
... | replace | 78 | 79 | 78 | 79 | 0 | |
p02715 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ll mod = 1e9 + 7;
// const ll mod = 998244353;
#define REP(i, n) for (int i = 0; i < (int)n; ++i)
// debug
#define dump(x) cer... | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ll mod = 1e9 + 7;
// const ll mod = 998244353;
#define REP(i, n) for (int i = 0; i < (int)n; ++i)
// debug
#define dump(x) cer... | replace | 127 | 128 | 127 | 128 | TLE | |
p02715 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < b; ++i)
#define all(c) c.begin(), c.end()
#define gmax(x, y) x = max(x, y)
#define gmin(x, y) x = min(x, y)
#define gadd(x, y) x = add(x, y)
#define gmul(x, y) x = mul(x, y)
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
const i... | #include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < b; ++i)
#define all(c) c.begin(), c.end()
#define gmax(x, y) x = max(x, y)
#define gmin(x, y) x = min(x, y)
#define gadd(x, y) x = add(x, y)
#define gmul(x, y) x = mul(x, y)
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
const i... | replace | 42 | 43 | 42 | 43 | 0 | |
p02715 | C++ | Runtime Error | // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
//----------------------- Print Function ----------------------//
inline void print() { cout << '\n'; }
template <typename First, typename... Rest>
void print(const First &first, const Rest &...rest) {
cout << first << ' ';
print(rest...);
}... | // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
//----------------------- Print Function ----------------------//
inline void print() { cout << '\n'; }
template <typename First, typename... Rest>
void print(const First &first, const Rest &...rest) {
cout << first << ' ';
print(rest...);
}... | replace | 84 | 85 | 84 | 85 | 0 | |
p02715 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#inc... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#inc... | replace | 100 | 101 | 100 | 101 | TLE | |
p02715 | C++ | Runtime Error | #include <bits/stdc++.h>
// #define fi first
// #define se second
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
#define FORR(i, a, b) for (int i = (b)-1; i >= (a); --i)
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
tem... | #include <bits/stdc++.h>
// #define fi first
// #define se second
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
#define FORR(i, a, b) for (int i = (b)-1; i >= (a); --i)
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
tem... | replace | 169 | 170 | 169 | 170 | 0 | |
p02715 | C++ | Runtime Error | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdlib>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep2(i, n, m) for (ll i = n; i <= m; i++)
#define rep3(i, n, m) for (ll i = n; ... | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdlib>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep2(i, n, m) for (ll i = n; i <= m; i++)
#define rep3(i, n, m) for (ll i = n; ... | replace | 92 | 93 | 92 | 93 | 0 | |
p02715 | C++ | Runtime Error | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REP1(i, a, b) for (int i = a; i <= (int)(b); i++)
#define ALL(x) begin(x), end(x)
#define PB push_back
using namespace std;
typedef int64_t LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
template <class T> inline bool chmax(... | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REP1(i, a, b) for (int i = a; i <= (int)(b); i++)
#define ALL(x) begin(x), end(x)
#define PB push_back
using namespace std;
typedef int64_t LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
template <class T> inline bool chmax(... | replace | 107 | 108 | 107 | 108 | 0 | |
p02715 | C++ | Runtime Error | #pragma GCC optimize("O3")
#include <algorithm>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
using QWORD = uint64... | #pragma GCC optimize("O3")
#include <algorithm>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
using QWORD = uint64... | replace | 264 | 266 | 264 | 266 | 0 | |
p02715 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <stdint.h>
#include <string>
#include <time.h>
#include <unordered_map>
#include ... | #include <algorithm>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <stdint.h>
#include <string>
#include <time.h>
#include <unordered_map>
#include ... | replace | 99 | 100 | 99 | 105 | TLE | |
p02715 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define pii pair<int, int>
#define pli pair<ll, int>
#define pil pair<int, ll>
#define pll pair<ll, ll>
const int inf = 1 << 30;
const ll linf = 1e18;
const ll mod = 1e9 + 7;
template <class T> void chmin(T &x, T y) {
if (x > y)
... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define pii pair<int, int>
#define pli pair<ll, int>
#define pil pair<int, ll>
#define pll pair<ll, ll>
const int inf = 1 << 30;
const ll linf = 1e18;
const ll mod = 1e9 + 7;
template <class T> void chmin(T &x, T y) {
if (x > y)
... | replace | 85 | 86 | 85 | 86 | 0 | |
p02715 | C++ | Runtime Error | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long LL;
const LL MOD = 1000000007LL;
LL modpow(LL x, LL n) {
LL r = 1;
while (n != 0) {
if (n & 1)
r = r * x % MOD;
x = x * x % MOD;
n >>= 1;
}
return r;
}
int main() {
int N, K;
... | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long LL;
const LL MOD = 1000000007LL;
LL modpow(LL x, LL n) {
LL r = 1;
while (n != 0) {
if (n & 1)
r = r * x % MOD;
x = x * x % MOD;
n >>= 1;
}
return r;
}
int main() {
int N, K;
... | replace | 21 | 22 | 21 | 22 | 0 | |
p02715 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
static const int64_t MOD = 1000000007;
int64_t modpow(int64_t base, int64_t k, int64_t mod) {
base %= mod;
int64_t answer = 1;
while (k > 0) {
if (k & 1)
answer = (answer * base) % mod;
base = (base * base) % mod;
k >>= 1;
}
return answer;
}
... | #include <bits/stdc++.h>
using namespace std;
static const int64_t MOD = 1000000007;
int64_t modpow(int64_t base, int64_t k, int64_t mod) {
base %= mod;
int64_t answer = 1;
while (k > 0) {
if (k & 1)
answer = (answer * base) % mod;
base = (base * base) % mod;
k >>= 1;
}
return answer;
}
... | replace | 22 | 23 | 22 | 23 | 0 | |
p02715 | C++ | Runtime Error | #line 1 "/mnt/c/Users/leafc/dev/compro/lib/math/modint.hpp"
#include <cstdint>
#include <iostream>
#ifndef MOD_INT
#define MOD_INT
template <std::uint_fast64_t MOD> class ModInt {
using u64 = std::uint_fast64_t;
public:
ModInt(const u64 val = 0) { value = val % MOD; }
ModInt operator+(const ModInt rhs) const {... | #line 1 "/mnt/c/Users/leafc/dev/compro/lib/math/modint.hpp"
#include <cstdint>
#include <iostream>
#ifndef MOD_INT
#define MOD_INT
template <std::uint_fast64_t MOD> class ModInt {
using u64 = std::uint_fast64_t;
public:
ModInt(const u64 val = 0) { value = val % MOD; }
ModInt operator+(const ModInt rhs) const {... | replace | 147 | 148 | 147 | 148 | 0 | |
p02715 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long BIG = 1000000007;
long long modpow(long long a, long long n, long long mod) {
long long res = 1;
while (n > 0) {
if (n & 1)
res = res * a % mod;
a = a * a % mod;
n >>= 1;
}
return res;
}
int main() {
long N, K;
long long ans = 0;
cin ... | #include <bits/stdc++.h>
using namespace std;
long BIG = 1000000007;
long long modpow(long long a, long long n, long long mod) {
long long res = 1;
while (n > 0) {
if (n & 1)
res = res * a % mod;
a = a * a % mod;
n >>= 1;
}
return res;
}
int main() {
long N, K;
long long ans = 0;
cin ... | replace | 21 | 22 | 21 | 22 | 0 | |
p02715 | C++ | Runtime Error | #include <bits/stdc++.h>
/*
#include<boost/multiprecision/cpp_int.hpp>
namespace mp=boost::multiprecision;
*/
using namespace std;
#define ll long long int
#define lo mp::cpp_int
#define pb push_back
#define pob pop_back
#define mp make_pair
#define endl "\n"
#define ce(x) cout << x << "\n"
#define fill(s, v) memset(s,... | #include <bits/stdc++.h>
/*
#include<boost/multiprecision/cpp_int.hpp>
namespace mp=boost::multiprecision;
*/
using namespace std;
#define ll long long int
#define lo mp::cpp_int
#define pb push_back
#define pob pop_back
#define mp make_pair
#define endl "\n"
#define ce(x) cout << x << "\n"
#define fill(s, v) memset(s,... | replace | 359 | 360 | 359 | 360 | 0 | |
p02715 | C++ | Runtime Error | #include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i, n) for (int i = 0; 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(a) a.begin(), a.end()
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)), x.end()... | #include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i, n) for (int i = 0; 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(a) a.begin(), a.end()
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)), x.end()... | replace | 76 | 77 | 76 | 77 | 0 | |
p02715 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// repetition
#define FOR(i, a, b) for (ll i = (a); i < (b); ++i)
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
// container util
#define all(x) (x).begin(), (x).end()
// typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll... | #include <bits/stdc++.h>
using namespace std;
// repetition
#define FOR(i, a, b) for (ll i = (a); i < (b); ++i)
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
// container util
#define all(x) (x).begin(), (x).end()
// typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll... | replace | 150 | 152 | 150 | 152 | 0 | |
p02715 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define S scanf
#define P printf
#define G getline
#define SZ size()
#define C clear()
#define B begin()
#define F front()
#define T top()
#define E end()
#define EM empty()
#define V vector
#define Q queue
#define DQ deque
#define PQ priority_queue
#define ST stack
#defi... | #include <bits/stdc++.h>
using namespace std;
#define S scanf
#define P printf
#define G getline
#define SZ size()
#define C clear()
#define B begin()
#define F front()
#define T top()
#define E end()
#define EM empty()
#define V vector
#define Q queue
#define DQ deque
#define PQ priority_queue
#define ST stack
#defi... | replace | 73 | 74 | 73 | 74 | 0 | |
p02715 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define show(x) \
{ ... | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define show(x) \
{ ... | replace | 121 | 122 | 121 | 122 | 0 | |
p02715 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long gcd(long long a, long long b) {
if (a < b) {
swap(a, b);
}
if (a % b == 0) {
return b;
}
return gcd(b, a % b);
}
long long power(long long a, long long b) {
long long ans = 1;
while (b) {
if (b % 2) {
... | #include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long gcd(long long a, long long b) {
if (a < b) {
swap(a, b);
}
if (a % b == 0) {
return b;
}
return gcd(b, a % b);
}
long long power(long long a, long long b) {
long long ans = 1;
while (b) {
if (b % 2) {
... | replace | 32 | 33 | 32 | 33 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.