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 |
|---|---|---|---|---|---|---|---|
p02987 | #include <cstdio>
#define NUM 4
// using namespace std;
int main() {
int i, j, count;
char S[NUM];
count = 0;
for (i = 0; i < NUM; i++) {
scanf("%c\n", &S[i]);
}
// S[0]==S[1]==S[2]==S[3]
for (i = 0; i < NUM - 1; i++) {
for (j = 1; j < NUM; j++) {
if (S[i] == S[i + j]) {
count++;
}
}
}
if (count == 2) {
printf("%s", "YES");
} else {
printf("%s", "NO");
}
} | #include <cstdio>
#define NUM 4
// using namespace std;
int main() {
int i, j, count;
char S[NUM];
count = 0;
for (i = 0; i < NUM; i++) {
scanf("%c\n", &S[i]);
}
for (i = 0; i < NUM - 1; i++) {
for (j = 1; j < NUM; j++) {
if (S[i] == S[i + j]) {
count++;
}
}
}
if (count == 2) {
printf("%s", "Yes");
} else {
printf("%s", "No");
}
} | [
"literal.string.change",
"literal.string.case.change",
"call.arguments.change",
"io.output.change"
] | 794,503 | 794,504 | u402389525 | cpp |
p02987 | #include <cstdio>
#define NUM 4
// using namespace std;
int main() {
int i, j, count;
char S[NUM];
count = 0;
for (i = 0; i < NUM; i++) {
scanf("%c", &S[i]);
}
// S[0]==S[1]==S[2]==S[3]
for (i = 0; i < NUM - 1; i++) {
for (j = 1; j < NUM; j++) {
if (S[i] == S[i + j]) {
count++;
}
}
}
if (count == 2) {
printf("%s", "YES");
} else {
printf("%s", "NO");
}
} | #include <cstdio>
#define NUM 4
// using namespace std;
int main() {
int i, j, count;
char S[NUM];
count = 0;
for (i = 0; i < NUM; i++) {
scanf("%c\n", &S[i]);
}
for (i = 0; i < NUM - 1; i++) {
for (j = 1; j < NUM; j++) {
if (S[i] == S[i + j]) {
count++;
}
}
}
if (count == 2) {
printf("%s", "Yes");
} else {
printf("%s", "No");
}
} | [
"literal.string.change",
"call.arguments.change",
"literal.string.case.change",
"io.output.change"
] | 794,505 | 794,504 | u402389525 | cpp |
p02987 | #include <cstdio>
#define NUM 4
// using namespace std;
int main() {
int i, j, count;
char S[NUM];
count = 0;
for (i = 0; i < NUM; i++) {
scanf("%c", &S[i]);
}
for (i = 0; i < NUM - 1; i++) {
for (j = 1; j < NUM; j++) {
if (S[i] == S[i + j]) {
count++;
}
}
}
if (count == 2) {
printf("%s\n", "YES");
} else {
printf("%s\n", "NO");
}
} | #include <cstdio>
#define NUM 4
// using namespace std;
int main() {
int i, j, count;
char S[NUM];
count = 0;
for (i = 0; i < NUM; i++) {
scanf("%c\n", &S[i]);
}
for (i = 0; i < NUM - 1; i++) {
for (j = 1; j < NUM; j++) {
if (S[i] == S[i + j]) {
count++;
}
}
}
if (count == 2) {
printf("%s", "Yes");
} else {
printf("%s", "No");
}
} | [
"literal.string.change",
"call.arguments.change",
"io.output.change",
"io.output.newline.remove",
"literal.string.case.change"
] | 794,506 | 794,504 | u402389525 | cpp |
p02987 | #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
string result = "No";
if (s[0] == s[1] && s[0] != s[2] && s[2] == s[3]) {
result = "Yes";
} else if (s[0] == s[2] && s[0] != s[1] && s[1] == s[3]) {
result = "Yes";
} else if (s[0] == s[3] && s[0] != s[1] && s[2] == s[2]) {
result = "Yes";
}
cout << result << endl;
return 0;
} | #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
string result = "No";
if (s[0] == s[1] && s[0] != s[2] && s[2] == s[3]) {
result = "Yes";
} else if (s[0] == s[2] && s[0] != s[1] && s[1] == s[3]) {
result = "Yes";
} else if (s[0] == s[3] && s[0] != s[1] && s[1] == s[2]) {
result = "Yes";
}
cout << result << endl;
return 0;
} | [
"literal.number.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change"
] | 794,523 | 794,524 | u639203570 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
cin >> str;
sort(str.begin(), str.end());
if (str[0] == str[1] && str[2] == str[3]) {
if (str[1] != str[2]) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
} else {
cout << "NO" << endl;
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
cin >> str;
sort(str.begin(), str.end());
if (str[0] == str[1] && str[2] == str[3]) {
if (str[1] != str[2]) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} else {
cout << "No" << endl;
}
return 0;
} | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,531 | 794,532 | u940054416 | cpp |
p02987 | #include <algorithm>
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
char S[10];
cin >> S;
sort(S, S + 4);
if (S[0] == S[1] && S[1] != S[2] && S[2] == S[3]) {
cout << "yes" << endl;
} else {
cout << "no" << endl;
}
} | #include <algorithm>
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
char S[10];
cin >> S;
sort(S, S + 4);
if (S[0] == S[1] && S[1] != S[2] && S[2] == S[3]) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,545 | 794,546 | u917140501 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
#define min(...) minn(__VA_ARGS__)
#define max(...) maxx(__VA_ARGS__)
#define stringio() \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
char _;
typedef long long ll;
typedef pair<int, int> pii;
template <typename t> constexpr const t minn(const t x, const t y) {
return x < y ? x : y;
}
template <typename t, typename... r>
constexpr const t minn(const t x, const r... xs) {
return minn(x, minn(xs...));
}
template <typename t> constexpr const t maxx(const t x, const t y) {
return x > y ? x : y;
}
template <typename t, typename... r>
constexpr const t maxx(const t x, const r... xs) {
return maxx(x, maxx(xs...));
}
template <typename t> void scan(t &x) {
do {
while ((x = getchar_unlocked()) < '0')
;
for (x -= '0'; '0' <= (_ = getchar_unlocked());
x = (x << 3) + (x << 1) + _ - '0')
;
} while (0);
}
template <typename t, typename... r> void scan(t &x, r &...xs) {
scan(x);
scan(xs...);
}
const int MAXN = 100005;
set<char> s;
int main() {
for (int i = 0; i < 4; i++)
s.insert(getchar_unlocked());
printf(s.size() == 2 ? "YES\n" : "NO\n");
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define min(...) minn(__VA_ARGS__)
#define max(...) maxx(__VA_ARGS__)
#define stringio() \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
char _;
typedef long long ll;
typedef pair<int, int> pii;
template <typename t> constexpr const t minn(const t x, const t y) {
return x < y ? x : y;
}
template <typename t, typename... r>
constexpr const t minn(const t x, const r... xs) {
return minn(x, minn(xs...));
}
template <typename t> constexpr const t maxx(const t x, const t y) {
return x > y ? x : y;
}
template <typename t, typename... r>
constexpr const t maxx(const t x, const r... xs) {
return maxx(x, maxx(xs...));
}
template <typename t> void scan(t &x) {
do {
while ((x = getchar_unlocked()) < '0')
;
for (x -= '0'; '0' <= (_ = getchar_unlocked());
x = (x << 3) + (x << 1) + _ - '0')
;
} while (0);
}
template <typename t, typename... r> void scan(t &x, r &...xs) {
scan(x);
scan(xs...);
}
const int MAXN = 100005;
set<char> s;
int main() {
for (int i = 0; i < 4; i++)
s.insert(getchar_unlocked());
printf(s.size() == 2 ? "Yes\n" : "No\n");
return 0;
}
| [
"literal.string.change",
"literal.string.case.change",
"call.arguments.change",
"io.output.change"
] | 794,563 | 794,564 | u047932856 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
cin >> str;
int count = 0;
for (int i = 0; i < 4; i++) {
for (int j = i + 1; j < 4; j++) {
char a = str.at(i);
char b = str.at(j);
if (a == b)
count++;
}
}
if (count != 0 && count != 2)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
cin >> str;
int count = 0;
for (int i = 0; i < 4; i++) {
for (int j = i + 1; j < 4; j++) {
char a = str.at(i);
char b = str.at(j);
if (a == b)
count++;
}
}
if (count == 2)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
| [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 794,577 | 794,578 | u625176086 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
cin >> str;
int count = 0;
for (int i = 0; i < 4; i++) {
for (int j = i + 1; j < 4; j++) {
char a = str.at(i);
char b = str.at(j);
if (a == b)
count++;
}
}
if (count != 0)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
cin >> str;
int count = 0;
for (int i = 0; i < 4; i++) {
for (int j = i + 1; j < 4; j++) {
char a = str.at(i);
char b = str.at(j);
if (a == b)
count++;
}
}
if (count == 2)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
| [] | 794,579 | 794,578 | u625176086 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
signed main() {
cin.tie(0);
ios::sync_with_stdio(false);
string S;
cin >> S;
char c[256] = {};
rep(i, 4) c[S[i]]++;
rep(i, 4) if (c[S[i]] != 2) {
cout << "NO" << endl;
return 0;
}
cout << "YES" << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
signed main() {
cin.tie(0);
ios::sync_with_stdio(false);
string S;
cin >> S;
char c[256] = {};
rep(i, 4) c[S[i]]++;
rep(i, 4) if (c[S[i]] != 2) {
cout << "No" << endl;
return 0;
}
cout << "Yes" << endl;
return 0;
}
| [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,580 | 794,581 | u128513271 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string A;
cin >> A;
char a, b, c, d;
a = A.at(0);
b = A.at(1);
c = A.at(2);
d = A.at(3);
if (a == b) {
if (c == d && b != a) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} else if (a == c) {
if (b == d && b != a) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} else if (a == d) {
if (b == c && b != a) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} else {
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string A;
cin >> A;
char a, b, c, d;
a = A.at(0);
b = A.at(1);
c = A.at(2);
d = A.at(3);
if (a == b) {
if (c == d && d != a) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} else if (a == c) {
if (b == d && b != a) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} else if (a == d) {
if (b == c && b != a) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} else {
cout << "No" << endl;
}
} | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 794,586 | 794,587 | u686962993 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int r[100005], r2[100005], r3[1000005];
int main() {
long long int a, b, c, d, e, f, g, k;
string s;
while (cin >> s) {
for (int i = 1; i <= 26; i++) {
r[i] = 0;
}
for (int i = 0; i < s.size(); i++) {
a = s[i] - 64;
r[a]++;
}
b = 0;
for (int i = 1; i <= 26; i++) {
if (r[i] == 2)
b++;
}
if (b == 2)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int r[100005], r2[100005], r3[1000005];
int main() {
long long int a, b, c, d, e, f, g, k;
string s;
while (cin >> s) {
for (int i = 1; i <= 26; i++) {
r[i] = 0;
}
for (int i = 0; i < s.size(); i++) {
a = s[i] - 64;
r[a]++;
}
b = 0;
for (int i = 1; i <= 26; i++) {
if (r[i] == 2)
b++;
}
if (b == 2)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
return 0;
}
| [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,593 | 794,594 | u970127238 | cpp |
p02987 | #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
int shuma = 0;
for (int i = 0; i < 3; i++) {
for (int j = i + 1; j < 4; j++) {
if (s[i] == s[j]) {
shuma++;
}
}
}
if (shuma == 2) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
int shuma = 0;
for (int i = 0; i < 3; i++) {
for (int j = i + 1; j < 4; j++) {
if (s[i] == s[j]) {
shuma++;
}
}
}
if (shuma == 2) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,595 | 794,596 | u172269390 | cpp |
p02987 | #include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
char s[10];
scanf("%s", s);
sort(s, s + 4);
if (s[0] == s[1] && s[2] == s[3] && s[1] != s[2])
puts("YES");
else
puts("NO");
} | #include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
char s[10];
scanf("%s", s);
sort(s, s + 4);
if (s[0] == s[1] && s[2] == s[3] && s[1] != s[2])
puts("Yes");
else
puts("No");
}
| [
"literal.string.change",
"literal.string.case.change",
"call.arguments.change",
"io.output.change"
] | 794,606 | 794,607 | u241159494 | cpp |
p02987 | #include "bits/stdc++.h"
using namespace std;
namespace ORIGIN {
#define LL long long
#define VLL vector<long long>
#define SORT(x) sort(x.begin(), x.end())
#define REVE(x) reverse(x.begin(), x.end())
#define rep(i, n) for (int i = 0; i < n; i++)
#define COUT(x) cout << x << endl
#define WHOLE(x) x.begin(), x.end()
double pai = 3.1415926535;
string atc = "atcoder";
typedef pair<long long, long long> data_t;
string strnum = "0123456789";
string alpS = "abcdefghijklmnopqrstuvwxyz";
string alpL = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int sizealp = (int)(alpS.size());
int mod = 1e9 + 7;
bool test = false;
} // namespace ORIGIN
using namespace ORIGIN;
#define aise akdj
void Test(char a) {
if (test) {
printf("%c", a);
}
}
int gcd(LL a, LL b) {
if (a == 0 || b == 0)
return 0;
if (a < b)
swap(a, b);
if (a % b == 0)
return b;
else
gcd(b, a % b);
}
int main() {
string s;
SORT(s);
if (s[0] == s[1] && s[2] == s[3] && s[0] != s[2])
COUT("Yes");
else
COUT("No");
}
| #include "bits/stdc++.h"
using namespace std;
namespace ORIGIN {
#define LL long long
#define VLL vector<long long>
#define SORT(x) sort(x.begin(), x.end())
#define REVE(x) reverse(x.begin(), x.end())
#define rep(i, n) for (int i = 0; i < n; i++)
#define COUT(x) cout << x << endl
#define WHOLE(x) x.begin(), x.end()
double pai = 3.1415926535;
string atc = "atcoder";
typedef pair<long long, long long> data_t;
string strnum = "0123456789";
string alpS = "abcdefghijklmnopqrstuvwxyz";
string alpL = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int sizealp = (int)(alpS.size());
int mod = 1e9 + 7;
bool test = false;
} // namespace ORIGIN
using namespace ORIGIN;
#define aise akdj
void Test(char a) {
if (test) {
printf("%c", a);
}
}
int gcd(LL a, LL b) {
if (a == 0 || b == 0)
return 0;
if (a < b)
swap(a, b);
if (a % b == 0)
return b;
else
gcd(b, a % b);
}
int main() {
string s;
cin >> s;
SORT(s);
if (s[0] == s[1] && s[2] == s[3] && s[0] != s[2])
COUT("Yes");
else
COUT("No");
}
| [] | 794,610 | 794,611 | u196798307 | cpp |
p02987 | #include <bits/stdc++.h>
#define endl '\n'
#define mp make_pair
using namespace std;
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// #define ordered_set tree<int, null_type,less<int>,
// rb_tree_tag,tree_order_statistics_node_update>
typedef long long int ll;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
ll n;
string s;
cin >> s;
set<char> st;
for (int i = 0; i < s.size(); i++) {
st.insert(s[i]);
}
if (st.size() == 2)
cout << "YES";
else
cout << "NO";
}
| #include <bits/stdc++.h>
#define endl '\n'
#define mp make_pair
using namespace std;
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// #define ordered_set tree<int, null_type,less<int>,
// rb_tree_tag,tree_order_statistics_node_update>
typedef long long int ll;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
ll n;
string s;
cin >> s;
set<char> st;
for (int i = 0; i < s.size(); i++) {
st.insert(s[i]);
}
if (st.size() == 2)
cout << "Yes";
else
cout << "No";
}
| [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,612 | 794,613 | u377622126 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
sort(s.begin(), s.end());
if (s[0] == s[1] && s[2] == s[3] && s[2] != s[3])
cout << "Yes";
else
cout << "No";
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
sort(s.begin(), s.end());
if (s[0] == s[1] && s[2] == s[3] && s[1] != s[2])
cout << "Yes";
else
cout << "No";
return 0;
}
| [
"literal.number.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change"
] | 794,635 | 794,636 | u389438219 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
vector<int> lookup(26, 0);
char temp;
for (int i = 0; i < 26; i++) {
cin >> temp;
lookup[temp - 'A']++;
}
for (int i = 0; i < 26; i++) {
if (lookup[i] != 0 || lookup[i] != 2) {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
vector<int> lookup(26, 0);
char temp;
for (int i = 0; i < 4; i++) {
cin >> temp;
lookup[temp - 'A']++;
}
for (int i = 0; i < 26; i++) {
if (lookup[i] != 0 && lookup[i] != 2) {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
} | [
"literal.number.change",
"control_flow.loop.for.condition.change",
"expression.operation.binary.change",
"misc.opposites",
"control_flow.branch.if.condition.change"
] | 794,637 | 794,638 | u083463940 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
char ch;
set<char> s;
for (int i = 0; i < 4; i++) {
cin >> ch;
s.insert(ch);
}
if (s.size() == 2)
cout << "YES";
else
cout << "NO";
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
char ch;
set<char> s;
for (int i = 0; i < 4; i++) {
cin >> ch;
s.insert(ch);
}
if (s.size() == 2)
cout << "Yes";
else
cout << "No";
return 0;
} | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,664 | 794,665 | u404706753 | cpp |
p02987 | #include <algorithm>
#include <iostream>
#include <string>
int main() {
std::string s;
std::cin >> s;
std::sort(s.begin(), s.end());
const auto ret =
(s[0] == s[1] && s[1] != s[2] && s[2] == s[3]) ? "YES" : "NO";
std::cout << ret << std::endl;
}
| #include <algorithm>
#include <iostream>
#include <string>
int main() {
std::string s;
std::cin >> s;
std::sort(s.begin(), s.end());
const auto ret =
(s[0] == s[1] && s[1] != s[2] && s[2] == s[3]) ? "Yes" : "No";
std::cout << ret << std::endl;
}
| [
"literal.string.change",
"literal.string.case.change"
] | 794,666 | 794,667 | u549516870 | cpp |
p02987 | #include <algorithm>
#include <iostream>
#include <string>
int main() {
std::string s;
std::cin >> s;
std::sort(s.begin(), s.end());
const auto ret =
(s[0] == s[1] && s[1] != s[2] && s[3] == s[4]) ? "YES" : "NO";
std::cout << ret << std::endl;
}
| #include <algorithm>
#include <iostream>
#include <string>
int main() {
std::string s;
std::cin >> s;
std::sort(s.begin(), s.end());
const auto ret =
(s[0] == s[1] && s[1] != s[2] && s[2] == s[3]) ? "Yes" : "No";
std::cout << ret << std::endl;
}
| [
"literal.number.change",
"variable_access.subscript.index.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change",
"literal.string.change",
"literal.string.case.change"
] | 794,668 | 794,667 | u549516870 | cpp |
p02987 | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
char a[8];
if (scanf("%s", a) == 1)
if ((a[0] == a[1]) && (a[2] == a[3]) && (a[1] == a[2]))
printf("Yes");
else if ((a[0] == a[2]) && (a[1] == a[3]) && (a[0] != a[1]))
printf("Yes");
else if ((a[0] == a[3]) && (a[1] == a[2]) && (a[0] != a[1]))
printf("Yes");
else
printf("No");
}
| #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
char a[8];
if (scanf("%s", a) == 1)
if ((a[0] == a[1]) && (a[2] == a[3]) && (a[1] != a[2]))
printf("Yes");
else if ((a[0] == a[2]) && (a[1] == a[3]) && (a[0] != a[1]))
printf("Yes");
else if ((a[0] == a[3]) && (a[1] == a[2]) && (a[0] != a[1]))
printf("Yes");
else
printf("No");
}
| [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 794,669 | 794,670 | u958419642 | cpp |
p02987 | #include "bits/stdc++.h"
using namespace std;
#define int long long
#define F first
#define S second
#define sz(x) ((int)x.size())
#define rep(i, a, n) for (int i = a; i <= n; ++i)
#define all(v) v.begin(), v.end()
#define pb push_back
#define P pair<int, int>
#define E cout << '\n'
const int mod = 1e9 + 7;
const int N = 3e5 + 5;
int a[N];
inline void solve() {
string s;
cin >> s;
sort(all(s));
if (s[0] == s[1] && s[2] == s[3] && s[0] != s[3]) {
cout << "YES";
} else {
cout << "NO";
}
}
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
int t = 1;
// cin >> t; while(t--)
solve();
return 0;
} | #include "bits/stdc++.h"
using namespace std;
#define int long long
#define F first
#define S second
#define sz(x) ((int)x.size())
#define rep(i, a, n) for (int i = a; i <= n; ++i)
#define all(v) v.begin(), v.end()
#define pb push_back
#define P pair<int, int>
#define E cout << '\n'
const int mod = 1e9 + 7;
const int N = 3e5 + 5;
int a[N];
inline void solve() {
string s;
cin >> s;
sort(all(s));
if (s[0] == s[1] && s[2] == s[3] && s[0] != s[3]) {
cout << "Yes";
} else {
cout << "No";
}
}
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
int t = 1;
// cin >> t; while(t--)
solve();
return 0;
} | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,675 | 794,676 | u450009898 | cpp |
p02987 | #include <iostream>
#include <map>
using namespace std;
int main() {
string s;
cin >> s;
map<char, int> m;
for (char c : s) {
m[c]++;
}
if (m.size() == 2) {
for (pair<int, int> p : m) {
if (p.second != 2) {
cout << "NO" << endl;
return 0;
}
}
cout << "YES" << endl;
return 0;
}
cout << "NO" << endl;
}
| #include <iostream>
#include <map>
using namespace std;
int main() {
string s;
cin >> s;
map<char, int> m;
for (char c : s) {
m[c]++;
}
if (m.size() == 2) {
for (pair<int, int> p : m) {
if (p.second != 2) {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
}
cout << "No" << endl;
}
| [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,677 | 794,678 | u594620232 | cpp |
p02987 | #include <iostream>
#include <string>
#include <unordered_set>
using namespace std;
int main() {
string str;
unordered_set<char> s;
cin >> str;
int count[4] = {0};
for (int i = 0; i < 4; i++) {
if (s.find(str[i]) == s.end()) {
count[i]++;
s.insert(str[i]);
} else if (str[i] == str[0])
count[0]++;
else if (str[i] == str[1])
count[1]++;
else
count[2]++;
}
if (count[0] == 2 && count[1] == 2 || count[0] == 2 && count[3] == 2)
cout << "Yes\n";
else
cout << "No\n";
return 0;
}
| #include <iostream>
#include <string>
#include <unordered_set>
using namespace std;
int main() {
string str;
unordered_set<char> s;
cin >> str;
int count[4] = {0};
for (int i = 0; i < 4; i++) {
if (s.find(str[i]) == s.end()) {
count[i]++;
s.insert(str[i]);
} else if (str[i] == str[0])
count[0]++;
else if (str[i] == str[1])
count[1]++;
else
count[2]++;
}
if (count[0] == 2 && count[1] == 2 || count[0] == 2 && count[2] == 2)
cout << "Yes\n";
else
cout << "No\n";
return 0;
}
| [
"literal.number.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change"
] | 794,692 | 794,693 | u819611746 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define isuck \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(0);
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); }
int main() {
isuck;
string s;
cin >> s;
sort(s.begin(), s.end());
if (s[0] == s[1] && s[2] == s[3] && s[1] != s[2] && s.size() == 4) {
cout << "YES";
} else
cout << "NO";
}
| #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define isuck \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(0);
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); }
int main() {
isuck;
string s;
cin >> s;
sort(s.begin(), s.end());
if (s[0] == s[1] && s[2] == s[3] && s[1] != s[2] && s.size() == 4) {
cout << "Yes";
} else
cout << "No";
}
| [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,694 | 794,695 | u608668320 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
sort(s.begin(), s.end());
if (s[0] == s[1] && s[2] == s[3] && s[0] != s[3]) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
sort(s.begin(), s.end());
if (s[0] == s[1] && s[2] == s[3] && s[0] != s[3]) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,704 | 794,705 | u465274766 | cpp |
p02987 | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
if (s[0] == s[1] && s[2] == s[3]) {
if (s[0] != s[2]) {
cout << "YES" << endl;
return 0;
}
}
if (s[0] == s[2] && s[1] == s[3]) {
if (s[0] != s[1]) {
cout << "YES" << endl;
return 0;
}
}
if (s[0] == s[3] && s[1] == s[2]) {
if (s[0] != s[1]) {
cout << "YES" << endl;
return 0;
}
}
cout << "NO" << endl;
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
if (s[0] == s[1] && s[2] == s[3]) {
if (s[0] != s[2]) {
cout << "Yes" << endl;
return 0;
}
}
if (s[0] == s[2] && s[1] == s[3]) {
if (s[0] != s[1]) {
cout << "Yes" << endl;
return 0;
}
}
if (s[0] == s[3] && s[1] == s[2]) {
if (s[0] != s[1]) {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0;
} | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,715 | 794,716 | u676042970 | cpp |
p02987 | #include <bits/stdc++.h>
#define inf 2147483647
#define llinf 9223372036854775807
#define ll long long
using namespace std;
const int maxn = 1e5 + 10;
char s[5];
int cnt = 0, vis[26];
int main() {
scanf("%s", s);
for (int i = 0; i < 4; i++) {
if (vis[s[i] - 'A'] != 0)
continue;
vis[s[i] - 'a'] = 1;
cnt++;
}
if (cnt == 2)
return puts("Yes"), 0;
puts("No");
return 0;
} | #include <bits/stdc++.h>
#define inf 2147483647
#define llinf 9223372036854775807
#define ll long long
using namespace std;
const int maxn = 1e5 + 10;
char s[5];
int cnt = 0, vis[26];
int main() {
scanf("%s", s);
for (int i = 0; i < 4; i++) {
if (vis[s[i] - 'A'] != 0)
continue;
vis[s[i] - 'A'] = 1;
cnt++;
}
if (cnt == 2)
return puts("Yes"), 0;
puts("No");
return 0;
} | [
"literal.string.change",
"literal.string.case.change",
"assignment.variable.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 794,727 | 794,728 | u285456273 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 2e5 + 5, MOD = 1e9 + 7;
string s;
int fr[27];
int main() {
cin >> s;
sort(s.begin(), s.end());
if (s[0] == s[1] && s[2] == s[3] && s[1] != s[2])
printf("YES");
else
printf("NO");
return 0;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 2e5 + 5, MOD = 1e9 + 7;
string s;
int fr[27];
int main() {
cin >> s;
sort(s.begin(), s.end());
if (s[0] == s[1] && s[2] == s[3] && s[1] != s[2])
printf("Yes");
else
printf("No");
return 0;
} | [
"literal.string.change",
"literal.string.case.change",
"call.arguments.change",
"io.output.change"
] | 794,729 | 794,730 | u135774780 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
sort(S.begin(), S.end());
if (S.at(0) == S.at(1) && S.at(1) != S.at(2) && S.at(2) == S.at(3))
cout << "YES" << endl;
else
cout << "NO" << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
sort(S.begin(), S.end());
if (S.at(0) == S.at(1) && S.at(1) != S.at(2) && S.at(2) == S.at(3))
cout << "Yes" << endl;
else
cout << "No" << endl;
} | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,731 | 794,732 | u756514276 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
bool flag;
cin >> s;
sort(s.begin(), s.end());
flag = (s[0] == s[1]) & (s[1] != s[2]) & (s[2] == s[3]);
cout << (flag ? "yes" : "no") << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
bool flag;
cin >> s;
sort(s.begin(), s.end());
flag = (s[0] == s[1]) & (s[1] != s[2]) & (s[2] == s[3]);
cout << (flag ? "Yes" : "No") << endl;
return 0;
}
| [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,748 | 794,749 | u286539644 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
set<char> in;
for (int i = 0; i < s.size(); i++) {
char j = s[i];
in.insert(j);
}
if (in.size() == 2) {
cout << "YES";
}
if (in.size() != 2) {
cout << "NO";
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
set<char> in;
for (int i = 0; i < s.size(); i++) {
char j = s[i];
in.insert(j);
}
if (in.size() == 2) {
cout << "Yes";
}
if (in.size() != 2) {
cout << "No";
}
return 0;
} | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,750 | 794,751 | u392722358 | cpp |
p02987 | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define fio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)
using ll = long long;
using ld = long double;
#define inf INT_MAX
const ll infll = 1ll * inf * inf;
#define mode 998244353
#define mod 1000000007
const long double PI =
3.141592653589793238462643383279502884197169399375105820974944;
#define pb push_back
#define mp make_pair
#define ub upper_bound
#define lb lower_bound
#define far(i, a, b) for (ll i = a; i <= b; i++)
#define rev(i, a, b) for (ll i = a; i >= b; i--)
#define all(v) v.begin(), v.end()
#define ff first
#define ss second
#define sz(a) int((a).size())
#define ftr(c, i) for (auto i = begin(c); i != end(c); i++)
#define rtr(c, i) for (auto i = rbegin(c); i != rend(c); i++)
#define pre(c, x) ((c).find(x) != (c).end())
#define cpre(c, x) (find(all(c), x) != (c).end())
#define mii map<int, int>
#define mll map<ll, ll>
#define vs vector<string>
#define vi vector<int>
#define vl vector<ll>
#define pll pair<ll, ll>
#define pii pair<int, int>
#define vii vector<pii>
#define vll vector<pll>
#define vvl vector<vector<ll>>
#define vvi vector<vector<int>>
#define wh(t) while (t--)
#define print(arr) \
for (auto it = arr.begin(); it != arr.end(); ++it) \
cout << (ll)(it - arr.begin()) << ')' << *it << ' '; \
cout << endl;
#define printii(arr) \
for (auto it = arr.begin(); it != arr.end(); ++it) \
cout << it->ff << ' ' << it->ss << endl; \
cout << endl;
#define MID(i, j) ((i) + (j)) / 2
#define nl '\n'
#define lcm(a, b) ((a) * (b)) / gcd((a), (b))
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll max(ll a, ll b) { return (a > b ? a : b); }
ll min(ll a, ll b) { return (a > b ? b : a); }
ll gcd(ll a, ll b) { return (b == 0) ? a : gcd(b, a % b); }
ll gcd(ll a, ll b, ll &x, ll &y) {
if (a == 0) {
x = 0;
y = 1;
return b;
}
ll x1, y1;
ll d = gcd(b % a, a, x1, y1);
x = y1 - (b / a) * x1;
y = x1;
return d;
}
ll modinv(ll a, ll b) {
ll x, y;
gcd(a, b, x, y);
return (x % b + b) % b;
}
ll ceiling(ll a, ll b) {
if (a % b == 0)
return a / b;
else
return a / b + 1;
}
ll bpow(ll a, ll b, ll m) {
a %= m;
ll res = 1;
while (b > 0) {
if (b & 1)
res = (res * a) % m;
b >>= 1;
a = a * a % m;
}
return res;
}
vvl mat_mul(vvl mat1, vvl mat2, ll mod1) {
vvl res(sz(mat1), vl(sz(mat2[0]), 0));
far(i, 0, sz(mat1) - 1) {
far(j, 0, sz(mat2[0]) - 1) {
far(k, 0, sz(mat1[0]) - 1) {
res[i][j] = (res[i][j] + (mat1[i][k] * mat2[k][j]) % mod1) % mod1;
}
}
}
return res;
}
vvl mat_exp(vvl mat, ll p, ll mod1) {
vvl res(sz(mat), vl(sz(mat[0]), 0));
far(i, 0, sz(mat) - 1) res[i][i] = 1;
while (p > 0) {
if (p & 1)
res = mat_mul(res, mat, mod1);
mat = mat_mul(mat, mat, mod1);
p >>= 1;
}
return res;
}
// find_by_order() // order_of_key()
typedef tree<int, null_type, less<int>, rb_tree_tag,
tree_order_statistics_node_update>
o_s;
const int N = 3 * 1e5 + 5;
ll n, m, q, t, k, x, y, z, ans;
int main() {
fio;
string s;
cin >> s;
mii res;
far(i, 0, 3) res[s[i] - 'A']++;
if (sz(res) != 2) {
cout << "NO" << nl;
return 0;
}
if (res.begin()->ss == 2 && res.rbegin()->ss == 2) {
cout << "YES" << nl;
return 0;
} else {
cout << "NO" << nl;
return 0;
}
}
| #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define fio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)
using ll = long long;
using ld = long double;
#define inf INT_MAX
const ll infll = 1ll * inf * inf;
#define mode 998244353
#define mod 1000000007
const long double PI =
3.141592653589793238462643383279502884197169399375105820974944;
#define pb push_back
#define mp make_pair
#define ub upper_bound
#define lb lower_bound
#define far(i, a, b) for (ll i = a; i <= b; i++)
#define rev(i, a, b) for (ll i = a; i >= b; i--)
#define all(v) v.begin(), v.end()
#define ff first
#define ss second
#define sz(a) int((a).size())
#define ftr(c, i) for (auto i = begin(c); i != end(c); i++)
#define rtr(c, i) for (auto i = rbegin(c); i != rend(c); i++)
#define pre(c, x) ((c).find(x) != (c).end())
#define cpre(c, x) (find(all(c), x) != (c).end())
#define mii map<int, int>
#define mll map<ll, ll>
#define vs vector<string>
#define vi vector<int>
#define vl vector<ll>
#define pll pair<ll, ll>
#define pii pair<int, int>
#define vii vector<pii>
#define vll vector<pll>
#define vvl vector<vector<ll>>
#define vvi vector<vector<int>>
#define wh(t) while (t--)
#define print(arr) \
for (auto it = arr.begin(); it != arr.end(); ++it) \
cout << (ll)(it - arr.begin()) << ')' << *it << ' '; \
cout << endl;
#define printii(arr) \
for (auto it = arr.begin(); it != arr.end(); ++it) \
cout << it->ff << ' ' << it->ss << endl; \
cout << endl;
#define MID(i, j) ((i) + (j)) / 2
#define nl '\n'
#define lcm(a, b) ((a) * (b)) / gcd((a), (b))
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll max(ll a, ll b) { return (a > b ? a : b); }
ll min(ll a, ll b) { return (a > b ? b : a); }
ll gcd(ll a, ll b) { return (b == 0) ? a : gcd(b, a % b); }
ll gcd(ll a, ll b, ll &x, ll &y) {
if (a == 0) {
x = 0;
y = 1;
return b;
}
ll x1, y1;
ll d = gcd(b % a, a, x1, y1);
x = y1 - (b / a) * x1;
y = x1;
return d;
}
ll modinv(ll a, ll b) {
ll x, y;
gcd(a, b, x, y);
return (x % b + b) % b;
}
ll ceiling(ll a, ll b) {
if (a % b == 0)
return a / b;
else
return a / b + 1;
}
ll bpow(ll a, ll b, ll m) {
a %= m;
ll res = 1;
while (b > 0) {
if (b & 1)
res = (res * a) % m;
b >>= 1;
a = a * a % m;
}
return res;
}
vvl mat_mul(vvl mat1, vvl mat2, ll mod1) {
vvl res(sz(mat1), vl(sz(mat2[0]), 0));
far(i, 0, sz(mat1) - 1) {
far(j, 0, sz(mat2[0]) - 1) {
far(k, 0, sz(mat1[0]) - 1) {
res[i][j] = (res[i][j] + (mat1[i][k] * mat2[k][j]) % mod1) % mod1;
}
}
}
return res;
}
vvl mat_exp(vvl mat, ll p, ll mod1) {
vvl res(sz(mat), vl(sz(mat[0]), 0));
far(i, 0, sz(mat) - 1) res[i][i] = 1;
while (p > 0) {
if (p & 1)
res = mat_mul(res, mat, mod1);
mat = mat_mul(mat, mat, mod1);
p >>= 1;
}
return res;
}
// find_by_order() // order_of_key()
typedef tree<int, null_type, less<int>, rb_tree_tag,
tree_order_statistics_node_update>
o_s;
const int N = 3 * 1e5 + 5;
ll n, m, q, t, k, x, y, z, ans;
int main() {
fio;
string s;
cin >> s;
mii res;
far(i, 0, 3) res[s[i] - 'A']++;
if (sz(res) != 2) {
cout << "No" << nl;
return 0;
}
if (res.begin()->ss == 2 && res.rbegin()->ss == 2) {
cout << "Yes" << nl;
return 0;
} else {
cout << "No" << nl;
return 0;
}
}
| [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,752 | 794,753 | u163191764 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string ANS = "Yes";
string S;
cin >> S;
int count;
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
if (S.at(i) == S.at(j)) {
count++;
}
}
if (count != 2) {
ANS = "No";
break;
}
}
cout << ANS << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string ANS = "Yes";
string S;
cin >> S;
int count;
for (int i = 0; i < 4; i++) {
count = 0;
for (int j = 0; j < 4; j++) {
if (S.at(i) == S.at(j)) {
count++;
}
}
if (count != 2) {
ANS = "No";
break;
}
}
cout << ANS << endl;
}
| [
"assignment.add"
] | 794,758 | 794,759 | u025771681 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
int ans[1000] = {0}, qqq = 0, www = 0;
cin >> s;
for (int i = 0; i < 4; i++) {
ans[s[i]]++;
}
for (int i = 0; i < 1000; i++) {
if (ans[i] == 2) {
qqq++;
}
if (ans[i] > 0) {
www++;
}
}
if (qqq == 2 && www == 2) {
cout << "YES";
return 0;
}
cout << "NO";
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
int ans[1000] = {0}, qqq = 0, www = 0;
cin >> s;
for (int i = 0; i < 4; i++) {
ans[s[i]]++;
}
for (int i = 0; i < 1000; i++) {
if (ans[i] == 2) {
qqq++;
}
if (ans[i] > 0) {
www++;
}
}
if (qqq == 2 && www == 2) {
cout << "Yes";
return 0;
}
cout << "No";
return 0;
} | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,760 | 794,761 | u262203607 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
char s[5];
scanf("%d", s);
sort(s, s + 4);
if (s[0] == s[1] && s[2] == s[3] && s[1] != s[2])
printf("Yes");
else
printf("No");
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
char s[5];
scanf("%s", s);
sort(s, s + 4);
if (s[0] == s[1] && s[2] == s[3] && s[1] != s[2])
printf("Yes");
else
printf("No");
return 0;
} | [
"literal.string.change",
"call.arguments.change"
] | 794,766 | 794,767 | u701113330 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
cin >> str;
array<int, 500> unk;
for (int &i : unk) {
i = 0;
}
for (char c : str) {
unk[c] += 1;
}
for (int i : unk) {
if (i != 2 && i != 0) {
cout << "NO" << endl;
exit(0);
}
}
cout << "YES" << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
cin >> str;
array<int, 500> unk;
for (int &i : unk) {
i = 0;
}
for (char c : str) {
unk[c] += 1;
}
for (int i : unk) {
if (i != 2 && i != 0) {
cout << "No" << endl;
exit(0);
}
}
cout << "Yes" << endl;
} | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,770 | 794,771 | u748830830 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
cin >> str;
array<int, 500> unk;
for (int &i : unk) {
i = 0;
}
for (char c : str) {
unk[c] += 1;
}
for (int i : unk) {
if (i != 2 && i != 0) {
cout << "NO";
exit(0);
}
}
cout << "YES" << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
cin >> str;
array<int, 500> unk;
for (int &i : unk) {
i = 0;
}
for (char c : str) {
unk[c] += 1;
}
for (int i : unk) {
if (i != 2 && i != 0) {
cout << "No" << endl;
exit(0);
}
}
cout << "Yes" << endl;
} | [
"literal.string.change",
"literal.string.case.change",
"io.output.change",
"io.output.newline.add"
] | 794,772 | 794,771 | u748830830 | cpp |
p02987 | #include <algorithm>
#include <cassert>
#include <functional>
#include <iostream>
#include <vector>
using namespace std;
int main() {
string s;
cin >> s;
int count = 0;
for (int i = 0; i < 4; i++) {
for (int j = i; j < 4; j++) {
if (s[i] == s[j]) {
count++;
}
}
}
if (count == 2) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | #include <algorithm>
#include <cassert>
#include <functional>
#include <iostream>
#include <vector>
using namespace std;
int main() {
string s;
cin >> s;
int count = 0;
for (int i = 0; i < 4; i++) {
for (int j = i + 1; j < 4; j++) {
if (s[i] == s[j]) {
count++;
}
}
}
if (count == 2) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | [
"control_flow.loop.for.initializer.change"
] | 794,773 | 794,774 | u759162415 | cpp |
p02987 | #include <algorithm>
#include <stdio.h>
using namespace std;
int main(int argc, char const *argv[]) {
char chs[5];
scanf("%s", chs);
sort(chs, chs + 4);
if (chs[0] == chs[1] && chs[1] != chs[2] && chs[2] == chs[3]) {
printf("YES\n");
return 0;
}
printf("NO\n");
return 0;
}
| #include <algorithm>
#include <stdio.h>
using namespace std;
int main(int argc, char const *argv[]) {
char chs[5];
scanf("%s", chs);
sort(chs, chs + 4);
if (chs[0] == chs[1] && chs[1] != chs[2] && chs[2] == chs[3]) {
printf("Yes\n");
return 0;
}
printf("No\n");
return 0;
}
| [
"literal.string.change",
"literal.string.case.change",
"call.arguments.change",
"io.output.change"
] | 794,777 | 794,778 | u109534827 | cpp |
p02987 | #include <algorithm>
#include <cstdio>
using namespace std;
int main(int argc, char const *argv[]) {
char chs[5];
scanf("%s", chs);
sort(chs, chs + 4);
if (chs[0] == chs[1] && chs[1] != chs[2] && chs[2] == chs[3]) {
printf("YES\n");
return 0;
}
printf("NO\n");
return 0;
}
| #include <algorithm>
#include <stdio.h>
using namespace std;
int main(int argc, char const *argv[]) {
char chs[5];
scanf("%s", chs);
sort(chs, chs + 4);
if (chs[0] == chs[1] && chs[1] != chs[2] && chs[2] == chs[3]) {
printf("Yes\n");
return 0;
}
printf("No\n");
return 0;
}
| [
"literal.string.change",
"literal.string.case.change",
"call.arguments.change",
"io.output.change"
] | 794,780 | 794,778 | u109534827 | cpp |
p02987 | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using lli = long long int;
int inf = 1000000007;
using namespace std;
int NextInt() {
int x;
cin >> x;
return x;
}
int main() {
vector<char> m;
for (int i = 0; i < 4; i++)
cin >> m[i];
sort(m.begin(), m.end());
if (m[0] == m[1] && m[1] != m[2] && m[2] == m[3])
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
} | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using lli = long long int;
int inf = 1000000007;
using namespace std;
int NextInt() {
int x;
cin >> x;
return x;
}
int main() {
vector<char> m(4);
for (int i = 0; i < 4; i++)
cin >> m[i];
sort(m.begin(), m.end());
if (m[0] == m[1] && m[1] != m[2] && m[2] == m[3])
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
} | [
"call.arguments.add"
] | 794,788 | 794,789 | u134381136 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string x;
cin >> x;
int a = x[0], b = x[1], c = x[2], d = x[3];
if (a == b, a != c, c == d) {
cout << "Yes" << endl;
} else if (a == c, a != b, b == d) {
cout << "Yes" << endl;
} else if (a == d, a != c, c == b) {
cout << "Yes" << endl;
} else
cout << "No" << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string x;
cin >> x;
int a = x[0], b = x[1], c = x[2], d = x[3];
if (a == b && a != c && c == d) {
cout << "Yes" << endl;
} else if (a == c && a != b && b == d) {
cout << "Yes" << endl;
} else if (a == d && a != c && c == b) {
cout << "Yes" << endl;
} else
cout << "No" << endl;
}
| [
"control_flow.branch.if.condition.change"
] | 794,792 | 794,793 | u827250617 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
char a, b;
a = s.at(0);
int x = 0, y = 0;
for (int i = 0; i < 4; i++) {
if (a == s.at(i)) {
x++;
} else {
b = s.at(i);
for (int j = 0; j < 4; j++) {
if (b == s.at(j)) {
y++;
}
}
}
}
if (x == 2 && y == 2) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
char a, b;
a = s.at(0);
int x = 0, y = 0;
for (int i = 0; i < 4; i++) {
if (a == s.at(i)) {
x++;
} else {
b = s.at(i);
for (int j = 0; j < 4; j++) {
if (b == s.at(j)) {
y++;
}
}
}
}
if (x == 2 && y == 4) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 794,802 | 794,803 | u646051775 | cpp |
p02987 | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
sort(s.begin(), s.end());
if (s[0] == s[1] && s[2] == s[3] && s[0] != s[2])
cout << "Yes" << endl;
cout << "No" << endl;
return 0;
}
| #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
sort(s.begin(), s.end());
if (s[0] == s[1] && s[2] == s[3] && s[0] != s[2])
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
| [
"control_flow.branch.else_if.replace.remove",
"control_flow.branch.if.replace.add"
] | 794,808 | 794,809 | u659629720 | cpp |
p02987 | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
string s;
cin >> s;
sort(s.begin(), s.end());
if (s[0] == s[1] && s[2] == s[3] && s[1] != s[2])
cout << "Yes" << endl;
else
cout << "NO" << endl;
return 0;
} | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
sort(s.begin(), s.end());
if (s[0] == s[1] && s[2] == s[3] && s[1] != s[2])
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
| [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,812 | 794,813 | u532573979 | cpp |
p02987 | #include <iostream>
#include <vector>
using namespace std;
int main() {
string S;
cin >> S;
vector<int> v(26);
for (int i = 0; i < 4; i++)
v[S[i] - 'A']++;
int cnt = 0;
for (int i = 0; i < 26; i++) {
if (v[i] == 2)
cnt++;
}
if (cnt == 2)
cout << "YES" << endl;
else
cout << "NO" << endl;
return 0;
} | #include <iostream>
#include <vector>
using namespace std;
int main() {
string S;
cin >> S;
vector<int> v(26);
for (int i = 0; i < 4; i++)
v[S[i] - 'A']++;
int cnt = 0;
for (int i = 0; i < 26; i++) {
if (v[i] == 2)
cnt++;
}
if (cnt == 2)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
} | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,822 | 794,823 | u188117876 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(NULL);
cin.tie(NULL);
cout.tie(NULL);
string s;
cin >> s;
map<char, int> mp;
++mp[s[0]];
++mp[s[1]];
++mp[s[2]];
++mp[s[3]];
if (mp.size() == 2 && mp.begin()->second == 2) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(NULL);
cin.tie(NULL);
cout.tie(NULL);
string s;
cin >> s;
map<char, int> mp;
++mp[s[0]];
++mp[s[1]];
++mp[s[2]];
++mp[s[3]];
if (mp.size() == 2 && mp.begin()->second == 2) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,835 | 794,836 | u079884366 | cpp |
p02987 | // gauravsinghh
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long int
#define ld long double
#define db double
#define pii pair<int, int>
#define pll pair<long long, long long>
#define sii set<int>
#define sll set<long long>
#define vii vector<int>
#define vll vector<long long>
#define mii map<int, int>
#define mll map<long long, long long>
#define lob lower_bound
#define upb upper_bound
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define pf push_front
#define ins insert
#define mp make_pair
#define w(t) \
cin >> t; \
while (t--)
#define on cout << "\n"
#define o2(a, b) cout << a << " " << b
#define os cout << " "
#define bitcount __builtin_popcount
#define gcd __gcd
#define endl "\n"
#define present(s, x) (s.find(x) != s.end())
#define cpresent(s, x) (find(all(s), x) != s.end())
#define ford(container, it) \
for (__typeof(container.begin()) it = container.begin(); \
it != container.end(); it++)
#define fors(container, it, a, b) \
for (__typeof(container.begin()) it = a; it != b; it++)
#define MOD 1000000007
#define EPSILON 1e-9
#define PI 3.14159265358979323846
#define inf 999999999999999999
#define siz 100005
#define fbo find_by_order
#define ook order_of_key
#define sz(s) (int)s.size()
#define mem(n, m) memset(n, m, sizeof(n))
#define rep(i, n) for (ll i = 0; i < n; i++)
#define ren(i, n) for (ll i = n - 1; i >= 0; i--)
#define all(x) x.begin(), x.end()
#define fo(i, a, b) for (int i = a; i <= b; i++)
#define ffo(i, a, b) for (int i = a; i >= b; i--)
#define MAX 100005
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
typedef tree<ll, null_type, less<ll>, rb_tree_tag,
tree_order_statistics_node_update>
pbds;
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")
void io_set() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
bool comp(const pair<ll, ll> &a, const pair<ll, ll> &b) {
return ((a.ss < b.ss) || (a.ss == b.ss && a.ff < b.ff));
}
signed main() {
IOS io_set();
string s;
cin >> s;
unordered_map<char, ll> mpp;
rep(i, sz(s)) { mpp[s[i]]++; }
if (sz(mpp) == 2) {
ll f = 0;
for (auto it : mpp) {
if (it.ss != 2) {
f = 1;
break;
}
}
if (f) {
cout << "No\n";
} else {
cout << "Yes\n";
}
} else {
cout << "No\n";
}
return 0;
}
| // gauravsinghh
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long int
#define ld long double
#define db double
#define pii pair<int, int>
#define pll pair<long long, long long>
#define sii set<int>
#define sll set<long long>
#define vii vector<int>
#define vll vector<long long>
#define mii map<int, int>
#define mll map<long long, long long>
#define lob lower_bound
#define upb upper_bound
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define pf push_front
#define ins insert
#define mp make_pair
#define w(t) \
cin >> t; \
while (t--)
#define on cout << "\n"
#define o2(a, b) cout << a << " " << b
#define os cout << " "
#define bitcount __builtin_popcount
#define gcd __gcd
#define endl "\n"
#define present(s, x) (s.find(x) != s.end())
#define cpresent(s, x) (find(all(s), x) != s.end())
#define ford(container, it) \
for (__typeof(container.begin()) it = container.begin(); \
it != container.end(); it++)
#define fors(container, it, a, b) \
for (__typeof(container.begin()) it = a; it != b; it++)
#define MOD 1000000007
#define EPSILON 1e-9
#define PI 3.14159265358979323846
#define inf 999999999999999999
#define siz 100005
#define fbo find_by_order
#define ook order_of_key
#define sz(s) (int)s.size()
#define mem(n, m) memset(n, m, sizeof(n))
#define rep(i, n) for (ll i = 0; i < n; i++)
#define ren(i, n) for (ll i = n - 1; i >= 0; i--)
#define all(x) x.begin(), x.end()
#define fo(i, a, b) for (int i = a; i <= b; i++)
#define ffo(i, a, b) for (int i = a; i >= b; i--)
#define MAX 100005
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
typedef tree<ll, null_type, less<ll>, rb_tree_tag,
tree_order_statistics_node_update>
pbds;
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")
void io_set() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
bool comp(const pair<ll, ll> &a, const pair<ll, ll> &b) {
return ((a.ss < b.ss) || (a.ss == b.ss && a.ff < b.ff));
}
signed main() {
IOS
// io_set();
string s;
cin >> s;
unordered_map<char, ll> mpp;
rep(i, sz(s)) { mpp[s[i]]++; }
if (sz(mpp) == 2) {
ll f = 0;
for (auto it : mpp) {
if (it.ss != 2) {
f = 1;
break;
}
}
if (f) {
cout << "No\n";
} else {
cout << "Yes\n";
}
} else {
cout << "No\n";
}
return 0;
}
| [
"variable_declaration.remove"
] | 794,839 | 794,840 | u480527921 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
sort(s.begin(), s.end());
bool a = (s[0] == s[1]);
bool b = (s[2] == s[3]);
bool dif = (s[0] != s[2]);
if (a and b and dif)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
sort(s.begin(), s.end());
bool a = (s[0] == s[1]);
bool b = (s[2] == s[3]);
bool dif = (s[0] != s[2]);
if (a and b and dif)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
| [
"literal.string.change",
"literal.string.case.change",
"control_flow.branch.if.condition.change"
] | 794,845 | 794,846 | u381585104 | cpp |
p02987 | #include "bits/stdc++.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const int INF = 1 << 28;
const ll MOD = 1000000007;
template <class T> bool chmax(T &a, const T &b) {
return (a < b) ? (a = b, 1) : 0;
}
template <class T> bool chmin(T &a, const T &b) {
return (b < a) ? (a = b, 1) : 0;
}
int main() {
string s;
cin >> s;
map<char, int> m;
for (int i = 0; i < s.size(); ++i) {
m[s[i]]++;
}
bool ok = true;
if (m.size() == 2) {
for (auto &p : m) {
if (p.second != 2) {
ok = false;
}
}
} else {
ok = false;
}
if (ok)
cout << "YES"
<< "\n";
else
cout << "NO"
<< "\n";
return 0;
} | #include "bits/stdc++.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const int INF = 1 << 28;
const ll MOD = 1000000007;
template <class T> bool chmax(T &a, const T &b) {
return (a < b) ? (a = b, 1) : 0;
}
template <class T> bool chmin(T &a, const T &b) {
return (b < a) ? (a = b, 1) : 0;
}
int main() {
string s;
cin >> s;
map<char, int> m;
for (int i = 0; i < s.size(); ++i) {
m[s[i]]++;
}
bool ok = true;
if (m.size() == 2) {
for (auto &p : m) {
if (p.second != 2) {
ok = false;
}
}
} else {
ok = false;
}
if (ok)
cout << "Yes"
<< "\n";
else
cout << "No"
<< "\n";
return 0;
} | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,853 | 794,854 | u756088996 | cpp |
p02987 |
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
bool ans = false;
//解法1
// OOXX
if ((s[0] == s[1]) && (s[2] == s[3]) && (s[1] != s[2])) {
ans = true;
}
// OXOX
if ((s[0] == s[2]) && (s[1] == s[3]) && (s[1] != s[2])) {
ans = true;
}
// OXXO
if ((s[0] == s[3]) && (s[2] == s[3]) && (s[0] != s[1])) {
ans = true;
}
/*
//解法2(sort)
sort(s.begin(), s.end());
//OOXX
if ((s[0] == s[1]) && (s[2] == s[3]) && (s[1] != s[2])) {
ans = true;
}
*/
if (ans) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
|
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
bool ans = false;
//解法1
// OOXX
if ((s[0] == s[1]) && (s[2] == s[3]) && (s[1] != s[2])) {
ans = true;
}
// OXOX
if ((s[0] == s[2]) && (s[1] == s[3]) && (s[1] != s[2])) {
ans = true;
}
// OXXO
if ((s[0] == s[3]) && (s[1] == s[2]) && (s[0] != s[1])) {
ans = true;
}
/*
//解法2(sort)
sort(s.begin(), s.end());
//OOXX
if ((s[0] == s[1]) && (s[2] == s[3]) && (s[1] != s[2])) {
ans = true;
}
*/
if (ans) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| [
"literal.number.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change"
] | 794,857 | 794,858 | u085230936 | cpp |
p02987 | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <ctype.h>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <time.h>
#include <vector>
#define mod 1000000007
#define ll long long int
#define pb(x) push_back(x)
#define MP(x, y) make_pair(x, y)
using namespace std;
ll power(ll a, ll b, ll m) {
if (b == 0)
return (1);
ll sol = power(a, b / 2, m);
sol = (sol * sol) % m;
if (b % 2 == 1)
sol = (sol * a) % m;
return (sol);
}
ll gcd(ll a, ll b) {
if (b == 0)
return a;
else {
return gcd(b, a % b);
}
}
int hashe[26];
void solve() {
string s;
cin >> s;
for (int i = 0; i < 4; i++) {
hashe[s[i] - '0']++;
}
int x = 0;
for (int i = 0; i < 26; i++) {
if (hashe[i] == 2) {
x++;
}
}
if (x == 2) {
cout << "Yes";
} else {
cout << "No";
}
}
int main() {
int t = 1;
// cin>>t;
while (t--) {
solve();
}
return 0;
} | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <ctype.h>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <time.h>
#include <vector>
#define mod 1000000007
#define ll long long int
#define pb(x) push_back(x)
#define MP(x, y) make_pair(x, y)
using namespace std;
ll power(ll a, ll b, ll m) {
if (b == 0)
return (1);
ll sol = power(a, b / 2, m);
sol = (sol * sol) % m;
if (b % 2 == 1)
sol = (sol * a) % m;
return (sol);
}
ll gcd(ll a, ll b) {
if (b == 0)
return a;
else {
return gcd(b, a % b);
}
}
int hashe[26];
void solve() {
string s;
cin >> s;
for (int i = 0; i < 4; i++) {
hashe[s[i] - 'A']++;
}
int x = 0;
for (int i = 0; i < 26; i++) {
if (hashe[i] == 2) {
x++;
}
}
if (x == 2) {
cout << "Yes";
} else {
cout << "No";
}
}
int main() {
int t = 1;
// cin>>t;
while (t--) {
solve();
}
return 0;
} | [
"literal.string.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 794,871 | 794,872 | u773115096 | cpp |
p02987 | #include <algorithm>
#include <bits/stdc++.h>
#include <fstream>
#include <iostream>
#include <queue>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
bool isSubsequence(string s, string t);
int main() {
string s;
cin >> s;
int arr[26] = {0};
for (int i = 0; i < 4; i++) {
arr[s[i] - 'A']++;
}
for (int i = 0; i < 26; i++) {
if (arr[i] != 0 && arr[i] != 2) {
cout << "NO";
return 0;
}
}
cout << "YES";
return 0;
}
| #include <algorithm>
#include <bits/stdc++.h>
#include <fstream>
#include <iostream>
#include <queue>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
bool isSubsequence(string s, string t);
int main() {
string s;
cin >> s;
int arr[26] = {0};
for (int i = 0; i < 4; i++) {
arr[s[i] - 'A']++;
}
for (int i = 0; i < 26; i++) {
if (arr[i] != 0 && arr[i] != 2) {
cout << "No";
return 0;
}
}
cout << "Yes";
return 0;
}
| [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,885 | 794,886 | u422178044 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(0) == S.at(1) && S.at(2) == S.at(3) && S.at(0) != S.at(2)) {
cout << "Yes" << endl;
}
if (S.at(0) == S.at(2) && S.at(1) == S.at(3) && S.at(0) != S.at(1)) {
cout << "Yes" << endl;
}
if (S.at(0) == S.at(3) && S.at(1) == S.at(2) && S.at(0) != S.at(1)) {
cout << "Yes" << endl;
} else if (true) {
cout << "No" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(0) == S.at(1) && S.at(2) == S.at(3) && S.at(0) != S.at(2)) {
cout << "Yes" << endl;
} else if (S.at(0) == S.at(2) && S.at(1) == S.at(3) && S.at(0) != S.at(1)) {
cout << "Yes" << endl;
} else if (S.at(0) == S.at(3) && S.at(1) == S.at(2) && S.at(0) != S.at(1)) {
cout << "Yes" << endl;
} else if (true) {
cout << "No" << endl;
}
}
| [
"control_flow.branch.else_if.replace.add",
"control_flow.branch.if.replace.remove"
] | 794,901 | 794,902 | u224951113 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(0) == S.at(1) && S.at(2) == S.at(3) && S.at(0) != S.at(2)) {
cout << "Yes" << endl;
}
if (S.at(0) == S.at(2) && S.at(1) == S.at(3) && S.at(0) != S.at(1)) {
cout << "Yes" << endl;
}
if (S.at(0) == S.at(3) && S.at(1) == S.at(2) && S.at(0) != S.at(1)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(0) == S.at(1) && S.at(2) == S.at(3) && S.at(0) != S.at(2)) {
cout << "Yes" << endl;
} else if (S.at(0) == S.at(2) && S.at(1) == S.at(3) && S.at(0) != S.at(1)) {
cout << "Yes" << endl;
} else if (S.at(0) == S.at(3) && S.at(1) == S.at(2) && S.at(0) != S.at(1)) {
cout << "Yes" << endl;
} else if (true) {
cout << "No" << endl;
}
}
| [
"control_flow.branch.else_if.replace.add",
"control_flow.branch.if.replace.remove",
"control_flow.branch.if.add"
] | 794,904 | 794,902 | u224951113 | cpp |
p02987 | #include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define ff first
#define ss second
#define vi vector<int>
#define br cout << "\n";
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define tr(c, i) for (auto i : c)
#define pii pair<int, int>
#define fast_io() \
ios_base::sync_with_stdio(false); \
cin.tie(nullptr)
#define pq \
priority_queue<pair<ll, pii>, vector<pair<ll, pii>>, greater<pair<ll, pii>>> \
p; // container adapter makes ascending q
#define er(x) cout << x << " "
#define err(x, y) cout << x << " " << y
const int MOD = 1e9 + 7;
const int N = 3500;
using namespace std;
clock_t time_p = clock();
void dem() {
time_p = clock() - time_p;
cerr << "Time Taken : " << (float)(time_p) / CLOCKS_PER_SEC << "\n";
}
int main() {
fast_io();
string s;
cin >> s;
map<char, int> m;
for (char x : s) {
m[x]++;
}
if (m.size() == 2)
cout << "YES";
else
cout << "NO";
return 0;
}
| #include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define ff first
#define ss second
#define vi vector<int>
#define br cout << "\n";
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define tr(c, i) for (auto i : c)
#define pii pair<int, int>
#define fast_io() \
ios_base::sync_with_stdio(false); \
cin.tie(nullptr)
#define pq \
priority_queue<pair<ll, pii>, vector<pair<ll, pii>>, greater<pair<ll, pii>>> \
p; // container adapter makes ascending q
#define er(x) cout << x << " "
#define err(x, y) cout << x << " " << y
const int MOD = 1e9 + 7;
const int N = 3500;
using namespace std;
clock_t time_p = clock();
void dem() {
time_p = clock() - time_p;
cerr << "Time Taken : " << (float)(time_p) / CLOCKS_PER_SEC << "\n";
}
int main() {
fast_io();
string s;
cin >> s;
map<char, int> m;
for (char x : s) {
m[x]++;
}
if (m.size() == 2)
cout << "Yes";
else
cout << "No";
return 0;
}
| [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,907 | 794,908 | u799948134 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define DEBUG(x) cerr << #x << ":" << x << endl;
#define DEBUG2(x, y) cerr << #x << ":" << x << " " << #y << ":" << y << endl;
#define DEBUG3(x, y, z) \
cerr << #x << ":" << x << " " << #y << ":" << y << " " << #z << ":" << z \
<< endl;
#define DEBUGVC(x) \
cerr << #x << ": "; \
for (auto a : x) \
cerr << a << " "; \
cerr << endl;
#define DEBUGMP(x) \
cerr << #x << ":" << endl; \
for (auto a : x) \
cerr << a.first << " " << a.second << endl;
#define MAX_N (2000006)
#define INF (1LL << 60)
const int MOD = (int)1e9 + 7;
signed main() {
string s;
cin >> s;
map<char, int> mp;
for (int i = 0; i < s.length(); i++) {
mp[s[i]]++;
}
if (mp.size() == 2) {
for (auto it : mp) {
if (it.second != 2) {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
}
cout << "No" << endl;
} | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define DEBUG(x) cerr << #x << ":" << x << endl;
#define DEBUG2(x, y) cerr << #x << ":" << x << " " << #y << ":" << y << endl;
#define DEBUG3(x, y, z) \
cerr << #x << ":" << x << " " << #y << ":" << y << " " << #z << ":" << z \
<< endl;
#define DEBUGVC(x) \
cerr << #x << ": "; \
for (auto a : x) \
cerr << a << " "; \
cerr << endl;
#define DEBUGMP(x) \
cerr << #x << ":" << endl; \
for (auto a : x) \
cerr << a.first << " " << a.second << endl;
#define MAX_N (2000006)
#define INF (1LL << 60)
const int MOD = (int)1e9 + 7;
signed main() {
string s;
cin >> s;
map<char, int> mp;
for (int i = 0; i < s.length(); i++) {
mp[s[i]]++;
}
if (mp.size() == 2) {
for (auto it : mp) {
if (it.second != 2) {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | [
"control_flow.branch.else.add"
] | 794,909 | 794,910 | u672541593 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int count2 = 0;
for (int i = 0; i < 4; i++) {
int count = 0;
for (int j = 0; j < 4; j++) {
if (S.at(i) == S.at(j)) {
count++;
}
}
if (count != 2) {
cout << "No" << endl;
count2++;
break;
}
}
if (count2 != 0) {
cout << "Yes" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int count2 = 0;
for (int i = 0; i < 4; i++) {
int count = 0;
for (int j = 0; j < 4; j++) {
if (S.at(i) == S.at(j)) {
count++;
}
}
if (count != 2) {
cout << "No" << endl;
count2++;
break;
}
}
if (count2 == 0) {
cout << "Yes" << endl;
}
} | [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 794,911 | 794,912 | u842747358 | cpp |
p02987 | #include <algorithm>
#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
char s[4];
scanf("%s", s);
sort(s, s + 4);
if (s[0] == s[1]) {
if (s[1] != s[2] && s[2] == s[3]) {
cout << "Yes" << endl;
}
} else {
cout << "No" << endl;
}
return 0;
} | #include <algorithm>
#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
char s[4];
scanf("%s", s);
sort(s, s + 4);
if (s[0] == s[1] && s[1] != s[2] && s[2] == s[3]) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
} | [
"control_flow.branch.if.condition.change"
] | 794,913 | 794,914 | u801144528 | cpp |
p02987 | #include <stdio.h>
#include <stdlib.h>
int main() {
char word[5];
int num[5];
int count1 = 0;
scanf("%s", word);
for (int i = 0; i < 4; i++)
num[i] = word[i];
if (((num[0] == num[1]) && (num[2] == num[3])) ||
((num[0] == num[3]) && (num[1] == num[2])) ||
((num[0] == num[2]) && (num[1] == num[3]))) {
if ((num[0] != num[1]) && (num[0] != num[2]))
printf("Yes\n");
else
printf("No\n");
} else
printf("No\n");
return 0;
} | #include <stdio.h>
#include <stdlib.h>
int main() {
char word[5];
int num[5];
int count1 = 0;
scanf("%s", word);
for (int i = 0; i < 4; i++)
num[i] = word[i];
if (((num[0] == num[1]) && (num[2] == num[3])) ||
((num[0] == num[3]) && (num[1] == num[2])) ||
((num[0] == num[2]) && (num[1] == num[3]))) {
if ((num[0] != num[1]) || (num[0] != num[2]))
printf("Yes\n");
else
printf("No\n");
} else
printf("No\n");
return 0;
} | [
"misc.opposites",
"control_flow.branch.if.condition.change"
] | 794,944 | 794,945 | u552004736 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int ans = 0;
if (s[0] == s[1] && s[1] == s[2] && s[2] == s[3]) {
/* code */
} else {
if (s[0] == s[1] && s[2] == s[3]) {
ans = 1;
} else if (s[0] == s[2] && s[1] == s[3]) {
ans = 1;
} else if (s[0] == s[3] && s[2] == s[3]) {
ans = 1;
}
}
if (ans == 1) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int ans = 0;
if (s[0] == s[1] && s[1] == s[2] && s[2] == s[3]) {
/* code */
} else {
if (s[0] == s[1] && s[2] == s[3]) {
ans = 1;
} else if (s[0] == s[2] && s[1] == s[3]) {
ans = 1;
} else if (s[0] == s[3] && s[1] == s[2]) {
ans = 1;
}
}
if (ans == 1) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| [
"literal.number.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change"
] | 794,946 | 794,947 | u745852541 | cpp |
p02987 | #include <iostream>
using namespace std;
int main() {
char S[4];
int ch = 0;
for (int i = 0; i < 4; i++)
cin >> S[i];
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
if (i != j) {
if (S[i] == S[j])
ch++;
}
}
}
if (ch == 4) {
cout << "YES";
} else {
cout << "NO";
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
char S[4];
int ch = 0;
for (int i = 0; i < 4; i++)
cin >> S[i];
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
if (i != j) {
if (S[i] == S[j])
ch++;
}
}
}
if (ch == 4) {
cout << "Yes";
} else {
cout << "No";
}
return 0;
} | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,948 | 794,949 | u326401041 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int count0 = 0;
int count1 = 0;
int count2 = 0;
int count3 = 0;
count0 = count(S.cbegin(), S.cend(), S.at(0));
count1 = count(S.cbegin(), S.cend(), S.at(1));
count2 = count(S.cbegin(), S.cend(), S.at(2));
count3 = count(S.cbegin(), S.cend(), S.at(3));
if (count0 + count1 + count2 + count3 == 8) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int count0 = 0;
int count1 = 0;
int count2 = 0;
int count3 = 0;
// 1文字目の個数
count0 = count(S.cbegin(), S.cend(), S.at(0));
// 2文字目の個数
count1 = count(S.cbegin(), S.cend(), S.at(1));
// 3文字目の個数
count2 = count(S.cbegin(), S.cend(), S.at(2));
// 4文字目の個数
count3 = count(S.cbegin(), S.cend(), S.at(3));
if (count0 + count1 + count2 + count3 == 8) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 794,952 | 794,953 | u553129408 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
string s;
int a[27], ans;
int main() {
cin >> s;
for (int i = 0; i < 4; i++) {
a[s[i] - '0']++;
}
for (int i = 1; i <= 26; i++) {
if (a[i] == 2)
ans++;
}
if (ans == 2)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
string s;
int a[45], ans;
int main() {
cin >> s;
for (int i = 0; i < 4; i++) {
a[s[i] - '0']++;
}
for (int i = 17; i <= 44; i++) {
if (a[i] == 2)
ans++;
}
if (ans == 2)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
| [
"literal.number.change",
"variable_declaration.array_dimensions.change",
"variable_declaration.value.change",
"control_flow.loop.for.initializer.change",
"control_flow.loop.for.condition.change",
"expression.operation.binary.change"
] | 794,958 | 794,959 | u352283288 | cpp |
p02987 | #include <iostream>
#include <string>
std::string s;
int main() {
std::cin >> s;
if (!(s[0] == s[1] && s[0] == s[2] && s[0] == s[3] && s[1] == s[2] &&
s[1] == s[3] && s[2] == s[3]))
if ((s[0] == s[1] && s[2] == s[3]) || (s[0] == s[2] && s[1] == s[3]) ||
(s[0] == s[3] && s[1] == s[2]))
std::cout << "Yes" << std::endl;
goto f;
std::cout << "No" << std::endl;
f:;
return 0;
} | #include <iostream>
#include <string>
std::string s;
int main() {
std::cin >> s;
if (!(s[0] == s[1] && s[0] == s[2] && s[0] == s[3] && s[1] == s[2] &&
s[1] == s[3] && s[2] == s[3]))
if ((s[0] == s[1] && s[2] == s[3]) || (s[0] == s[2] && s[1] == s[3]) ||
(s[0] == s[3] && s[1] == s[2])) {
std::cout << "Yes" << std::endl;
goto f;
}
std::cout << "No" << std::endl;
f:;
return 0;
} | [] | 794,966 | 794,967 | u688065650 | cpp |
p02987 | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
if (s[0] == s[1] && s[2] == s[3] || s[0] == s[2] && s[1] == s[3] ||
s[0] == s[3] && s[1] == s[2] ||
!(s[0] == s[1] && s[0] == s[2] && s[0] == s[3]))
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
if ((s[0] == s[1] && s[2] == s[3] || s[0] == s[2] && s[1] == s[3] ||
s[0] == s[3] && s[1] == s[2]) &&
!(s[0] == s[1] && s[0] == s[2] && s[0] == s[3]))
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
} | [
"control_flow.branch.if.condition.change"
] | 794,970 | 794,971 | u323966851 | cpp |
p02987 | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
int ans;
int tmp = 0;
ans = 0;
int j = 0;
for (int i = 1; i < 4; i++) {
if (s[0] == s[i]) {
tmp++;
j = i;
}
}
if (tmp != 1) {
cout << "No" << endl;
} else {
for (int i = 2; i < 4; i++) {
if (j == 1) {
if (s[2] == s[3])
ans++;
} else {
if (j == i)
continue;
if (s[1] == s[i])
ans++;
}
}
if (ans == 1) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
return 0;
}
| #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
int ans;
int tmp = 0;
ans = 0;
int j = 0;
for (int i = 1; i < 4; i++) {
if (s[0] == s[i]) {
tmp++;
j = i;
}
}
if (tmp != 1) {
cout << "No" << endl;
} else {
for (int i = 2; i < 4; i++) {
if (j == 1) {
if (s[2] == s[3])
ans++;
break;
} else {
if (j == i)
continue;
if (s[1] == s[i])
ans++;
}
}
if (ans == 1) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
return 0;
}
| [
"control_flow.break.add"
] | 794,972 | 794,973 | u313043608 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
string S;
cin >> S;
char s = S[0];
ll cnt = 0;
for (int i = 1; i < 4; ++i) {
if (s == S[i])
cnt++;
}
if (cnt >= 2 || cnt == 0) {
cout << "No" << endl;
return 0;
}
char s2 = S[1];
if (s2 == s) {
s2 = S[2];
if (s2 == s || s2 != S[3]) {
cout << "No" << endl;
return 0;
}
cout << "Yes" << endl;
return 0;
}
cnt = 0;
for (int i = 2; i < 4; ++i) {
if (s == S[i])
cnt++;
}
if (cnt >= 2 || cnt == 0) {
cout << "No" << endl;
return 0;
}
cout << "Yes" << endl;
}
| #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
string S;
cin >> S;
char s = S[0];
ll cnt = 0;
for (int i = 1; i < 4; ++i) {
if (s == S[i])
cnt++;
}
if (cnt >= 2 || cnt == 0) {
cout << "No" << endl;
return 0;
}
char s2 = S[1];
if (s2 == s) {
s2 = S[2];
if (s2 == s || s2 != S[3]) {
cout << "No" << endl;
return 0;
}
cout << "Yes" << endl;
return 0;
}
cnt = 0;
for (int i = 2; i < 4; ++i) {
if (s2 == S[i])
cnt++;
}
if (cnt >= 2 || cnt == 0) {
cout << "No" << endl;
return 0;
}
cout << "Yes" << endl;
}
| [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 794,985 | 794,986 | u084968244 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
string S;
cin >> S;
char s = S[0];
ll cnt = 0;
for (int i = 1; i < 4; ++i) {
if (s == S[i])
cnt++;
if (cnt >= 2 || cnt == 0) {
cout << "No" << endl;
return 0;
}
}
char s2 = S[1];
if (s2 == s) {
s2 = S[2];
if (s2 == s || s2 != S[3]) {
cout << "No" << endl;
return 0;
}
cout << "Yes" << endl;
return 0;
}
cnt = 0;
for (int i = 2; i < 4; ++i) {
if (s == S[i])
cnt++;
if (cnt >= 2 || cnt == 0) {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
}
| #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
string S;
cin >> S;
char s = S[0];
ll cnt = 0;
for (int i = 1; i < 4; ++i) {
if (s == S[i])
cnt++;
}
if (cnt >= 2 || cnt == 0) {
cout << "No" << endl;
return 0;
}
char s2 = S[1];
if (s2 == s) {
s2 = S[2];
if (s2 == s || s2 != S[3]) {
cout << "No" << endl;
return 0;
}
cout << "Yes" << endl;
return 0;
}
cnt = 0;
for (int i = 2; i < 4; ++i) {
if (s2 == S[i])
cnt++;
}
if (cnt >= 2 || cnt == 0) {
cout << "No" << endl;
return 0;
}
cout << "Yes" << endl;
}
| [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 794,987 | 794,986 | u084968244 | cpp |
p02987 | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
using itn = int;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;
int main() {
string s;
cin >> s;
if (s[0] == s[1] && s[0] != s[2] && s[0] != s[3]) {
if (s[2] == s[3]) {
cout << "Yes" << endl;
return 0;
}
}
if (s[0] == s[2] && s[0] != s[1] && s[0] != s[3]) {
if (s[1] == s[3]) {
cout << "Yes" << endl;
return 0;
}
}
if (s[0] == s[3] && s[0] != s[1] && s[0] != s[2]) {
if (s[2] == s[2]) {
cout << "Yes" << endl;
return 0;
}
}
if (s[1] == s[2] && s[1] != s[0] && s[1] != s[3]) {
if (s[0] == s[3]) {
cout << "Yes" << endl;
return 0;
}
}
if (s[1] == s[3] && s[1] != s[0] && s[1] != s[2]) {
if (s[0] == s[2]) {
cout << "Yes" << endl;
return 0;
}
}
if (s[2] == s[3] && s[2] != s[0] && s[2] != s[1]) {
if (s[0] == s[1]) {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0;
} | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
using itn = int;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;
int main() {
string s;
cin >> s;
if (s[0] == s[1] && s[0] != s[2] && s[0] != s[3]) {
if (s[2] == s[3]) {
cout << "Yes" << endl;
return 0;
}
}
if (s[0] == s[2] && s[0] != s[1] && s[0] != s[3]) {
if (s[1] == s[3]) {
cout << "Yes" << endl;
return 0;
}
}
if (s[0] == s[3] && s[0] != s[1] && s[0] != s[2]) {
if (s[1] == s[2]) {
cout << "Yes" << endl;
return 0;
}
}
if (s[1] == s[2] && s[1] != s[0] && s[1] != s[3]) {
if (s[0] == s[3]) {
cout << "Yes" << endl;
return 0;
}
}
if (s[1] == s[3] && s[1] != s[0] && s[1] != s[2]) {
if (s[0] == s[2]) {
cout << "Yes" << endl;
return 0;
}
}
if (s[2] == s[3] && s[2] != s[0] && s[2] != s[1]) {
if (s[0] == s[1]) {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0;
} | [
"literal.number.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change"
] | 795,013 | 795,014 | u538125576 | cpp |
p02987 | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, n, m) for (int i = n; i < m; i++)
#define ll long long int
using namespace std;
int main() {
string s;
cin >> s;
if (s[0] == s[1] && s[2] == s[3] && s[0] != s[2]) {
cout << "YES" << endl;
} else if (s[0] == s[2] && s[1] == s[3] && s[0] != s[1]) {
cout << "YES" << endl;
} else if (s[0] == s[3] && s[1] == s[2] && s[0] != s[1]) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
}
| #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, n, m) for (int i = n; i < m; i++)
#define ll long long int
using namespace std;
int main() {
string s;
cin >> s;
if (s[0] == s[1] && s[2] == s[3] && s[0] != s[2]) {
cout << "Yes" << endl;
} else if (s[0] == s[2] && s[1] == s[3] && s[0] != s[1]) {
cout << "Yes" << endl;
} else if (s[0] == s[3] && s[1] == s[2] && s[0] != s[1]) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 795,022 | 795,023 | u620059302 | cpp |
p02987 | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m + 1; i < n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int main() {
int count1, count2;
count1 = 1;
count2 = 1;
string S;
cin >> S;
int a, b, c;
a = 0;
b = 0;
c = 0;
char tem = '0';
if (S[0] == S[1]) {
if (S[2] == S[3] && S[0] != S[2]) {
a = 1;
}
} else if (S[0] == S[2]) {
if (S[1] == S[3] && S[0] != S[1]) {
a = 1;
}
} else if (S[0] == S[3]) {
if (S[1] == S[2] && S[0] != S[1]) {
a = 1;
}
}
if (a) {
cout << "Yes" << endl;
} else {
std::cout << "NO" << '\n';
}
}
| #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m + 1; i < n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int main() {
int count1, count2;
count1 = 1;
count2 = 1;
string S;
cin >> S;
int a, b, c;
a = 0;
b = 0;
c = 0;
char tem = '0';
if (S[0] == S[1]) {
if (S[2] == S[3] && S[0] != S[2]) {
a = 1;
}
} else if (S[0] == S[2]) {
if (S[1] == S[3] && S[0] != S[1]) {
a = 1;
}
} else if (S[0] == S[3]) {
if (S[1] == S[2] && S[0] != S[1]) {
a = 1;
}
}
if (a) {
cout << "Yes" << endl;
} else {
std::cout << "No" << '\n';
}
}
| [
"literal.string.change",
"literal.string.case.change",
"expression.operation.binary.change"
] | 795,030 | 795,031 | u085564315 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int i;
for (i = 1; i < 3; i++) {
if (S[i] != S[0]) {
break;
}
}
if (i == 1) {
if (S[2] == S[0] && S[3] == S[1] || S[2] == S[1] || S[3] == S[0]) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} else if (i == 2) {
if (S[2] == S[3]) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} else {
cout << "No" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int i;
for (i = 1; i < 3; i++) {
if (S[i] != S[0]) {
break;
}
}
if (i == 1) {
if (S[2] == S[0] && S[3] == S[1] || S[2] == S[1] && S[3] == S[0]) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} else if (i == 2) {
if (S[2] == S[3]) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} else {
cout << "No" << endl;
}
}
| [
"misc.opposites",
"control_flow.branch.if.condition.change"
] | 795,034 | 795,035 | u503170128 | cpp |
p02987 | #include <stdio.h>
int main(void) {
char *S;
scanf("%s", S);
int cnt = 0;
for (int j = 0; j < 4; j++) {
for (int i = 0; i < 4; i++) {
if (S[j] == S[i]) {
cnt++;
}
}
if (cnt != 2) {
printf("No");
return 0;
}
cnt = 0;
}
printf("Yes");
return 0;
} | #include <stdio.h>
int main(void) {
char S[4];
scanf("%s", S);
int cnt = 0;
for (int j = 0; j < 4; j++) {
for (int i = 0; i < 4; i++) {
if (S[j] == S[i]) {
cnt++;
}
}
if (cnt != 2) {
printf("No");
return 0;
}
cnt = 0;
}
printf("Yes");
return 0;
} | [] | 795,046 | 795,047 | u245335950 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
#define llong long long int
#define rep(i, n) for (int i = 0; i < n; ++i)
#define stl_rep(itr, x) for (auto itr = x.begin(); itr != x.end(); ++itr)
#define stl_repr(itr, x) for (auto itr = x.rbegin(); itr != x.rend(); ++itr)
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
const static int MOD = 1000000000 + 7;
const static int inf = INT_MAX / 2;
const static llong INF = 1LL << 31;
const static int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int main(int argc, char *argv[]) {
cin.tie(0);
ios::sync_with_stdio(false);
string S;
cin >> S;
map<char, int> M;
rep(i, S.size()) { ++M[S[i]]; }
stl_rep(itr, M) {
if (itr->second != 2) {
cout << "No" << endl;
return 0;
}
cout << "Yes" << endl;
return 0;
}
} | #include <bits/stdc++.h>
using namespace std;
#define llong long long int
#define rep(i, n) for (int i = 0; i < n; ++i)
#define stl_rep(itr, x) for (auto itr = x.begin(); itr != x.end(); ++itr)
#define stl_repr(itr, x) for (auto itr = x.rbegin(); itr != x.rend(); ++itr)
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
const static int MOD = 1000000000 + 7;
const static int inf = INT_MAX / 2;
const static llong INF = 1LL << 31;
const static int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int main(int argc, char *argv[]) {
cin.tie(0);
ios::sync_with_stdio(false);
string S;
cin >> S;
map<char, int> M;
rep(i, S.size()) { ++M[S[i]]; }
stl_rep(itr, M) {
if (itr->second != 2) {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
} | [] | 795,048 | 795,049 | u943004959 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll MOD = 1000000007;
int main() {
string a;
cin >> a;
set<char> s;
for (int i = 0; i < 3; i++) {
s.insert(a[i]);
}
if (s.size() == 2)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll MOD = 1000000007;
int main() {
string a;
cin >> a;
set<char> s;
for (int i = 0; i < 4; i++) {
s.insert(a[i]);
}
if (s.size() == 2)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
| [
"literal.number.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 795,050 | 795,051 | u831873811 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s[0] == s[1] || s[0] == s[2] || s[0] == s[3]) {
puts("No");
} else if (s[0] == s[1] || s[2] == s[3]) {
puts("Yes");
} else if (s[0] == s[2] || s[1] == s[3]) {
puts("Yes");
} else if (s[0] == s[3] || s[1] == s[2]) {
puts("Yes");
} else
puts("No");
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s[0] == s[1] && s[0] == s[2] && s[0] == s[3]) {
puts("No");
} else if (s[0] == s[1] && s[2] == s[3]) {
puts("Yes");
} else if (s[0] == s[2] && s[1] == s[3]) {
puts("Yes");
} else if (s[0] == s[3] && s[1] == s[2]) {
puts("Yes");
} else
puts("No");
return 0;
} | [
"misc.opposites",
"control_flow.branch.if.condition.change"
] | 795,052 | 795,053 | u636358157 | cpp |
p02987 | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORS(i, m, n) for (int i = m; i <= n; i++)
#define BIT(n) (1LL << (n))
#define INF 2e9
#define MOD (1000000007)
#define EPS 1e-9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long long int lli;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
string S;
cin >> S;
string ans = "No";
if ((S[0] == S[1] && S[2] == S[3] && S[0] != S[1]) ||
(S[0] == S[2] && S[1] == S[3] && S[0] != S[2]) ||
(S[0] == S[3] && S[1] == S[2] && S[0] != S[3]))
ans = "Yes";
cout << ans << "\n";
} | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORS(i, m, n) for (int i = m; i <= n; i++)
#define BIT(n) (1LL << (n))
#define INF 2e9
#define MOD (1000000007)
#define EPS 1e-9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long long int lli;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
string S;
cin >> S;
string ans = "No";
if ((S[0] == S[1] && S[2] == S[3] && S[0] != S[2]) ||
(S[0] == S[2] && S[1] == S[3] && S[0] != S[1]) ||
(S[0] == S[3] && S[1] == S[2] && S[0] != S[1]))
ans = "Yes";
cout << ans << "\n";
} | [
"literal.number.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change"
] | 795,058 | 795,059 | u468262978 | cpp |
p02987 | #include <iostream>
#include <unordered_map>
#include <vector>
using namespace std;
int main() {
std::string s;
cin >> s;
bool flag = false;
unordered_map<char, int> map;
for (int i = 0; i < s.length() - 1; i++) {
char a = s[i];
if (map.find(a) != map.end()) {
map[a] += 1;
} else {
map[a] = 1;
}
}
if (map.size() == 2) {
int count = 0;
for (auto pair : map) {
if (pair.second == 2) {
count += 1;
}
}
if (count == 2) {
flag = true;
}
}
if (flag)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
} | #include <iostream>
#include <unordered_map>
#include <vector>
using namespace std;
int main() {
std::string s;
cin >> s;
bool flag = false;
unordered_map<char, int> map;
for (int i = 0; i < s.length(); i++) {
char a = s[i];
if (map.find(a) != map.end()) {
map[a] += 1;
} else {
map[a] = 1;
}
}
if (map.size() == 2) {
int count = 0;
for (auto pair : map) {
if (pair.second == 2) {
count += 1;
}
}
if (count == 2) {
flag = true;
}
}
if (flag)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
} | [
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove"
] | 795,067 | 795,068 | u894411949 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
map<char, int> m;
for (int i = 0; i < s.size(); i++) {
m[s[i]]++;
}
for (int i = 0; i < s.size(); i++) {
if (m[s[i]] % 2 == 0) {
continue;
} else {
cout << "No";
}
}
cout << "Yes";
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
map<char, int> m;
for (int i = 0; i < s.size(); i++) {
m[s[i]]++;
}
for (int i = 0; i < s.size(); i++) {
if (m[s[i]] / 2 == 1) {
continue;
} else {
cout << "No";
return 0;
}
}
cout << "Yes";
return 0;
} | [
"expression.operator.arithmetic.change",
"control_flow.branch.if.condition.change",
"literal.number.change",
"control_flow.return.add",
"control_flow.return.0.add"
] | 795,071 | 795,070 | u811897616 | cpp |
p02987 | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
char first = s[0];
char second = '-';
int fl = 1;
int sl = 0;
for (int i = 1; i < 4; i++) {
if (s[i] != first) {
if (second == '-') {
second = s[i];
sl++;
} else if (second != s[i]) {
cout << "NO";
return 0;
} else {
sl++;
}
} else {
fl++;
}
}
if (fl == 2) {
cout << "YES";
} else {
cout << "NO";
}
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
char first = s[0];
char second = '-';
int fl = 1;
int sl = 0;
for (int i = 1; i < 4; i++) {
if (s[i] != first) {
if (second == '-') {
second = s[i];
sl++;
} else if (second != s[i]) {
cout << "No";
return 0;
} else {
sl++;
}
} else {
fl++;
}
}
if (fl == 2) {
cout << "Yes";
} else {
cout << "No";
}
return 0;
} | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 795,078 | 795,079 | u865979946 | cpp |
p02987 | #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 << "NO" << endl;
} else if (S[0] == S[1] && S[2] == S[3]) {
cout << "YES" << endl;
} else if (S[0] == S[2] && S[1] == S[3]) {
cout << "YES" << endl;
} else if (S[0] == S[3] && S[1] == S[2]) {
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 << "No" << endl;
} else if (S[0] == S[1] && S[2] == S[3]) {
cout << "Yes" << endl;
} else if (S[0] == S[2] && S[1] == S[3]) {
cout << "Yes" << endl;
} else if (S[0] == S[3] && S[1] == S[2]) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 795,082 | 795,083 | u190066528 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
int hantei = -2;
string S;
cin >> S;
for (int i = 0; i < 3; i++) {
for (int j = 1; j < 4; j++) {
if (S.at(i) == S.at(j)) {
hantei += 1;
}
}
}
if (hantei == 2) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int hantei = 0;
string S;
cin >> S;
for (int i = 0; i < 3; i++) {
for (int j = i + 1; j < 4; j++) {
if (S.at(i) == S.at(j)) {
hantei += 1;
}
}
}
if (hantei == 2) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | [
"literal.number.change",
"variable_declaration.value.change",
"control_flow.loop.for.initializer.change"
] | 795,087 | 795,088 | u757672175 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define endl "\n"
int main() {
string s;
sort(s.begin(), s.end());
if (s[0] == s[1] && s[2] == s[3] && s[1] != s[2])
cout << "Yes";
else
cout << "No";
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define endl "\n"
int main() {
string s;
cin >> s;
sort(s.begin(), s.end());
if (s[0] == s[1] && s[2] == s[3] && s[1] != s[2])
cout << "Yes";
else
cout << "No";
return 0;
} | [] | 795,097 | 795,098 | u858959088 | cpp |
p02987 | #include <iostream>
//#include<cstdio>
using namespace std;
int main() {
char s[10];
int count, i, j;
for (int i = 0; i < 4; i++) {
cin >> s[i];
}
for (i = 0; i < 4; i++) {
count = 0;
for (j = 0; j < 4; j++) {
if (s[i] == s[j]) {
count++;
}
}
if (count != 2) {
cout << "NO" << endl;
return 0;
}
}
cout << "YES" << endl;
return 0;
} | #include <iostream>
using namespace std;
int main() {
char s[10];
int count, i, j;
for (int i = 0; i < 4; i++) {
cin >> s[i];
}
for (i = 0; i < 4; i++) {
count = 0;
for (j = 0; j < 4; j++) {
if (s[i] == s[j]) {
count++;
}
}
if (count != 2) {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
} | [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 795,101 | 795,102 | u297190465 | cpp |
p02987 | #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
using P = pair<ll, ll>;
using mat = vector<vector<ll>>;
typedef string::const_iterator State;
class ParseError {};
void IOS() { ios::sync_with_stdio(false), cin.tie(0); }
const ll INF = 1e16;
const ll MOD = 1e9 + 7;
const ld EPS = 1e-12;
template <typename T> void dump(T x) { cout << x << endl; }
void dumpf(ld x, int t) { cout << setprecision(t) << fixed << x << endl; }
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
fill((T *)array, (T *)(array + N), val);
}
inline ll mod(ll a, ll b) {
if (a > 0)
return a % b;
if (a % b == 0)
return 0;
ll x = -a / b + 1;
a += x * b;
return a % b;
}
ll powm(ll a, ll b, ll c) {
if (b == 0)
return 1;
else if (b % 2 == 0) {
ll d = powm(a, b / 2, c);
return (d * d) % c;
} else
return (a * powm(a, b - 1, c)) % c;
}
ll gcd(ll a, ll b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
// ll dx[4] = {1, 0, -1, 0};
// ll dy[4] = {0, 1, 0, -1};
vector<ll> g[114514];
vector<ll> h[114514];
bool used[114514] = {};
ll d[114514];
void dfs(int from, int now, int cnt) {
if (cnt == 0) {
if (from != now)
h[from].push_back(now);
return;
}
for (int i = 0; i < g[now].size(); i++) {
dfs(from, g[now][i], cnt - 1);
}
return;
}
int main() {
IOS();
int unko[26] = {};
string s;
cin >> s;
for (int i = 0; i < 4; i++) {
unko[s[i] - 'a']++;
}
bool ok = true;
for (int i = 0; i < 26; i++) {
if (unko[i] != 0 && unko[i] != 2)
ok = false;
}
dump(ok ? "Yes" : "No");
return 0;
}
| #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
using P = pair<ll, ll>;
using mat = vector<vector<ll>>;
typedef string::const_iterator State;
class ParseError {};
void IOS() { ios::sync_with_stdio(false), cin.tie(0); }
const ll INF = 1e16;
const ll MOD = 1e9 + 7;
const ld EPS = 1e-12;
template <typename T> void dump(T x) { cout << x << endl; }
void dumpf(ld x, int t) { cout << setprecision(t) << fixed << x << endl; }
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
fill((T *)array, (T *)(array + N), val);
}
inline ll mod(ll a, ll b) {
if (a > 0)
return a % b;
if (a % b == 0)
return 0;
ll x = -a / b + 1;
a += x * b;
return a % b;
}
ll powm(ll a, ll b, ll c) {
if (b == 0)
return 1;
else if (b % 2 == 0) {
ll d = powm(a, b / 2, c);
return (d * d) % c;
} else
return (a * powm(a, b - 1, c)) % c;
}
ll gcd(ll a, ll b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
// ll dx[4] = {1, 0, -1, 0};
// ll dy[4] = {0, 1, 0, -1};
vector<ll> g[114514];
vector<ll> h[114514];
bool used[114514] = {};
ll d[114514];
void dfs(int from, int now, int cnt) {
if (cnt == 0) {
if (from != now)
h[from].push_back(now);
return;
}
for (int i = 0; i < g[now].size(); i++) {
dfs(from, g[now][i], cnt - 1);
}
return;
}
int main() {
IOS();
int unko[26] = {};
string s;
cin >> s;
for (int i = 0; i < 4; i++) {
unko[s[i] - 'A']++;
}
bool ok = true;
for (int i = 0; i < 26; i++) {
if (unko[i] != 0 && unko[i] != 2)
ok = false;
}
dump(ok ? "Yes" : "No");
return 0;
}
| [
"literal.string.change",
"literal.string.case.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 795,116 | 795,117 | u872959410 | cpp |
p02987 | #include <stdio.h>
#include <stdlib.h>
int main() {
char a[4];
scanf("%s", a);
int b = 0;
if (a[0] == a[1] and a[2] == a[3]) {
b = b + 1;
} else if (a[1] == a[2] and a[0] == a[3]) {
b = b + 1;
} else if (a[0] == a[2] and a[1] == a[3]) {
b = b + 1;
}
if (a[0] == a[1] and a[1] == a[2] and a[2] == a[3]) {
b = 0;
}
if (b >= 1) {
printf("yes\n");
}
if (b <= 0) {
printf("no\n");
}
system("pause");
return 0;
} | #include <stdio.h>
#include <stdlib.h>
int main() {
char a[4];
scanf("%s", a);
int b = 0;
if (a[0] == a[1] and a[2] == a[3]) {
b = b + 1;
} else if (a[1] == a[2] and a[0] == a[3]) {
b = b + 1;
} else if (a[0] == a[2] and a[1] == a[3]) {
b = b + 1;
}
if (a[0] == a[1] and a[1] == a[2] and a[2] == a[3]) {
b = 0;
}
if (b >= 1) {
printf("Yes\n");
}
if (b <= 0) {
printf("No\n");
}
system("pause");
return 0;
} | [
"literal.string.change",
"literal.string.case.change",
"call.arguments.change",
"io.output.change"
] | 795,118 | 795,119 | u518181228 | cpp |
p02987 | #include <stdio.h>
int main(void) {
int i;
char S[4];
int eq[4] = {0, 0};
scanf("%s", S);
for (i = 0; i < 4; i++) {
if (S[0] == S[i]) {
eq[0]++;
}
if (S[1] == S[i]) {
eq[1]++;
}
if (S[2] == S[i]) {
eq[2]++;
}
if (S[3] == S[i]) {
eq[3]++;
}
}
if (eq[0] == 2 && eq[1] == 2 && eq[3] == 2 && eq[4] == 2) {
printf("Yes\n");
} else {
printf("No\n");
}
return 0;
} | #include <stdio.h>
int main(void) {
int i;
char S[4];
int eq[4] = {0, 0};
scanf("%s", S);
for (i = 0; i < 4; i++) {
if (S[0] == S[i]) {
eq[0]++;
}
if (S[1] == S[i]) {
eq[1]++;
}
if (S[2] == S[i]) {
eq[2]++;
}
if (S[3] == S[i]) {
eq[3]++;
}
}
if (eq[0] == 2 && eq[1] == 2 && eq[2] == 2 && eq[3] == 2) {
printf("Yes\n");
} else {
printf("No\n");
}
return 0;
} | [
"literal.number.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change"
] | 795,120 | 795,121 | u456658814 | cpp |
p02987 | #include <iostream>
#include <string>
using namespace std;
int main(void) {
char input[4];
string judge = "No";
cin >> input[0] >> input[1] >> input[2] >> input[3];
char hantei1 = 0;
char hantei2 = 0;
int count_char1 = 0;
int count_char2 = 0;
for (int i = 0; i < 4; i++) {
if (hantei1 == 0 || hantei1 == input[i]) {
hantei1 = input[i];
count_char1 += 1;
} else if (hantei2 == 0 || hantei2 == input[i]) {
hantei2 = input[i];
count_char2 += 1;
} else {
cout << "No";
return 0;
}
}
if (count_char1 == 2 && count_char2 == 2) {
cout << "No";
return 0;
}
cout << "Yes";
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main(void) {
char input[4];
string judge = "No";
cin >> input[0] >> input[1] >> input[2] >> input[3];
char hantei1 = 0;
char hantei2 = 0;
int count_char1 = 0;
int count_char2 = 0;
for (int i = 0; i < 4; i++) {
if (hantei1 == 0 || hantei1 == input[i]) {
hantei1 = input[i];
count_char1 += 1;
} else if (hantei2 == 0 || hantei2 == input[i]) {
hantei2 = input[i];
count_char2 += 1;
} else {
cout << "No";
return 0;
}
}
if (count_char1 == 2 && count_char2 == 2) {
cout << "Yes";
return 0;
}
cout << "No";
return 0;
} | [
"literal.string.change",
"io.output.change"
] | 795,124 | 795,125 | u616901930 | cpp |
p02987 | #include <assert.h>
#include <ctype.h>
#include <limits.h>
#include <math.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#define nl std::cout << "\n"
#define in(x) std::cin >> (x)
#define out(x) std::cout << (x) << " "
#define err(x) std::cerr << #x << " = " << (x) << " | "
#define inn(x) \
int x; \
in(x)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, l, r) for (int i = (l); i < (r); ++i)
#define rrep(i, n) for (int i = (n)-1; i > -1; --i)
#define no puts("NO")
#define yes puts("YES")
using ll = long long int;
using vi = std::vector<int>;
using ii = std::pair<int, int>;
using iii = std::pair<ii, int>;
using vii = std::vector<ii>;
const int N = 1010101;
const int MD = 1e9 + 7;
void solve() {
std::string s;
in(s);
rep(i, 26) {
int c = std::count(s.begin(), s.end(), 'A' + i);
if (c != 0 && c != 2) {
no;
return;
}
}
yes;
return;
}
int main() {
std::ios_base::sync_with_stdio(0);
std::cin.tie(0);
std::cout.tie(0);
// int t; in(t); repr(tc, 1, t + 1)
solve();
return 0;
}
| #include <assert.h>
#include <ctype.h>
#include <limits.h>
#include <math.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#define nl std::cout << "\n"
#define in(x) std::cin >> (x)
#define out(x) std::cout << (x) << " "
#define err(x) std::cerr << #x << " = " << (x) << " | "
#define inn(x) \
int x; \
in(x)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, l, r) for (int i = (l); i < (r); ++i)
#define rrep(i, n) for (int i = (n)-1; i > -1; --i)
#define no puts("No")
#define yes puts("Yes")
using ll = long long int;
using vi = std::vector<int>;
using ii = std::pair<int, int>;
using iii = std::pair<ii, int>;
using vii = std::vector<ii>;
const int N = 1010101;
const int MD = 1e9 + 7;
void solve() {
std::string s;
in(s);
rep(i, 26) {
int c = std::count(s.begin(), s.end(), 'A' + i);
if (c != 0 && c != 2) {
no;
return;
}
}
yes;
return;
}
int main() {
std::ios_base::sync_with_stdio(0);
std::cin.tie(0);
std::cout.tie(0);
// int t; in(t); repr(tc, 1, t + 1)
solve();
return 0;
}
| [
"preprocessor.define.value.change"
] | 795,148 | 795,149 | u811925505 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string n;
int a[1000] = {};
cin >> n;
bool flag = true;
for (int i = 0; i < 4; i++)
a[(int)n[i]]++;
for (int i = 0; i < 1000; i++) {
if (a[i] != 0 || a[i] != 2) {
flag = false;
break;
}
}
if (flag)
cout << "Yes" << endl;
else
cout << "No" << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string n;
int a[1000] = {};
cin >> n;
bool flag = true;
for (int i = 0; i < 4; i++) {
a[(int)n[i]]++;
// cout<<a[(int)n[i]]<<endl;
}
for (int i = 0; i < 1000; i++) {
if (a[i] != 0 && a[i] != 2) {
// cout<<a[i]<<endl;
flag = false;
break;
}
}
if (flag)
cout << "Yes" << endl;
else
cout << "No" << endl;
} | [
"misc.opposites",
"control_flow.branch.if.condition.change"
] | 795,150 | 795,151 | u167647458 | cpp |
p02987 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define ll long long
using namespace std;
int main() {
string S;
cin >> S;
bool can = false;
if (S.at(0) == S.at(1)) {
if (S.at(2) == S.at(3))
can = true;
if (S.at(0) == S.at(2))
can = false;
}
if (S.at(0) == S.at(2)) {
if (S.at(1) == S.at(3))
can = true;
if (S.at(0) == S.at(1))
can = false;
}
if (S.at(0) == S.at(3)) {
if (S.at(1) == S.at(2))
can = true;
if (S.at(0) == S.at(3))
can = false;
}
if (can)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
| #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define ll long long
using namespace std;
int main() {
string S;
cin >> S;
bool can = false;
if (S.at(0) == S.at(1)) {
if (S.at(2) == S.at(3))
can = true;
if (S.at(0) == S.at(2))
can = false;
} else if (S.at(0) == S.at(2)) {
if (S.at(1) == S.at(3))
can = true;
if (S.at(0) == S.at(1))
can = false;
} else if (S.at(0) == S.at(3)) {
if (S.at(1) == S.at(2))
can = true;
if (S.at(0) == S.at(1))
can = false;
}
if (can)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
| [
"control_flow.branch.else_if.replace.add",
"control_flow.branch.if.replace.remove",
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 795,166 | 795,167 | u526894223 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n = 4;
vector<char> s(n);
for (int i = 0; i < n; i++) {
cin >> s.at(i);
}
bool ans = false;
if (s.at(0) == s.at(1) && s.at(2) == s.at(3) && s.at(0) != s.at(2))
ans = true;
else if (s.at(0) == s.at(2) && s.at(1) == s.at(3) && s.at(0) != s.at(1))
ans = true;
else if (s.at(0) == s.at(3) && s.at(1) == s.at(2) && s.at(0) != s.at(3))
ans = true;
if (ans)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n = 4;
vector<char> s(n);
for (int i = 0; i < n; i++) {
cin >> s.at(i);
}
bool ans = false;
if (s.at(0) == s.at(1) && s.at(2) == s.at(3) && s.at(0) != s.at(2))
ans = true;
else if (s.at(0) == s.at(2) && s.at(1) == s.at(3) && s.at(0) != s.at(1))
ans = true;
else if (s.at(0) == s.at(3) && s.at(1) == s.at(2) && s.at(0) != s.at(1))
ans = true;
if (ans)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
| [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 795,174 | 795,175 | u031598803 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(0) == S.at(1) && S.at(2) == S.at(3) && S.at(0) == S.at(2)) {
cout << "Yes" << endl;
} else if (S.at(0) == S.at(2) && S.at(1) == S.at(3) && S.at(0) == S.at(1)) {
cout << "Yes" << endl;
} else if (S.at(0) == S.at(3) && S.at(1) == S.at(2) && S.at(0) == S.at(1)) {
cout << "Yes" << endl;
} else
cout << "No" << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(0) == S.at(1) && S.at(2) == S.at(3) && S.at(0) != S.at(2)) {
cout << "Yes" << endl;
} else if (S.at(0) == S.at(2) && S.at(1) == S.at(3) && S.at(0) != S.at(1)) {
cout << "Yes" << endl;
} else if (S.at(0) == S.at(3) && S.at(1) == S.at(2) && S.at(0) != S.at(1)) {
cout << "Yes" << endl;
} else
cout << "No" << endl;
}
| [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 795,192 | 795,193 | u388134182 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
sort(s.begin(), s.end());
if (s[0] == s[1] && s[2] == s[3] && s[1] != s[2]) {
puts("YES");
} else {
puts("NO");
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
sort(s.begin(), s.end());
if (s[0] == s[1] && s[2] == s[3] && s[1] != s[2]) {
puts("Yes");
} else {
puts("No");
}
}
| [
"literal.string.change",
"literal.string.case.change",
"call.arguments.change",
"io.output.change"
] | 795,199 | 795,200 | u434765267 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
string s;
cin >> s;
char a, b;
int aa = 0, bb = 0;
string ans = "n";
for (int i = 0; i < 4; i++) {
if (i == 0) {
a = s[i];
aa++;
continue;
}
if (s[i] != a) {
if (bb == 0) {
b = s[i];
bb++;
}
if (b == s[i]) {
bb++;
} else
ans = "No";
} else {
aa++;
}
}
if (ans != "No") {
if (aa == 2 && bb == 2) {
ans = "Yes";
} else {
ans = "No";
}
}
cout << ans << endl;
}
| #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
string s;
cin >> s;
char a, b;
int aa = 0, bb = 0;
string ans = "n";
for (int i = 0; i < 4; i++) {
if (i == 0) {
a = s[i];
aa++;
continue;
}
if (s[i] != a) {
if (bb == 0) {
b = s[i];
bb++;
} else if (b == s[i]) {
bb++;
} else
ans = "No";
} else {
aa++;
}
}
if (ans != "No") {
if (aa == 2 && bb == 2) {
ans = "Yes";
} else {
ans = "No";
}
}
cout << ans << endl;
}
| [
"control_flow.branch.else_if.replace.add",
"control_flow.branch.if.replace.remove"
] | 795,203 | 795,204 | u794565416 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
string s;
cin >> s;
if (s[0] == s[1] && s[2] == s[3] && s[0] != s[2]) {
cout << "Yes" << endl;
return 0;
} else if (s[0] == s[3] && s[1] == s[2] && s[0] != s[1]) {
cout << "Yes" << endl;
return 0;
} else if (s[0] == s[2] && s[1] == s[3] && s[0] != s[1]) {
cout << "Yes" << endl;
return 0;
} else
cout << "NO" << endl;
// cout << s[0] << s[1] << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
string s;
cin >> s;
if (s[0] == s[1] && s[2] == s[3] && s[0] != s[2]) {
cout << "Yes" << endl;
return 0;
} else if (s[0] == s[3] && s[1] == s[2] && s[0] != s[1]) {
cout << "Yes" << endl;
return 0;
} else if (s[0] == s[2] && s[1] == s[3] && s[0] != s[1]) {
cout << "Yes" << endl;
return 0;
} else
cout << "No" << endl;
// cout << s[0] << s[1] << endl;
return 0;
}
| [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 795,233 | 795,234 | u639032323 | cpp |
p02987 | #include <bits/stdc++.h>
using namespace std;
void init() {}
void solve() {
char c[4];
scanf("%s", c);
int tab[300];
for (int i = 0; i < 300; i++)
tab[i] = 0;
for (int i = 0; i < 4; i++)
tab[c[i]]++;
int p = 0;
for (int i = 65; i <= 95; i++)
if (tab[i] == 2)
p++;
if (p != 2)
printf("NO\n");
else
printf("YES");
}
const bool mtc = false;
int main() {
int t;
if (mtc) {
scanf("%d", &t);
while (t--)
solve();
} else
solve();
}
| #include <bits/stdc++.h>
using namespace std;
void init() {}
void solve() {
char c[4];
scanf("%s", c);
int tab[300];
for (int i = 0; i < 300; i++)
tab[i] = 0;
for (int i = 0; i < 4; i++)
tab[c[i]]++;
int p = 0;
for (int i = 65; i <= 90; i++)
if (tab[i] == 2)
p++;
if (p != 2)
printf("No\n");
else
printf("Yes");
}
const bool mtc = false;
int main() {
int t;
if (mtc) {
scanf("%d", &t);
while (t--)
solve();
} else
solve();
}
| [
"literal.number.change",
"control_flow.loop.for.condition.change",
"expression.operation.binary.change",
"literal.string.change",
"literal.string.case.change",
"call.arguments.change",
"io.output.change"
] | 795,237 | 795,238 | u800645121 | cpp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.