problem_id stringlengths 6 6 | buggy_code stringlengths 8 526k ⌀ | fixed_code stringlengths 12 526k ⌀ | labels listlengths 0 15 ⌀ | buggy_submission_id int64 1 1.54M ⌀ | fixed_submission_id int64 2 1.54M ⌀ | user_id stringlengths 10 10 ⌀ | language stringclasses 9 values |
|---|---|---|---|---|---|---|---|
p02990 | #include <algorithm>
#include <functional>
#include <iostream>
#include <limits.h>
#include <string>
#include <vector>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
vector<vector<int>> nCk(n + 1, vector<int>(n + 1));
for (int i = 0; i <= n; i++) {
nCk[i][0] = 1;
nCk[i][i] = 1;
for (int j = 1; j <= i - 1; j++) {
nCk[i][j] = (nCk[i - 1][j - 1] + nCk[i - 1][j]) % 1000000007;
}
}
for (int i = 1; i <= k; i++)
cout << nCk[k - 1][i - 1] * nCk[n - k + 1][i] % 1000000007 << endl;
return 0;
}
| #include <algorithm>
#include <functional>
#include <iostream>
#include <limits.h>
#include <string>
#include <vector>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
vector<vector<int>> nCk(n + 1, vector<int>(n + 1, 0));
for (int i = 0; i <= n; i++) {
nCk[i][0] = 1;
nCk[i][i] = 1;
for (int j = 1; j <= i - 1; j++) {
nCk[i][j] = (nCk[i - 1][j - 1] + nCk[i - 1][j]) % 1000000007;
}
}
for (int i = 1; i <= k; i++)
cout << (long long)nCk[k - 1][i - 1] * nCk[n - k + 1][i] % 1000000007
<< endl;
return 0;
}
| [
"call.arguments.add"
] | 800,474 | 800,473 | u433162241 | cpp |
p02990 | #include "bits/stdc++.h"
using namespace std;
#define COUNTOF(array) (sizeof(array) / sizeof(array[0]))
#define OUT(P) cout << (P) << endl
#define OUT2(P1, P2) cout << (P1) << " " << (P2) << endl
#define PRINT_ARRAY(P) \
for (int i = 0; i < P.size(); i++) \
cout << P[i] << endl;
#define PRINT_ARRAY_INLINE(P) \
do { \
for (int i = 0; i < P.size(); i++) \
cout << P[i] << " "; \
cout << endl; \
} while (0)
#define PRINT_ARRAY_WITH_LABEL(L, P) \
do { \
cout << L << ": "; \
PRINT_ARRAY_INLINE(P); \
cout << endl; \
} while (0)
typedef long long ll;
const long DIVIDE = 1e9 + 7;
int sum_digits(int num);
template <class T> vector<T> copy_vector(vector<T> vec);
long gcd(long a, long b);
long lcm(long a, long b);
// ****** print functions ****** //
template <class T, class U> void print_pairs(const vector<pair<T, U>> pairs);
template <class K, class V> void print_map(const map<K, V> m);
vector<vector<long>> comb(int n, int r) {
vector<vector<long>> v(n + 1, vector<long>(n + 1, 0));
for (int i = 0; i < v.size(); i++) {
v[i][0] = 1;
v[i][i] = 1;
}
for (int i = 1; i < v.size(); i++) {
for (int j = 1; j < i; j++) {
v[i][j] = (v[i - 1][j - 1] + v[i - 1][j]);
}
}
return v;
}
long order(long n, long k) {
long rtn = 1;
for (long i = 0; i < k; i++) {
rtn *= (n - i);
}
return rtn;
}
int main() {
long n, k;
cin >> n >> k;
long hole = n - k + 1;
vector<vector<long>> comb_ = comb(2000, 2000);
for (long i = 1; i <= k; i++) {
long c1 = comb_[hole][i];
long c2 = comb_[k - 1][i - 1];
// long comb = order(hole, i) / order(i, i);
// long comb2 = order(k-1, i-1) / order(i-1, i-1);
cout << (c1 * c2) % DIVIDE << endl;
}
return 0;
}
/******************************/
/***** DECRARED FUNCTIONS *****/
/******************************/
int sum_digits(int num) {
int rtn = 0;
while (num != 0) {
int tmp = num % 10;
rtn += tmp;
num /= 10;
}
return rtn;
}
// vectorのコピー
template <class T> vector<T> copy_vector(vector<T> vec) {
vector<T> rtn;
rtn.reserve(vec.size());
copy(vec.begin(), vec.end(), back_inserter(rtn));
return rtn;
}
long gcd(long a, long b) {
if (b == 0)
return a;
else
return gcd(b, a % b);
}
long lcm(long a, long b) {
long gcd_ = gcd(a, b);
return (a * b) / gcd_;
}
template <class T, class U> void print_pairs(const vector<pair<T, U>> &pairs) {
for (int i = 0; i < pairs.size(); i++) {
cout << "(" << pairs[i].first << ", " << pairs[i].second << ")"
<< " ";
}
cout << endl;
}
template <class K, class V> void print_map(const map<K, V> &m) {
for (auto it = m.cbegin(); it != m.cend(); it++) {
cout << it->first << ": " << it->second << endl;
}
}
| #include "bits/stdc++.h"
using namespace std;
#define COUNTOF(array) (sizeof(array) / sizeof(array[0]))
#define OUT(P) cout << (P) << endl
#define OUT2(P1, P2) cout << (P1) << " " << (P2) << endl
#define PRINT_ARRAY(P) \
for (int i = 0; i < P.size(); i++) \
cout << P[i] << endl;
#define PRINT_ARRAY_INLINE(P) \
do { \
for (int i = 0; i < P.size(); i++) \
cout << P[i] << " "; \
cout << endl; \
} while (0)
#define PRINT_ARRAY_WITH_LABEL(L, P) \
do { \
cout << L << ": "; \
PRINT_ARRAY_INLINE(P); \
cout << endl; \
} while (0)
typedef long long ll;
const long DIVIDE = 1e9 + 7;
int sum_digits(int num);
template <class T> vector<T> copy_vector(vector<T> vec);
long gcd(long a, long b);
long lcm(long a, long b);
// ****** print functions ****** //
template <class T, class U> void print_pairs(const vector<pair<T, U>> pairs);
template <class K, class V> void print_map(const map<K, V> m);
vector<vector<long>> comb(int n, int r) {
vector<vector<long>> v(n + 1, vector<long>(n + 1, 0));
for (int i = 0; i < v.size(); i++) {
v[i][0] = 1;
v[i][i] = 1;
}
for (int i = 1; i < v.size(); i++) {
for (int j = 1; j < i; j++) {
v[i][j] = (v[i - 1][j - 1] + v[i - 1][j]) % DIVIDE;
}
}
return v;
}
long order(long n, long k) {
long rtn = 1;
for (long i = 0; i < k; i++) {
rtn *= (n - i);
}
return rtn;
}
int main() {
long n, k;
cin >> n >> k;
long hole = n - k + 1;
vector<vector<long>> comb_ = comb(2000, 2000);
for (long i = 1; i <= k; i++) {
long c1 = comb_[hole][i];
long c2 = comb_[k - 1][i - 1];
// long comb = order(hole, i) / order(i, i);
// long comb2 = order(k-1, i-1) / order(i-1, i-1);
cout << (c1 * c2) % DIVIDE << endl;
}
return 0;
}
/******************************/
/***** DECRARED FUNCTIONS *****/
/******************************/
int sum_digits(int num) {
int rtn = 0;
while (num != 0) {
int tmp = num % 10;
rtn += tmp;
num /= 10;
}
return rtn;
}
// vectorのコピー
template <class T> vector<T> copy_vector(vector<T> vec) {
vector<T> rtn;
rtn.reserve(vec.size());
copy(vec.begin(), vec.end(), back_inserter(rtn));
return rtn;
}
long gcd(long a, long b) {
if (b == 0)
return a;
else
return gcd(b, a % b);
}
long lcm(long a, long b) {
long gcd_ = gcd(a, b);
return (a * b) / gcd_;
}
template <class T, class U> void print_pairs(const vector<pair<T, U>> &pairs) {
for (int i = 0; i < pairs.size(); i++) {
cout << "(" << pairs[i].first << ", " << pairs[i].second << ")"
<< " ";
}
cout << endl;
}
template <class K, class V> void print_map(const map<K, V> &m) {
for (auto it = m.cbegin(); it != m.cend(); it++) {
cout << it->first << ": " << it->second << endl;
}
}
| [
"assignment.change"
] | 800,488 | 800,489 | u026686258 | cpp |
p02990 | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
long long factorial(long long i) { // 階乗
if (i > 0)
return i * factorial(i - 1);
else
return 1;
}
//// a^n mod
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;
}
//// a^(-1) mod
long long modinv(long long a, long long mod) { return modpow(a, mod - 2, mod); }
int main() {
const ll mod = 1000000000 + 7;
ll N, K;
cin >> N >> K;
vector<ll> fact(max(K + 2, N - K) + 3);
fact[0] = 1;
rep(i, max(K + 2, N - K) + 3) { fact[i + 1] = fact[i] * (i + 1) % mod; }
vector<ll> cnt(K);
ll tmp = 0;
for (int i = 1; i <= K; i++) {
// r の位置 * rの個数
tmp = fact[K - 1] * modinv(fact[i - 1], mod) % mod *
modinv(fact[K - i], mod) % mod;
// cout << "1:" << tmp << endl;
if (N - K - i + 1 < 0) {
tmp = 0;
} else
tmp *= fact[N - K + 1] * modinv(fact[i], mod) % mod *
modinv(fact[N - K - i + 1], mod) % mod;
// cout << "2:" << fact[N-K+1] << ' ' << modinv(fact[i],mod) << ' ' <<
// modinv(fact[N-K-i+1],mod) << endl;
tmp = tmp % mod;
cnt[i - 1] = tmp;
}
rep(i, K) { cout << cnt[i] << endl; }
return 0;
} | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
long long factorial(long long i) { // 階乗
if (i > 0)
return i * factorial(i - 1);
else
return 1;
}
//// a^n mod
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;
}
//// a^(-1) mod
long long modinv(long long a, long long mod) { return modpow(a, mod - 2, mod); }
int main() {
const ll mod = 1000000000 + 7;
ll N, K;
cin >> N >> K;
vector<ll> fact(max(K + 2, N - K) + 4);
fact[0] = 1;
rep(i, max(K + 2, N - K) + 3) { fact[i + 1] = fact[i] * (i + 1) % mod; }
vector<ll> cnt(K);
ll tmp = 0;
for (int i = 1; i <= K; i++) {
// r の位置 * rの個数
tmp = fact[K - 1] * modinv(fact[i - 1], mod) % mod *
modinv(fact[K - i], mod) % mod;
// cout << "1:" << tmp << endl;
if (N - K - i + 1 < 0) {
tmp = 0;
} else
tmp *= fact[N - K + 1] * modinv(fact[i], mod) % mod *
modinv(fact[N - K - i + 1], mod) % mod;
// cout << "2:" << fact[N-K+1] << ' ' << modinv(fact[i],mod) << ' ' <<
// modinv(fact[N-K-i+1],mod) << endl;
tmp = tmp % mod;
cnt[i - 1] = tmp;
}
rep(i, K) { cout << cnt[i] << endl; }
return 0;
} | [
"literal.number.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 800,492 | 800,493 | u017293723 | cpp |
p02990 | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
long long factorial(long long i) { // 階乗
if (i > 0)
return i * factorial(i - 1);
else
return 1;
}
//// a^n mod
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;
}
//// a^(-1) mod
long long modinv(long long a, long long mod) { return modpow(a, mod - 2, mod); }
int main() {
const ll mod = 1000000000 + 7;
ll N, K;
cin >> N >> K;
vector<ll> fact(max(K + 2, N - K) + 1);
fact[0] = 1;
rep(i, max(K + 2, N - K) + 3) { fact[i + 1] = fact[i] * (i + 1) % mod; }
vector<ll> cnt(K);
ll tmp = 0;
for (int i = 1; i <= K; i++) {
// r の位置 * rの個数
tmp = fact[K - 1] * modinv(fact[i - 1], mod) % mod *
modinv(fact[K - i], mod) % mod;
// cout << "1:" << tmp << endl;
if (N - K - i + 1 < 0) {
tmp = 0;
} else
tmp *= fact[N - K + 1] * modinv(fact[i], mod) % mod *
modinv(fact[N - K - i + 1], mod) % mod;
// cout << "2:" << fact[N-K+1] << ' ' << modinv(fact[i],mod) << ' ' <<
// modinv(fact[N-K-i+1],mod) << endl;
tmp = tmp % mod;
cnt[i - 1] = tmp;
}
rep(i, K) { cout << cnt[i] << endl; }
return 0;
} | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
long long factorial(long long i) { // 階乗
if (i > 0)
return i * factorial(i - 1);
else
return 1;
}
//// a^n mod
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;
}
//// a^(-1) mod
long long modinv(long long a, long long mod) { return modpow(a, mod - 2, mod); }
int main() {
const ll mod = 1000000000 + 7;
ll N, K;
cin >> N >> K;
vector<ll> fact(max(K + 2, N - K) + 4);
fact[0] = 1;
rep(i, max(K + 2, N - K) + 3) { fact[i + 1] = fact[i] * (i + 1) % mod; }
vector<ll> cnt(K);
ll tmp = 0;
for (int i = 1; i <= K; i++) {
// r の位置 * rの個数
tmp = fact[K - 1] * modinv(fact[i - 1], mod) % mod *
modinv(fact[K - i], mod) % mod;
// cout << "1:" << tmp << endl;
if (N - K - i + 1 < 0) {
tmp = 0;
} else
tmp *= fact[N - K + 1] * modinv(fact[i], mod) % mod *
modinv(fact[N - K - i + 1], mod) % mod;
// cout << "2:" << fact[N-K+1] << ' ' << modinv(fact[i],mod) << ' ' <<
// modinv(fact[N-K-i+1],mod) << endl;
tmp = tmp % mod;
cnt[i - 1] = tmp;
}
rep(i, K) { cout << cnt[i] << endl; }
return 0;
} | [
"literal.number.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 800,494 | 800,493 | u017293723 | cpp |
p02990 | #include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define REPr(i, n) for (int i = (n)-1; i >= 0; --i)
#define FORq(i, m, n) for (int i = (m); i <= (n); ++i)
#define FORqr(i, m, n) for (int i = (n); i >= (m); --i)
#define PB push_back
#define MP make_pair
#define DEBUG printf("%s\n", "debug")
#define fst first
#define snd second
#define SIN(x, S) (S.count(x) != 0)
#define M0(x) memset(x, 0, sizeof(x))
#define FILL(x, y) memset(x, y, sizeof(x))
#define MM(x) memset(x, -1, sizeof(x))
#define ALL(x) (x).begin(), (x).end()
using namespace std;
typedef pair<int, int> PII;
typedef pair<long long, long long> PLL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long long> VL;
typedef long long ll;
typedef long long integer;
///////////////////////////////////////////////
/* (๑╹◡╹) */
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll MOD = 1000000007;
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
/* (๑╹◡╹)(๑╹◡╹)(๑╹◡╹)*/
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
/* (๑╹◡╹)(๑╹◡╹)(๑╹◡╹)(๑╹◡╹)(๑╹◡╹)(๑╹◡╹) */
///////////////////////////////////////////////
const int MAX = 510000;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++) {
fac[i] = fac[i - 1] * i % MOD;
inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
finv[i] = finv[i - 1] * inv[i] % MOD;
}
}
// 二項係数計算
long long COM(int n, int k) {
if (n < k)
return 0;
if (n < 0 || k < 0)
return 0;
return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
int main() {
COMinit();
int N, K;
cin >> N >> K;
ll ans;
rep(i, K) {
if (K - i < 0 || N - K + 1 < i + 1) {
ans = 0;
} else if (K - i == 0) {
ans = COM(N - K + 1, i + 1);
} else {
ans = COM(N - K + 1, i + 1) * COM(K - 1, i);
}
cout << ans << endl;
}
}
| #include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define REPr(i, n) for (int i = (n)-1; i >= 0; --i)
#define FORq(i, m, n) for (int i = (m); i <= (n); ++i)
#define FORqr(i, m, n) for (int i = (n); i >= (m); --i)
#define PB push_back
#define MP make_pair
#define DEBUG printf("%s\n", "debug")
#define fst first
#define snd second
#define SIN(x, S) (S.count(x) != 0)
#define M0(x) memset(x, 0, sizeof(x))
#define FILL(x, y) memset(x, y, sizeof(x))
#define MM(x) memset(x, -1, sizeof(x))
#define ALL(x) (x).begin(), (x).end()
using namespace std;
typedef pair<int, int> PII;
typedef pair<long long, long long> PLL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long long> VL;
typedef long long ll;
typedef long long integer;
///////////////////////////////////////////////
/* (๑╹◡╹) */
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll MOD = 1000000007;
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
/* (๑╹◡╹)(๑╹◡╹)(๑╹◡╹)*/
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
/* (๑╹◡╹)(๑╹◡╹)(๑╹◡╹)(๑╹◡╹)(๑╹◡╹)(๑╹◡╹) */
///////////////////////////////////////////////
const int MAX = 510000;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++) {
fac[i] = fac[i - 1] * i % MOD;
inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
finv[i] = finv[i - 1] * inv[i] % MOD;
}
}
// 二項係数計算
long long COM(int n, int k) {
if (n < k)
return 0;
if (n < 0 || k < 0)
return 0;
return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
int main() {
COMinit();
int N, K;
cin >> N >> K;
ll ans;
rep(i, K) {
if (K - i < 0 || N - K + 1 < i + 1) {
ans = 0;
} else if (K - i == 0) {
ans = COM(N - K + 1, i + 1);
} else {
ans = COM(N - K + 1, i + 1) * COM(K - 1, i);
}
ans = ans % MOD;
cout << ans << endl;
}
} | [
"assignment.add"
] | 800,497 | 800,498 | u532894762 | cpp |
p02990 | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
const int INF = (1 << 30);
const ll MOD = 1000000007;
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
ll com[2020][2020];
int main() {
com[0][0] = 1;
for (int i = 1; i < 55; ++i) {
for (int j = 0; j <= i; ++j) {
com[i][j] += com[i - 1][j];
if (j > 0)
com[i][j] += com[i - 1][j - 1];
com[i][j] %= MOD;
}
}
int N, K;
cin >> N >> K;
for (int i = 1; i <= K; i++) { // iグループに分ける
ll cnt = com[K - 1][i - 1] % MOD; // 青玉をiグループに分ける分け方
ll cnt_red = 0;
if (i == 1) {
cnt_red += N - K + 1;
} else {
for (int x = i - 1; x <= N - K; x++) { // x は区切るのに使う赤玉
ll cnt_red_x = max(com[x - 1][i - 2], 1LL);
int a = N - K - x; // 区切るのに関係ない赤玉a個
if (a > 0)
cnt_red_x *= (ll)(a + 1);
cnt_red += cnt_red_x;
cnt_red %= MOD;
}
}
cnt *= cnt_red;
cout << cnt % MOD << endl;
}
return 0;
} | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
const int INF = (1 << 30);
const ll MOD = 1000000007;
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
ll com[2020][2020];
int main() {
com[0][0] = 1;
for (int i = 1; i < 2020; ++i) {
for (int j = 0; j <= i; ++j) {
com[i][j] += com[i - 1][j];
if (j > 0)
com[i][j] += com[i - 1][j - 1];
com[i][j] %= MOD;
}
}
int N, K;
cin >> N >> K;
for (int i = 1; i <= K; i++) { // iグループに分ける
ll cnt = com[K - 1][i - 1] % MOD; // 青玉をiグループに分ける分け方
ll cnt_red = 0;
if (i == 1) {
cnt_red += N - K + 1;
} else {
for (int x = i - 1; x <= N - K; x++) { // x は区切るのに使う赤玉
ll cnt_red_x = max(com[x - 1][i - 2], 1LL);
int a = N - K - x; // 区切るのに関係ない赤玉a個
if (a > 0)
cnt_red_x *= (ll)(a + 1);
cnt_red += cnt_red_x;
cnt_red %= MOD;
}
}
cnt *= cnt_red;
cout << cnt % MOD << endl;
}
return 0;
}
| [
"literal.number.change",
"control_flow.loop.for.condition.change",
"expression.operation.binary.change"
] | 800,515 | 800,516 | u706695185 | cpp |
p02990 | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
const int INF = (1 << 30);
const ll MOD = 1000000007;
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
ll com[2020][2020];
int main() {
com[0][0] = 1;
for (int i = 1; i < 55; ++i) {
for (int j = 0; j <= i; ++j) {
com[i][j] += com[i - 1][j];
if (j > 0)
com[i][j] += com[i - 1][j - 1];
com[i][j] %= MOD;
}
}
int N, K;
cin >> N >> K;
for (int i = 1; i <= K; i++) { // iグループに分ける
ll cnt = com[K - 1][i - 1] * com[N - K + 1][i] % MOD;
cout << cnt << endl;
}
return 0;
} | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
const int INF = (1 << 30);
const ll MOD = 1000000007;
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
ll com[2020][2020];
int main() {
com[0][0] = 1;
for (int i = 1; i < 2020; ++i) {
for (int j = 0; j <= i; ++j) {
com[i][j] += com[i - 1][j];
if (j > 0)
com[i][j] += com[i - 1][j - 1];
com[i][j] %= MOD;
}
}
int N, K;
cin >> N >> K;
for (int i = 1; i <= K; i++) { // iグループに分ける
ll cnt = com[K - 1][i - 1] * com[N - K + 1][i] % MOD;
cout << cnt << endl;
}
return 0;
} | [
"literal.number.change",
"control_flow.loop.for.condition.change",
"expression.operation.binary.change"
] | 800,517 | 800,518 | u706695185 | cpp |
p02990 | #include <algorithm>
#include <cstdint>
#include <iostream>
#include <numeric>
using namespace std;
const u_int64_t D = 1'000'000'007LL;
u_int64_t dpow(const u_int64_t x, const u_int64_t y) {
if (y == 0LL) {
return 1;
} else if (y % 2LL == 0) {
return dpow(x * x % D, y / 2LL);
} else {
return x * dpow(x, y - 1LL) % D;
}
}
u_int64_t inv(const u_int64_t x) { return dpow(x, D - 2LL); }
u_int64_t comb(const u_int64_t n, const u_int64_t k) {
u_int64_t a = 1;
u_int64_t b = 1;
for (u_int64_t i = 0; i < k; i++) {
a = a * (n - i) % D;
b = b * (i + 1) % D;
}
return (a * inv(b)) % D;
}
int main() {
u_int64_t n, k;
cin >> n >> k;
for (u_int64_t i = 1; i <= k; i++) {
const u_int64_t blue = comb(k - 1, i - 1);
const u_int64_t red = comb(n - k + 1, i);
cout << blue * red << endl;
}
return 0;
} | #include <algorithm>
#include <cstdint>
#include <iostream>
#include <numeric>
using namespace std;
const u_int64_t D = 1'000'000'007LL;
u_int64_t dpow(const u_int64_t x, const u_int64_t y) {
if (y == 0LL) {
return 1;
} else if (y % 2LL == 0) {
return dpow(x * x % D, y / 2LL);
} else {
return x * dpow(x, y - 1LL) % D;
}
}
u_int64_t inv(const u_int64_t x) { return dpow(x, D - 2LL); }
u_int64_t comb(const u_int64_t n, const u_int64_t k) {
u_int64_t a = 1;
u_int64_t b = 1;
for (u_int64_t i = 0; i < k; i++) {
a = a * (n - i) % D;
b = b * (i + 1) % D;
}
return (a * inv(b)) % D;
}
int main() {
u_int64_t n, k;
cin >> n >> k;
for (u_int64_t i = 1; i <= k; i++) {
const u_int64_t blue = comb(k - 1, i - 1);
const u_int64_t red = comb(n - k + 1, i);
cout << blue * red % D << endl;
}
return 0;
} | [
"expression.operation.binary.add"
] | 800,519 | 800,520 | u395676079 | cpp |
p02990 | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(a) a.begin(), a.end()
#define sz(a) (ll)(a.size())
#define endl "\n"
ll gcd(ll a, ll b) {
if (b == 0) {
return a;
}
return gcd(b, a % b);
}
const ll L = 1e5 + 5;
const ll mod = 1e9 + 7;
ll fact[10005];
void factorial() {
fact[0] = 1;
for (ll i = 1; i < 10005; i++) {
fact[i] = (fact[i - 1] * i) % mod;
}
}
ll modexp(ll a, ll b, ll c) {
a %= c;
ll ans = 1;
while (b) {
if (b & 1) {
ans = (ans * a) % c;
}
a = (a * a) % c;
b >>= 1;
}
return ans;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
ll n, k;
cin >> n >> k;
factorial();
for (ll i = 1; i <= k; i++) {
if (n - k - i + 1 < 0) {
cout << 0 << endl;
}
ll ans = fact[k - 1];
ans *= modexp(fact[i - 1], mod - 2, mod);
ans %= mod;
ans *= modexp(fact[k - i], mod - 2, mod);
ans %= mod;
ll res = fact[n - k + 1];
res *= modexp(fact[i], mod - 2, mod);
res %= mod;
res *= modexp(fact[n - k - i + 1], mod - 2, mod);
res %= mod;
cout << (ans * res) % mod << endl;
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(a) a.begin(), a.end()
#define sz(a) (ll)(a.size())
#define endl "\n"
ll gcd(ll a, ll b) {
if (b == 0) {
return a;
}
return gcd(b, a % b);
}
const ll L = 1e5 + 5;
const ll mod = 1e9 + 7;
ll fact[4005];
void factorial() {
fact[0] = 1;
for (ll i = 1; i < 4005; i++) {
fact[i] = (fact[i - 1] * i) % mod;
}
}
ll modexp(ll a, ll b, ll c) {
a %= c;
ll ans = 1;
while (b) {
if (b & 1) {
ans = (ans * a) % c;
}
a = (a * a) % c;
b >>= 1;
}
return ans;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
ll n, k;
cin >> n >> k;
factorial();
for (ll i = 1; i <= k; i++) {
if (n - k - i + 1 < 0) {
cout << 0 << endl;
continue;
}
ll ans = fact[k - 1];
ans *= modexp(fact[i - 1], mod - 2, mod);
ans %= mod;
ans *= modexp(fact[k - i], mod - 2, mod);
ans %= mod;
ll res = fact[n - k + 1];
res *= modexp(fact[i], mod - 2, mod);
res %= mod;
res *= modexp(fact[n - k - i + 1], mod - 2, mod);
res %= mod;
cout << (ans * res) % mod << endl;
}
return 0;
} | [
"literal.number.change",
"variable_declaration.array_dimensions.change",
"control_flow.loop.for.condition.change",
"expression.operation.binary.change"
] | 800,523 | 800,524 | u616547520 | cpp |
p02990 | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(a) a.begin(), a.end()
#define sz(a) (ll)(a.size())
#define endl "\n"
ll gcd(ll a, ll b) {
if (b == 0) {
return a;
}
return gcd(b, a % b);
}
const ll L = 1e5 + 5;
const ll mod = 1e9 + 7;
ll fact[4005];
void factorial() {
fact[0] = 1;
for (ll i = 1; i < 10005; i++) {
fact[i] = (fact[i - 1] * i) % mod;
}
}
ll modexp(ll a, ll b, ll c) {
a %= c;
ll ans = 1;
while (b) {
if (b & 1) {
ans = (ans * a) % c;
}
a = (a * a) % c;
b >>= 1;
}
return ans;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
ll n, k;
cin >> n >> k;
factorial();
for (ll i = 1; i <= k; i++) {
if (n - k - i + 1 < 0) {
cout << 0 << endl;
}
ll ans = fact[k - 1];
ans *= modexp(fact[i - 1], mod - 2, mod);
ans %= mod;
ans *= modexp(fact[k - i], mod - 2, mod);
ans %= mod;
ll res = fact[n - k + 1];
res *= modexp(fact[i], mod - 2, mod);
res %= mod;
res *= modexp(fact[n - k - i + 1], mod - 2, mod);
res %= mod;
cout << (ans * res) % mod << endl;
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(a) a.begin(), a.end()
#define sz(a) (ll)(a.size())
#define endl "\n"
ll gcd(ll a, ll b) {
if (b == 0) {
return a;
}
return gcd(b, a % b);
}
const ll L = 1e5 + 5;
const ll mod = 1e9 + 7;
ll fact[4005];
void factorial() {
fact[0] = 1;
for (ll i = 1; i < 4005; i++) {
fact[i] = (fact[i - 1] * i) % mod;
}
}
ll modexp(ll a, ll b, ll c) {
a %= c;
ll ans = 1;
while (b) {
if (b & 1) {
ans = (ans * a) % c;
}
a = (a * a) % c;
b >>= 1;
}
return ans;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
ll n, k;
cin >> n >> k;
factorial();
for (ll i = 1; i <= k; i++) {
if (n - k - i + 1 < 0) {
cout << 0 << endl;
continue;
}
ll ans = fact[k - 1];
ans *= modexp(fact[i - 1], mod - 2, mod);
ans %= mod;
ans *= modexp(fact[k - i], mod - 2, mod);
ans %= mod;
ll res = fact[n - k + 1];
res *= modexp(fact[i], mod - 2, mod);
res %= mod;
res *= modexp(fact[n - k - i + 1], mod - 2, mod);
res %= mod;
cout << (ans * res) % mod << endl;
}
return 0;
} | [
"literal.number.change",
"control_flow.loop.for.condition.change",
"expression.operation.binary.change"
] | 800,525 | 800,524 | u616547520 | cpp |
p02990 |
#include <iostream>
using namespace std;
long long C[2000][2000];
int main() {
long mod = 1E9 + 7;
int N, K;
cin >> N >> K;
C[0][0] = 1;
C[1][0] = 1;
C[1][1] = 1;
for (int i = 2; i < 2000; i++) {
C[i][0] = 1;
for (int j = 1; j <= i; j++) {
C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % mod;
}
}
int R = N - K;
for (int i = 1; i <= K; i++) {
long a = C[R + 1][i] % mod;
long b = C[K - 1][i - 1] % mod;
cout << (a * b) % mod << endl;
}
return 0;
}
|
#include <iostream>
using namespace std;
long long C[2005][2005];
int main() {
long mod = 1E9 + 7;
int N, K;
cin >> N >> K;
C[0][0] = 1;
C[1][0] = 1;
C[1][1] = 1;
for (int i = 2; i < 2005; i++) {
C[i][0] = 1;
for (int j = 1; j <= i; j++) {
C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % mod;
}
}
int R = N - K;
for (int i = 1; i <= K; i++) {
long a = C[R + 1][i] % mod;
long b = C[K - 1][i - 1] % mod;
cout << (a * b) % mod << endl;
}
return 0;
}
| [
"literal.number.change",
"variable_declaration.array_dimensions.change",
"control_flow.loop.for.condition.change",
"expression.operation.binary.change"
] | 800,528 | 800,529 | u811978802 | cpp |
p02990 | #include <iostream>
#include <vector>
using namespace std;
static const int mod = 1e9 + 7;
using ll = long long;
vector<vector<ll>> comb(int n, int r) {
vector<vector<ll>> v(n + 1, vector<ll>(n + 1, 0));
for (int i = 0; i < v.size(); i++) {
v[i][0] = 1;
v[i][i] = 1;
}
for (int j = 1; j < v.size(); j++) {
for (int k = 1; k < j; k++) {
v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
}
}
return v;
}
int main() {
ll N, K;
cin >> N >> K;
auto c = comb(2000, 2000);
for (int i = 1; i <= K; i++)
cout << (c[K - 1][i - 1] * c[N - K + 1][i]) % mod << endl;
} | #include <iostream>
#include <vector>
using namespace std;
static const int mod = 1e9 + 7;
using ll = long long;
vector<vector<ll>> comb(int n, int r) {
vector<vector<ll>> v(n + 1, vector<ll>(n + 1, 0));
for (int i = 0; i < v.size(); i++) {
v[i][0] = 1;
v[i][i] = 1;
}
for (int j = 1; j < v.size(); j++) {
for (int k = 1; k < j; k++) {
v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]) % mod;
}
}
return v;
}
int main() {
ll N, K;
cin >> N >> K;
auto c = comb(2000, 2000);
for (int i = 1; i <= K; i++)
cout << (c[K - 1][i - 1] * c[N - K + 1][i]) % mod << endl;
} | [
"assignment.change"
] | 800,533 | 800,534 | u024469792 | cpp |
p02990 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
typedef vector<str> vst;
typedef vector<ll> vll;
ll mod = 1000000007, INF = 10000000000000000;
ll gcd(ll a, ll b) {
if (b == 0) {
return a;
}
return gcd(b, a % b);
}
ll fac[200100];
ll inv[200100];
ll facinv[200100];
void C_init() {
fac[0] = 1;
for (int i = 1; i < 200100; i++)
fac[i] = (fac[i - 1] * i) % mod;
inv[1] = 1;
for (int i = 2; i < 200100; i++)
inv[i] = ((-(mod / i) * inv[mod % i]) % mod + mod) % mod;
facinv[0] = 1;
for (int i = 1; i < 200100; i++)
facinv[i] = (facinv[i - 1] * inv[i]) % mod;
return;
}
ll nCr(ll n, ll r) {
return max((ll)0, ((fac[n] * facinv[n - r]) % mod * facinv[r]) % mod);
}
// for (ll i = 0; i < n; i++) {
// sort(.begin(),.end());
int main() {
ll n, k;
cin >> n >> k;
for (ll i = 1; i <= k; i++) {
if (i <= n - k + 1) {
ll ans = nCr(k - 1, i - 1);
ans %= mod;
ll x = nCr(n - k + 1, i);
x %= mod;
ans *= x;
ans %= mod;
cout << ans << endl;
} else {
cout << 0 << endl;
}
}
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
typedef vector<str> vst;
typedef vector<ll> vll;
ll mod = 1000000007, INF = 10000000000000000;
ll gcd(ll a, ll b) {
if (b == 0) {
return a;
}
return gcd(b, a % b);
}
ll fac[200100];
ll inv[200100];
ll facinv[200100];
void C_init() {
fac[0] = 1;
for (int i = 1; i < 200100; i++)
fac[i] = (fac[i - 1] * i) % mod;
inv[1] = 1;
for (int i = 2; i < 200100; i++)
inv[i] = ((-(mod / i) * inv[mod % i]) % mod + mod) % mod;
facinv[0] = 1;
for (int i = 1; i < 200100; i++)
facinv[i] = (facinv[i - 1] * inv[i]) % mod;
return;
}
ll nCr(ll n, ll r) {
return max((ll)0, ((fac[n] * facinv[n - r]) % mod * facinv[r]) % mod);
}
// for (ll i = 0; i < n; i++) {
// sort(.begin(),.end());
int main() {
ll n, k;
cin >> n >> k;
C_init();
for (ll i = 1; i <= k; i++) {
if (i <= n - k + 1) {
ll ans = nCr(k - 1, i - 1);
ans %= mod;
ll x = nCr(n - k + 1, i);
x %= mod;
ans *= x;
ans %= mod;
cout << ans << endl;
} else {
cout << 0 << endl;
}
}
}
| [
"call.add"
] | 800,535 | 800,536 | u061912210 | cpp |
p02990 | #include <bits/stdc++.h>
#define int long long
using namespace std;
const int MOD = pow(10, 9) + 7;
// const int MOD = 998244353;
// const int MOD = ;
int mod(int A, int M) { return (A % M + M) % M; }
const int INF = 1LL << 60;
const string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const string abc = "abcdefghijklmnopqrstuvwxyz";
template <class T> bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T> bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
int divCeil(int A, int B) { return (A + (B - 1)) / B; }
int myctoi(char C) { return C - 48; }
char myitoc(int N) { return '0' + N; }
class combination {
public:
vector<int> fac, finv, inv;
combination(int M) {
fac = vector<int>(M, 1);
finv = vector<int>(M, 1);
inv = vector<int>(M, 1);
for (int i = 2; i < M; i++) {
fac.at(i) = fac.at(i - 1) * i % MOD;
inv.at(i) = MOD - inv.at(MOD % i) * (MOD / i) % MOD;
finv.at(i) = finv.at(i - 1) * inv.at(i) % MOD;
}
}
int COM(int N, int K) {
if (N < K)
return 0;
if (N < 0 || K < 0)
return 0;
return fac.at(N) * (finv.at(K) * finv.at(N - K) % MOD) % MOD;
}
};
signed main() {
int N, K;
cin >> N >> K;
combination C(111111);
for (int i = 0; i < K; i++) {
int ans = C.COM(N - 1, i) * C.COM(N - K + 1, N - K - i) % MOD;
cout << ans << endl;
}
} | #include <bits/stdc++.h>
#define int long long
using namespace std;
const int MOD = pow(10, 9) + 7;
// const int MOD = 998244353;
// const int MOD = ;
int mod(int A, int M) { return (A % M + M) % M; }
const int INF = 1LL << 60;
const string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const string abc = "abcdefghijklmnopqrstuvwxyz";
template <class T> bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T> bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
int divCeil(int A, int B) { return (A + (B - 1)) / B; }
int myctoi(char C) { return C - 48; }
char myitoc(int N) { return '0' + N; }
class combination {
public:
vector<int> fac, finv, inv;
combination(int M) {
fac = vector<int>(M, 1);
finv = vector<int>(M, 1);
inv = vector<int>(M, 1);
for (int i = 2; i < M; i++) {
fac.at(i) = fac.at(i - 1) * i % MOD;
inv.at(i) = MOD - inv.at(MOD % i) * (MOD / i) % MOD;
finv.at(i) = finv.at(i - 1) * inv.at(i) % MOD;
}
}
int COM(int N, int K) {
if (N < K)
return 0;
if (N < 0 || K < 0)
return 0;
return fac.at(N) * (finv.at(K) * finv.at(N - K) % MOD) % MOD;
}
};
signed main() {
int N, K;
cin >> N >> K;
combination C(111111);
for (int i = 0; i < K; i++) {
int ans = C.COM(K - 1, i) * C.COM(N - K + 1, N - K - i) % MOD;
cout << ans << endl;
}
} | [
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 800,558 | 800,559 | u811472478 | cpp |
p02990 | //#include <bits/stdc++.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, j, k) for (int i = (int)(j); i < (int)(k); ++i)
#define ROF(i, j, k) for (int i = (int)(j); i >= (int)(k); --i)
#define FORLL(i, n, m) for (long long i = n; i < (long long)(m); i++)
#define SORT(v, n) sort(v, v + n)
#define REVERSE(v) reverse((v).begin(), (v).end())
using namespace std;
using ll = long long;
const ll MOD = 1000000007LL;
typedef pair<int, int> P;
ll ADD(ll x, ll y) { return (x + y) % MOD; }
ll SUB(ll x, ll y) { return (x - y + MOD) % MOD; }
ll MUL(ll x, ll y) { return x * y % MOD; }
ll POW(ll x, ll e) {
ll v = 1;
for (; e; x = MUL(x, x), e >>= 1)
if (e & 1)
v = MUL(v, x);
return v;
}
ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/
return MUL(x, POW(y, MOD - 2));
}
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> bool chmin(T &a, const T &b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
const int MAX = 510000;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++) {
fac[i] = fac[i - 1] * i % MOD;
inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
finv[i] = finv[i - 1] * inv[i] % MOD;
}
}
// 二項係数計算
long long COM(int n, int k) {
if (n < k)
return 0;
if (n < 0 || k < 0)
return 0;
return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
ll modinv(ll a, ll m) {
ll b = m, u = 1, v = 0;
while (b) {
ll t = a / b;
a -= t * b;
swap(a, b);
u -= t * v;
swap(u, v);
}
u %= m;
if (u < 0)
u += m;
return u;
}
int main(void) {
ios_base::sync_with_stdio(false);
cin.tie(0);
int n, k;
cin >> n >> k;
COMinit();
FOR(i, 0, k) {
// Red: n-k, Blue:k
ll val = COM(n - k + 1, i + 1) * COM(k - 1, i);
cout << val << endl;
}
return 0;
} | //#include <bits/stdc++.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, j, k) for (int i = (int)(j); i < (int)(k); ++i)
#define ROF(i, j, k) for (int i = (int)(j); i >= (int)(k); --i)
#define FORLL(i, n, m) for (long long i = n; i < (long long)(m); i++)
#define SORT(v, n) sort(v, v + n)
#define REVERSE(v) reverse((v).begin(), (v).end())
using namespace std;
using ll = long long;
const ll MOD = 1000000007LL;
typedef pair<int, int> P;
ll ADD(ll x, ll y) { return (x + y) % MOD; }
ll SUB(ll x, ll y) { return (x - y + MOD) % MOD; }
ll MUL(ll x, ll y) { return x * y % MOD; }
ll POW(ll x, ll e) {
ll v = 1;
for (; e; x = MUL(x, x), e >>= 1)
if (e & 1)
v = MUL(v, x);
return v;
}
ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/
return MUL(x, POW(y, MOD - 2));
}
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> bool chmin(T &a, const T &b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
const int MAX = 510000;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++) {
fac[i] = fac[i - 1] * i % MOD;
inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
finv[i] = finv[i - 1] * inv[i] % MOD;
}
}
// 二項係数計算
long long COM(int n, int k) {
if (n < k)
return 0;
if (n < 0 || k < 0)
return 0;
return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
ll modinv(ll a, ll m) {
ll b = m, u = 1, v = 0;
while (b) {
ll t = a / b;
a -= t * b;
swap(a, b);
u -= t * v;
swap(u, v);
}
u %= m;
if (u < 0)
u += m;
return u;
}
int main(void) {
ios_base::sync_with_stdio(false);
cin.tie(0);
int n, k;
cin >> n >> k;
COMinit();
// cout << COM(n-k+1,1) << endl;
FOR(i, 0, k) {
// Red: n-k, Blue:k
ll val = COM(n - k + 1, i + 1) * COM(k - 1, i);
// ll val = COM(restRed+restBlue+1, 1) * (ll)pow(restRed, i*2+1) %MOD;
// val *= pow(restBlue, i);
// val %= MOD;
cout << val % MOD << endl;
}
return 0;
} | [
"expression.operation.binary.add"
] | 800,560 | 800,561 | u783861517 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
bool flag = false;
for (int i = 1; i < S.size(); ++i) {
if (S.at(i - 1) == S.at(i)) {
cout << "Bad" << endl;
flag = true;
}
}
if (!flag) {
cout << "Good" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
bool flag = false;
for (int i = 1; i < S.size(); ++i) {
if (S.at(i - 1) == S.at(i) && flag == false) {
cout << "Bad" << endl;
flag = true;
}
}
if (!flag) {
cout << "Good" << endl;
}
}
| [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 800,588 | 800,589 | u308463793 | cpp |
p02993 | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
int count = 0;
for (int i = 0; i < s.size(); i++) {
if (s.at(i) == s.at(i + 1)) {
count++;
}
}
if (count > 0) {
cout << "Bad" << endl;
} else {
cout << "Good" << endl;
}
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
int count = 0;
for (int i = 0; i < s.size() - 1; i++) {
if (s.at(i) == s.at(i + 1)) {
count++;
}
}
if (count > 0) {
cout << "Bad" << endl;
} else {
cout << "Good" << endl;
}
} | [
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 800,590 | 800,591 | u296160120 | cpp |
p02993 | #include <algorithm>
#include <cstdio>
using namespace std;
char ch, la;
int main() {
while (scanf("%c", &ch) != EOF) {
if (ch == la) {
printf("Bad");
return 0;
}
}
printf("Good");
} | #include <algorithm>
#include <cstdio>
using namespace std;
char ch, la;
int main() {
while (scanf("%c", &ch) != EOF) {
if (ch == la) {
printf("Bad");
return 0;
}
la = ch;
}
printf("Good");
} | [
"assignment.add"
] | 800,612 | 800,613 | u880272923 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int p = 0;
for (int i = 0; i < 3; i++) {
if (s[i] == s[i + 1]) {
cout << "bad";
p = 1;
break;
} else
p++;
}
if (p != 1)
cout << "good";
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int p = 0;
for (int i = 0; i < 4; i++) {
if (s[i] == s[i + 1]) {
cout << "Bad";
p = 1;
break;
} else
p++;
}
if (p != 1)
cout << "Good";
return 0;
} | [
"literal.number.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change",
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 800,618 | 800,619 | u236966848 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int p = 0;
for (int i = 0; i < 4; i++) {
if (s[i] == s[i + 1]) {
cout << "bad";
p = 1;
break;
} else
p++;
}
if (p != 1)
cout << "good";
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int p = 0;
for (int i = 0; i < 4; i++) {
if (s[i] == s[i + 1]) {
cout << "Bad";
p = 1;
break;
} else
p++;
}
if (p != 1)
cout << "Good";
return 0;
} | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 800,620 | 800,619 | u236966848 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int a, b, c, d, n, m, i, j, t[200005];
string s, q;
int main() {
cin >> s;
if (s[0] == s[1] || s[1] == s[2] || s[2] == s[3])
cout << "Bad";
else
cout << "Hard";
} | #include <bits/stdc++.h>
using namespace std;
int a, b, c, d, n, m, i, j, t[200005];
string s, q;
int main() {
cin >> s;
if (s[0] == s[1] || s[1] == s[2] || s[2] == s[3])
cout << "Bad";
else
cout << "Good";
} | [
"literal.string.change",
"io.output.change"
] | 800,629 | 800,630 | u030094335 | cpp |
p02993 | // AUTHOR:: MOHAMMAD FAISAL
// BEGINNING WITH THE NAME OF ALMIGHTY GOD ALLAH
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s[0] == s[1] || s[1] == s[2] || s[2] == s[3] || s[3] == s[4])
cout << "Good";
else
cout << "Bad";
return 0;
} | // AUTHOR:: MOHAMMAD FAISAL
// BEGINNING WITH THE NAME OF ALMIGHTY GOD ALLAH
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s[0] == s[1] || s[1] == s[2] || s[2] == s[3] || s[3] == s[4])
cout << "Bad";
else
cout << "Good";
return 0;
}
| [
"control_flow.branch.else.remove",
"control_flow.branch.else_if.replace.remove",
"control_flow.branch.if.replace.add"
] | 800,633 | 800,634 | u993949676 | cpp |
p02993 | #include "bits/stdc++.h"
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(0) == s.at(1) && s.at(1) == s.at(2) && s.at(2) == s.at(3)) {
cout << "Bad" << endl;
} else {
cout << "Good" << endl;
}
} | #include "bits/stdc++.h"
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(0) == s.at(1) || s.at(1) == s.at(2) || s.at(2) == s.at(3)) {
cout << "Bad" << endl;
} else {
cout << "Good" << endl;
}
} | [
"misc.opposites",
"control_flow.branch.if.condition.change"
] | 800,641 | 800,642 | u251410638 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S[0] == S[1] || S[1] == S[2] || S[2] == S[3]) {
cout << "Bad" << endl;
} else {
cout << "Yes" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S[0] == S[1] || S[1] == S[2] || S[2] == S[3]) {
cout << "Bad" << endl;
} else {
cout << "Good" << endl;
}
}
| [
"literal.string.change",
"io.output.change"
] | 800,650 | 800,651 | u313124728 | cpp |
p02993 | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main() {
char s[5];
cin >> s;
bool flag = false;
for (int i = 1; i < 4; i++) {
if (s[i - 1] == s[i])
flag = true;
}
if (flag)
cout << "Good" << endl;
else
cout << "Bad" << endl;
return 0;
} | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main() {
char s[5];
cin >> s;
bool flag = false;
for (int i = 1; i < 4; i++) {
if (s[i - 1] == s[i])
flag = true;
}
if (!flag)
cout << "Good" << endl;
else
cout << "Bad" << endl;
return 0;
} | [
"expression.operation.unary.add",
"control_flow.branch.if.condition.change"
] | 800,654 | 800,655 | u094619686 | cpp |
p02993 | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
for (int i = 0; i < 2; i++) {
if (s[i] == s[i + 1]) {
cout << "Bad\n";
return 0;
}
}
cout << "Good\n";
}
| #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
for (int i = 0; i < 3; i++) {
if (s[i] == s[i + 1]) {
cout << "Bad\n";
return 0;
}
}
cout << "Good\n";
}
| [
"literal.number.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 800,661 | 800,662 | u352248517 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
bool good = true;
for (int i = 0; i < s.size() - 2; i++) {
if (s[i] == s[i + 1]) {
good = false;
break;
}
}
if (good) {
cout << "Good" << endl;
} else {
cout << "Bad" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
bool good = true;
for (int i = 0; i < s.size() - 1; i++) {
if (s[i] == s[i + 1]) {
good = false;
break;
}
}
if (good) {
cout << "Good" << endl;
} else {
cout << "Bad" << endl;
}
} | [
"literal.number.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 800,681 | 800,682 | u045368371 | cpp |
p02993 | #include <iostream>
using namespace std;
int main() {
char input[100];
int i = 0;
cin >> input;
if (input[0] == input[1] || input[1] == input[2] || input[2] == input[3]) {
i++;
} else if (i == 0) {
cout << "Good" << endl;
} else if (i != 0) {
cout << "Bad" << endl;
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
char input[100];
int i = 0;
cin >> input;
if (input[0] == input[1] || input[1] == input[2] || input[2] == input[3]) {
i++;
}
if (i == 0) {
cout << "Good" << endl;
} else if (i != 0) {
cout << "Bad" << endl;
}
return 0;
}
| [
"control_flow.branch.if.replace.add",
"control_flow.branch.else_if.replace.remove"
] | 800,692 | 800,693 | u705509942 | cpp |
p02993 | #include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
int main() {
string s;
cin >> s;
for (int i = 0; i < s.length() - 1; i++) {
if (s[i] == s[i + 1]) {
cout << "bad";
return 0;
}
}
cout << "good";
} | #include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
int main() {
string s;
cin >> s;
for (int i = 0; i < s.length() - 1; i++) {
if (s[i] == s[i + 1]) {
cout << "Bad";
return 0;
}
}
cout << "Good";
} | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 800,694 | 800,695 | u724012411 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, ans = "Good";
cin >> s;
for (int i = 0; i < 2; i++) {
if (s.at(i) == s.at(i + 1)) {
ans = "Bad";
break;
}
}
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, ans = "Good";
cin >> s;
for (int i = 0; i < 3; i++) {
if (s.at(i) == s.at(i + 1)) {
ans = "Bad";
break;
}
}
cout << ans << endl;
}
| [
"literal.number.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 800,696 | 800,697 | u071019032 | cpp |
p02993 | //
// respect the past, embrace the future
//
#include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using namespace ::std;
using vpll = vector<pair<long long, long long>>;
using pll = pair<long long, long long>;
using vll = vector<long long>;
using ll = long long;
#define N (long long)(2e6 + 7)
#define M (long long)(1e9 + 7)
#define INF (long long)(2e18)
#define F first
#define S second
inline void fastInputOutput() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
inline void ReadWriteFromFile() {
freopen("../in.txt", "r", stdin);
freopen("../out.txt", "w", stdout);
}
ll n, k, ans, a, b, check[N];
pll p[N];
int32_t main(int argc, char *argv[]) {
fastInputOutput();
// ReadWriteFromFile();
string str;
cin >> str;
for (int i = 0; i < 3; i++)
if (str[i] == str[i + 1])
ans = 1;
cout << (ans ? "Good" : "Bad");
} | //
// respect the past, embrace the future
//
#include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using namespace ::std;
using vpll = vector<pair<long long, long long>>;
using pll = pair<long long, long long>;
using vll = vector<long long>;
using ll = long long;
#define N (long long)(2e6 + 7)
#define M (long long)(1e9 + 7)
#define INF (long long)(2e18)
#define F first
#define S second
inline void fastInputOutput() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
inline void ReadWriteFromFile() {
freopen("../in.txt", "r", stdin);
freopen("../out.txt", "w", stdout);
}
ll n, k, ans, a, b, check[N];
pll p[N];
int32_t main(int argc, char *argv[]) {
fastInputOutput();
// ReadWriteFromFile();
string str;
cin >> str;
for (int i = 0; i < 3; i++)
if (str[i] == str[i + 1])
ans = 1;
cout << (!ans ? "Good" : "Bad");
} | [
"expression.operation.unary.add"
] | 800,700 | 800,701 | u656672211 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
bool A = false;
for (int i = 0; i < S.size(); i++) {
if (S.at(i) == S.at(i + 1))
A = true;
}
if (A == true)
cout << "Bad" << endl;
else if (A == false)
cout << "Good" << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
bool A = false;
for (int i = 0; i < S.size() - 1; i++) {
if (S.at(i) == S.at(i + 1))
A = true;
}
if (A == true)
cout << "Bad" << endl;
else if (A == false)
cout << "Good" << endl;
} | [
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 800,702 | 800,703 | u429665788 | cpp |
p02993 | #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
if (s[0] == s[1] || s[1] == s[2] || s[2] == s[3])
cout << "bad";
else
cout << "good";
return 0;
}
| #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
if (s[0] == s[1] || s[1] == s[2] || s[2] == s[3])
cout << "Bad";
else
cout << "Good";
return 0;
}
| [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 800,708 | 800,709 | u767923114 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int flag = 0;
for (int i = 0; i < 4; i++) {
if (i < 3) {
if (s[i] == s[i + 1])
flag = 1;
}
}
if (flag == 1)
cout << "Bad";
else
cout << "Bad";
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int flag = 0;
for (int i = 0; i < 4; i++) {
if (i < 3) {
if (s[i] == s[i + 1])
flag = 1;
}
}
if (flag == 1)
cout << "Bad";
else
cout << "Good";
return 0;
} | [
"literal.string.change",
"io.output.change"
] | 800,712 | 800,713 | u056766050 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
for (int i = 1; i < s.length(); ++i) {
if (s[i] == s[i - 1]) {
cout << "Bad\n";
}
return 0;
}
cout << "Good\n";
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
for (int i = 1; i < s.length(); ++i) {
if (s[i] == s[i - 1]) {
cout << "Bad\n";
return 0;
}
}
cout << "Good\n";
}
| [] | 800,714 | 800,715 | u031432512 | cpp |
p02993 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
vector<char> s(4);
rep(i, 4) cin >> s.at(i);
string ans;
rep(i, 3) {
if (s.at(i) != s.at(i + 1)) {
ans = "Yes";
} else {
ans = "No";
break;
}
}
cout << ans << endl;
} | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
vector<char> s(4);
rep(i, 4) cin >> s.at(i);
string ans;
rep(i, 3) {
if (s.at(i) != s.at(i + 1)) {
ans = "Good";
} else {
ans = "Bad";
break;
}
}
cout << ans << endl;
} | [
"literal.string.change",
"assignment.value.change"
] | 800,719 | 800,720 | u902140923 | cpp |
p02993 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
int main() {
string ans = "Good";
vector<int> s;
rep(i, 4) { cin >> s[i]; }
rep(i, 3) {
if (s[i] == s[i + 1])
ans = "Bad";
}
cout << ans << endl;
return 0;
}
|
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
int main() {
string ans = "Good";
string s;
rep(i, 4) { cin >> s[i]; }
rep(i, 3) {
if (s[i] == s[i + 1])
ans = "Bad";
}
cout << ans << endl;
return 0;
}
| [
"variable_declaration.type.change"
] | 800,721 | 800,722 | u405620865 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
void solve() {
char ch[4 + 1];
scanf("%s", &ch);
string ans = "Good";
if (ch[0] == ch[1] || ch[1] == ch[2] || ch[3] == ch[4]) {
ans = "Bad";
}
cout << ans << "\n";
}
int main() {
solve();
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
void solve() {
char ch[4 + 1];
scanf("%s", &ch);
string ans = "Good";
if (ch[0] == ch[1] || ch[1] == ch[2] || ch[2] == ch[3]) {
ans = "Bad";
}
cout << ans << "\n";
}
int main() {
solve();
return 0;
}
| [
"literal.number.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change"
] | 800,727 | 800,728 | u794280735 | cpp |
p02993 | #include "bits/stdc++.h"
#pragma once
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(0) == s.at(1) or s.at(1) == s.at(2) or s.at(2) == s.at(3))
puts("Bad");
else
puts("No");
} | #include "bits/stdc++.h"
#pragma once
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(0) == s.at(1) or s.at(1) == s.at(2) or s.at(2) == s.at(3))
puts("Bad");
else
puts("Good");
} | [
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 800,729 | 800,730 | u102067593 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int main() {
string a;
cin >> a;
if (a.at(0) == a.at(1) || a.at(1) == a.at(2) || a.at(0) == a.at(1)) {
cout << "Bad" << endl;
}
else {
cout << "Good" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string a;
cin >> a;
if (a.at(0) == a.at(1) || a.at(1) == a.at(2) || a.at(2) == a.at(3)) {
cout << "Bad" << endl;
}
else {
cout << "Good" << endl;
}
} | [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 800,735 | 800,736 | u165771525 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b = 0, min = 1000000000;
string s;
cin >> s;
for (int i = 0; i < 3; i++) {
if (s[i] == s[i + 1])
b = 1;
}
if (b == 1)
cout << "Good\n";
else
cout << "Bad\n";
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b = 0;
string s;
cin >> s;
for (int i = 0; i < 3; i++) {
if (s[i] == s[i + 1])
b = 1;
}
if (b != 1)
cout << "Good\n";
else
cout << "Bad\n";
}
| [
"variable_declaration.remove",
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 800,740 | 800,741 | u240895927 | cpp |
p02993 | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
int main() {
string s;
cin >> s;
rep(i, 3) {
if (s[i - 1] == s[i]) {
cout << "Bad";
return 0;
}
}
cout << "Good";
}
| #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
int main() {
string s;
cin >> s;
rep(i, 3) {
if (s[i] == s[i + 1]) {
cout << "Bad";
return 0;
}
}
cout << "Good";
}
| [
"expression.operation.binary.remove",
"control_flow.branch.if.condition.change"
] | 800,742 | 800,743 | u154833883 | cpp |
p02993 | #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
if ((s[0] == s[1]) || (s[1] == s[2]) || (s[2] == s[3]))
cout << "Bad" << endl;
else
cout << "Go" << endl;
}
| #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
if ((s[0] == s[1]) || (s[1] == s[2]) || (s[2] == s[3]))
cout << "Bad" << endl;
else
cout << "Good" << endl;
}
| [
"literal.string.change",
"io.output.change"
] | 800,746 | 800,747 | u902803949 | cpp |
p02993 | #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
if ((s[0] != s[1]) || (s[1] != s[2]) || (s[2] != s[3]))
cout << "Good" << endl;
else
cout << "Bad" << endl;
}
| #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
if ((s[0] == s[1]) || (s[1] == s[2]) || (s[2] == s[3]))
cout << "Bad" << endl;
else
cout << "Good" << endl;
}
| [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"literal.string.change",
"io.output.change"
] | 800,748 | 800,747 | u902803949 | cpp |
p02993 | #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
if ((s[0] == s[1]) || (s[1] == s[2]) || (s[2] == s[3]))
cout << "Bud" << endl;
else
cout << "Good" << endl;
}
| #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
if ((s[0] == s[1]) || (s[1] == s[2]) || (s[2] == s[3]))
cout << "Bad" << endl;
else
cout << "Good" << endl;
}
| [
"literal.string.change",
"io.output.change"
] | 800,749 | 800,747 | u902803949 | cpp |
p02993 | #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
if ((s[0] != s[1]) || (s[1] != s[2]) || (s[2] != s[3]))
cout << "Good" << endl;
else
cout << "Bud" << endl;
}
| #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
if ((s[0] == s[1]) || (s[1] == s[2]) || (s[2] == s[3]))
cout << "Bad" << endl;
else
cout << "Good" << endl;
}
| [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"literal.string.change",
"io.output.change"
] | 800,750 | 800,747 | u902803949 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0);
cout.tie(0);
ios_base::sync_with_stdio(0);
string s;
cin >> s;
for (int i = 0; i < 3; i++) {
if (s[i] == s[i + 1])
cout << "Bad" << endl;
return 0;
}
cout << "Good" << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0);
cout.tie(0);
ios_base::sync_with_stdio(0);
string s;
cin >> s;
for (int i = 0; i < 3; i++)
if (s[i] == s[i + 1]) {
cout << "Bad\n";
;
return 0;
}
cout << "Good" << endl;
return 0;
} | [
"literal.string.change",
"io.output.change",
"expression.operation.binary.remove"
] | 800,757 | 800,758 | u931911335 | cpp |
p02993 | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define all(x) (x).begin(), (x).end()
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return 1;
}
return 0;
}
typedef long long ll;
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
string s;
cin >> s;
ll f = 1;
rep(i, 3) {
if (s[i] != s[i + 1])
f = 0;
}
if (f) {
cout << "Good" << endl;
} else {
cout << "Bad" << endl;
}
return 0;
}
| #include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define all(x) (x).begin(), (x).end()
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return 1;
}
return 0;
}
typedef long long ll;
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
string s;
cin >> s;
ll f = 1;
rep(i, 3) {
if (s[i] == s[i + 1])
f = 0;
}
if (f) {
cout << "Good" << endl;
} else {
cout << "Bad" << endl;
}
return 0;
}
| [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 800,759 | 800,760 | u834415466 | cpp |
p02993 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
using namespace std;
typedef long long ll;
int main() {
string S;
cin >> S;
bool f = true;
for (int i = 0; i < 3; i++) {
if (S[i] == S[i + 1]) {
f = false;
cout << "Bad" << endl;
}
}
if (f)
cout << "Good" << endl;
}
| #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
using namespace std;
typedef long long ll;
int main() {
string S;
cin >> S;
bool f = true;
for (int i = 0; i < 3; i++) {
if (S[i] == S[i + 1]) {
f = false;
cout << "Bad" << endl;
break;
}
}
if (f)
cout << "Good" << endl;
}
| [
"control_flow.break.add"
] | 800,773 | 800,774 | u979078704 | cpp |
p02993 | #include <bits/stdc++.h>
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define sol (k + k)
#define sag (k + k + 1)
#define orta ((bas + son) / 2)
#define ort ((bas + son + 1ll) / 2ll)
#define coc g[node][i]
#define mod 1000000007
#define inf 1000000009
#define N 1000005
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
string s;
int main() {
cin >> s;
for (int i = 0; i < s.length() - 2; i++) {
if (s[i] == s[i + 1]) {
cout << "Bad";
return 0;
}
}
cout << "Good";
return 0;
}
| #include <bits/stdc++.h>
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define sol (k + k)
#define sag (k + k + 1)
#define orta ((bas + son) / 2)
#define ort ((bas + son + 1ll) / 2ll)
#define coc g[node][i]
#define mod 1000000007
#define inf 1000000009
#define N 1000005
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
string s;
int main() {
cin >> s;
for (int i = 0; i < s.length() - 1; i++) {
if (s[i] == s[i + 1]) {
cout << "Bad";
return 0;
}
}
cout << "Good";
return 0;
}
| [
"literal.number.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 800,775 | 800,776 | u863190862 | cpp |
p02993 | #include <algorithm>
#include <complex>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdio.h>
#include <string.h>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
typedef long long int llint;
typedef pair<int, int> pint;
typedef vector<bool> vbool;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<llint> vllint;
typedef vector<vllint> vvllint;
typedef vector<pair<int, int>> vpint;
typedef vector<pair<llint, llint>> vpllint;
#define rep(i, n) for (int i = 0; i < n; i++)
#define drep(i, n) for (int i = n - 1; 0 <= i; i--)
#define yes(ans) \
if (ans) \
cout << "yes" << endl; \
else \
cout << "no" << endl;
#define Yes(ans) \
if (ans) \
cout << "Yes" << endl; \
else \
cout << "No" << endl;
#define YES(ans) \
if (ans) \
cout << "YES" << endl; \
else \
cout << "NO" << endl;
#define POSSIBLE(ans) \
if (ans) \
cout << "POSSIBLE" << endl; \
else \
cout << "IMPOSSIBLE" << endl;
#define Pi 3.1415926535897932384626
#define coutans rep(i, ans.size()) cout << ans[i] << endl;
#define mod (llint)1000000007
#define int_max 2147483647
#define ll_max (llint)9223372036854775807
class UnionFind {
public:
//親の番号を格納する。親だった場合は-(その集合のサイズ)
vector<int> Parent;
//作るときはParentの値を全て-1にする
//こうすると全てバラバラになる
UnionFind(int N) { Parent = vector<int>(N, -1); }
// Aがどのグループに属しているか調べる
int root(int A) {
if (Parent[A] < 0)
return A;
return Parent[A] = root(Parent[A]);
}
//自分のいるグループの頂点数を調べる
int size(int A) {
return -Parent[root(A)]; //親をとってきたい
}
// AとBをくっ付ける
bool connect(int A, int B) {
// AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
A = root(A);
B = root(B);
if (A == B) {
//すでにくっついてるからくっ付けない
return false;
}
//大きい方(A)に小さいほう(B)をくっ付けたい
//大小が逆だったらひっくり返しちゃう。
if (size(A) < size(B))
swap(A, B);
// Aのサイズを更新する
Parent[A] += Parent[B];
// Bの親をAに変更する
Parent[B] = A;
return true;
}
};
// aとbの最大公約数を求めるよ
long long GCD(long long a, long long b) {
if (b == 0)
return a;
else
return GCD(b, a % b);
}
// 返り値: a と b の最大公約数
// ax + by = gcd(a, b) を満たす (x, y) が格納される
long long extGCD(long long a, long long b, long long &x, long long &y) {
if (b == 0) {
x = 1;
y = 0;
return a;
}
long long d = extGCD(b, a % b, y, x);
y -= a / b * x;
return d;
}
bool check(llint a, llint b) { return a > b; }
// mod. m での a の逆元 a^{-1} を計算する
long long modinv(long long a, long long m) {
long long b = m, u = 1, v = 0;
while (b) {
long long t = a / b;
a -= t * b;
swap(a, b);
u -= t * v;
swap(u, v);
}
u %= m;
if (u < 0)
u += m;
return u;
}
bool IsPrime(llint num) {
if (num < 2)
return false;
else if (num == 2)
return true;
else if (num % 2 == 0)
return false; // 偶数はあらかじめ除く
double sqrtNum = sqrt(num);
for (llint i = 3; i <= sqrtNum; i += 2) {
if (num % i == 0) {
// 素数ではない
return false;
}
}
// 素数である
return true;
}
// aのb乗を求める(1000000007で割った余りやで)
llint modpow(llint a, llint b) {
if (b == 0)
return 1;
if (b == 1)
return a;
llint tmp = modpow(a, b / 2);
tmp %= mod;
tmp = tmp * tmp % mod;
if (b % 2)
return tmp * a % mod;
else
return tmp;
}
// aCbを1000000007で割った余りを求める
llint convination(llint a, llint b) {
llint ans = 1;
for (llint i = 0; i < b; i++) {
ans *= a - i;
ans %= mod;
}
for (llint i = 1; i <= b; i++) {
ans *= modinv(i, mod);
ans %= mod;
}
return ans;
}
int main() {
string s;
cin >> s;
bool ans = true;
rep(i, s.size() - 1) if (s[i] == s[i - 1]) ans = false;
if (ans)
cout << "Good" << endl;
else
cout << "Bad" << endl;
return 0;
} | #include <algorithm>
#include <complex>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdio.h>
#include <string.h>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
typedef long long int llint;
typedef pair<int, int> pint;
typedef vector<bool> vbool;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<llint> vllint;
typedef vector<vllint> vvllint;
typedef vector<pair<int, int>> vpint;
typedef vector<pair<llint, llint>> vpllint;
#define rep(i, n) for (int i = 0; i < n; i++)
#define drep(i, n) for (int i = n - 1; 0 <= i; i--)
#define yes(ans) \
if (ans) \
cout << "yes" << endl; \
else \
cout << "no" << endl;
#define Yes(ans) \
if (ans) \
cout << "Yes" << endl; \
else \
cout << "No" << endl;
#define YES(ans) \
if (ans) \
cout << "YES" << endl; \
else \
cout << "NO" << endl;
#define POSSIBLE(ans) \
if (ans) \
cout << "POSSIBLE" << endl; \
else \
cout << "IMPOSSIBLE" << endl;
#define Pi 3.1415926535897932384626
#define coutans rep(i, ans.size()) cout << ans[i] << endl;
#define mod (llint)1000000007
#define int_max 2147483647
#define ll_max (llint)9223372036854775807
class UnionFind {
public:
//親の番号を格納する。親だった場合は-(その集合のサイズ)
vector<int> Parent;
//作るときはParentの値を全て-1にする
//こうすると全てバラバラになる
UnionFind(int N) { Parent = vector<int>(N, -1); }
// Aがどのグループに属しているか調べる
int root(int A) {
if (Parent[A] < 0)
return A;
return Parent[A] = root(Parent[A]);
}
//自分のいるグループの頂点数を調べる
int size(int A) {
return -Parent[root(A)]; //親をとってきたい
}
// AとBをくっ付ける
bool connect(int A, int B) {
// AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
A = root(A);
B = root(B);
if (A == B) {
//すでにくっついてるからくっ付けない
return false;
}
//大きい方(A)に小さいほう(B)をくっ付けたい
//大小が逆だったらひっくり返しちゃう。
if (size(A) < size(B))
swap(A, B);
// Aのサイズを更新する
Parent[A] += Parent[B];
// Bの親をAに変更する
Parent[B] = A;
return true;
}
};
// aとbの最大公約数を求めるよ
long long GCD(long long a, long long b) {
if (b == 0)
return a;
else
return GCD(b, a % b);
}
// 返り値: a と b の最大公約数
// ax + by = gcd(a, b) を満たす (x, y) が格納される
long long extGCD(long long a, long long b, long long &x, long long &y) {
if (b == 0) {
x = 1;
y = 0;
return a;
}
long long d = extGCD(b, a % b, y, x);
y -= a / b * x;
return d;
}
bool check(llint a, llint b) { return a > b; }
// mod. m での a の逆元 a^{-1} を計算する
long long modinv(long long a, long long m) {
long long b = m, u = 1, v = 0;
while (b) {
long long t = a / b;
a -= t * b;
swap(a, b);
u -= t * v;
swap(u, v);
}
u %= m;
if (u < 0)
u += m;
return u;
}
bool IsPrime(llint num) {
if (num < 2)
return false;
else if (num == 2)
return true;
else if (num % 2 == 0)
return false; // 偶数はあらかじめ除く
double sqrtNum = sqrt(num);
for (llint i = 3; i <= sqrtNum; i += 2) {
if (num % i == 0) {
// 素数ではない
return false;
}
}
// 素数である
return true;
}
// aのb乗を求める(1000000007で割った余りやで)
llint modpow(llint a, llint b) {
if (b == 0)
return 1;
if (b == 1)
return a;
llint tmp = modpow(a, b / 2);
tmp %= mod;
tmp = tmp * tmp % mod;
if (b % 2)
return tmp * a % mod;
else
return tmp;
}
// aCbを1000000007で割った余りを求める
llint convination(llint a, llint b) {
llint ans = 1;
for (llint i = 0; i < b; i++) {
ans *= a - i;
ans %= mod;
}
for (llint i = 1; i <= b; i++) {
ans *= modinv(i, mod);
ans %= mod;
}
return ans;
}
int main() {
string s;
cin >> s;
bool ans = true;
rep(i, s.size() - 1) if (s[i] == s[i + 1]) ans = false;
if (ans)
cout << "Good" << endl;
else
cout << "Bad" << endl;
return 0;
} | [
"misc.opposites",
"expression.operator.arithmetic.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change"
] | 800,777 | 800,778 | u376082984 | cpp |
p02993 | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
for (int i = 0; i < s.size() - 1; i++) {
if (s[i] == s[i + 1]) {
cout << "Bad" << endl;
return 0;
}
}
cout << "Good" << endl;
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
for (int i = 0; i < s.size() - 1; i++) {
if (s[i] == s[i + 1]) {
cout << "Bad" << endl;
return 0;
}
}
cout << "Good" << endl;
return 0;
} | [] | 800,785 | 800,786 | u033627628 | cpp |
p02993 | #include <cstdlib>
#include <iostream>
using namespace std;
int main() {
string str;
int flag = 0;
for (int i = 1; i < 4; i++) {
if (str[i - 1] == str[i])
flag = 1;
}
if (flag == 1)
cout << "Bad" << endl;
else
cout << "Good" << endl;
return 0;
} | #include <cstdlib>
#include <iostream>
using namespace std;
int main() {
string str;
cin >> str;
int flag = 0;
for (int i = 1; i < 4; i++) {
if (str[i - 1] == str[i])
flag = 1;
}
if (flag == 1)
cout << "Bad" << endl;
else
cout << "Good" << endl;
return 0;
} | [] | 800,791 | 800,792 | u163149221 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
int main() {
string a;
cin >> a;
if (a[0] != a[1] && a[1] != a[2]) {
if (a[2] != a[3])
cout << "Good" << endl;
else
cout << "Bad" << endl;
} else
cout << "Good" << endl;
} | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
int main() {
string a;
cin >> a;
if (a[0] != a[1] && a[1] != a[2]) {
if (a[2] != a[3])
cout << "Good" << endl;
else
cout << "Bad" << endl;
} else
cout << "Bad" << endl;
} | [
"literal.string.change",
"io.output.change"
] | 800,802 | 800,803 | u551813187 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
int main() {
string s;
cin >> s;
rep(i, 2) {
if ((int)s.at(i) == (int)s.at(i + 1)) {
cout << "Bad" << endl;
return 0;
}
}
cout << "Good" << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
int main() {
string s;
cin >> s;
rep(i, 3) {
if ((int)s.at(i) == (int)s.at(i + 1)) {
cout << "Bad" << endl;
return 0;
}
}
cout << "Good" << endl;
return 0;
} | [
"literal.number.change",
"call.arguments.change"
] | 800,804 | 800,805 | u399819590 | cpp |
p02993 | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
char c = s[0];
for (int i = 1; i < 3; i++) {
if (c == s[i]) {
cout << "Bad" << endl;
return 0;
}
c = s[i];
}
cout << "Good" << endl;
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
char c = s[0];
for (int i = 1; i < 4; i++) {
if (c == s[i]) {
cout << "Bad" << endl;
return 0;
}
c = s[i];
}
cout << "Good" << endl;
return 0;
} | [
"literal.number.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 800,809 | 800,810 | u632094970 | cpp |
p02993 | // inlclude前用define
#define _USE_MATH_DEFINES
// include
#include <algorithm>
#include <cmath>
#include <iostream>
#include <numeric>
#include <string>
#include <type_traits>
#include <vector>
//#include<deque>
#include <iomanip>
#include <map>
#include <set>
#include <tuple>
using namespace std;
// typedef
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef long long int ll;
// define
#define INF 1e9
#define NUM 1000000007
#define all(x) begin(x), end(x)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int dp[110][10010] = {}; //[v][w]
int main() {
string s;
cout << s << endl;
for (int i = 0; i < 3; i++) {
if (s[i] == s[i + 1]) {
cout << "Bad" << endl;
return 0;
}
}
cout << "Good" << endl;
}
| // inlclude前用define
#define _USE_MATH_DEFINES
// include
#include <algorithm>
#include <cmath>
#include <iostream>
#include <numeric>
#include <string>
#include <type_traits>
#include <vector>
//#include<deque>
#include <iomanip>
#include <map>
#include <set>
#include <tuple>
using namespace std;
// typedef
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef long long int ll;
// define
#define INF 1e9
#define NUM 1000000007
#define all(x) begin(x), end(x)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int dp[110][10010] = {}; //[v][w]
int main() {
string s;
cin >> s;
for (int i = 0; i < 3; i++) {
if (s[i] == s[i + 1]) {
cout << "Bad" << endl;
return 0;
}
}
cout << "Good" << endl;
}
| [
"expression.operation.binary.remove"
] | 800,817 | 800,818 | u226951654 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int main() {
int a = 0;
string s;
cin >> s;
for (int i = 0; i < 2; i++) {
if (s.at(0) == s.at(1)) {
a++;
break;
}
if (s.at(i) == s.at(i + 1) || s.at(i + 1) == s.at(i + 2)) {
a++;
break;
}
}
if (a == 0)
cout << "Bad" << endl;
else
cout << "Good" << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int a = 0;
string s;
cin >> s;
for (int i = 0; i < 2; i++) {
if (s.at(0) == s.at(1)) {
a++;
break;
}
if (s.at(i) == s.at(i + 1) || s.at(i + 1) == s.at(i + 2)) {
a++;
break;
}
}
if (a == 0)
cout << "Good" << endl;
else
cout << "Bad" << endl;
} | [
"control_flow.branch.else.remove",
"control_flow.branch.else_if.replace.remove",
"control_flow.branch.if.replace.add"
] | 800,819 | 800,820 | u814465158 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
bool judge = true;
for (int i = 0; i < 4; i++) {
if (S[i] == S[(i + 1) % 4]) {
judge = false;
}
}
cout << (judge ? "Good" : "Bad") << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
bool judge = true;
for (int i = 0; i < 3; i++) {
if (S[i] == S[i + 1]) {
judge = false;
}
}
cout << (judge ? "Good" : "Bad") << endl;
} | [
"literal.number.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change",
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 800,823 | 800,824 | u267265758 | cpp |
p02993 | #define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <string>
using namespace std;
int main() {
FILE *fin = NULL, *fout = NULL;
// fin = freopen("input.txt", "r", stdin);
// fout = freopen("output.txt", "w", stdout);
int S[10];
scanf("%s", S);
if (S[0] == S[1] || S[1] == S[2] || S[2] == S[3]) {
printf("Bad");
} else {
printf("Good");
}
// finalize
if (NULL != fin)
fclose(fin);
if (NULL != fout)
fclose(fout);
return 0;
} | #define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <string>
using namespace std;
int main() {
FILE *fin = NULL, *fout = NULL;
// fin = freopen("input.txt", "r", stdin);
// fout = freopen("output.txt", "w", stdout);
char S[10];
scanf("%s", S);
if (S[0] == S[1] || S[1] == S[2] || S[2] == S[3]) {
printf("Bad");
} else {
printf("Good");
}
// finalize
if (NULL != fin)
fclose(fin);
if (NULL != fout)
fclose(fout);
return 0;
} | [
"variable_declaration.type.primitive.change"
] | 800,827 | 800,828 | u103357948 | cpp |
p02993 | #include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
typedef unsigned long long ll;
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define F first
#define S second
using namespace std;
const ll INF = 1e12;
int main() {
vector<int> s(4);
bool judge = true;
rep(i, 0, 4) {
cin >> s[i];
if (i > 0 && s[i] == s[i - 1])
judge = false;
}
if (judge)
cout << "Good" << endl;
else
cout << "Bad" << endl;
return 0;
} | #include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
typedef unsigned long long ll;
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define F first
#define S second
using namespace std;
const ll INF = 1e12;
int main() {
vector<char> s(4);
bool judge = true;
rep(i, 0, 4) {
cin >> s[i];
if (i > 0 && s[i] == s[i - 1])
judge = false;
}
if (judge)
cout << "Good" << endl;
else
cout << "Bad" << endl;
return 0;
} | [
"variable_declaration.type.primitive.change"
] | 800,831 | 800,832 | u726450206 | cpp |
p02993 | /// A drunk man will find his way home, but a drunk bird may get lost forever...
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define f first
#define s second
#define int long long
#define sz(x) (int)x.size()
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
string s;
cin >> s;
for (int i = 0; i < 2; i++) {
if (s[i] == s[i + 1]) {
cout << "Bad" << endl;
return 0;
}
}
cout << "Good" << endl;
return 0;
}
| /// A drunk man will find his way home, but a drunk bird may get lost forever...
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define f first
#define s second
#define int long long
#define sz(x) (int)x.size()
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
string s;
cin >> s;
for (int i = 0; i < 3; i++) {
if (s[i] == s[i + 1]) {
cout << "Bad" << endl;
return 0;
}
}
cout << "Good" << endl;
return 0;
}
| [
"literal.number.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 800,837 | 800,838 | u361937441 | cpp |
p02993 | #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
int l = s.length();
int i;
for (i = 0; i < l - 2; i++) {
if (s[i] == s[i + 1]) {
cout << "Bad\n";
return 0;
}
}
cout << "Good\n";
return 0;
} | #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
int l = s.length();
int i;
for (i = 0; i < l - 1; i++) {
if (s[i] == s[i + 1]) {
cout << "Bad\n";
return 0;
}
}
cout << "Good\n";
return 0;
}
| [
"literal.number.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 800,845 | 800,846 | u621527413 | cpp |
p02993 | #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
int l = s.length();
int i;
for (i = 0; i < l - 2; i++) {
if (s[i] == s[i + 1]) {
cout << "Bad";
return 0;
}
}
cout << "Good";
return 0;
}
| #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
int l = s.length();
int i;
for (i = 0; i < l - 1; i++) {
if (s[i] == s[i + 1]) {
cout << "Bad\n";
return 0;
}
}
cout << "Good\n";
return 0;
}
| [
"literal.number.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change",
"literal.string.change",
"io.output.change"
] | 800,847 | 800,846 | u621527413 | cpp |
p02993 | // atcoder/abc131/A/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/
#include <bits/stdc++.h>
#define each(i, c) for (auto &i : c)
#define unless(cond) if (!(cond))
using namespace std;
typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;
template <typename P, typename Q>
ostream &operator<<(ostream &os, pair<P, Q> p) {
os << "(" << p.first << "," << p.second << ")";
return os;
}
template <typename P, typename Q>
istream &operator>>(istream &is, pair<P, Q> &p) {
is >> p.first >> p.second;
return is;
}
template <typename T> ostream &operator<<(ostream &os, vector<T> v) {
os << "(";
each(i, v) os << i << ",";
os << ")";
return os;
}
template <typename T> istream &operator>>(istream &is, vector<T> &v) {
each(i, v) is >> i;
return is;
}
template <typename T> inline T setmax(T &a, T b) { return a = std::max(a, b); }
template <typename T> inline T setmin(T &a, T b) { return a = std::min(a, b); }
int main(int argc, char *argv[]) {
ios_base::sync_with_stdio(0);
cin.tie(0);
string s;
while (cin >> s) {
bool f = false;
for (int i = 0; i + 1 < s.size(); ++i) {
f = f || (s[i] == s[i + 1]);
}
cout << (f ? "Good" : "Bad") << endl;
}
return 0;
}
| // atcoder/abc131/A/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/
#include <bits/stdc++.h>
#define each(i, c) for (auto &i : c)
#define unless(cond) if (!(cond))
using namespace std;
typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;
template <typename P, typename Q>
ostream &operator<<(ostream &os, pair<P, Q> p) {
os << "(" << p.first << "," << p.second << ")";
return os;
}
template <typename P, typename Q>
istream &operator>>(istream &is, pair<P, Q> &p) {
is >> p.first >> p.second;
return is;
}
template <typename T> ostream &operator<<(ostream &os, vector<T> v) {
os << "(";
each(i, v) os << i << ",";
os << ")";
return os;
}
template <typename T> istream &operator>>(istream &is, vector<T> &v) {
each(i, v) is >> i;
return is;
}
template <typename T> inline T setmax(T &a, T b) { return a = std::max(a, b); }
template <typename T> inline T setmin(T &a, T b) { return a = std::min(a, b); }
int main(int argc, char *argv[]) {
ios_base::sync_with_stdio(0);
cin.tie(0);
string s;
while (cin >> s) {
bool f = false;
for (int i = 0; i + 1 < s.size(); ++i) {
f = f || (s[i] == s[i + 1]);
}
cout << (!f ? "Good" : "Bad") << endl;
}
return 0;
}
| [
"expression.operation.unary.add",
"control_flow.loop.condition.change"
] | 800,848 | 800,849 | u768334187 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
for (int i = 0; i < 3; i++) {
if (S.at(i) == S.at(i + 1)) {
cout << "bad" << endl;
break;
} else {
if (i == 2) {
cout << "good" << endl;
} else {
continue;
}
}
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
for (int i = 0; i < 3; i++) {
if (S.at(i) == S.at(i + 1)) {
cout << "Bad" << endl;
break;
} else {
if (i == 2) {
cout << "Good" << endl;
} else {
continue;
}
}
}
} | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 800,862 | 800,863 | u747415691 | cpp |
p02993 | #include <iostream>
#include <string>
using namespace std;
int main() {
string S;
cin >> S;
int flag = 0;
for (int i = 1; i < 3; i++) {
if (S[i - 1] == S[i] and S[i + 1] == S[i]) {
flag++;
break;
}
}
if (flag != 0) {
cout << "Bad" << endl;
} else {
cout << "Good" << endl;
}
}
| #include <iostream>
#include <string>
using namespace std;
int main() {
string S;
cin >> S;
int flag = 0;
for (int i = 1; i < 3; i++) {
if (S[i - 1] == S[i] or S[i + 1] == S[i]) {
flag++;
break;
}
}
if (flag != 0) {
cout << "Bad" << endl;
} else {
cout << "Good" << endl;
}
} | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 800,866 | 800,867 | u938317342 | cpp |
p02993 | #include <algorithm>
#include <iostream>
#include <utility>
#include <vector>
#define PB push_back
#define FOR(n) for (int i = 0; i < n; ++i)
#define COUT(n) cout << n << " " << flush
#define ALL(obj) obj.begin(), obj.end()
using namespace std;
int main() {
bool f = true;
char s[5];
cin >> s;
FOR(3) {
if (s[i] == s[i + 1]) {
f = false;
break;
}
}
if (f)
cout << "good" << endl;
else
cout << "bad" << endl;
return 0;
} | #include <algorithm>
#include <iostream>
#include <utility>
#include <vector>
#define PB push_back
#define FOR(n) for (int i = 0; i < n; ++i)
#define COUT(n) cout << n << " " << flush
#define ALL(obj) obj.begin(), obj.end()
using namespace std;
int main() {
bool f = true;
char s[5];
cin >> s;
FOR(3) {
if (s[i] == s[i + 1]) {
f = false;
break;
}
}
if (f)
cout << "Good" << endl;
else
cout << "Bad" << endl;
return 0;
} | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 800,868 | 800,869 | u273004731 | cpp |
p02993 | #include <iostream>
using namespace std;
int main() {
int arr[4];
for (int i = 0; i < 4; i++)
cin >> arr[i];
if (arr[0] == arr[1] || arr[1] == arr[2] || arr[2] == arr[3])
cout << "bad";
else
cout << "good";
return 0;
} | #include <iostream>
using namespace std;
int main() {
char arr[4];
for (int i = 0; i < 4; i++)
cin >> arr[i];
if (arr[0] == arr[1] || arr[1] == arr[2] || arr[2] == arr[3])
cout << "Bad";
else
cout << "Good";
return 0;
} | [
"variable_declaration.type.primitive.change",
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 800,870 | 800,871 | u871166059 | cpp |
p02993 | #include <iostream>
using namespace std;
int main() {
string s;
bool flag = true;
for (int i = 0; i < 3; i++) {
if (s[i] == s[i + 1]) {
flag = false;
break;
}
}
if (flag) {
cout << "Good" << endl;
} else {
cout << "Bad" << endl;
}
return 0;
} | #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
bool flag = true;
for (int i = 0; i < 3; i++) {
if (s[i] == s[i + 1]) {
flag = false;
break;
}
}
if (flag) {
cout << "Good" << endl;
} else {
cout << "Bad" << endl;
}
return 0;
} | [] | 800,889 | 800,890 | u522506260 | cpp |
p02993 | #include <iostream>
using namespace std;
int main() {
string a;
cin >> a;
for (int i = 1; i <= 3; i++) {
if (a[i] == a[i + 1]) {
cout << "Bad";
return 0;
}
}
cout << "Good";
return 0;
}
| #include <iostream>
using namespace std;
int main() {
string a;
cin >> a;
for (int i = 1; i <= 3; i++) {
if (a[i] == a[i - 1]) {
cout << "Bad";
return 0;
}
}
cout << "Good";
return 0;
}
| [
"misc.opposites",
"expression.operator.arithmetic.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change"
] | 800,907 | 800,908 | u847127726 | cpp |
p02993 | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
for (int i = 0; i < 2; i++) {
if (s[i] == s[i + 1]) {
cout << "Bad";
return 0;
}
}
cout << "Good";
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
for (int i = 0; i < 3; i++) {
if (s[i] == s[i + 1]) {
cout << "Bad";
return 0;
}
}
cout << "Good";
} | [
"literal.number.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 800,909 | 800,910 | u534015096 | cpp |
p02993 | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
for (int i = 0; i < 2; i++) {
if (s[i] == s[i + 1]) {
cout << "bad";
return 0;
}
}
cout << "good";
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
for (int i = 0; i < 3; i++) {
if (s[i] == s[i + 1]) {
cout << "Bad";
return 0;
}
}
cout << "Good";
} | [
"literal.number.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change",
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 800,911 | 800,910 | u534015096 | cpp |
p02993 | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
int a = 0;
if (s[0] == s[1]) {
cout << "Bad" << endl;
a++;
}
if (s[1] == s[2]) {
cout << "Bad" << endl;
a++;
}
if (s[2] == s[3]) {
cout << "Bad" << endl;
a++;
}
if (a == 0) {
cout << "Good" << endl;
}
return 0;
}
| #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
int a = 0;
if (s[0] == s[1]) {
cout << "Bad" << endl;
a++;
} else if (s[1] == s[2]) {
cout << "Bad" << endl;
a++;
} else if (s[2] == s[3]) {
cout << "Bad" << endl;
a++;
}
if (a == 0) {
cout << "Good" << endl;
}
return 0;
}
| [
"control_flow.branch.else_if.replace.add",
"control_flow.branch.if.replace.remove"
] | 800,912 | 800,913 | u738164318 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
char a = S[0];
char b = S[1];
char c = S[2];
char d = S[3];
if (a == b || b == c || c == d) {
cout << "Good" << endl;
} else {
cout << "Bad" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
char a = S[0];
char b = S[1];
char c = S[2];
char d = S[3];
if (a == b || b == c || c == d) {
cout << "Bad" << endl;
} else {
cout << "Good" << endl;
}
}
| [
"literal.string.change",
"io.output.change"
] | 800,914 | 800,915 | u101777447 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
//#define int long long
#define fo(a, b) for (int a = 0; a < b; a++)
#define Sort(a) sort(a.begin(), a.end())
#define rev(a) reverse(a.begin(), a.end())
int wari(int a, int b) {
if (a % b == 0)
return a / b;
else
return a / b + 1;
}
int keta(int a) {
double b = a;
b = log10(b);
int c = b;
return c + 1;
}
int souwa(int a) { return a * (a + 1) / 2; }
int lcm(int a, int b) {
int d = a, e = b, f;
if (a < b)
swap(a, b);
int c, m = 1;
while (m) {
c = a % b;
if (c == 0) {
f = b;
m--;
} else {
a = b;
b = c;
}
}
return d * e / f;
}
int gcm(int a, int b) {
int d = a, e = b, f;
if (a < b)
swap(a, b);
int c, m = 1;
while (m) {
c = a % b;
if (c == 0) {
f = b;
m--;
} else {
a = b;
b = c;
}
}
return f;
}
bool prime(int a) {
if (a < 2)
return false;
else if (a == 2)
return true;
else if (a % 2 == 0)
return false;
double b = sqrt(a);
for (int i = 3; i <= b; i += 2) {
if (a % i == 0) {
return false;
}
}
return true;
}
signed main() {
vector<string> s(4);
cin >> s[0] >> s[1] >> s[2] >> s[3];
if (s[0] == s[1] || s[1] == s[2] || s[2] == s[3]) {
cout << "Bad" << endl;
} else
cout << "Good" << endl;
}
| #include <bits/stdc++.h>
using namespace std;
//#define int long long
#define fo(a, b) for (int a = 0; a < b; a++)
#define Sort(a) sort(a.begin(), a.end())
#define rev(a) reverse(a.begin(), a.end())
int wari(int a, int b) {
if (a % b == 0)
return a / b;
else
return a / b + 1;
}
int keta(int a) {
double b = a;
b = log10(b);
int c = b;
return c + 1;
}
int souwa(int a) { return a * (a + 1) / 2; }
int lcm(int a, int b) {
int d = a, e = b, f;
if (a < b)
swap(a, b);
int c, m = 1;
while (m) {
c = a % b;
if (c == 0) {
f = b;
m--;
} else {
a = b;
b = c;
}
}
return d * e / f;
}
int gcm(int a, int b) {
int d = a, e = b, f;
if (a < b)
swap(a, b);
int c, m = 1;
while (m) {
c = a % b;
if (c == 0) {
f = b;
m--;
} else {
a = b;
b = c;
}
}
return f;
}
bool prime(int a) {
if (a < 2)
return false;
else if (a == 2)
return true;
else if (a % 2 == 0)
return false;
double b = sqrt(a);
for (int i = 3; i <= b; i += 2) {
if (a % i == 0) {
return false;
}
}
return true;
}
signed main() {
string s;
cin >> s[0] >> s[1] >> s[2] >> s[3];
if (s[0] == s[1] || s[1] == s[2] || s[2] == s[3]) {
cout << "Bad" << endl;
} else
cout << "Good" << endl;
}
| [
"call.arguments.change"
] | 800,921 | 800,922 | u790461875 | cpp |
p02993 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
int main() {
string s;
;
if (s[0] == s[1] || s[1] == s[2] || s[2] == s[3]) {
cout << "Bad" << endl;
}
else {
cout << "Good" << endl;
}
return 0;
}
| #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
int main() {
string s;
cin >> s;
if (s[0] == s[1] || s[1] == s[2] || s[2] == s[3]) {
cout << "Bad" << endl;
}
else {
cout << "Good" << endl;
}
return 0;
}
| [
"expression.operation.binary.add"
] | 800,923 | 800,924 | u625522718 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
using Int = long long int;
template <typename T> void swap(T *t1, T *t2) {
T *tmp = t1;
t1 = t2;
t2 = tmp;
}
Int tmpi = 0;
double tmpd = 0.0;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
char s[4];
cin >> s;
if (s[0] == s[1] || s[1] == s[2] || s[2] == s[3]) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
using Int = long long int;
template <typename T> void swap(T *t1, T *t2) {
T *tmp = t1;
t1 = t2;
t2 = tmp;
}
Int tmpi = 0;
double tmpd = 0.0;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
char s[4];
cin >> s;
if (s[0] == s[1] || s[1] == s[2] || s[2] == s[3]) {
cout << "Bad" << endl;
} else {
cout << "Good" << endl;
}
return 0;
} | [
"literal.string.change",
"io.output.change"
] | 800,929 | 800,930 | u026620445 | cpp |
p02993 | #define DBG 0 // submission 0
#if DBG == 1
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <string>
#include <vector>
#else
#include <bits/stdc++.h>
#endif
using namespace std;
int main() {
// long long ans = 0,sum = 0;
// long long N,K;
int i, j, k, tmp = 0;
string S;
cin >> S;
for (i = 1; i < 4; i++) {
if (S[i] == S[i - 1]) {
tmp = 1;
break;
}
}
cout << (tmp ? "Good" : "Bad") << endl;
}
| #define DBG 0 // submission 0
#if DBG == 1
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <string>
#include <vector>
#else
#include <bits/stdc++.h>
#endif
using namespace std;
int main() {
// long long ans = 0,sum = 0;
// long long N,K;
int i, j, k, tmp = 0;
string S;
cin >> S;
for (i = 1; i < 4; i++) {
if (S[i] == S[i - 1]) {
tmp = 1;
break;
}
}
cout << (tmp ? "Bad" : "Good") << endl;
}
| [
"literal.string.change",
"io.output.change"
] | 800,935 | 800,936 | u099619676 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S[0] != S[1] && S[1] != S[2] && S[2] != S[3])
cout << "Yes" << endl;
else
cout << "No" << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S[0] != S[1] && S[1] != S[2] && S[2] != S[3])
cout << "Good" << endl;
else
cout << "Bad" << endl;
}
| [
"literal.string.change",
"io.output.change"
] | 800,946 | 800,947 | u854161810 | cpp |
p02993 | #include <iostream>
using namespace std;
int main(void) {
string s;
cin >> s;
for (int i = 0; i < 4; i++) {
if (s[i] == s[i + 1]) {
cout << "bad" << endl;
return 0;
}
}
cout << "good" << endl;
return 0;
} | #include <iostream>
using namespace std;
int main(void) {
string s;
cin >> s;
for (int i = 0; i < 4; i++) {
if (s[i] == s[i + 1]) {
cout << "Bad" << endl;
return 0;
}
}
cout << "Good" << endl;
return 0;
} | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 800,948 | 800,949 | u762674876 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int main() {
vector<int> num(4);
for (int &x : num) {
cin >> x;
}
for (int i = 0; i < 3; i++) {
if (num[i + 1] == num[i]) {
cout << "Bad" << endl;
;
return 0;
}
}
cout << "Good" << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
vector<char> num(4);
for (char &x : num) {
cin >> x;
}
for (int i = 0; i < 3; i++) {
if (num[i + 1] == num[i]) {
cout << "Bad" << endl;
;
return 0;
}
}
cout << "Good" << endl;
} | [
"variable_declaration.type.primitive.change"
] | 800,954 | 800,955 | u351265848 | cpp |
p02993 | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long int ll;
typedef vector<pair<ll, ll>> Q;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const ll inf = 1e9 + 7;
ll gcd(ll a, ll b) { return (b ? gcd(b, a % b) : a); }
ll lcm(ll a, ll b) { return a / (gcd(a, b)) * b; }
int main() {
char a[4];
rep(i, 3) cin >> a[i];
bool flag = false;
rep(i, 3) {
if (a[i + 1] == a[i])
flag = true;
}
if (flag)
cout << "Bad";
else
cout << "Good";
cout << endl;
} | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long int ll;
typedef vector<pair<ll, ll>> Q;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const ll inf = 1e9 + 7;
ll gcd(ll a, ll b) { return (b ? gcd(b, a % b) : a); }
ll lcm(ll a, ll b) { return a / (gcd(a, b)) * b; }
int main() {
char a[4];
rep(i, 4) cin >> a[i];
bool flag = false;
rep(i, 3) {
if (a[i + 1] == a[i])
flag = true;
}
if (flag)
cout << "Bad";
else
cout << "Good";
cout << endl;
} | [
"literal.number.change",
"call.arguments.change"
] | 800,960 | 800,961 | u620242073 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
// start
vector<char> s(4);
rep(i, 4) cin >> s.at(i);
rep(i, 3) {
if (s.at(i) == s.at(i + 1))
cout << "Bad" << endl;
return 0;
}
cout << "Good" << endl;
// end
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
// start
vector<char> s(4);
rep(i, 4) cin >> s.at(i);
rep(i, 3) {
if (s.at(i) == s.at(i + 1)) {
cout << "Bad" << endl;
return 0;
}
}
cout << "Good" << endl;
// end
return 0;
}
| [] | 800,980 | 800,981 | u376234649 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, ans = "Good";
cin >> s;
int num = s.size();
char tem = s[0];
for (int i = 1; i < num - 1; ++i) {
if (tem == s[i]) {
ans = "Bad";
}
tem = s[i];
}
cout << ans << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s, ans = "Good";
cin >> s;
int num = s.size();
char tem = s[0];
for (int i = 1; i < num; ++i) {
if (tem == s[i]) {
ans = "Bad";
}
tem = s[i];
}
cout << ans << endl;
}
| [
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove"
] | 801,006 | 801,007 | u812874294 | cpp |
p02993 | #include <algorithm>
#include <iostream>
#include <iterator>
#include <map>
using namespace std;
int main(void) {
// Your code here!
string s;
cin >> s;
if (s[0] == s[1] || s[1] == s[2] || s[2] == s[3]) {
cout << "Bad";
} else {
cout << "God";
}
cout << endl;
}
| #include <algorithm>
#include <iostream>
#include <iterator>
#include <map>
using namespace std;
int main(void) {
// Your code here!
string s;
cin >> s;
if (s[0] == s[1] || s[1] == s[2] || s[2] == s[3]) {
cout << "Bad";
} else {
cout << "Good";
}
cout << endl;
}
| [
"literal.string.change",
"io.output.change"
] | 801,012 | 801,013 | u361036928 | cpp |
p02993 | #include <iostream>
using namespace std;
int main() {
string S;
cin >> S;
bool flag = false;
for (int i = 0; i < 3; i++) {
if (S[i] == S[i + 1]) {
flag = true;
break;
}
}
if (flag == true)
cout << 'Bad' << endl;
else
cout << 'Good' << endl;
return 0;
} | #include <iostream>
using namespace std;
int main() {
string S;
cin >> S;
bool flag = false;
for (int i = 0; i < 3; i++) {
if (S[i] == S[i + 1]) {
flag = true;
break;
}
}
if (flag == true)
cout << "Bad" << endl;
else
cout << "Good" << endl;
return 0;
} | [
"literal.string.change",
"io.output.change"
] | 801,026 | 801,027 | u204523044 | cpp |
p02993 | #include <iostream>
using namespace std;
int main() {
string S;
cin >> S;
bool flag = false;
for (int i = 0; i < 3; i++) {
if (S[i] == S[i + 1]) {
flag = true;
break;
}
}
if (flag == true)
cout << 'Bad' << endl;
else
cout << 'Bad' << endl;
return 0;
} | #include <iostream>
using namespace std;
int main() {
string S;
cin >> S;
bool flag = false;
for (int i = 0; i < 3; i++) {
if (S[i] == S[i + 1]) {
flag = true;
break;
}
}
if (flag == true)
cout << "Bad" << endl;
else
cout << "Good" << endl;
return 0;
} | [
"literal.string.change",
"io.output.change"
] | 801,028 | 801,027 | u204523044 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
bool hantei = false;
for (int i = 0; i < 2; i++) {
if (S.at(i) == S.at(i + 1)) {
hantei = true;
break;
}
}
if (hantei) {
cout << "Bad" << endl;
} else {
cout << "Good" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
bool hantei = false;
for (int i = 0; i < 3; i++) {
if (S.at(i) == S.at(i + 1)) {
hantei = true;
break;
}
}
if (hantei) {
cout << "Bad" << endl;
} else {
cout << "Good" << endl;
}
}
| [
"literal.number.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 801,042 | 801,043 | u776056110 | cpp |
p02993 | #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(obj) (obj).begin(), (obj).end()
#define unsigned long ul
#define long long ll
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
string s;
cin >> s;
if (s[0] == s[1] || s[1] == s[2] || s[2] == s[3])
cout << "Good";
else
cout << "Bad";
cout << endl;
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 (int i = 0; i < (n); ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define unsigned long ul
#define long long ll
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
string s;
cin >> s;
if (s[0] == s[1] || s[1] == s[2] || s[2] == s[3])
cout << "Bad";
else
cout << "Good";
cout << endl;
return 0;
}
| [
"control_flow.branch.else.remove",
"control_flow.branch.else_if.replace.remove",
"control_flow.branch.if.replace.add"
] | 801,048 | 801,049 | u948212340 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
string s;
cin >> s;
int lastDigit = -1;
for (auto &x : s) {
int curDigit = x - '0';
if (lastDigit == curDigit) {
cout << "Bad\n";
return 0;
}
}
cout << "Good\n";
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
string s;
cin >> s;
int lastDigit = -1;
for (auto &x : s) {
int curDigit = x - '0';
if (lastDigit == curDigit) {
cout << "Bad\n";
return 0;
}
lastDigit = curDigit;
}
cout << "Good\n";
return 0;
}
| [
"assignment.add"
] | 801,052 | 801,053 | u804448625 | cpp |
p02993 | #include <bits/stdc++.h>
#define repeat(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
string S, ans;
cin >> S;
repeat(i, 3) {
if (S[i] == S[i + 1]) {
ans = "Bad";
} else {
ans = "Good";
}
}
cout << ans << endl;
}
| #include <bits/stdc++.h>
#define repeat(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
string S, ans;
cin >> S;
repeat(i, 3) {
if (S[i] == S[i + 1]) {
ans = "Bad";
break;
} else {
ans = "Good";
}
}
cout << ans << endl;
}
| [
"control_flow.break.add"
] | 801,065 | 801,066 | u726060136 | cpp |
p02993 | #include <iostream>
using namespace std;
int main() {
bool flag = true;
int c, c2 = 'a';
for (int i = 0; i < 4; i++) {
cin >> c;
if (c == c2)
flag = false;
c2 = c;
}
if (flag)
cout << "Good" << endl;
else
cout << "Bad" << endl;
} | #include <iostream>
using namespace std;
int main() {
bool flag = true;
char c, c2 = 'a';
for (int i = 0; i < 4; i++) {
cin >> c;
if (c == c2)
flag = false;
c2 = c;
}
if (flag)
cout << "Good" << endl;
else
cout << "Bad" << endl;
}
| [
"variable_declaration.type.primitive.change"
] | 801,075 | 801,076 | u716314620 | cpp |
p02993 | #include <algorithm>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
//#include <stdio.h>
//#include <stack>
//#include <queue>
#include <cmath>
#include <cstdio>
#include <iterator>
#include <map>
//#include <fstream>
//#include <list>
//#include <iomanip>
#include <cctype>
#include <stdlib.h>
using namespace std;
#define MOD 1000000007
#define Int int64_t
#define PI 3.14159265358979
#define ssort(z) sort(z.begin(), z.end())
#define rsort(z) sort(z.rbegin(), z.rend())
#define eerase(z) z.erase(unique(z.begin(), z.end()), z.end())
#define ccnt(z, w) count(z.begin(), z.end(), w)
void printVec(std::vector<int> &vec) {
std::cout << "";
for (auto it = vec.begin(); it != vec.end(); ++it) {
std::cout << *it << " ";
}
std::cout << std::endl;
}
void printVec1(std::vector<string> &vec) {
std::cout << "";
for (auto it = vec.begin(); it != vec.end(); ++it) {
std::cout << *it << " ";
}
std::cout << std::endl;
}
void printVec2(std::vector<Int> &vec) {
std::cout << "";
for (auto it = vec.begin(); it != vec.end(); ++it) {
std::cout << *it << " ";
}
std::cout << std::endl;
}
Int gcd(Int a, Int b) { return b != 0 ? gcd(b, a % b) : a; }
Int lcm(Int a, Int b) {
return a / gcd(a, b) * b;
// a*bは64bit integer overflow
}
bool comp(const string a, const string b) { return a.length() < b.length(); }
bool integer(double num) { return floor(num) == num; }
string gen(int num) {
string str = "";
for (int i = 0; i < num; i++)
str += ".";
return str;
}
Int fact(int num) {
if (num == 0)
return 1;
else
return num * fact(num - 1);
}
int main() {
string n;
cin >> n;
char t = n[0];
for (int i = 1; i < 4; i++) {
if (n[i] == t && i < 3) {
cout << "Bad";
return 0;
}
t = n[i];
}
cout << "Good";
cout << endl;
return 0;
} | #include <algorithm>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
//#include <stdio.h>
//#include <stack>
//#include <queue>
#include <cmath>
#include <cstdio>
#include <iterator>
#include <map>
//#include <fstream>
//#include <list>
//#include <iomanip>
#include <cctype>
#include <stdlib.h>
using namespace std;
#define MOD 1000000007
#define Int int64_t
#define PI 3.14159265358979
#define ssort(z) sort(z.begin(), z.end())
#define rsort(z) sort(z.rbegin(), z.rend())
#define eerase(z) z.erase(unique(z.begin(), z.end()), z.end())
#define ccnt(z, w) count(z.begin(), z.end(), w)
void printVec(std::vector<int> &vec) {
std::cout << "";
for (auto it = vec.begin(); it != vec.end(); ++it) {
std::cout << *it << " ";
}
std::cout << std::endl;
}
void printVec1(std::vector<string> &vec) {
std::cout << "";
for (auto it = vec.begin(); it != vec.end(); ++it) {
std::cout << *it << " ";
}
std::cout << std::endl;
}
void printVec2(std::vector<Int> &vec) {
std::cout << "";
for (auto it = vec.begin(); it != vec.end(); ++it) {
std::cout << *it << " ";
}
std::cout << std::endl;
}
Int gcd(Int a, Int b) { return b != 0 ? gcd(b, a % b) : a; }
Int lcm(Int a, Int b) {
return a / gcd(a, b) * b;
// a*bは64bit integer overflow
}
bool comp(const string a, const string b) { return a.length() < b.length(); }
bool integer(double num) { return floor(num) == num; }
string gen(int num) {
string str = "";
for (int i = 0; i < num; i++)
str += ".";
return str;
}
Int fact(int num) {
if (num == 0)
return 1;
else
return num * fact(num - 1);
}
int main() {
string n;
cin >> n;
char t = n[0];
for (int i = 1; i < 4; i++) {
if (n[i] == t) {
cout << "Bad";
return 0;
}
t = n[i];
}
cout << "Good";
cout << endl;
return 0;
} | [
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove"
] | 801,077 | 801,078 | u565624841 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int main() {
vector<int> S(4);
for (int i = 0; i < 3; i++) {
cin >> S.at(i);
}
if (S.at(0) == S.at(1) || S.at(1) == S.at(2) || S.at(2) == S.at(3)) {
cout << "Bad" << endl;
}
else {
cout << "Good" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
vector<char> S(4);
for (int i = 0; i < 4; i++) {
cin >> S.at(i);
}
if (S.at(0) == S.at(1) || S.at(1) == S.at(2) || S.at(2) == S.at(3)) {
cout << "Bad" << endl;
}
else {
cout << "Good" << endl;
}
}
| [
"variable_declaration.type.primitive.change",
"literal.number.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 801,079 | 801,080 | u083447997 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int main() {
vector<int> S(4);
for (int i = 0; i < 4; i++) {
cin >> S.at(i);
}
if (S.at(0) == S.at(1) || S.at(1) == S.at(2) || S.at(2) == S.at(3)) {
cout << "Bad" << endl;
}
else {
cout << "Good" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
vector<char> S(4);
for (int i = 0; i < 4; i++) {
cin >> S.at(i);
}
if (S.at(0) == S.at(1) || S.at(1) == S.at(2) || S.at(2) == S.at(3)) {
cout << "Bad" << endl;
}
else {
cout << "Good" << endl;
}
}
| [
"variable_declaration.type.primitive.change"
] | 801,081 | 801,080 | u083447997 | cpp |
p02993 | #include "bits/stdc++.h"
using namespace std;
int main() {
string s;
cin >> s;
int flag = 0;
int s1, s2;
for (int i = 0; i < 3; i++) {
s1 = s[i] - '0';
s2 = s[i + 1] - '0';
if (abs(s1 - s2) == 1) {
flag = 1;
}
}
if (flag == 1) {
cout << "Bad" << endl;
} else {
cout << "Good" << endl;
}
return 0;
} | #include "bits/stdc++.h"
using namespace std;
int main() {
string s;
cin >> s;
int flag = 0;
int s1, s2;
for (int i = 0; i < 3; i++) {
s1 = s[i] - '0';
s2 = s[i + 1] - '0';
if (abs(s1 - s2) == 0) {
flag = 1;
}
}
if (flag == 1) {
cout << "Bad" << endl;
} else {
cout << "Good" << endl;
}
return 0;
} | [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 801,086 | 801,087 | u297292406 | cpp |
p02993 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
bool isgood;
if (s[0] == s[1])
isgood = false;
if (s[1] == s[2])
isgood = false;
if (s[2] == s[3])
isgood = false;
cout << (isgood ? "Good" : "Bad") << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
bool isgood = true;
if (s[0] == s[1])
isgood = false;
if (s[1] == s[2])
isgood = false;
if (s[2] == s[3])
isgood = false;
cout << (isgood ? "Good" : "Bad") << endl;
return 0;
}
| [
"variable_declaration.value.change"
] | 801,101 | 801,102 | u162080911 | cpp |
p02993 | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
const int INF = 1 << 30;
const ll INFll = 1ll << 60;
int main() {
string s;
cin >> s;
bool flag = false;
for (int i = 0; i < s.size() - 1; i++)
flag = flag || (s[i] == s[i + 1]);
if (flag) {
cout << 'Bad' << endl;
} else {
cout << 'Good' << endl;
}
return 0;
}
| #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
const int INF = 1 << 30;
const ll INFll = 1ll << 60;
int main() {
string s;
cin >> s;
bool flag = false;
for (int i = 0; i < s.size() - 1; i++)
flag = flag || (s[i] == s[i + 1]);
if (flag) {
cout << "Bad" << endl;
} else {
cout << "Good" << endl;
}
return 0;
}
| [
"literal.string.change",
"io.output.change"
] | 801,107 | 801,108 | u735008991 | cpp |
p02993 | #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
int count = 1;
for (int i = 1; i < 4; i++) {
if (s[i] == s[i + 1]) {
count = 0;
}
}
if (count == 0) {
cout << "Bad" << endl;
} else {
cout << "Good" << endl;
}
} | #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
int count = 1;
for (int i = 0; i < 4; i++) {
if (s[i] == s[i + 1]) {
count = 0;
}
}
if (count == 0) {
cout << "Bad" << endl;
} else {
cout << "Good" << endl;
}
} | [
"literal.number.change",
"variable_declaration.value.change",
"control_flow.loop.for.initializer.change",
"expression.off_by_one"
] | 801,111 | 801,112 | u374765578 | cpp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.