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 |
|---|---|---|---|---|---|---|---|
p03017 | #include <bits/stdc++.h>
using namespace std;
bool isChangeble(int start, int goal, string s) {
int p = start;
int num = 0;
while (p < goal) {
if (s[p] == '.') {
num += 1;
p += 1;
if (num == 3) {
return true;
}
continue;
} else {
num = 0;
p += 1;
continue;
}
}
return false;
}
bool isDoubleSharpe(int start, int goal, string s) {
int p = start;
int num = 0;
while (p < goal) {
if (s[p] == '#') {
num += 1;
p += 1;
if (num == 2) {
return true;
}
continue;
} else {
num = 0;
p += 1;
}
}
return false;
}
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
a -= 1;
b -= 1;
c -= 1;
d -= 1;
string s;
cin >> s;
if (isDoubleSharpe(a, min(c, d), s)) {
cout << "No" << endl;
} else if (d < c && (s[d - 1] == '#' || s[d + 1] == '#') &&
!isChangeble(a, d, s)) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
bool isChangeble(int start, int goal, string s) {
int p = start;
int num = 0;
while (p < goal) {
if (s[p] == '.') {
num += 1;
p += 1;
if (num == 3) {
return true;
}
continue;
} else {
num = 0;
p += 1;
continue;
}
}
return false;
}
bool isDoubleSharpe(int start, int goal, string s) {
int p = start;
int num = 0;
while (p < goal) {
if (s[p] == '#') {
num += 1;
p += 1;
if (num == 2) {
return true;
}
continue;
} else {
num = 0;
p += 1;
}
}
return false;
}
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
a -= 1;
b -= 1;
c -= 1;
d -= 1;
string s;
cin >> s;
if (isDoubleSharpe(a, max(c, d), s)) {
cout << "No" << endl;
} else if (d < c && (s[d - 1] == '#' || s[d + 1] == '#') &&
!isChangeble(b - 1, d + 1, s)) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
} | [
"misc.opposites",
"identifier.change",
"call.function.change",
"control_flow.branch.if.condition.change"
] | 832,332 | 832,330 | u679245300 | cpp |
p03017 | #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, a, b) for (int i = (a); i < (b); ++i)
#define FORR(i, a, b) for (int i = b - 1; i >= a; --i)
#define p(s) cout << (s) << endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define ALL(v) (v).begin(), (v).end()
#define m0(x) memset(x, 0, sizeof(x))
typedef long long ll;
using namespace std;
static const ll mod = 1e9 + 7;
static const ll inf = 1e18;
static const int White = 0;
static const int Gray = 1;
static const int Black = 2;
void pvector(vector<ll> A) {
cout << "[vector]";
for (int i = 0; i < A.size(); i++) {
cout << A[i] << " ";
}
cout << endl;
}
int main() {
ll N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
A--;
B--;
C--;
D--;
string S;
cin >> S;
vector<ll> v;
ll cnt = 0;
ll apoint, bpoint, cpoint, dpoint;
ll sum = 0;
bool flag = 1, can = 0;
if (C < D) {
FOR(i, A, C) {
if (S[i] == '#' && S[i + 1] == '#')
flag = 0;
}
FOR(i, B, D) {
if (S[i] == '#' && S[i + 1] == '#')
flag = 0;
}
if (flag)
p("Yes");
else
p("No");
} else {
FOR(i, A, C) {
if (S[i] == '#' && S[i + 1] == '#')
flag = 0;
}
FOR(i, B, D) {
if (S[i] == '#' && S[i + 1] == '#')
flag = 0;
}
FOR(i, B, D - 1) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.')
can = 1;
}
if (!can)
flag = 0;
if (flag)
p("Yes");
else
p("No");
}
// pvector(v);
} | #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, a, b) for (int i = (a); i < (b); ++i)
#define FORR(i, a, b) for (int i = b - 1; i >= a; --i)
#define p(s) cout << (s) << endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define ALL(v) (v).begin(), (v).end()
#define m0(x) memset(x, 0, sizeof(x))
typedef long long ll;
using namespace std;
static const ll mod = 1e9 + 7;
static const ll inf = 1e18;
static const int White = 0;
static const int Gray = 1;
static const int Black = 2;
void pvector(vector<ll> A) {
cout << "[vector]";
for (int i = 0; i < A.size(); i++) {
cout << A[i] << " ";
}
cout << endl;
}
int main() {
ll N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
A--;
B--;
C--;
D--;
string S;
cin >> S;
vector<ll> v;
ll cnt = 0;
ll apoint, bpoint, cpoint, dpoint;
ll sum = 0;
bool flag = 1, can = 0;
if (C < D) {
FOR(i, A, C) {
if (S[i] == '#' && S[i + 1] == '#')
flag = 0;
}
FOR(i, B, D) {
if (S[i] == '#' && S[i + 1] == '#')
flag = 0;
}
if (flag)
p("Yes");
else
p("No");
} else {
FOR(i, A, C) {
if (S[i] == '#' && S[i + 1] == '#')
flag = 0;
}
FOR(i, B, D) {
if (S[i] == '#' && S[i + 1] == '#')
flag = 0;
}
FOR(i, B - 1, D) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.')
can = 1;
}
if (!can)
flag = 0;
if (flag)
p("Yes");
else
p("No");
}
// pvector(v);
} | [
"call.arguments.change",
"call.arguments.add"
] | 832,333 | 832,334 | u839397805 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(int argc, char *argv[]) {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
a--, b--, c--, d--;
int ok = 1;
for (int i = a; i < c; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
ok = 0;
}
}
for (int i = b; i < d; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
ok = 0;
}
}
if (d < c) {
int b_jump = 0;
for (int i = a; i < d; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
b_jump = 1;
}
}
ok = ok && b_jump;
}
if (ok) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(int argc, char *argv[]) {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
a--, b--, c--, d--;
int ok = 1;
for (int i = a; i < c; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
ok = 0;
}
}
for (int i = b; i < d; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
ok = 0;
}
}
if (d < c) {
int b_jump = 0;
for (int i = b - 1; i < d; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
b_jump = 1;
}
}
ok = ok && b_jump;
}
if (ok) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| [
"control_flow.loop.for.initializer.change"
] | 832,335 | 832,336 | u440032761 | cpp |
p03017 | #include <iostream>
#include <string>
using namespace std;
int main() {
long long N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
string ans = "Yes";
if (C > D) {
for (long long i = B - 2; i < D - 2; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
ans = "Yes";
break;
} else {
ans = "No";
}
}
for (long long i = A; i < C - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
ans = "No";
break;
}
}
} else {
for (long long i = A; i < D - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
ans = "No";
break;
}
}
}
cout << ans << endl;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
long long N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
string ans = "Yes";
if (C > D) {
for (long long i = B - 2; i < D - 1; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
ans = "Yes";
break;
} else {
ans = "No";
}
}
for (long long i = A; i < C - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
ans = "No";
break;
}
}
} else {
for (long long i = A; i < D - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
ans = "No";
break;
}
}
}
cout << ans << endl;
} | [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 832,345 | 832,346 | u940000534 | cpp |
p03017 | #include <iostream>
#include <string>
using namespace std;
int main() {
long long N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
string ans = "Yes";
if (C > D) {
for (long long i = B - 1; i < D - 2; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
ans = "Yes";
break;
} else {
ans = "No";
}
}
for (long long i = A - 1; i < C - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
ans = "No";
break;
}
}
} else {
for (long long i = A - 1; i < D - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
ans = "No";
break;
}
}
}
cout << ans << endl;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
long long N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
string ans = "Yes";
if (C > D) {
for (long long i = B - 2; i < D - 1; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
ans = "Yes";
break;
} else {
ans = "No";
}
}
for (long long i = A; i < C - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
ans = "No";
break;
}
}
} else {
for (long long i = A; i < D - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
ans = "No";
break;
}
}
}
cout << ans << endl;
} | [
"literal.number.change",
"control_flow.loop.for.initializer.change",
"expression.off_by_one",
"expression.operation.binary.change",
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 832,347 | 832,346 | u940000534 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
A--;
B--;
C--;
D--;
string S;
cin >> S;
bool yesA = true;
bool yesB = true;
int cnt = 0; // check # count
for (int i = A; i <= C; i++) {
if (S[i] == '#')
cnt++;
else
cnt = 0;
if (cnt == 2) {
yesA = false;
break;
}
}
cnt = 0;
for (int i = B; i <= D; i++) {
if (S[i] == '#')
cnt++;
else
cnt = 0;
if (cnt == 2) {
yesB = false;
break;
}
}
if (yesA == false || yesB == false) {
cout << "No" << endl;
return 0;
}
if (C < D) {
cout << "Yes" << endl;
return 0;
}
cnt = 0;
for (int i = B - 1; i <= D; i++) {
if (S[i] == '.')
cnt++;
else
cnt = 0;
if (cnt == 3) {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
A--;
B--;
C--;
D--;
string S;
cin >> S;
bool yesA = true;
bool yesB = true;
int cnt = 0; // check # count
for (int i = A; i <= C; i++) {
if (S[i] == '#')
cnt++;
else
cnt = 0;
if (cnt == 2) {
yesA = false;
break;
}
}
cnt = 0;
for (int i = B; i <= D; i++) {
if (S[i] == '#')
cnt++;
else
cnt = 0;
if (cnt == 2) {
yesB = false;
break;
}
}
if (yesA == false || yesB == false) {
cout << "No" << endl;
return 0;
}
if (C < D) {
cout << "Yes" << endl;
return 0;
}
cnt = 0;
for (int i = B - 1; i <= D + 1; i++) {
if (S[i] == '.')
cnt++;
else
cnt = 0;
if (cnt == 3) {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0;
}
| [
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 832,348 | 832,349 | u761335395 | cpp |
p03017 | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
const double PI = acos(-1.0);
const double eps = 1e-6;
const int mod = 1e9 + 7;
const int maxn = 200005;
int T, n, m;
int main() {
// scanf("%d",&T);
// while(T--) {
//
// }
ll nn, a, b, c, d;
cin >> nn >> a >> b >> c >> d;
string s;
cin >> s;
// int flag = 0;
if (c > d) {
int flag = 0;
for (int i = b - 1; i < d - 2; i++)
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
flag = 1;
break;
}
if (!flag) {
cout << "No\n";
return 0;
}
}
for (int i = min(a, b); i < max(c, d); i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No\n";
return 0;
}
}
cout << "Yes\n";
return 0;
} | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
const double PI = acos(-1.0);
const double eps = 1e-6;
const int mod = 1e9 + 7;
const int maxn = 200005;
int T, n, m;
int main() {
// scanf("%d",&T);
// while(T--) {
//
// }
ll nn, a, b, c, d;
cin >> nn >> a >> b >> c >> d;
string s;
cin >> s;
// int flag = 0;
if (c > d) {
int flag = 0;
for (int i = b - 2; i < d - 1; i++)
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
flag = 1;
// cout<<1111<<endl;
break;
}
if (!flag) {
cout << "No\n";
return 0;
}
}
for (int i = min(a, b); i < max(c, d); i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No\n";
return 0;
}
}
cout << "Yes\n";
return 0;
} | [
"literal.number.change",
"control_flow.loop.for.initializer.change",
"expression.off_by_one",
"expression.operation.binary.change",
"control_flow.branch.if.condition.change"
] | 832,350 | 832,351 | u269278772 | cpp |
p03017 | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
const double PI = acos(-1.0);
const double eps = 1e-6;
const int mod = 1e9 + 7;
const int maxn = 200005;
int T, n, m;
int main() {
// scanf("%d",&T);
// while(T--) {
//
// }
ll nn, a, b, c, d;
cin >> nn >> a >> b >> c >> d;
string s;
cin >> s;
// int flag = 0;
if (c > d) {
int flag = 0;
for (int i = b - 1; i < d - 1; i++)
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
flag = 1;
break;
}
if (!flag) {
cout << "No\n";
return 0;
}
}
for (int i = min(a, b); i < max(c, d); i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No\n";
return 0;
}
}
cout << "Yes\n";
return 0;
} | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
const double PI = acos(-1.0);
const double eps = 1e-6;
const int mod = 1e9 + 7;
const int maxn = 200005;
int T, n, m;
int main() {
// scanf("%d",&T);
// while(T--) {
//
// }
ll nn, a, b, c, d;
cin >> nn >> a >> b >> c >> d;
string s;
cin >> s;
// int flag = 0;
if (c > d) {
int flag = 0;
for (int i = b - 2; i < d - 1; i++)
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
flag = 1;
// cout<<1111<<endl;
break;
}
if (!flag) {
cout << "No\n";
return 0;
}
}
for (int i = min(a, b); i < max(c, d); i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No\n";
return 0;
}
}
cout << "Yes\n";
return 0;
} | [
"literal.number.change",
"control_flow.loop.for.initializer.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 832,352 | 832,351 | u269278772 | cpp |
p03017 | #include <bits/stdc++.h>
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define fu(i, r, t) for (int i = r; i <= t; i++)
#define fd(i, r, t) for (int i = r; i >= t; i--)
#define Set set<int>
#define int long long
#define P pair<int, int>
const int maxn = 1e6 + 5;
const int INF = 1e17 + 6;
using namespace std;
// int n,m,a[maxn],b[maxn],ans;
int n;
void over() {
cout << "No";
exit(0);
}
int a, b, c, d, len;
string k;
bool if_have(int num, int kinds, int st, int zhong) {
// kinds:0-#,1-. ,包括st
int times = 0;
if (kinds) {
fu(i, st, zhong) {
if (k[i] == '.') {
times++;
if (times == num)
return 1;
} else {
times = 0;
}
}
} else {
fu(i, st, zhong) {
if (k[i] == '#') {
times++;
if (times == num)
return 1;
} else {
times = 0;
}
}
}
return 0;
}
int32_t main() {
IOS;
cin >> n >> a >> b >> c >> d;
cin >> k;
len = k.length();
int time1 = 0;
if (c < d) // b
{
if (if_have(2, 0, b - 1, d - 1))
over();
if (if_have(2, 0, a - 1, c - 1))
over();
cout << "Yes";
} else {
//看看能不能先走a
//看看b能不能挪
if (if_have(3, 1, b - 1, d - 1)) { //可以挪
if (if_have(2, 0, a - 1, c - 1))
over();
if (if_have(2, 0, b - 1, d - 1))
over();
cout << "Yes";
} else {
if (if_have(2, 0, b - 1, d - 1))
over();
k[d - 1] = '#';
if (if_have(2, 0, a - 1, c - 1))
over();
cout << "Yes";
}
}
return 0;
}
| #include <bits/stdc++.h>
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define fu(i, r, t) for (int i = r; i <= t; i++)
#define fd(i, r, t) for (int i = r; i >= t; i--)
#define Set set<int>
#define int long long
#define P pair<int, int>
const int maxn = 1e6 + 5;
const int INF = 1e17 + 6;
using namespace std;
// int n,m,a[maxn],b[maxn],ans;
int n;
void over() {
cout << "No";
exit(0);
}
int a, b, c, d, len;
string k;
bool if_have(int num, int kinds, int st, int zhong) {
// kinds:0-#,1-. ,包括st
int times = 0;
if (kinds) {
fu(i, st, zhong) {
if (k[i] == '.') {
times++;
if (times == num)
return 1;
} else {
times = 0;
}
}
} else {
fu(i, st, zhong) {
if (k[i] == '#') {
times++;
if (times == num)
return 1;
} else {
times = 0;
}
}
}
return 0;
}
int32_t main() {
IOS;
cin >> n >> a >> b >> c >> d;
cin >> k;
len = k.length();
int time1 = 0;
if (c < d) // b
{
if (if_have(2, 0, b - 1, d - 1))
over();
if (if_have(2, 0, a - 1, c - 1))
over();
cout << "Yes";
} else {
//看看能不能先走a
//看看b能不能挪
if (if_have(3, 1, b - 2, d - 1)) { //可以挪
if (if_have(2, 0, a - 1, c - 1))
over();
if (if_have(2, 0, b - 1, d - 1))
over();
cout << "Yes";
} else {
if (if_have(2, 0, b - 1, d - 1))
over();
k[d - 1] = '#';
if (if_have(2, 0, a - 1, c - 1))
over();
cout << "Yes";
}
}
return 0;
}
| [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 832,353 | 832,354 | u020160935 | cpp |
p03017 | #include <algorithm>
#include <cassert>
#include <cmath>
#include <iostream>
#include <math.h>
#include <string>
#include <utility>
#include <vector>
#define INF 1000000000;
using namespace std;
char mas[200500];
int main() {
int N = 0, A = 0, B = 0, C = 0, D = 0;
cin >> N >> A >> B >> C >> D;
for (int i = 0; i < N; i++) {
cin >> mas[i];
if (i + 1 >= A || i + 1 >= B) {
if (i + 1 < max(C, D)) {
if (mas[i] == '#') {
if (mas[i - 1] == '#') {
cout << "No" << endl;
return 0;
}
}
}
}
}
if (A > B && C < D) {
if (abs(A - B) == 1) {
if (mas[max(A, B)] == '.') {
cout << "Yes" << endl;
return 0;
}
}
for (int i = max(A, B); i < min(C, D); i++) {
if (mas[i - 1] == '.' && mas[i] == '.' && mas[i + 1] == '.') {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0;
}
if (A < B && C > D) {
if (abs(A - B) == 1) {
if (mas[max(A, B)] == '.') {
cout << "Yes" << endl;
return 0;
}
}
for (int i = max(A, B); i < min(C, D); i++) {
if (mas[i - 1] == '.' && mas[i] == '.' && mas[i + 1] == '.') {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0;
}
cout << "Yes" << endl;
return 0;
} | #include <algorithm>
#include <cassert>
#include <cmath>
#include <iostream>
#include <math.h>
#include <string>
#include <utility>
#include <vector>
#define INF 1000000000;
using namespace std;
char mas[200500];
int main() {
int N = 0, A = 0, B = 0, C = 0, D = 0;
cin >> N >> A >> B >> C >> D;
for (int i = 0; i < N; i++) {
cin >> mas[i];
if (i + 1 >= A || i + 1 >= B) {
if (i + 1 < max(C, D)) {
if (mas[i] == '#') {
if (mas[i - 1] == '#') {
cout << "No" << endl;
return 0;
}
}
}
}
}
if (A > B && C < D) {
if (abs(A - B) == 1) {
if (mas[max(A, B)] == '.') {
cout << "Yes" << endl;
return 0;
}
}
for (int i = max(A, B) - 1; i < min(C, D); i++) {
if (mas[i - 1] == '.' && mas[i] == '.' && mas[i + 1] == '.') {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0;
}
if (A < B && C > D) {
if (abs(A - B) == 1) {
if (mas[max(A, B)] == '.') {
cout << "Yes" << endl;
return 0;
}
}
for (int i = max(A, B) - 1; i < min(C, D); i++) {
if (mas[i - 1] == '.' && mas[i] == '.' && mas[i + 1] == '.') {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0;
}
cout << "Yes" << endl;
return 0;
} | [
"control_flow.loop.for.initializer.change"
] | 832,365 | 832,366 | u019465635 | cpp |
p03017 | #ifdef _WIN32
#define DEBUG 1
#endif
#define _CRT_SECURE_NO_WARNINGS
#define MATH_PI 3.14159265358979323846264338327950288419716939
#include <fstream>
#include <iostream>
#include <math.h>
#include <string.h>
using namespace std;
#ifdef DEBUG
#include "include.h"
#else
inline void wait() {}
inline void dout(const char *arg, ...) {}
#endif
// template<typename T>inline void swap(T a, T b){T t = a; a = b; b = t;}
#define CLIP(ptr, min, max) \
{ \
if ((min) <= (max)) { \
if (ptr < (min)) { \
ptr = (min); \
} \
if (ptr > (max)) { \
ptr = (max); \
} \
} \
}
#define max(a, b) a > b ? a : b;
#define min(a, b) a > b ? b : a;
#define Sin(deg) sin((deg)*MATH_PI / 180)
#define Cos(deg) cos((deg)*MATH_PI / 180)
#define Tan(deg) tan((deg)*MATH_PI / 180)
#define Rad(deg) ((deg)*MATH_PI / 180)
#define ff(param, num) for (int param = 0; param < num; ++param)
#define fi(num) for (int i = 0; i < num; ++i)
#define fj(num) for (int j = 0; j < num; ++j)
#define fk(num) for (int k = 0; k < num; ++k)
#define fl(num) for (int l = 0; l < num; ++l)
#define fn(num) for (int n = 0; n < num; ++n)
#define ffr(param, num) for (int param = num - 1; param >= 0; --param)
#define fir(num) for (int i = num - 1; i >= 0; --i)
#define fjr(num) for (int j = num - 1; j >= 0; --j)
#define fkr(num) for (int k = num - 1; k >= 0; --k)
#define flr(num) for (int l = num - 1; l >= 0; --l)
#define fnr(num) for (int n = num - 1; n >= 0; --n)
#define gi(p) Scanf("%d", p)
#define gi2(p1, p2) Scanf2("%d %d", p1, p2)
#define gi3(p1, p2, p3) Scanf3("%d %d %d", p1, p2, p3)
#define gi4(p1, p2, p3, p4) Scanf4("%d %d %d %d", p1, p2, p3, p4)
#define gll(p) Scanf("%lld", p)
#define gll2(p1, p2) Scanf2("%lld %lld", p1, p2)
#define gll3(p1, p2, p3) Scanf3("%lld %lld %lld", p1, p2, p3)
#define gll4(p1, p2, p3, p4) Scanf4("%lld %lld %lld %lld", p1, p2, p3, p4)
#define gf(p) Scanf("%f", p)
#define gf2(p1, p2) Scanf2("%f %f", p1, p2)
#define gf3(p1, p2, p3) Scanf3("%f %f %f", p1, p2, p3)
#define gf4(p1, p2, p3, p4) Scanf4("%f %f %f %f", p1, p2, p3, p4)
#ifdef DEBUG
#define gc(buf) fscanf(local_in.fp, "%s", buf)
#define Scanf(expr, p) fscanf(local_in.fp, expr, &p)
#define Scanf2(expr, p1, p2) fscanf(local_in.fp, expr, &p1, &p2)
#define Scanf3(expr, p1, p2, p3) fscanf(local_in.fp, expr, &p1, &p2, &p3)
#define Scanf4(expr, p1, p2, p3, p4) \
fscanf(local_in.fp, expr, &p1, &p2, &p3, &p4)
#else
#define gc(buf) Scanf("%s", buf)
#define Scanf(expr, p) scanf(expr, &p)
#define Scanf2(expr, p1, p2) scanf(expr, &p1, &p2)
#define Scanf3(expr, p1, p2, p3) scanf(expr, &p1, &p2, &p3)
#define Scanf4(expr, p1, p2, p3, p4) scanf(expr, &p1, &p2, &p3, &p4)
#endif
#define ans(p) cout << p << endl;
int ValList[10010];
void CombSort(int N, int *ar, int order_ascending = 1) {
int h = int(N / 1.3);
int flag;
int i;
while (true) {
flag = 0;
for (i = 0; i + h < N; ++i) {
if ((order_ascending && ar[i] > ar[i + h]) ||
(!order_ascending && ar[i] < ar[i + h])) {
swap<int>(ar[i], ar[i + h]);
flag = 1;
}
}
if (h == 1 && !flag)
break;
if (h == 9 || h == 10)
h = 11;
if (h > 1)
h = int(h / 1.3);
}
}
int EuclideanAlgorithm(int N, int *ar) {
fn(N - 1) {
while (true) {
if (ar[n] % ar[n + 1] == 0 || ar[n + 1] % ar[n] == 0) {
ar[n + 1] = min(ar[n], ar[n + 1]);
break;
}
if (ar[n] > ar[n + 1]) {
ar[n] %= ar[n + 1];
} else {
ar[n + 1] %= ar[n];
}
}
}
return ar[N - 1];
}
template <typename T> void CombSort(int N, T *ar, int order_ascending = 1) {
int i, flag;
int h = N / 1.3;
while (true) {
flag = 0;
for (i = 0; i + h < N; ++i) {
if (order_ascending && ar[i].SortValue > ar[i + h].SortValue ||
!order_ascending && ar[i].SortValue < ar[i + h].SortValue) {
swap<T>(ar[i], ar[i + h]);
flag = 1;
}
}
if (h > 1) {
h /= 1.3;
if (h == 9 || h == 10)
h = 11;
} else {
if (!flag)
break;
}
}
}
signed main() {
int i, j, k, l;
char cbuf[200010];
int N, st[2], ed[2];
gi(N);
gi4(st[0], st[1], ed[0], ed[1]);
st[0]--;
st[1]--;
ed[0]--;
ed[1]--;
gc(cbuf);
int flag = 1;
int lt, rt;
lt = min(st[0], st[1]);
rt = max(ed[0], ed[1]);
int cnt = 0;
for (int i = lt; i < rt; ++i) {
if (cbuf[i] == '#') {
++cnt;
if (cnt >= 2) {
flag = 0;
break;
}
} else {
cnt = 0;
}
}
if (ed[0] > ed[1]) {
flag = 0;
for (int i = st[1]; i <= ed[1]; ++i) {
if (i == st[1]) {
if (cbuf[i - 1] == '.')
cnt = 1;
}
if (cbuf[i] == '.') {
++cnt;
if (cnt >= 3) {
flag = 1;
break;
}
} else {
cnt = 0;
}
}
}
if (flag) {
ans("Yes");
} else {
ans("No");
}
wait();
return 0;
} | #ifdef _WIN32
#define DEBUG 1
#endif
#define _CRT_SECURE_NO_WARNINGS
#define MATH_PI 3.14159265358979323846264338327950288419716939
#include <fstream>
#include <iostream>
#include <math.h>
#include <string.h>
using namespace std;
#ifdef DEBUG
#include "include.h"
#else
inline void wait() {}
inline void dout(const char *arg, ...) {}
#endif
// template<typename T>inline void swap(T a, T b){T t = a; a = b; b = t;}
#define CLIP(ptr, min, max) \
{ \
if ((min) <= (max)) { \
if (ptr < (min)) { \
ptr = (min); \
} \
if (ptr > (max)) { \
ptr = (max); \
} \
} \
}
#define max(a, b) a > b ? a : b;
#define min(a, b) a > b ? b : a;
#define Sin(deg) sin((deg)*MATH_PI / 180)
#define Cos(deg) cos((deg)*MATH_PI / 180)
#define Tan(deg) tan((deg)*MATH_PI / 180)
#define Rad(deg) ((deg)*MATH_PI / 180)
#define ff(param, num) for (int param = 0; param < num; ++param)
#define fi(num) for (int i = 0; i < num; ++i)
#define fj(num) for (int j = 0; j < num; ++j)
#define fk(num) for (int k = 0; k < num; ++k)
#define fl(num) for (int l = 0; l < num; ++l)
#define fn(num) for (int n = 0; n < num; ++n)
#define ffr(param, num) for (int param = num - 1; param >= 0; --param)
#define fir(num) for (int i = num - 1; i >= 0; --i)
#define fjr(num) for (int j = num - 1; j >= 0; --j)
#define fkr(num) for (int k = num - 1; k >= 0; --k)
#define flr(num) for (int l = num - 1; l >= 0; --l)
#define fnr(num) for (int n = num - 1; n >= 0; --n)
#define gi(p) Scanf("%d", p)
#define gi2(p1, p2) Scanf2("%d %d", p1, p2)
#define gi3(p1, p2, p3) Scanf3("%d %d %d", p1, p2, p3)
#define gi4(p1, p2, p3, p4) Scanf4("%d %d %d %d", p1, p2, p3, p4)
#define gll(p) Scanf("%lld", p)
#define gll2(p1, p2) Scanf2("%lld %lld", p1, p2)
#define gll3(p1, p2, p3) Scanf3("%lld %lld %lld", p1, p2, p3)
#define gll4(p1, p2, p3, p4) Scanf4("%lld %lld %lld %lld", p1, p2, p3, p4)
#define gf(p) Scanf("%f", p)
#define gf2(p1, p2) Scanf2("%f %f", p1, p2)
#define gf3(p1, p2, p3) Scanf3("%f %f %f", p1, p2, p3)
#define gf4(p1, p2, p3, p4) Scanf4("%f %f %f %f", p1, p2, p3, p4)
#ifdef DEBUG
#define gc(buf) fscanf(local_in.fp, "%s", buf)
#define Scanf(expr, p) fscanf(local_in.fp, expr, &p)
#define Scanf2(expr, p1, p2) fscanf(local_in.fp, expr, &p1, &p2)
#define Scanf3(expr, p1, p2, p3) fscanf(local_in.fp, expr, &p1, &p2, &p3)
#define Scanf4(expr, p1, p2, p3, p4) \
fscanf(local_in.fp, expr, &p1, &p2, &p3, &p4)
#else
#define gc(buf) Scanf("%s", buf)
#define Scanf(expr, p) scanf(expr, &p)
#define Scanf2(expr, p1, p2) scanf(expr, &p1, &p2)
#define Scanf3(expr, p1, p2, p3) scanf(expr, &p1, &p2, &p3)
#define Scanf4(expr, p1, p2, p3, p4) scanf(expr, &p1, &p2, &p3, &p4)
#endif
#define ans(p) cout << p << endl;
int ValList[10010];
void CombSort(int N, int *ar, int order_ascending = 1) {
int h = int(N / 1.3);
int flag;
int i;
while (true) {
flag = 0;
for (i = 0; i + h < N; ++i) {
if ((order_ascending && ar[i] > ar[i + h]) ||
(!order_ascending && ar[i] < ar[i + h])) {
swap<int>(ar[i], ar[i + h]);
flag = 1;
}
}
if (h == 1 && !flag)
break;
if (h == 9 || h == 10)
h = 11;
if (h > 1)
h = int(h / 1.3);
}
}
int EuclideanAlgorithm(int N, int *ar) {
fn(N - 1) {
while (true) {
if (ar[n] % ar[n + 1] == 0 || ar[n + 1] % ar[n] == 0) {
ar[n + 1] = min(ar[n], ar[n + 1]);
break;
}
if (ar[n] > ar[n + 1]) {
ar[n] %= ar[n + 1];
} else {
ar[n + 1] %= ar[n];
}
}
}
return ar[N - 1];
}
template <typename T> void CombSort(int N, T *ar, int order_ascending = 1) {
int i, flag;
int h = N / 1.3;
while (true) {
flag = 0;
for (i = 0; i + h < N; ++i) {
if (order_ascending && ar[i].SortValue > ar[i + h].SortValue ||
!order_ascending && ar[i].SortValue < ar[i + h].SortValue) {
swap<T>(ar[i], ar[i + h]);
flag = 1;
}
}
if (h > 1) {
h /= 1.3;
if (h == 9 || h == 10)
h = 11;
} else {
if (!flag)
break;
}
}
}
signed main() {
int i, j, k, l;
char cbuf[200010];
int N, st[2], ed[2];
gi(N);
gi4(st[0], st[1], ed[0], ed[1]);
st[0]--;
st[1]--;
ed[0]--;
ed[1]--;
gc(cbuf);
int flag = 1;
int lt, rt;
lt = min(st[0], st[1]);
rt = max(ed[0], ed[1]);
int cnt = 0;
for (int i = lt; i < rt; ++i) {
if (cbuf[i] == '#') {
++cnt;
if (cnt >= 2) {
flag = 0;
break;
}
} else {
cnt = 0;
}
}
if (ed[0] > ed[1] && flag) {
flag = 0;
for (int i = st[1]; i <= ed[1] + 1; ++i) {
if (i == st[1]) {
if (cbuf[i - 1] == '.')
cnt = 1;
}
if (cbuf[i] == '.') {
++cnt;
if (cnt >= 3) {
flag = 1;
break;
}
} else {
cnt = 0;
}
}
}
if (flag) {
ans("Yes");
} else {
ans("No");
}
wait();
return 0;
} | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 832,381 | 832,380 | u575781793 | cpp |
p03017 | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef vector<vector<int>> v2int;
typedef vector<ll> vll;
typedef vector<vector<ll>> v2ll;
typedef list<int> liint;
typedef pair<int, int> pint;
const int INF = int(2e9);
const ll LINF = ll(2e9) * ll(2e9);
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
template <class T, class C> void chmax(T &a, C b) { a > b ?: a = b; }
template <class T, class C> void chmin(T &a, C b) { a < b ?: a = b; }
bool is_reachable(const string &S, int start, int end) {
REP(i, start - 1, end - 1) {
if (S[i] == '#' && S[i + 1] == '#') {
return false;
}
}
return true;
}
bool is_triple(const string &S, int start, int N) {
REP(i, start - 1, N - 1) {
if (S[i - 1] == '.' && S[i] == '.' && S[i + 1] == '.') {
return true;
}
}
return false;
}
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
if (C < D) {
if (is_reachable(S, A, C) == true && is_reachable(S, B, D) == true) {
cout << "Yes" << endl;
return 0;
} else {
cout << "No" << endl;
return 0;
}
} else {
if (is_reachable(S, A, C) == true && is_reachable(S, B, D) == true &&
is_triple(S, B, D) == true) {
cout << "Yes" << endl;
return 0;
} else {
cout << "No" << endl;
return 0;
}
}
return 0;
} | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef vector<vector<int>> v2int;
typedef vector<ll> vll;
typedef vector<vector<ll>> v2ll;
typedef list<int> liint;
typedef pair<int, int> pint;
const int INF = int(2e9);
const ll LINF = ll(2e9) * ll(2e9);
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
template <class T, class C> void chmax(T &a, C b) { a > b ?: a = b; }
template <class T, class C> void chmin(T &a, C b) { a < b ?: a = b; }
bool is_reachable(const string &S, int start, int end) {
REP(i, start - 1, end - 1) {
if (S[i] == '#' && S[i + 1] == '#') {
return false;
}
}
return true;
}
bool is_triple(const string &S, int start, int N) {
REP(i, start - 1, N) {
if (S[i - 1] == '.' && S[i] == '.' && S[i + 1] == '.') {
return true;
}
}
return false;
}
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
if (C < D) {
if (is_reachable(S, A, C) == true && is_reachable(S, B, D) == true) {
cout << "Yes" << endl;
return 0;
} else {
cout << "No" << endl;
return 0;
}
} else {
if (is_reachable(S, A, C) == true && is_reachable(S, B, D) == true &&
is_triple(S, B, D) == true) {
cout << "Yes" << endl;
return 0;
} else {
cout << "No" << endl;
return 0;
}
}
return 0;
} | [
"expression.operation.binary.remove"
] | 832,382 | 832,383 | u391331433 | cpp |
p03017 | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef vector<vector<int>> v2int;
typedef vector<ll> vll;
typedef vector<vector<ll>> v2ll;
typedef list<int> liint;
typedef pair<int, int> pint;
const int INF = int(2e9);
const ll LINF = ll(2e9) * ll(2e9);
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
template <class T, class C> void chmax(T &a, C b) { a > b ?: a = b; }
template <class T, class C> void chmin(T &a, C b) { a < b ?: a = b; }
bool is_reachable(const string &S, int start, int end) {
REP(i, start - 1, end - 1) {
if (S[i] == '#' && S[i + 1] == '#') {
return false;
}
}
return true;
}
bool is_triple(const string &S, int start, int N) {
REP(i, start - 1, N - 1) {
if (S[i - 1] == '.' && S[i] == '.' && S[i + 1] == '.') {
return true;
}
}
return false;
}
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
if (C < D) {
if (is_reachable(S, A, C) == true && is_reachable(S, B, D) == true) {
cout << "Yes" << endl;
return 0;
} else {
cout << "No" << endl;
return 0;
}
} else {
if (is_reachable(S, A, C) == true && is_reachable(S, B, D) == true &&
is_triple(S, B, C) == true) {
cout << "Yes" << endl;
return 0;
} else {
cout << "No" << endl;
return 0;
}
}
return 0;
} | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef vector<vector<int>> v2int;
typedef vector<ll> vll;
typedef vector<vector<ll>> v2ll;
typedef list<int> liint;
typedef pair<int, int> pint;
const int INF = int(2e9);
const ll LINF = ll(2e9) * ll(2e9);
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
template <class T, class C> void chmax(T &a, C b) { a > b ?: a = b; }
template <class T, class C> void chmin(T &a, C b) { a < b ?: a = b; }
bool is_reachable(const string &S, int start, int end) {
REP(i, start - 1, end - 1) {
if (S[i] == '#' && S[i + 1] == '#') {
return false;
}
}
return true;
}
bool is_triple(const string &S, int start, int N) {
REP(i, start - 1, N) {
if (S[i - 1] == '.' && S[i] == '.' && S[i + 1] == '.') {
return true;
}
}
return false;
}
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
if (C < D) {
if (is_reachable(S, A, C) == true && is_reachable(S, B, D) == true) {
cout << "Yes" << endl;
return 0;
} else {
cout << "No" << endl;
return 0;
}
} else {
if (is_reachable(S, A, C) == true && is_reachable(S, B, D) == true &&
is_triple(S, B, D) == true) {
cout << "Yes" << endl;
return 0;
} else {
cout << "No" << endl;
return 0;
}
}
return 0;
} | [
"expression.operation.binary.remove",
"identifier.change",
"control_flow.branch.if.condition.change"
] | 832,384 | 832,383 | u391331433 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
#define REP(i, a, n) for (int i = a; i < n; ++i)
#define REPR(i, a, n) for (int i = a; i > n; --i)
#define RUP(a, b) ((a + b - 1) / (b))
#define SORTG(v) sort(v.begin(), v.end(), greater<>())
#define SORT(v) sort(v.begin(), v.end())
#define ALL(v) (v).begin(), (v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define INF LLONG_MAX / 3
typedef long long ll;
typedef pair<int, int> Pii;
typedef tuple<int, int, int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<string> Vs;
template <class T> void chmax(T &a, T b) {
if (a < b) {
a = b;
}
}
template <class T> void chmin(T &a, T b) {
if (a > b) {
a = b;
}
}
void YesNo(int a) { cout << ((a) ? "Yes" : "No") << endl; }
void YESNO(int a) { cout << ((a) ? "YES" : "NO") << endl; }
void AorB(int a, string b, string c) { cout << ((a) ? b : c) << endl; }
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
void start() {
cin.tie(0);
cout.tie(0);
ios::sync_with_stdio(false);
}
signed main() {
start();
int n, a, b, c, d;
string s;
cin >> n >> a >> b >> c >> d >> s;
a--;
b--;
c--;
d--;
REP(i, a, max(c, d)) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
if (d > c) {
cout << "Yes" << endl;
return 0;
} else {
bool ok = false;
REP(i, b, d) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.')
ok = true;
}
YesNo(ok);
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
#define REP(i, a, n) for (int i = a; i < n; ++i)
#define REPR(i, a, n) for (int i = a; i > n; --i)
#define RUP(a, b) ((a + b - 1) / (b))
#define SORTG(v) sort(v.begin(), v.end(), greater<>())
#define SORT(v) sort(v.begin(), v.end())
#define ALL(v) (v).begin(), (v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define INF LLONG_MAX / 3
typedef long long ll;
typedef pair<int, int> Pii;
typedef tuple<int, int, int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<string> Vs;
template <class T> void chmax(T &a, T b) {
if (a < b) {
a = b;
}
}
template <class T> void chmin(T &a, T b) {
if (a > b) {
a = b;
}
}
void YesNo(int a) { cout << ((a) ? "Yes" : "No") << endl; }
void YESNO(int a) { cout << ((a) ? "YES" : "NO") << endl; }
void AorB(int a, string b, string c) { cout << ((a) ? b : c) << endl; }
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
void start() {
cin.tie(0);
cout.tie(0);
ios::sync_with_stdio(false);
}
signed main() {
start();
int n, a, b, c, d;
string s;
cin >> n >> a >> b >> c >> d >> s;
a--;
b--;
c--;
d--;
REP(i, a, max(c, d)) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
if (d > c) {
cout << "Yes" << endl;
return 0;
} else {
bool ok = false;
REP(i, b, d + 1) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.')
ok = true;
}
YesNo(ok);
}
return 0;
}
| [
"expression.operation.binary.add"
] | 832,385 | 832,386 | u635484372 | cpp |
p03017 | #include <iostream>
#include <algorithm>
#include <cmath>
#include <iomanip>
// array
#include <map>
#include <set>
#include <vector>
using namespace std;
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
if (c > d) {
//追い越し確認
bool oikosu = false;
for (int i = b - 1; d - 1 > i; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
oikosu = true;
break;
}
}
if (!oikosu) {
cout << "No" << endl;
return 0;
}
}
for (int i = a; c - 1 > i; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (int i = b; d - 1 > i; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
} | #include <iostream>
#include <algorithm>
#include <cmath>
#include <iomanip>
// array
#include <map>
#include <set>
#include <vector>
using namespace std;
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
if (c > d) {
//追い越し確認
bool oikosu = false;
for (int i = b - 2; d - 1 > i; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
oikosu = true;
break;
}
}
if (!oikosu) {
cout << "No" << endl;
return 0;
}
}
for (int i = a; c - 1 > i; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (int i = b; d - 1 > i; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
} | [
"literal.number.change",
"control_flow.loop.for.initializer.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 832,398 | 832,399 | u466161487 | cpp |
p03017 | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int N, A, B, C, D;
string S;
int CHECK(void) {
for (int i = B + 1; i <= D; i++) {
if ((S[i] == '#') && (S[i - 1] == '#')) {
return -1;
}
}
for (int i = A + 1; i <= C; i++) {
if ((S[i] == '#') && (S[i - 1] == '#')) {
return -1;
}
}
if (C < B) {
return 1;
}
int ret = 1;
if (D < C) {
ret = -1;
for (int i = B + 1; i <= D; i++) {
if ((S[i] == '.') && (S[i - 1] == '.') && (S[i - 2] == '.')) {
ret = 1;
}
}
}
return ret;
}
int main(void) {
cin >> N >> A >> B >> C >> D;
cin >> S;
S = "?" + S;
if (CHECK() == 1) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
} | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int N, A, B, C, D;
string S;
int CHECK(void) {
for (int i = B + 1; i <= D; i++) {
if ((S[i] == '#') && (S[i - 1] == '#')) {
return -1;
}
}
for (int i = A + 1; i <= C; i++) {
if ((S[i] == '#') && (S[i - 1] == '#')) {
return -1;
}
}
if (C < B) {
return 1;
}
int ret = 1;
if (D < C) {
ret = -1;
for (int i = B + 1; i <= D + 1; i++) {
if ((S[i] == '.') && (S[i - 1] == '.') && (S[i - 2] == '.')) {
ret = 1;
}
}
}
return ret;
}
int main(void) {
cin >> N >> A >> B >> C >> D;
cin >> S;
S = "?" + S;
if (CHECK() == 1) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
} | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 832,407 | 832,408 | u835297884 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
/*{{{*/ // template
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr long long LINF = numeric_limits<long long>::max() / 3;
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(v) (v).begin(), (v).end()
#define sz(x) (int)(x).size()
#define debug(x) cerr << #x << ":" << x << endl
#define debug2(x, y) cerr << #x << "," << #y ":" << x << "," << y << endl
// struct fin{ fin(){ cin.tie(0); ios::sync_with_stdio(false); } } fin_;
struct Double {
double d;
explicit Double(double x) : d(x) {}
};
ostream &operator<<(ostream &os, const Double x) {
os << fixed << setprecision(20) << x.d;
return os;
}
template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec) {
os << "[";
for (const auto &v : vec) {
os << v << ",";
}
os << "]";
return os;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const map<T, U> &mp) {
os << "{";
for (auto &p : mp) {
os << p << ",";
}
os << "}";
return os;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
os << "(" << p.first << "," << p.second << ")";
return os;
}
template <typename T> ostream &operator<<(ostream &os, const set<T> &st) {
os << "{";
for (T v : st)
os << v << ",";
os << "}";
return os;
}
template <typename T, typename U> inline void chmax(T &x, U y) {
if (y > x)
x = y;
}
template <typename T, typename U> inline void chmin(T &x, U y) {
if (y < x)
x = y;
}
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
ll gcd(ll a, ll b) {
if (b == 0)
return a;
else
return gcd(b, a % b);
}
// constexpr double eps = 1e-14;
constexpr double eps = 1e-10;
constexpr ll mod = 1e9 + 7;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
/*}}}*/
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
a--;
b--;
c--;
d--;
if (c < d) {
bool snk = true;
for (int i = a; i < c; i++) {
if (s[i] == '#' and s[i + 1] == '#') {
snk = false;
break;
}
}
bool hnk = true;
for (int i = b; i < d; i++) {
if (s[i] == '#' and s[i + 1] == '#') {
hnk = false;
break;
}
}
if (snk and hnk) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} else {
bool hnk = true;
for (int i = b; i < d; i++) {
if (s[i] == '#' and s[i + 1] == '#') {
hnk = false;
break;
}
}
if (!hnk) {
cout << "No" << endl;
return 0;
}
bool ok = false;
for (int i = b; i <= d - 1; i++) {
if (s[i] == '.' and s[i + 1] == '.' and s[i + 2] == '.') {
ok = true;
break;
}
}
if (!ok) {
cout << "No" << endl;
return 0;
}
bool snk = true;
for (int i = a; i < c; i++) {
if (s[i] == '#' and s[i + 1] == '#') {
snk = false;
break;
}
}
if (!snk) {
cout << "No" << endl;
return 0;
}
cout << "Yes" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
/*{{{*/ // template
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr long long LINF = numeric_limits<long long>::max() / 3;
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(v) (v).begin(), (v).end()
#define sz(x) (int)(x).size()
#define debug(x) cerr << #x << ":" << x << endl
#define debug2(x, y) cerr << #x << "," << #y ":" << x << "," << y << endl
// struct fin{ fin(){ cin.tie(0); ios::sync_with_stdio(false); } } fin_;
struct Double {
double d;
explicit Double(double x) : d(x) {}
};
ostream &operator<<(ostream &os, const Double x) {
os << fixed << setprecision(20) << x.d;
return os;
}
template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec) {
os << "[";
for (const auto &v : vec) {
os << v << ",";
}
os << "]";
return os;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const map<T, U> &mp) {
os << "{";
for (auto &p : mp) {
os << p << ",";
}
os << "}";
return os;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
os << "(" << p.first << "," << p.second << ")";
return os;
}
template <typename T> ostream &operator<<(ostream &os, const set<T> &st) {
os << "{";
for (T v : st)
os << v << ",";
os << "}";
return os;
}
template <typename T, typename U> inline void chmax(T &x, U y) {
if (y > x)
x = y;
}
template <typename T, typename U> inline void chmin(T &x, U y) {
if (y < x)
x = y;
}
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
ll gcd(ll a, ll b) {
if (b == 0)
return a;
else
return gcd(b, a % b);
}
// constexpr double eps = 1e-14;
constexpr double eps = 1e-10;
constexpr ll mod = 1e9 + 7;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
/*}}}*/
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
a--;
b--;
c--;
d--;
if (c < d) {
bool snk = true;
for (int i = a; i < c; i++) {
if (s[i] == '#' and s[i + 1] == '#') {
snk = false;
break;
}
}
bool hnk = true;
for (int i = b; i < d; i++) {
if (s[i] == '#' and s[i + 1] == '#') {
hnk = false;
break;
}
}
if (snk and hnk) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} else {
bool hnk = true;
for (int i = b; i < d; i++) {
if (s[i] == '#' and s[i + 1] == '#') {
hnk = false;
break;
}
}
if (!hnk) {
cout << "No" << endl;
return 0;
}
bool ok = false;
for (int i = b - 1; i <= d - 1; i++) {
if (s[i] == '.' and s[i + 1] == '.' and s[i + 2] == '.') {
ok = true;
break;
}
}
if (!ok) {
// TODO ここでNoになってるが実はYesのパターンがある
cout << "No" << endl;
return 0;
}
bool snk = true;
for (int i = a; i < c; i++) {
if (s[i] == '#' and s[i + 1] == '#') {
snk = false;
break;
}
}
if (!snk) {
cout << "No" << endl;
return 0;
}
// OK
cout << "Yes" << endl;
}
}
| [
"control_flow.loop.for.initializer.change"
] | 832,414 | 832,415 | u013750540 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, b, e) for (int i = (b); i <= (e); i++)
#define pr(x) \
do { \
cerr << (#x) << " = " << (x) << endl; \
} while (0)
#define pri(x, i) \
do { \
cerr << (#x) << "[" << i << "] = " << (x[i]) << endl; \
} while (0)
#define UNIQUE(v) \
do { \
(v).erase(unique(begin(v), end(v)), end(v)); \
} while (0)
namespace std {
template <class S, class T>
pair<S, T> operator+(const pair<S, T> &a, const pair<S, T> &b) {
return mp<S, T>(a.first + b.first, a.second + b.second);
}
template <class S, class T>
pair<S, T> operator-(const pair<S, T> &a, const pair<S, T> &b) {
return mp<S, T>(a.first - b.first, a.second - b.second);
}
template <class S, class T>
pair<S, T> &operator+=(pair<S, T> &a, const pair<S, T> &other) {
return a = a + other;
}
template <class S, class T>
pair<S, T> &operator-=(pair<S, T> &a, const pair<S, T> &other) {
return a = a - other;
}
template <class S, class T> ostream &operator<<(ostream &ost, pair<S, T> p) {
ost << "(" << p.first << ", " << p.second << ")";
return ost;
}
template <class T>
ostream &print_iterable_container(ostream &ost, T &container) {
for (auto &&iter = begin(container); iter != end(container); ++iter)
ost << (iter == begin(container) ? " [ " : ", ") << (*iter);
return ost << " ]";
}
#define APPLY_PRINT_ITERABLE_CONTAINER(container_type) \
template <class T> \
ostream &operator<<(ostream &ost, container_type<T> &container) { \
return print_iterable_container(ost, container); \
}
APPLY_PRINT_ITERABLE_CONTAINER(vector);
APPLY_PRINT_ITERABLE_CONTAINER(list);
APPLY_PRINT_ITERABLE_CONTAINER(deque);
} // namespace std
template <class T> inline bool CHMAX(T &l, const T &r) {
return l < r ? l = r, 1 : 0;
}
template <class T> inline bool CHMIN(T &l, const T &r) {
return l > r ? l = r, 1 : 0;
}
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vvll = vector<vll>;
using vpii = vector<pii>;
using vpll = vector<pll>;
using ld = long double;
template <class T> using VV = vector<vector<T>>;
template <class T> using maxPQ = priority_queue<T>;
template <class T> using minPQ = priority_queue<T, vector<T>, greater<T>>;
template <class T, class U> using uomap = unordered_map<T, U>;
template <class T> using uoset = unordered_set<T>;
const ll INF = 1001001001;
const ll INFll = (ll)INF * INF;
const ll MOD = 1000000007;
const ll MOD_FFT = 998244353;
const ld EPS = 1e-15;
// function<void(int,int)> tensi_no_3p=[&](int v,int d){
//};
int main() {
ios_base::sync_with_stdio(false);
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
A--;
B--;
C--;
D--;
string S;
cin >> S;
S += "#####";
bool canswap = false;
repr(i, B, D - 1) {
if (S[i] == '#' && S[i + 1] == '#')
goto NO;
if (S[i - 1] == '.' && S[i] == '.' && S[i + 1] == '.')
canswap = true;
}
if (!canswap && D < C)
goto NO;
repr(i, A, C - 1) {
if (S[i] == '#' && S[i + 1] == '#')
goto NO;
}
cout << "Yes" << endl;
return 0;
NO:
cout << "No" << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, b, e) for (int i = (b); i <= (e); i++)
#define pr(x) \
do { \
cerr << (#x) << " = " << (x) << endl; \
} while (0)
#define pri(x, i) \
do { \
cerr << (#x) << "[" << i << "] = " << (x[i]) << endl; \
} while (0)
#define UNIQUE(v) \
do { \
(v).erase(unique(begin(v), end(v)), end(v)); \
} while (0)
namespace std {
template <class S, class T>
pair<S, T> operator+(const pair<S, T> &a, const pair<S, T> &b) {
return mp<S, T>(a.first + b.first, a.second + b.second);
}
template <class S, class T>
pair<S, T> operator-(const pair<S, T> &a, const pair<S, T> &b) {
return mp<S, T>(a.first - b.first, a.second - b.second);
}
template <class S, class T>
pair<S, T> &operator+=(pair<S, T> &a, const pair<S, T> &other) {
return a = a + other;
}
template <class S, class T>
pair<S, T> &operator-=(pair<S, T> &a, const pair<S, T> &other) {
return a = a - other;
}
template <class S, class T> ostream &operator<<(ostream &ost, pair<S, T> p) {
ost << "(" << p.first << ", " << p.second << ")";
return ost;
}
template <class T>
ostream &print_iterable_container(ostream &ost, T &container) {
for (auto &&iter = begin(container); iter != end(container); ++iter)
ost << (iter == begin(container) ? " [ " : ", ") << (*iter);
return ost << " ]";
}
#define APPLY_PRINT_ITERABLE_CONTAINER(container_type) \
template <class T> \
ostream &operator<<(ostream &ost, container_type<T> &container) { \
return print_iterable_container(ost, container); \
}
APPLY_PRINT_ITERABLE_CONTAINER(vector);
APPLY_PRINT_ITERABLE_CONTAINER(list);
APPLY_PRINT_ITERABLE_CONTAINER(deque);
} // namespace std
template <class T> inline bool CHMAX(T &l, const T &r) {
return l < r ? l = r, 1 : 0;
}
template <class T> inline bool CHMIN(T &l, const T &r) {
return l > r ? l = r, 1 : 0;
}
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vvll = vector<vll>;
using vpii = vector<pii>;
using vpll = vector<pll>;
using ld = long double;
template <class T> using VV = vector<vector<T>>;
template <class T> using maxPQ = priority_queue<T>;
template <class T> using minPQ = priority_queue<T, vector<T>, greater<T>>;
template <class T, class U> using uomap = unordered_map<T, U>;
template <class T> using uoset = unordered_set<T>;
const ll INF = 1001001001;
const ll INFll = (ll)INF * INF;
const ll MOD = 1000000007;
const ll MOD_FFT = 998244353;
const ld EPS = 1e-15;
// function<void(int,int)> tensi_no_3p=[&](int v,int d){
//};
int main() {
ios_base::sync_with_stdio(false);
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
A--;
B--;
C--;
D--;
string S;
cin >> S;
S += "#####";
bool canswap = false;
repr(i, B, D) {
if (S[i] == '#' && S[i + 1] == '#')
goto NO;
if (S[i - 1] == '.' && S[i] == '.' && S[i + 1] == '.')
canswap = true;
}
if (!canswap && D < C)
goto NO;
repr(i, A, C - 1) {
if (S[i] == '#' && S[i + 1] == '#')
goto NO;
}
cout << "Yes" << endl;
return 0;
NO:
cout << "No" << endl;
return 0;
}
| [
"expression.operation.binary.remove"
] | 832,416 | 832,417 | u674402178 | cpp |
p03017 | // by xxj
#include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
#define mp make_pair
#define ll long long
#define pii pair<int, int>
#define lowbit(x) x & -x
const int inf = 1e9 + 7;
const double eps = 1e-10;
const ll linf = 1e18 + 7;
const ll hh = 523;
// const int mod=;
string s;
int main() {
// freopen(".in","r",stdin);
// freopen(".out","w",stdout);
int n, a, b, c, d;
scanf("%d%d%d%d%d", &n, &a, &b, &c, &d);
a--;
b--;
c--;
d--;
cin >> s;
for (int i = a + 1; i <= c - 2; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
puts("No");
return 0;
}
}
for (int i = b + 1; i <= d - 2; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
puts("No");
return 0;
}
}
if (c < b) {
puts("Yes");
return 0;
}
if (c < d) {
puts("Yes");
return 0;
}
for (int i = max(b - 1, 0); i < d - 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
puts("Yes");
return 0;
}
}
puts("No");
return 0;
}
/*
input:
*/
| // by xxj
#include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
#define mp make_pair
#define ll long long
#define pii pair<int, int>
#define lowbit(x) x & -x
const int inf = 1e9 + 7;
const double eps = 1e-10;
const ll linf = 1e18 + 7;
const ll hh = 523;
// const int mod=;
string s;
int main() {
// freopen(".in","r",stdin);
// freopen(".out","w",stdout);
int n, a, b, c, d;
scanf("%d%d%d%d%d", &n, &a, &b, &c, &d);
a--;
b--;
c--;
d--;
cin >> s;
for (int i = a + 1; i <= c - 2; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
puts("No");
return 0;
}
}
for (int i = b + 1; i <= d - 2; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
puts("No");
return 0;
}
}
if (c < b) {
puts("Yes");
return 0;
}
if (c < d) {
puts("Yes");
return 0;
}
for (int i = max(b - 1, 0); i <= d - 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
puts("Yes");
return 0;
}
}
puts("No");
return 0;
}
/*
input:
*/
| [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 832,420 | 832,421 | u776618439 | cpp |
p03017 | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
using namespace std;
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
int maxcd = C;
if (D > C)
maxcd = D;
for (int i = A - 1; i < maxcd; i++) {
if (S[i] == '#') {
if (S[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
}
int rcnt = 0;
if (maxcd == D) {
cout << "Yes" << endl;
return 0;
} else {
for (int i = B - 2; i < D; i++) {
if (S[i] == '.')
rcnt++;
else
rcnt = 0;
if (rcnt > 2) {
cout << "Yes" << endl;
return 0;
}
}
}
cout << "No" << endl;
return 0;
} | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
using namespace std;
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
int maxcd = C;
if (D > C)
maxcd = D;
for (int i = A - 1; i < maxcd; i++) {
if (S[i] == '#') {
if (S[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
}
int rcnt = 0;
if (maxcd == D) {
cout << "Yes" << endl;
return 0;
} else {
for (int i = B - 2; i < D + 1; i++) {
if (S[i] == '.')
rcnt++;
else
rcnt = 0;
if (rcnt > 2) {
cout << "Yes" << endl;
return 0;
}
}
}
cout << "No" << endl;
return 0;
} | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 832,422 | 832,423 | u772041670 | cpp |
p03017 | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
using namespace std;
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
int maxcd = C;
if (D > C)
maxcd = D;
for (int i = A - 1; i < maxcd; i++) {
if (S[i] == '#') {
if (S[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
}
int rcnt = 0;
if (maxcd == D) {
cout << "Yes" << endl;
return 0;
} else {
for (int i = B - 2; i < maxcd; i++) {
if (S[i] == '.')
rcnt++;
else
rcnt = 0;
if (rcnt > 2) {
cout << "Yes" << endl;
return 0;
}
}
}
cout << "No" << endl;
return 0;
} | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
using namespace std;
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
int maxcd = C;
if (D > C)
maxcd = D;
for (int i = A - 1; i < maxcd; i++) {
if (S[i] == '#') {
if (S[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
}
int rcnt = 0;
if (maxcd == D) {
cout << "Yes" << endl;
return 0;
} else {
for (int i = B - 2; i < D + 1; i++) {
if (S[i] == '.')
rcnt++;
else
rcnt = 0;
if (rcnt > 2) {
cout << "Yes" << endl;
return 0;
}
}
}
cout << "No" << endl;
return 0;
} | [
"identifier.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 832,424 | 832,423 | u772041670 | cpp |
p03017 | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
using namespace std;
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
int maxcd = C;
if (D > C)
maxcd = D;
for (int i = A - 1; i < maxcd; i++) {
if (S[i] == '#') {
if (S[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
}
int rcnt = 0;
if (maxcd == D) {
cout << "Yes" << endl;
return 0;
} else {
for (int i = B - 1; i < maxcd; i++) {
if (S[i] == '.')
rcnt++;
else
rcnt = 0;
if (rcnt > 2) {
cout << "Yes" << endl;
return 0;
}
}
}
cout << "No" << endl;
return 0;
} | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
using namespace std;
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
int maxcd = C;
if (D > C)
maxcd = D;
for (int i = A - 1; i < maxcd; i++) {
if (S[i] == '#') {
if (S[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
}
int rcnt = 0;
if (maxcd == D) {
cout << "Yes" << endl;
return 0;
} else {
for (int i = B - 2; i < D + 1; i++) {
if (S[i] == '.')
rcnt++;
else
rcnt = 0;
if (rcnt > 2) {
cout << "Yes" << endl;
return 0;
}
}
}
cout << "No" << endl;
return 0;
} | [
"literal.number.change",
"control_flow.loop.for.initializer.change",
"expression.off_by_one",
"expression.operation.binary.change",
"identifier.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 832,425 | 832,423 | u772041670 | cpp |
p03017 | #include <algorithm>
#include <iostream>
#include <list>
#include <math.h>
#include <stdio.h>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
using vec = vector<int>;
using mat = vector<vec>;
using lst = list<int>;
int main() {
int N, A, B, C, D;
string S;
cin >> N >> A >> B >> C >> D;
cin >> S;
--A;
--B;
--C;
--D;
for (int i = 0; i < N - 1; ++i) {
if (S[i] == '#' && S[i + 1] == '#') {
if (A < i && (i < C || i < D)) {
cout << "No" << endl;
return 0;
}
}
}
if (C < D) {
cout << "Yes" << endl;
return 0;
}
for (int i = 0; i < N - 2; ++i) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
if (B < i && i < D) {
cout << "Yes" << endl;
return 0;
}
}
}
cout << "No" << endl;
return 0;
} | #include <algorithm>
#include <iostream>
#include <list>
#include <math.h>
#include <stdio.h>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
using vec = vector<int>;
using mat = vector<vec>;
using lst = list<int>;
int main() {
int N, A, B, C, D;
string S;
cin >> N >> A >> B >> C >> D;
cin >> S;
--A;
--B;
--C;
--D;
for (int i = 0; i < N - 1; ++i) {
if (S[i] == '#' && S[i + 1] == '#') {
if (A < i && (i < C || i < D)) {
cout << "No" << endl;
return 0;
}
}
}
if (C < D) {
cout << "Yes" << endl;
return 0;
}
for (int i = 0; i < N - 2; ++i) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
if (B - 2 < i && i < D) {
cout << "Yes" << endl;
return 0;
}
}
}
cout << "No" << endl;
return 0;
} | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 832,426 | 832,427 | u765606693 | cpp |
p03017 | #include <algorithm>
#include <iostream>
#include <list>
#include <math.h>
#include <stdio.h>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
using vec = vector<int>;
using mat = vector<vec>;
using lst = list<int>;
int main() {
int N, A, B, C, D;
string S;
cin >> N >> A >> B >> C >> D;
cin >> S;
--A;
--B;
--C;
--D;
for (int i = 0; i < N - 1; ++i) {
if (S[i] == '#' && S[i + 1] == '#') {
if (A < i && (i < C || i < D)) {
cout << "No" << endl;
return 0;
}
}
}
if (C < D) {
cout << "Yes" << endl;
return 0;
}
for (int i = 0; i < N - 2; ++i) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
if (B < i) {
cout << "Yes" << endl;
return 0;
}
}
}
cout << "No" << endl;
return 0;
} | #include <algorithm>
#include <iostream>
#include <list>
#include <math.h>
#include <stdio.h>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
using vec = vector<int>;
using mat = vector<vec>;
using lst = list<int>;
int main() {
int N, A, B, C, D;
string S;
cin >> N >> A >> B >> C >> D;
cin >> S;
--A;
--B;
--C;
--D;
for (int i = 0; i < N - 1; ++i) {
if (S[i] == '#' && S[i + 1] == '#') {
if (A < i && (i < C || i < D)) {
cout << "No" << endl;
return 0;
}
}
}
if (C < D) {
cout << "Yes" << endl;
return 0;
}
for (int i = 0; i < N - 2; ++i) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
if (B - 2 < i && i < D) {
cout << "Yes" << endl;
return 0;
}
}
}
cout << "No" << endl;
return 0;
} | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 832,428 | 832,427 | u765606693 | cpp |
p03017 | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <iterator>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define mems(p) memset(p, 0, sizeof(p))
#define mp make_pair
void fast() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
}
int main() {
fast();
int n, a, b, c, d;
string s;
cin >> n >> a >> b >> c >> d >> s;
int bb = b;
while (d - b > 2) {
if (s[b + 1] == '.')
b += 2;
else if (s[b] == '.')
++b;
else {
cout << "No" << endl;
return 0;
}
}
while (c - a > 2) {
if (s[a + 1] == '.')
a += 2;
else if (s[a] == '.')
++a;
else {
cout << "No" << endl;
return 0;
}
}
if (c > d) {
for (int i = bb - 1; i < d - 1; ++i) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0;
}
cout << "Yes" << endl;
} | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <iterator>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define mems(p) memset(p, 0, sizeof(p))
#define mp make_pair
void fast() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
}
int main() {
fast();
int n, a, b, c, d;
string s;
cin >> n >> a >> b >> c >> d >> s;
int bb = b;
while (d - b > 2) {
if (s[b + 1] == '.')
b += 2;
else if (s[b] == '.')
++b;
else {
cout << "No" << endl;
return 0;
}
}
while (c - a > 2) {
if (s[a + 1] == '.')
a += 2;
else if (s[a] == '.')
++a;
else {
cout << "No" << endl;
return 0;
}
}
if (c > d) {
for (int i = bb - 2; i < d - 1; ++i) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0;
}
cout << "Yes" << endl;
} | [
"literal.number.change",
"control_flow.loop.for.initializer.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 832,431 | 832,432 | u217609546 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int N, A, B, C, D;
string S;
bool solve() {
int R1 = min(C, D), R2 = max(C, D);
for (int i = A; i < C; i++) {
if (S[i] == '#' && S[i + 1] == '#')
return false;
}
for (int i = B; i < D; i++) {
if (S[i] == '#' && S[i + 1] == '#')
return false;
}
if (D < C) {
bool ok = false;
for (int i = B; i < D - 1; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
ok = true;
break;
}
}
if (!ok)
return false;
}
return true;
}
int main() {
cin >> N >> A >> B >> C >> D >> S;
A--, B--, C--, D--;
string ans = solve() ? "Yes" : "No";
cout << ans << '\n';
return 0;
} | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int N, A, B, C, D;
string S;
bool solve() {
int R1 = min(C, D), R2 = max(C, D);
for (int i = A; i < C; i++) {
if (S[i] == '#' && S[i + 1] == '#')
return false;
}
for (int i = B; i < D; i++) {
if (S[i] == '#' && S[i + 1] == '#')
return false;
}
if (D < C) {
bool ok = false;
for (int i = B - 1; i < D; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
ok = true;
break;
}
}
if (!ok)
return false;
}
return true;
}
int main() {
cin >> N >> A >> B >> C >> D >> S;
A--, B--, C--, D--;
string ans = solve() ? "Yes" : "No";
cout << ans << '\n';
return 0;
} | [
"control_flow.loop.for.initializer.change",
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove"
] | 832,441 | 832,442 | u930841425 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef double db;
#define go(u) for (int i = head[u], v = e[i].to; i; i = e[i].lst, v = e[i].to)
#define rep(i, a, b) for (int i = a; i <= b; ++i)
#define pb push_back
#define re(x) memset(x, 0, sizeof x)
inline int gi() {
int x = 0, f = 1;
char ch = getchar();
while (!isdigit(ch)) {
if (ch == '-')
f = -1;
ch = getchar();
}
while (isdigit(ch)) {
x = (x << 3) + (x << 1) + ch - 48;
ch = getchar();
}
return x * f;
}
template <typename T> inline bool Max(T &a, T b) {
return a < b ? a = b, 1 : 0;
}
template <typename T> inline bool Min(T &a, T b) {
return a > b ? a = b, 1 : 0;
}
const int N = 2e5 + 7;
int n, A, B, C, D;
char s[N];
int main() {
#ifdef fwat
#endif
n = gi(), A = gi(), B = gi(), C = gi(), D = gi();
scanf("%s", s + 1);
int mx = 0;
for (int i = A, j = i; i <= C; i = j + 1, j = i) {
while (j + 1 <= C && s[j + 1] == s[j])
++j;
if (s[i] == '#')
Max(mx, j - i + 1);
}
if (mx > 1)
return puts("No"), 0;
mx = 0;
for (int i = B, j = i; i <= D; i = j + 1, j = i) {
while (j + 1 <= C && s[j + 1] == s[j])
++j;
if (s[i] == '#')
Max(mx, j - i + 1);
}
if (mx > 1)
return puts("No"), 0;
bool fg = 0;
for (int i = B - 1, j = i; i <= D; i = j + 1, j = i) {
while (j + 1 <= C && s[j + 1] == s[j])
++j;
if (s[i] == '.' && j - i + 1 >= 3)
fg = 1;
}
if (C > D && !fg)
return puts("No"), 0;
puts("Yes");
return 0;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef double db;
#define go(u) for (int i = head[u], v = e[i].to; i; i = e[i].lst, v = e[i].to)
#define rep(i, a, b) for (int i = a; i <= b; ++i)
#define pb push_back
#define re(x) memset(x, 0, sizeof x)
inline int gi() {
int x = 0, f = 1;
char ch = getchar();
while (!isdigit(ch)) {
if (ch == '-')
f = -1;
ch = getchar();
}
while (isdigit(ch)) {
x = (x << 3) + (x << 1) + ch - 48;
ch = getchar();
}
return x * f;
}
template <typename T> inline bool Max(T &a, T b) {
return a < b ? a = b, 1 : 0;
}
template <typename T> inline bool Min(T &a, T b) {
return a > b ? a = b, 1 : 0;
}
const int N = 2e5 + 7;
int n, A, B, C, D;
char s[N];
int main() {
#ifdef fwat
#endif
n = gi(), A = gi(), B = gi(), C = gi(), D = gi();
scanf("%s", s + 1);
int mx = 0;
for (int i = A, j = i; i <= C; i = j + 1, j = i) {
while (j + 1 <= C && s[j + 1] == s[j])
++j;
if (s[i] == '#')
Max(mx, j - i + 1);
}
if (mx > 1)
return puts("No"), 0;
mx = 0;
for (int i = B, j = i; i <= D; i = j + 1, j = i) {
while (j + 1 <= D && s[j + 1] == s[j])
++j;
if (s[i] == '#')
Max(mx, j - i + 1);
}
if (mx > 1)
return puts("No"), 0;
bool fg = 0;
for (int i = B - 1, j = i; i <= D + 1; i = j + 1, j = i) {
while (j + 1 <= D + 1 && s[j + 1] == s[j])
++j;
if (s[i] == '.' && j - i + 1 >= 3)
fg = 1;
}
if (C > D && !fg)
return puts("No"), 0;
puts("Yes");
return 0;
} | [
"identifier.change",
"control_flow.loop.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 832,447 | 832,446 | u543414214 | cpp |
p03017 | #include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cfenv>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <time.h>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
//#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
long long MOD =
1000000000 + 7; // ;//1000000000 + 7 998244353 924844033 1000000000 + 9;
constexpr long long INF = numeric_limits<LL>::max();
constexpr long long DINF = 1000000000000;
const double PI = acos(-1);
#define fir first
#define sec second
#define thi third
#define debug(x) cerr << #x << ": " << x << '\n'
typedef pair<LL, LL> Pll;
typedef pair<double, double> Dll;
typedef pair<LL, pair<LL, LL>> Ppll;
typedef pair<LL, pair<LL, bitset<100001>>> Pbll;
typedef pair<LL, pair<LL, vector<LL>>> Pvll;
typedef pair<LL, LL> Vec2;
struct Tll {
LL first, second, third;
};
struct Fll {
LL first, second, third, fourth;
};
typedef pair<LL, Tll> Ptll;
#define rep(i, rept) for (LL i = 0; i < rept; i++)
#define Rrep(i, mf) for (LL i = mf - 1; i >= 0; i--)
void YN(bool f) {
if (f)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
void yn(bool f) {
if (f)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
struct Edge {
LL to, cost;
};
struct edge {
LL from, to, cost;
};
vector<vector<Edge>> g;
vector<edge> ed;
vector<Pll> pv;
map<LL, LL> ma;
set<LL> st;
int di[4][2] = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}};
LL n, m, k, p, q, w, h, ans, cnt, sum, a[310000], b[310000];
string str;
bool f[11000];
char c[210000];
int main() {
cin >> n >> p >> q >> w >> h;
p--, q--, h--, w--;
// p->w,q->h
rep(i, n) { cin >> c[i]; }
if (w < p || h < q) {
cout << "No" << endl;
return 0;
}
if (w > h) {
for (int i = p; i <= min(w, n - 2); i++) {
if (c[i] == '#' && c[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (int i = max(q - 1, (LL)0); i <= min(h, n - 3); i++) {
if (c[i] == '.' && c[i + 1] == '.' && c[i + 2] == '.') {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0;
} else {
for (int i = p; i <= min(h, n - 2); i++) {
if (c[i] == '#' && c[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
}
return 0;
}
| #include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cfenv>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <time.h>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
//#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
long long MOD =
1000000000 + 7; // ;//1000000000 + 7 998244353 924844033 1000000000 + 9;
constexpr long long INF = numeric_limits<LL>::max();
constexpr long long DINF = 1000000000000;
const double PI = acos(-1);
#define fir first
#define sec second
#define thi third
#define debug(x) cerr << #x << ": " << x << '\n'
typedef pair<LL, LL> Pll;
typedef pair<double, double> Dll;
typedef pair<LL, pair<LL, LL>> Ppll;
typedef pair<LL, pair<LL, bitset<100001>>> Pbll;
typedef pair<LL, pair<LL, vector<LL>>> Pvll;
typedef pair<LL, LL> Vec2;
struct Tll {
LL first, second, third;
};
struct Fll {
LL first, second, third, fourth;
};
typedef pair<LL, Tll> Ptll;
#define rep(i, rept) for (LL i = 0; i < rept; i++)
#define Rrep(i, mf) for (LL i = mf - 1; i >= 0; i--)
void YN(bool f) {
if (f)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
void yn(bool f) {
if (f)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
struct Edge {
LL to, cost;
};
struct edge {
LL from, to, cost;
};
vector<vector<Edge>> g;
vector<edge> ed;
vector<Pll> pv;
map<LL, LL> ma;
set<LL> st;
int di[4][2] = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}};
LL n, m, k, p, q, w, h, ans, cnt, sum, a[310000], b[310000];
string str;
bool f[11000];
char c[210000];
int main() {
cin >> n >> p >> q >> w >> h;
p--, q--, h--, w--;
// p->w,q->h
rep(i, n) { cin >> c[i]; }
if (w < p || h < q) {
cout << "No" << endl;
return 0;
}
if (w > h) {
for (int i = p; i <= min(w, n - 2); i++) {
if (c[i] == '#' && c[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (int i = max(q - 1, (LL)0); i <= min(h - 1, n - 3); i++) {
if (c[i] == '.' && c[i + 1] == '.' && c[i + 2] == '.') {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0;
} else {
for (int i = p; i <= min(h, n - 2); i++) {
if (c[i] == '#' && c[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
}
return 0;
}
| [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 832,448 | 832,449 | u202928696 | cpp |
p03017 | #include <bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
// using namespace __gnu_pbds;
const int inf = 0x3f3f3f3f;
const double eps = 1e-6;
const int mod = 1000000007;
typedef long long ll;
int modpow(int x, int y, int md = mod) {
if (y == 0)
return 1;
int ret = modpow(x, y >> 1, md);
ret = (ll)ret * ret % md;
if (y & 1)
ret = (ll)ret * x % md;
return ret;
}
string s;
int n, a, b, c, d;
int main() {
ios::sync_with_stdio(0);
cin >> n >> a >> b >> c >> d;
cin >> s;
s = " " + s + "#####";
if (d > c) {
for (int i = min(a, b); i <= max(c, d) - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
return puts("No") & 0;
}
puts("Yes");
} else {
// d<c
for (int i = a; i <= c - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
return puts("No") & 0;
}
}
for (int i = b; i <= d - 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
return puts("Yes") & 0;
}
}
puts("No");
}
return 0;
} | #include <bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
// using namespace __gnu_pbds;
const int inf = 0x3f3f3f3f;
const double eps = 1e-6;
const int mod = 1000000007;
typedef long long ll;
int modpow(int x, int y, int md = mod) {
if (y == 0)
return 1;
int ret = modpow(x, y >> 1, md);
ret = (ll)ret * ret % md;
if (y & 1)
ret = (ll)ret * x % md;
return ret;
}
string s;
int n, a, b, c, d;
int main() {
ios::sync_with_stdio(0);
cin >> n >> a >> b >> c >> d;
cin >> s;
s = " " + s + "#####";
if (d > c) {
for (int i = min(a, b); i <= max(c, d) - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
return puts("No") & 0;
}
puts("Yes");
} else {
// d<c
for (int i = a; i <= c - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
return puts("No") & 0;
}
}
for (int i = b - 1; i <= d - 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
return puts("Yes") & 0;
}
}
puts("No");
}
return 0;
} | [
"control_flow.loop.for.initializer.change"
] | 832,454 | 832,455 | u588911593 | cpp |
p03017 | #include <bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
// using namespace __gnu_pbds;
const int inf = 0x3f3f3f3f;
const double eps = 1e-6;
const int mod = 1000000007;
typedef long long ll;
int modpow(int x, int y, int md = mod) {
if (y == 0)
return 1;
int ret = modpow(x, y >> 1, md);
ret = (ll)ret * ret % md;
if (y & 1)
ret = (ll)ret * x % md;
return ret;
}
string s;
int n, a, b, c, d;
int main() {
ios::sync_with_stdio(0);
cin >> n >> a >> b >> c >> d;
cin >> s;
s = " " + s + "#####";
if (d > c) {
for (int i = min(a, b); i <= max(c, d) - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
return puts("No") & 0;
}
puts("Yes");
} else {
// d<c
for (int i = a; i <= c - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
return puts("No") & 0;
}
}
for (int i = b; i <= d - 2; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
return puts("Yes") & 0;
}
}
puts("No");
}
return 0;
} | #include <bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
// using namespace __gnu_pbds;
const int inf = 0x3f3f3f3f;
const double eps = 1e-6;
const int mod = 1000000007;
typedef long long ll;
int modpow(int x, int y, int md = mod) {
if (y == 0)
return 1;
int ret = modpow(x, y >> 1, md);
ret = (ll)ret * ret % md;
if (y & 1)
ret = (ll)ret * x % md;
return ret;
}
string s;
int n, a, b, c, d;
int main() {
ios::sync_with_stdio(0);
cin >> n >> a >> b >> c >> d;
cin >> s;
s = " " + s + "#####";
if (d > c) {
for (int i = min(a, b); i <= max(c, d) - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
return puts("No") & 0;
}
puts("Yes");
} else {
// d<c
for (int i = a; i <= c - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
return puts("No") & 0;
}
}
for (int i = b - 1; i <= d - 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
return puts("Yes") & 0;
}
}
puts("No");
}
return 0;
} | [
"control_flow.loop.for.initializer.change",
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 832,456 | 832,455 | u588911593 | cpp |
p03017 | #include <bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
// using namespace __gnu_pbds;
const int inf = 0x3f3f3f3f;
const double eps = 1e-6;
const int mod = 1000000007;
typedef long long ll;
int modpow(int x, int y, int md = mod) {
if (y == 0)
return 1;
int ret = modpow(x, y >> 1, md);
ret = (ll)ret * ret % md;
if (y & 1)
ret = (ll)ret * x % md;
return ret;
}
string s;
int n, a, b, c, d;
int main() {
ios::sync_with_stdio(0);
cin >> n >> a >> b >> c >> d;
cin >> s;
s = " " + s + "#####";
if (d > c) {
for (int i = min(a, b); i <= max(c, d) - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
return puts("No") & 0;
}
puts("Yes");
} else {
// d<c
for (int i = a; i <= c - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
return puts("No") & 0;
}
}
for (int i = b + 1; i <= d - 2; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
return puts("Yes") & 0;
}
}
puts("No");
}
return 0;
} | #include <bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
// using namespace __gnu_pbds;
const int inf = 0x3f3f3f3f;
const double eps = 1e-6;
const int mod = 1000000007;
typedef long long ll;
int modpow(int x, int y, int md = mod) {
if (y == 0)
return 1;
int ret = modpow(x, y >> 1, md);
ret = (ll)ret * ret % md;
if (y & 1)
ret = (ll)ret * x % md;
return ret;
}
string s;
int n, a, b, c, d;
int main() {
ios::sync_with_stdio(0);
cin >> n >> a >> b >> c >> d;
cin >> s;
s = " " + s + "#####";
if (d > c) {
for (int i = min(a, b); i <= max(c, d) - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
return puts("No") & 0;
}
puts("Yes");
} else {
// d<c
for (int i = a; i <= c - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
return puts("No") & 0;
}
}
for (int i = b - 1; i <= d - 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
return puts("Yes") & 0;
}
}
puts("No");
}
return 0;
} | [
"misc.opposites",
"expression.operator.arithmetic.change",
"control_flow.loop.for.initializer.change",
"expression.operation.binary.change",
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 832,457 | 832,455 | u588911593 | cpp |
p03017 | #include <bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
// using namespace __gnu_pbds;
const int inf = 0x3f3f3f3f;
const double eps = 1e-6;
const int mod = 1000000007;
typedef long long ll;
int modpow(int x, int y, int md = mod) {
if (y == 0)
return 1;
int ret = modpow(x, y >> 1, md);
ret = (ll)ret * ret % md;
if (y & 1)
ret = (ll)ret * x % md;
return ret;
}
string s;
int n, a, b, c, d;
int main() {
ios::sync_with_stdio(0);
cin >> n >> a >> b >> c >> d;
cin >> s;
s = " " + s + "#####";
if (d > c) {
for (int i = min(a, b); i <= max(c, d) - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
return puts("No") & 0;
}
puts("Yes");
} else {
for (int i = a; i <= c - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
return puts("No") & 0;
}
}
for (int i = b + 1; i <= c - 2; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
return puts("Yes") & 0;
}
}
puts("No");
}
return 0;
} | #include <bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
// using namespace __gnu_pbds;
const int inf = 0x3f3f3f3f;
const double eps = 1e-6;
const int mod = 1000000007;
typedef long long ll;
int modpow(int x, int y, int md = mod) {
if (y == 0)
return 1;
int ret = modpow(x, y >> 1, md);
ret = (ll)ret * ret % md;
if (y & 1)
ret = (ll)ret * x % md;
return ret;
}
string s;
int n, a, b, c, d;
int main() {
ios::sync_with_stdio(0);
cin >> n >> a >> b >> c >> d;
cin >> s;
s = " " + s + "#####";
if (d > c) {
for (int i = min(a, b); i <= max(c, d) - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
return puts("No") & 0;
}
puts("Yes");
} else {
// d<c
for (int i = a; i <= c - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
return puts("No") & 0;
}
}
for (int i = b - 1; i <= d - 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
return puts("Yes") & 0;
}
}
puts("No");
}
return 0;
} | [
"misc.opposites",
"expression.operator.arithmetic.change",
"control_flow.loop.for.initializer.change",
"expression.operation.binary.change",
"identifier.change",
"control_flow.branch.if.condition.change",
"literal.number.change"
] | 832,458 | 832,455 | u588911593 | cpp |
p03017 | #include "bits/stdc++.h"
using namespace std;
#define PB push_back
#define MP make_pair
#define REP(i, n) for (int i = 0; i < (n); i++)
int main() {
string s;
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
cin >> s;
a--;
b--;
c--;
d--;
for (int i = a + 1; i < max(c, d); i++) {
if (s[i] == '#' && s[i - 1] == '#') {
cout << "No" << endl;
return 0;
}
}
if (c < d) {
cout << "Yes" << endl;
return 0;
}
for (int i = b; i < d; i++) {
if (i + 1 >= n)
continue;
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.') {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0;
} | #include "bits/stdc++.h"
using namespace std;
#define PB push_back
#define MP make_pair
#define REP(i, n) for (int i = 0; i < (n); i++)
int main() {
string s;
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
cin >> s;
a--;
b--;
c--;
d--;
for (int i = a + 1; i < max(c, d); i++) {
if (s[i] == '#' && s[i - 1] == '#') {
cout << "No" << endl;
return 0;
}
}
if (c < d) {
cout << "Yes" << endl;
return 0;
}
for (int i = b; i <= d; i++) {
if (i + 1 >= n)
continue;
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.') {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0;
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 832,465 | 832,466 | u572537642 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
#define inf 999999999
#define loop(i, a, b) for (int i = (a), i##len = (b); i < i##len; ++i)
#define rep(i, n) loop(i, 0, n)
#define lin long long
#define lfl long double
lin n, a, b, c, d;
string s;
bool solve(lin src, lin dst) {
lin cur = src;
while (cur < dst) {
if (s[cur + 1] == '#' && s[cur + 2] == '#')
return false;
if (s[cur + 1] != '#')
cur++;
else
cur += 2;
}
return true;
}
bool solve2(lin p1, lin p2) {
lin sp = 0;
for (lin i = p1; i < p2; i++) {
if (s[i] == '#')
sp = 0;
else
sp++;
if (sp >= 3)
return true;
}
return false;
}
int main(void) {
cin >> n >> a >> b >> c >> d >> s;
a--;
b--;
c--;
d--;
bool res = false;
if (c < d) {
if (solve(a, c) && solve(b, d))
res = true;
} else {
if (solve(a, c) && solve(b, d) && solve2(b - 1, c + 1))
res = true;
}
if (res)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define inf 999999999
#define loop(i, a, b) for (int i = (a), i##len = (b); i < i##len; ++i)
#define rep(i, n) loop(i, 0, n)
#define lin long long
#define lfl long double
lin n, a, b, c, d;
string s;
bool solve(lin src, lin dst) {
lin cur = src;
while (cur < dst) {
if (s[cur + 1] == '#' && s[cur + 2] == '#')
return false;
if (s[cur + 1] != '#')
cur++;
else
cur += 2;
}
return true;
}
bool solve2(lin p1, lin p2) {
lin sp = 0;
for (lin i = p1; i <= p2; i++) {
if (s[i] == '#')
sp = 0;
else
sp++;
if (sp >= 3)
return true;
}
return false;
}
int main(void) {
cin >> n >> a >> b >> c >> d >> s;
a--;
b--;
c--;
d--;
bool res = false;
if (c < d) {
if (solve(a, c) && solve(b, d))
res = true;
} else {
if (solve(a, c) && solve(b, d) && solve2(b - 1, d + 1))
res = true;
}
if (res)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change",
"identifier.change",
"control_flow.branch.if.condition.change"
] | 832,469 | 832,470 | u762193256 | cpp |
p03017 | #include <iostream>
using namespace std;
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
A--;
B--;
C--;
D--;
string S;
cin >> S;
if (C < D) {
for (int i = A + 1; i <= D; i++) {
if (S[i] == '#' && S[i - 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
} else {
for (int i = A + 1; i <= D; i++) {
if (S[i] == '#' && S[i - 1] == '#') {
cout << "No" << endl;
return 0;
}
}
bool f = false;
for (int i = B + 1; i <= D; i++) {
if (S[i] == '.' && S[i - 1] == '.' && S[i - 2] == '.') {
f = true;
break;
}
}
if (f) {
cout << "Yes" << endl;
return 0;
} else {
cout << "No" << endl;
return 0;
}
}
} | #include <iostream>
using namespace std;
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
A--;
B--;
C--;
D--;
string S;
cin >> S;
if (C < D) {
for (int i = A + 1; i <= D; i++) {
if (S[i] == '#' && S[i - 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
} else {
for (int i = A + 1; i <= D; i++) {
if (S[i] == '#' && S[i - 1] == '#') {
cout << "No" << endl;
return 0;
}
}
bool f = false;
for (int i = B + 1; i <= D + 1; i++) {
if (S[i] == '.' && S[i - 1] == '.' && S[i - 2] == '.') {
f = true;
break;
}
}
if (f) {
cout << "Yes" << endl;
return 0;
} else {
cout << "No" << endl;
return 0;
}
}
} | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 832,471 | 832,472 | u693133807 | cpp |
p03017 | #include <iostream>
using namespace std;
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
A--;
B--;
C--;
D--;
string S;
cin >> S;
if (C < D) {
for (int i = A + 1; i <= D; i++) {
if (S[i] == '#' && S[i - 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
} else {
for (int i = A + 1; i <= D; i++) {
if (S[i] == '#' && S[i - 1] == '#') {
cout << "No" << endl;
return 0;
}
}
bool f = false;
for (int i = B + 2; i <= D; i++) {
if (S[i] == '.' && S[i - 1] == '.' && S[i - 2] == '.') {
f = true;
break;
}
}
if (f) {
cout << "Yes" << endl;
return 0;
} else {
cout << "No" << endl;
return 0;
}
}
} | #include <iostream>
using namespace std;
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
A--;
B--;
C--;
D--;
string S;
cin >> S;
if (C < D) {
for (int i = A + 1; i <= D; i++) {
if (S[i] == '#' && S[i - 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
} else {
for (int i = A + 1; i <= D; i++) {
if (S[i] == '#' && S[i - 1] == '#') {
cout << "No" << endl;
return 0;
}
}
bool f = false;
for (int i = B + 1; i <= D + 1; i++) {
if (S[i] == '.' && S[i - 1] == '.' && S[i - 2] == '.') {
f = true;
break;
}
}
if (f) {
cout << "Yes" << endl;
return 0;
} else {
cout << "No" << endl;
return 0;
}
}
} | [
"literal.number.change",
"control_flow.loop.for.initializer.change",
"expression.off_by_one",
"expression.operation.binary.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 832,473 | 832,472 | u693133807 | cpp |
p03017 | #include <iostream>
using namespace std;
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
A--;
B--;
C--;
D--;
string S;
cin >> S;
if (C < D) {
for (int i = A; i <= D; i++) {
if (S[i] == '#' && S[i - 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
} else {
for (int i = A + 1; i <= D; i++) {
if (S[i] == '#' && S[i - 1] == '#') {
cout << "No" << endl;
return 0;
}
}
bool f = false;
for (int i = B + 2; i <= D; i++) {
if (S[i] == '.' && S[i - 1] == '.' && S[i - 2] == '.') {
f = true;
break;
}
}
if (f) {
cout << "Yes" << endl;
return 0;
} else {
cout << "No" << endl;
return 0;
}
}
} | #include <iostream>
using namespace std;
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
A--;
B--;
C--;
D--;
string S;
cin >> S;
if (C < D) {
for (int i = A + 1; i <= D; i++) {
if (S[i] == '#' && S[i - 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
} else {
for (int i = A + 1; i <= D; i++) {
if (S[i] == '#' && S[i - 1] == '#') {
cout << "No" << endl;
return 0;
}
}
bool f = false;
for (int i = B + 1; i <= D + 1; i++) {
if (S[i] == '.' && S[i - 1] == '.' && S[i - 2] == '.') {
f = true;
break;
}
}
if (f) {
cout << "Yes" << endl;
return 0;
} else {
cout << "No" << endl;
return 0;
}
}
} | [
"control_flow.loop.for.initializer.change",
"literal.number.change",
"expression.off_by_one",
"expression.operation.binary.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 832,474 | 832,472 | u693133807 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) (((long long)mod_x) % modulo)
int main() {
long long N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
for (int i = A - 1; i < C - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (int i = B - 1; i < D - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
bool flag = false;
if ((B - A) * (D - C) < 0) {
for (int i = max(A, B) - 2; i < min(C, D); i++) {
if (i < 0)
continue;
if (i + 2 >= N)
continue;
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
flag = true;
}
}
} else
flag = true;
if (flag)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) (((long long)mod_x) % modulo)
int main() {
long long N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
for (int i = A - 1; i < C - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (int i = B - 1; i < D - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
bool flag = false;
if ((B - A) * (D - C) < 0) {
for (int i = max(A, B) - 2; i < min(C, D) - 1; i++) {
if (i < 0)
continue;
if (i + 2 >= N)
continue;
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
flag = true;
}
}
} else
flag = true;
if (flag)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
} | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 832,478 | 832,479 | u118797367 | cpp |
p03017 | #include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <complex>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <cassert>
#include <functional>
typedef long long ll;
using namespace std;
#ifndef LOCAL
#define debug(x) ;
#else
#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;
template <typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &p) {
out << "{" << p.first << ", " << p.second << "}";
return out;
}
template <typename T> ostream &operator<<(ostream &out, const vector<T> &v) {
out << '{';
for (const T &item : v)
out << item << ", ";
out << "\b\b}";
return out;
}
#endif
#define mod 1000000007 // 1e9+7(prime number)
#define INF 1000000000 // 1e9
#define LLINF 2000000000000000000LL // 2e18
#define SIZE 200010
void NG() {
puts("No");
exit(0);
}
bool check1(char *s, int a, int b) {
for (int i = a; i < b; i++) {
if (s[i] == '#' && s[i + 1] == '#')
return false;
}
return true;
}
bool check2(char *s, int a, int b) {
for (int i = a + 1; i < b; i++) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.')
return true;
}
return false;
}
int main() {
int N, A, B, C, D;
char s[SIZE];
scanf("%d%d%d%d%d", &N, &A, &B, &C, &D);
scanf("%s", s);
A--;
B--;
C--;
D--;
if (C < A)
NG();
if (D < B)
NG();
if (A > B) {
swap(A, B);
swap(C, D);
}
if (!check1(s, A + 1, C - 1))
NG();
if (!check1(s, B + 1, D - 1))
NG();
if (A < B && B < C) {
bool ok = false;
if (C < D) {
ok = true;
} else {
ok = check2(s, max(A, B - 1), min(C + 1, D));
}
if (!ok)
NG();
}
puts("Yes");
return 0;
}
| #include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <complex>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <cassert>
#include <functional>
typedef long long ll;
using namespace std;
#ifndef LOCAL
#define debug(x) ;
#else
#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;
template <typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &p) {
out << "{" << p.first << ", " << p.second << "}";
return out;
}
template <typename T> ostream &operator<<(ostream &out, const vector<T> &v) {
out << '{';
for (const T &item : v)
out << item << ", ";
out << "\b\b}";
return out;
}
#endif
#define mod 1000000007 // 1e9+7(prime number)
#define INF 1000000000 // 1e9
#define LLINF 2000000000000000000LL // 2e18
#define SIZE 200010
void NG() {
puts("No");
exit(0);
}
bool check1(char *s, int a, int b) {
for (int i = a; i < b; i++) {
if (s[i] == '#' && s[i + 1] == '#')
return false;
}
return true;
}
bool check2(char *s, int a, int b) {
for (int i = a + 1; i < b; i++) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.')
return true;
}
return false;
}
int main() {
int N, A, B, C, D;
char s[SIZE];
scanf("%d%d%d%d%d", &N, &A, &B, &C, &D);
scanf("%s", s);
A--;
B--;
C--;
D--;
if (C < A)
NG();
if (D < B)
NG();
if (A > B) {
swap(A, B);
swap(C, D);
}
if (!check1(s, A + 1, C - 1))
NG();
if (!check1(s, B + 1, D - 1))
NG();
if (A < B && B < C) {
bool ok = false;
if (C < D) {
ok = true;
} else {
ok = check2(s, max(A, B - 1), min(C, D + 1));
}
if (!ok)
NG();
}
puts("Yes");
return 0;
}
| [
"expression.operation.binary.remove",
"assignment.change"
] | 832,487 | 832,488 | u378419207 | cpp |
p03017 | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string.h>
#include <vector>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) (a).begin(), (a).end()
typedef long long lint;
using namespace std;
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
A--;
B--;
C--;
D--;
string S;
cin >> S;
bool f = true;
FOR(i, A, C) if (S[i] == '#' and S[i + 1] == '#') f = false;
FOR(i, B, D) if (S[i] == '#' and S[i + 1] == '#') f = false;
if (D > C) {
cout << (f ? "Yes" : "No") << endl;
return 0;
}
f = false;
FOR(i, B, C) {
if (S[i - 1] == '.' and S[i] == '.' and S[i + 1] == '.')
f = true;
}
cout << (f ? "Yes" : "No") << endl;
return 0;
}
| #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string.h>
#include <vector>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) (a).begin(), (a).end()
typedef long long lint;
using namespace std;
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
A--;
B--;
C--;
D--;
string S;
cin >> S;
bool f = true;
FOR(i, A, C) if (S[i] == '#' and S[i + 1] == '#') f = false;
FOR(i, B, D) if (S[i] == '#' and S[i + 1] == '#') f = false;
if (D > C) {
cout << (f ? "Yes" : "No") << endl;
return 0;
}
f = false;
FOR(i, B, D + 1) {
if (S[i - 1] == '.' and S[i] == '.' and S[i + 1] == '.')
f = true;
}
cout << (f ? "Yes" : "No") << endl;
return 0;
}
| [
"expression.operation.binary.add"
] | 832,495 | 832,496 | u484460274 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
S = '#' + S + "#";
char mae = '.';
int NG = 0;
for (int i = A + 1; i < C; i++) {
if (mae == '#' && S[i] == '#')
NG = 1;
mae = S[i];
}
mae = '.';
for (int i = B + 1; i < D; i++) {
if (mae == '#' && S[i] == '#')
NG = 1;
mae = S[i];
}
if (C > D) {
int OK = 0;
for (int i = B; i < D; i++) {
if (S[i - 1] == '.' && S[i] == '.' && S[i + 1] == '.')
OK = 1;
}
if (OK == 0)
NG = 1;
}
if (NG)
co("No");
else
co("Yes");
Would you please return 0;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
S = '#' + S + "#";
char mae = '.';
int NG = 0;
for (int i = A + 1; i < C; i++) {
if (mae == '#' && S[i] == '#')
NG = 1;
mae = S[i];
}
mae = '.';
for (int i = B + 1; i < D; i++) {
if (mae == '#' && S[i] == '#')
NG = 1;
mae = S[i];
}
if (C > D) {
int OK = 0;
for (int i = B; i <= D; i++) {
if (S[i - 1] == '.' && S[i] == '.' && S[i + 1] == '.')
OK = 1;
}
if (OK == 0)
NG = 1;
}
if (NG)
co("No");
else
co("Yes");
Would you please return 0;
} | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 832,497 | 832,498 | u096883693 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
S = '#' + S + "#";
char mae = '.';
int NG = 0;
for (int i = A + 1; i < C; i++) {
if (mae == '#' && S[i] == '#')
NG = 1;
mae = S[i];
}
mae = '.';
for (int i = B + 1; i < D; i++) {
if (mae == '#' && S[i] == '#')
NG = 1;
mae = S[i];
}
if (C > D) {
int OK = 0;
for (int i = B + 1; i < D; i++) {
if (S[i - 1] == '.' && S[i] == '.' && S[i + 1] == '.')
OK = 1;
}
if (OK == 0)
NG = 1;
}
if (NG)
co("No");
else
co("Yes");
Would you please return 0;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
S = '#' + S + "#";
char mae = '.';
int NG = 0;
for (int i = A + 1; i < C; i++) {
if (mae == '#' && S[i] == '#')
NG = 1;
mae = S[i];
}
mae = '.';
for (int i = B + 1; i < D; i++) {
if (mae == '#' && S[i] == '#')
NG = 1;
mae = S[i];
}
if (C > D) {
int OK = 0;
for (int i = B; i <= D; i++) {
if (S[i - 1] == '.' && S[i] == '.' && S[i + 1] == '.')
OK = 1;
}
if (OK == 0)
NG = 1;
}
if (NG)
co("No");
else
co("Yes");
Would you please return 0;
} | [
"control_flow.loop.for.initializer.change",
"expression.operation.binary.remove",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 832,499 | 832,498 | u096883693 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> i_i;
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
// const ll mod = 1000000007;
int n, a, b, c, d;
string s;
signed main() {
cin >> n >> a >> b >> c >> d >> s;
a--;
b--;
c--;
d--; // 添字化
bool can = true;
for (int i = a; i < c; i++) {
if (s[i] == '#' && s[i + 1] == '#')
can = false;
}
for (int i = b; i < d; i++) {
if (s[i] == '#' && s[i + 1] == '#')
can = false;
}
if (d < c) {
can = false;
for (int i = b - 1; i <= d - 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 1] == '.')
can = true;
}
}
if (can)
cout << "Yes" << endl;
else
cout << "No" << endl;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> i_i;
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
// const ll mod = 1000000007;
int n, a, b, c, d;
string s;
signed main() {
cin >> n >> a >> b >> c >> d >> s;
a--;
b--;
c--;
d--; // 添字化
bool can = true;
for (int i = a; i < c; i++) {
if (s[i] == '#' && s[i + 1] == '#')
can = false;
}
for (int i = b; i < d; i++) {
if (s[i] == '#' && s[i + 1] == '#')
can = false;
}
if (d < c) {
can = false;
for (int i = b - 1; i <= d - 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
can = true;
}
}
}
if (can)
cout << "Yes" << endl;
else
cout << "No" << endl;
} | [
"literal.number.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change"
] | 832,500 | 832,501 | u684255050 | cpp |
p03017 | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using std::cerr;
using std::cin;
using std::cout;
using std::endl;
int main(void) {
cout << std::fixed << std::setprecision(10);
cin.tie(0);
std::ios::sync_with_stdio(false);
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
std::string s;
cin >> s;
s = "." + s;
if (c < d) {
for (int i = a; i < d; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
} else {
for (int i = a; i < d; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (int i = a; i <= d - 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
}
return 0;
}
| #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using std::cerr;
using std::cin;
using std::cout;
using std::endl;
int main(void) {
cout << std::fixed << std::setprecision(10);
cin.tie(0);
std::ios::sync_with_stdio(false);
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
std::string s;
cin >> s;
s = "." + s;
if (c < d) {
for (int i = a; i < d; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
} else {
for (int i = a; i < d; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (int i = b - 1; i <= d - 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
}
return 0;
}
| [
"control_flow.loop.for.initializer.change"
] | 832,505 | 832,506 | u844133200 | cpp |
p03017 | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <sys/time.h>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>
using namespace std;
void solve(long long N, long long A, long long B, long long C, long long D,
string S) {
A--;
B--;
C--;
D--;
if (D > C) {
for (int i = A; i < C; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
std::cout << "No" << std::endl;
return;
}
}
for (int i = B; i < D; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
std::cout << "No" << std::endl;
return;
}
}
std::cout << "Yes" << std::endl;
return;
} else {
bool flag = false;
for (int i = A; i < C; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
std::cout << "No" << std::endl;
return;
}
}
for (int i = B; i < D; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
std::cout << "No" << std::endl;
return;
}
}
for (int i = B; i < D; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
flag = true;
}
}
if (flag) {
std::cout << "Yes" << std::endl;
return;
} else {
std::cout << "No" << std::endl;
return;
}
}
}
int main() {
long long B;
string S;
long long C;
long long D;
long long A;
long long N;
scanf("%lld", &N);
scanf("%lld", &A);
scanf("%lld", &B);
scanf("%lld", &C);
scanf("%lld", &D);
cin >> S;
solve(N, A, B, C, D, S);
return 0;
}
| #include <algorithm>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <sys/time.h>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>
using namespace std;
void solve(long long N, long long A, long long B, long long C, long long D,
string S) {
A--;
B--;
C--;
D--;
if (D > C) {
for (int i = A; i < C; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
std::cout << "No" << std::endl;
return;
}
}
for (int i = B; i < D; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
std::cout << "No" << std::endl;
return;
}
}
std::cout << "Yes" << std::endl;
return;
} else {
bool flag = false;
for (int i = A; i < C; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
std::cout << "No" << std::endl;
return;
}
}
for (int i = B; i < D; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
std::cout << "No" << std::endl;
return;
}
}
for (int i = B - 1; i < D; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
flag = true;
}
}
if (flag) {
std::cout << "Yes" << std::endl;
return;
} else {
std::cout << "No" << std::endl;
return;
}
}
}
int main() {
long long B;
string S;
long long C;
long long D;
long long A;
long long N;
scanf("%lld", &N);
scanf("%lld", &A);
scanf("%lld", &B);
scanf("%lld", &C);
scanf("%lld", &D);
cin >> S;
solve(N, A, B, C, D, S);
return 0;
}
| [
"control_flow.loop.for.initializer.change"
] | 832,509 | 832,510 | u462434199 | cpp |
p03017 | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <sys/time.h>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>
using namespace std;
void solve(long long N, long long A, long long B, long long C, long long D,
string S) {
A--;
B--;
C--;
D--;
if (D > C) {
for (int i = A; i < C; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
std::cout << "No" << std::endl;
return;
}
}
for (int i = B; i < D; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
std::cout << "No" << std::endl;
return;
}
}
std::cout << "Yes" << std::endl;
return;
} else {
bool flag = false;
for (int i = A; i < C; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
std::cout << "No" << std::endl;
return;
}
}
for (int i = B; i < D; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
std::cout << "No" << std::endl;
return;
}
}
for (int i = B; i < D - 1; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
flag = true;
}
}
if (flag) {
std::cout << "Yes" << std::endl;
return;
} else {
std::cout << "No" << std::endl;
return;
}
}
}
int main() {
long long B;
string S;
long long C;
long long D;
long long A;
long long N;
scanf("%lld", &N);
scanf("%lld", &A);
scanf("%lld", &B);
scanf("%lld", &C);
scanf("%lld", &D);
cin >> S;
solve(N, A, B, C, D, S);
return 0;
}
| #include <algorithm>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <sys/time.h>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>
using namespace std;
void solve(long long N, long long A, long long B, long long C, long long D,
string S) {
A--;
B--;
C--;
D--;
if (D > C) {
for (int i = A; i < C; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
std::cout << "No" << std::endl;
return;
}
}
for (int i = B; i < D; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
std::cout << "No" << std::endl;
return;
}
}
std::cout << "Yes" << std::endl;
return;
} else {
bool flag = false;
for (int i = A; i < C; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
std::cout << "No" << std::endl;
return;
}
}
for (int i = B; i < D; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
std::cout << "No" << std::endl;
return;
}
}
for (int i = B - 1; i < D; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
flag = true;
}
}
if (flag) {
std::cout << "Yes" << std::endl;
return;
} else {
std::cout << "No" << std::endl;
return;
}
}
}
int main() {
long long B;
string S;
long long C;
long long D;
long long A;
long long N;
scanf("%lld", &N);
scanf("%lld", &A);
scanf("%lld", &B);
scanf("%lld", &C);
scanf("%lld", &D);
cin >> S;
solve(N, A, B, C, D, S);
return 0;
}
| [
"control_flow.loop.for.initializer.change",
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove"
] | 832,511 | 832,510 | u462434199 | cpp |
p03017 | #include <bits/stdc++.h>
#define int long long
#define rep(i, n) REP(i, 0, n)
#define REP(i, l, r) for (long long i = l; i < r; i++)
using namespace std;
typedef pair<int, int> P;
struct edge {
int to, cost;
};
class dijkstra {
int V;
int d[100002];
priority_queue<P, vector<P>, greater<P>> que;
void update(int s, vector<edge> G[]) {
fill(d, d + V + 1, 100000000000ll);
d[s] = 0;
que.push(make_pair(0, s));
while (!que.empty()) {
P p = que.top();
que.pop();
int v = p.second;
if (d[v] < p.first)
continue;
rep(i, G[v].size()) {
edge e = G[v][i];
if (d[e.to] > d[v] + e.cost) {
d[e.to] = d[v] + e.cost;
que.push(make_pair(d[e.to], e.to));
}
}
}
}
public:
dijkstra(int v, int s, vector<edge> G[]) {
V = v;
update(s, G);
}
int find(int e) { return d[e]; }
};
int gcd(int a, int b) {
if (a % b == 0)
return b;
else
return gcd(b, a % b);
}
int lcm(int a, int b) { return a * b / gcd(a, b); }
bool prime(int a) {
if (a == 1)
return false;
for (int i = 2; i * i <= a; i++) {
if (a % i == 0)
return false;
}
return true;
}
class Union_Find {
private:
vector<int> t, s;
public:
Union_Find(int max_length) {
rep(i, max_length + 1) {
t.push_back(i);
s.push_back(1);
}
}
void Union(int x, int y) {
if (same(x, y))
return;
int tx = Find(x), ty = Find(y);
if (s[tx] < s[ty]) {
s[ty] += s[tx];
t[tx] = ty;
} else if (s[tx] > s[ty]) {
s[tx] += s[ty];
t[ty] = tx;
} else if (tx > ty) {
t[tx] = ty;
s[ty] += s[tx];
} else {
t[ty] = tx;
s[tx] += s[ty];
}
}
int Find(int n) {
if (t[n] == n)
return n;
else
return t[n] = Find(t[n]);
}
bool same(int x, int y) { return Find(x) == Find(y); }
int get_Size(int a) { return s[a]; }
};
signed main() {
int n, a, b, c, d;
string s;
cin >> n >> a >> b >> c >> d >> s;
bool bo = false, boo = false;
REP(i, 2, s.size()) {
if (((a < i && i < c) || (b < i && i < d)) && s[i] == '#' &&
s[i - 1] == '#')
boo = true;
if (d >= i && a < i && b < i && s[i] == '.' && s[i - 1] == '.' &&
s[i - 2] == '.')
bo = true;
}
if ((bo == false && d < c) || boo)
cout << "No" << endl;
else
cout << "Yes" << endl;
}
| #include <bits/stdc++.h>
#define int long long
#define rep(i, n) REP(i, 0, n)
#define REP(i, l, r) for (long long i = l; i < r; i++)
using namespace std;
typedef pair<int, int> P;
struct edge {
int to, cost;
};
class dijkstra {
int V;
int d[100002];
priority_queue<P, vector<P>, greater<P>> que;
void update(int s, vector<edge> G[]) {
fill(d, d + V + 1, 100000000000ll);
d[s] = 0;
que.push(make_pair(0, s));
while (!que.empty()) {
P p = que.top();
que.pop();
int v = p.second;
if (d[v] < p.first)
continue;
rep(i, G[v].size()) {
edge e = G[v][i];
if (d[e.to] > d[v] + e.cost) {
d[e.to] = d[v] + e.cost;
que.push(make_pair(d[e.to], e.to));
}
}
}
}
public:
dijkstra(int v, int s, vector<edge> G[]) {
V = v;
update(s, G);
}
int find(int e) { return d[e]; }
};
int gcd(int a, int b) {
if (a % b == 0)
return b;
else
return gcd(b, a % b);
}
int lcm(int a, int b) { return a * b / gcd(a, b); }
bool prime(int a) {
if (a == 1)
return false;
for (int i = 2; i * i <= a; i++) {
if (a % i == 0)
return false;
}
return true;
}
class Union_Find {
private:
vector<int> t, s;
public:
Union_Find(int max_length) {
rep(i, max_length + 1) {
t.push_back(i);
s.push_back(1);
}
}
void Union(int x, int y) {
if (same(x, y))
return;
int tx = Find(x), ty = Find(y);
if (s[tx] < s[ty]) {
s[ty] += s[tx];
t[tx] = ty;
} else if (s[tx] > s[ty]) {
s[tx] += s[ty];
t[ty] = tx;
} else if (tx > ty) {
t[tx] = ty;
s[ty] += s[tx];
} else {
t[ty] = tx;
s[tx] += s[ty];
}
}
int Find(int n) {
if (t[n] == n)
return n;
else
return t[n] = Find(t[n]);
}
bool same(int x, int y) { return Find(x) == Find(y); }
int get_Size(int a) { return s[a]; }
};
signed main() {
int n, a, b, c, d;
string s;
cin >> n >> a >> b >> c >> d >> s;
bool bo = false, boo = false;
REP(i, 2, s.size()) {
if (((a < i && i < c) || (b < i && i < d)) && s[i] == '#' &&
s[i - 1] == '#')
boo = true;
if (d >= i && a <= i && b <= i && s[i] == '.' && s[i - 1] == '.' &&
s[i - 2] == '.')
bo = true;
}
if ((bo == false && d < c) || boo)
cout << "No" << endl;
else
cout << "Yes" << endl;
}
| [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 832,518 | 832,519 | u073057072 | cpp |
p03017 | #include <bits/stdc++.h>
#define int long long
#define rep(i, n) REP(i, 0, n)
#define REP(i, l, r) for (long long i = l; i < r; i++)
using namespace std;
typedef pair<int, int> P;
struct edge {
int to, cost;
};
class dijkstra {
int V;
int d[100002];
priority_queue<P, vector<P>, greater<P>> que;
void update(int s, vector<edge> G[]) {
fill(d, d + V + 1, 100000000000ll);
d[s] = 0;
que.push(make_pair(0, s));
while (!que.empty()) {
P p = que.top();
que.pop();
int v = p.second;
if (d[v] < p.first)
continue;
rep(i, G[v].size()) {
edge e = G[v][i];
if (d[e.to] > d[v] + e.cost) {
d[e.to] = d[v] + e.cost;
que.push(make_pair(d[e.to], e.to));
}
}
}
}
public:
dijkstra(int v, int s, vector<edge> G[]) {
V = v;
update(s, G);
}
int find(int e) { return d[e]; }
};
int gcd(int a, int b) {
if (a % b == 0)
return b;
else
return gcd(b, a % b);
}
int lcm(int a, int b) { return a * b / gcd(a, b); }
bool prime(int a) {
if (a == 1)
return false;
for (int i = 2; i * i <= a; i++) {
if (a % i == 0)
return false;
}
return true;
}
class Union_Find {
private:
vector<int> t, s;
public:
Union_Find(int max_length) {
rep(i, max_length + 1) {
t.push_back(i);
s.push_back(1);
}
}
void Union(int x, int y) {
if (same(x, y))
return;
int tx = Find(x), ty = Find(y);
if (s[tx] < s[ty]) {
s[ty] += s[tx];
t[tx] = ty;
} else if (s[tx] > s[ty]) {
s[tx] += s[ty];
t[ty] = tx;
} else if (tx > ty) {
t[tx] = ty;
s[ty] += s[tx];
} else {
t[ty] = tx;
s[tx] += s[ty];
}
}
int Find(int n) {
if (t[n] == n)
return n;
else
return t[n] = Find(t[n]);
}
bool same(int x, int y) { return Find(x) == Find(y); }
int get_Size(int a) { return s[a]; }
};
signed main() {
int n, a, b, c, d;
string s;
cin >> n >> a >> b >> c >> d >> s;
bool bo = false, boo = false;
REP(i, 2, s.size()) {
if (((a < i && i < c) || (b < i && i < d)) && s[i] == '#' &&
s[i - 1] == '#')
boo = true;
if (d > i && a < i && b < i && s[i] == '.' && s[i - 1] == '.' &&
s[i - 2] == '.')
bo = true;
}
if ((bo == false && d < c) || boo)
cout << "No" << endl;
else
cout << "Yes" << endl;
}
| #include <bits/stdc++.h>
#define int long long
#define rep(i, n) REP(i, 0, n)
#define REP(i, l, r) for (long long i = l; i < r; i++)
using namespace std;
typedef pair<int, int> P;
struct edge {
int to, cost;
};
class dijkstra {
int V;
int d[100002];
priority_queue<P, vector<P>, greater<P>> que;
void update(int s, vector<edge> G[]) {
fill(d, d + V + 1, 100000000000ll);
d[s] = 0;
que.push(make_pair(0, s));
while (!que.empty()) {
P p = que.top();
que.pop();
int v = p.second;
if (d[v] < p.first)
continue;
rep(i, G[v].size()) {
edge e = G[v][i];
if (d[e.to] > d[v] + e.cost) {
d[e.to] = d[v] + e.cost;
que.push(make_pair(d[e.to], e.to));
}
}
}
}
public:
dijkstra(int v, int s, vector<edge> G[]) {
V = v;
update(s, G);
}
int find(int e) { return d[e]; }
};
int gcd(int a, int b) {
if (a % b == 0)
return b;
else
return gcd(b, a % b);
}
int lcm(int a, int b) { return a * b / gcd(a, b); }
bool prime(int a) {
if (a == 1)
return false;
for (int i = 2; i * i <= a; i++) {
if (a % i == 0)
return false;
}
return true;
}
class Union_Find {
private:
vector<int> t, s;
public:
Union_Find(int max_length) {
rep(i, max_length + 1) {
t.push_back(i);
s.push_back(1);
}
}
void Union(int x, int y) {
if (same(x, y))
return;
int tx = Find(x), ty = Find(y);
if (s[tx] < s[ty]) {
s[ty] += s[tx];
t[tx] = ty;
} else if (s[tx] > s[ty]) {
s[tx] += s[ty];
t[ty] = tx;
} else if (tx > ty) {
t[tx] = ty;
s[ty] += s[tx];
} else {
t[ty] = tx;
s[tx] += s[ty];
}
}
int Find(int n) {
if (t[n] == n)
return n;
else
return t[n] = Find(t[n]);
}
bool same(int x, int y) { return Find(x) == Find(y); }
int get_Size(int a) { return s[a]; }
};
signed main() {
int n, a, b, c, d;
string s;
cin >> n >> a >> b >> c >> d >> s;
bool bo = false, boo = false;
REP(i, 2, s.size()) {
if (((a < i && i < c) || (b < i && i < d)) && s[i] == '#' &&
s[i - 1] == '#')
boo = true;
if (d >= i && a <= i && b <= i && s[i] == '.' && s[i - 1] == '.' &&
s[i - 2] == '.')
bo = true;
}
if ((bo == false && d < c) || boo)
cout << "No" << endl;
else
cout << "Yes" << endl;
}
| [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 832,520 | 832,519 | u073057072 | cpp |
p03017 | #include <cstdio>
#include <iostream>
using namespace std;
const int maxn = 222222;
char ss[maxn];
int N, A, B, C, D;
bool check1(int x, int y) {
for (int i = x + 2; i < y; ++i)
if (ss[i] == '#' && ss[i - 1] == '#')
return false;
return true;
}
bool check2(int x, int y) {
for (int i = x + 1; i < y; ++i)
if (ss[i] == '.' && ss[i - 1] == '.' && ss[i + 1] == '.')
return true;
return false;
}
int main() {
scanf("%d%d%d%d%d", &N, &A, &B, &C, &D);
scanf("%s", ss + 1);
if (C < D) {
if (check1(A, C) && check1(B, D))
puts("Yes");
else
puts("No");
} else {
if (check1(B, D) && check2(B, D) && check1(A, B) && check1(D, C))
puts("Yes");
else
puts("No");
}
return 0;
} | #include <cstdio>
#include <iostream>
using namespace std;
const int maxn = 222222;
char ss[maxn];
int N, A, B, C, D;
bool check1(int x, int y) {
for (int i = x + 2; i < y; ++i)
if (ss[i] == '#' && ss[i - 1] == '#')
return false;
return true;
}
bool check2(int x, int y) {
for (int i = x; i <= y; ++i)
if (ss[i] == '.' && ss[i - 1] == '.' && ss[i + 1] == '.')
return true;
return false;
}
int main() {
scanf("%d%d%d%d%d", &N, &A, &B, &C, &D);
scanf("%s", ss + 1);
if (C < D) {
if (check1(A, C) && check1(B, D))
puts("Yes");
else
puts("No");
} else {
if (check1(B, D) && check2(B, D) && check1(A, B) && check1(D, C))
puts("Yes");
else
puts("No");
}
return 0;
} | [
"control_flow.loop.for.initializer.change",
"expression.operation.binary.remove",
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 832,521 | 832,522 | u136503093 | cpp |
p03017 | #include <bits/stdc++.h>
#define LL long long
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPA(i, n) for (int i = 1; i < (n); ++i)
#define PII pair<int, int>
#define PLI pair<long long, int>
#define PLL pair<long long, long long>
#define MOD ((int)1e6 + 3)
#define INF ((int)1e9)
#define INFLL ((LL)1e18)
#define ALL(x) (x).begin(), (x).end()
#define ctoi(x) (x - 'a')
#define CTOI(x) (x - 'A')
#define BIT(x) (1 << (x))
using namespace std;
LL modinv(LL a) {
LL b = MOD, u = 1, v = 0;
while (b) {
LL t = a / b;
a -= t * b;
swap(a, b);
u -= t * v;
swap(u, v);
}
u %= MOD;
if (u < 0)
u += MOD;
return u;
}
int exp(int a, int b) {
LL res = 1;
LL sum = a;
for (int i = 0; i < 30; ++i) {
if (BIT(i) & b) {
res = (res * sum) % MOD;
}
sum = (sum * sum) % MOD;
}
return res;
}
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string str;
cin >> str;
str = " " + str;
bool flag = true;
if (C < D) {
int count = 0;
for (int i = B; i < D; ++i) {
if (str[i] == '#') {
++count;
if (count == 2) {
flag = false;
break;
}
} else {
count = 0;
}
}
count = 0;
for (int i = A; i < C; ++i) {
if (str[i] == '#') {
++count;
if (count == 2) {
flag = false;
break;
}
} else {
count = 0;
}
}
} else {
bool nf = false;
int count = 0;
for (int i = B; i <= C; ++i) {
if (str[i] == '#') {
++count;
if (count == 2) {
flag = false;
break;
}
} else {
count = 0;
if (str[i - 1] == '.' && str[i + 1] == '.') {
nf = true;
}
}
}
count = 0;
for (int i = A; i < D; ++i) {
if (str[i] == '#') {
++count;
if (count == 2) {
flag = false;
break;
}
} else {
count = 0;
}
}
if (!nf) {
flag = false;
}
}
cout << (flag ? "Yes" : "No") << endl;
return 0;
}
| #include <bits/stdc++.h>
#define LL long long
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPA(i, n) for (int i = 1; i < (n); ++i)
#define PII pair<int, int>
#define PLI pair<long long, int>
#define PLL pair<long long, long long>
#define MOD ((int)1e6 + 3)
#define INF ((int)1e9)
#define INFLL ((LL)1e18)
#define ALL(x) (x).begin(), (x).end()
#define ctoi(x) (x - 'a')
#define CTOI(x) (x - 'A')
#define BIT(x) (1 << (x))
using namespace std;
LL modinv(LL a) {
LL b = MOD, u = 1, v = 0;
while (b) {
LL t = a / b;
a -= t * b;
swap(a, b);
u -= t * v;
swap(u, v);
}
u %= MOD;
if (u < 0)
u += MOD;
return u;
}
int exp(int a, int b) {
LL res = 1;
LL sum = a;
for (int i = 0; i < 30; ++i) {
if (BIT(i) & b) {
res = (res * sum) % MOD;
}
sum = (sum * sum) % MOD;
}
return res;
}
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string str;
cin >> str;
str = " " + str;
bool flag = true;
if (C < D) {
int count = 0;
for (int i = B; i < D; ++i) {
if (str[i] == '#') {
++count;
if (count == 2) {
flag = false;
break;
}
} else {
count = 0;
}
}
count = 0;
for (int i = A; i < C; ++i) {
if (str[i] == '#') {
++count;
if (count == 2) {
flag = false;
break;
}
} else {
count = 0;
}
}
} else {
bool nf = false;
int count = 0;
for (int i = B; i <= D; ++i) {
if (str[i] == '#') {
++count;
if (count == 2) {
flag = false;
break;
}
} else {
count = 0;
if (str[i - 1] == '.' && str[i + 1] == '.') {
nf = true;
}
}
}
count = 0;
for (int i = A; i < C; ++i) {
if (str[i] == '#') {
++count;
if (count == 2) {
flag = false;
break;
}
} else {
count = 0;
}
}
if (!nf) {
flag = false;
}
}
cout << (flag ? "Yes" : "No") << endl;
return 0;
}
| [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 832,529 | 832,530 | u493610446 | cpp |
p03017 | /*
_ _ _ _ _ _ _
_ _ _ _
/ /\ / /\ / /\ / /\ /
/\ /\ \ /\_\/\_\ _ /\ \ /\ \ _ /\ \
/ / \ / / \ / / \ / / / / / / \ \ \ / / /
/ //\_\ \ \ \ / \ \ /\_\ / \ \
/ / /\ \__ / / /\ \ / / /\ \__ / /_/ / / / /\ \_\ /\ \/
\ \/ / / /\ \_\ / /\ \ \_/ / // /\ \_\ / / /\ \___\ / / /\ \ \ / /
/\ \___\ / /\ \__/ / / / /\/_/ / \____\__/ / / /\/_/ / / /\ \___/ // /
/\/_/ \ \ \ \/___// / / \ \ \ \ \ \ \/___// /\ \___\/ / / / / /
/\/________/ / / / / / / \/____// / / ______
\ \ \ / / /___/ /\ \ \ \ \ / / /\/___/ / / / / / /
/\/_// / / / / / / / / / / // / / /\_____\ _ \ \ \ / / /_____/ /\ \
_ \ \ \ / / / / / / / / / / / / / / / / / / / / / / / // /
/ \/____ /
/_/\__/ / / / /_________/\ \ \ /_/\__/ / / / / / / / /___/ / /__ / / / /
/ /___/ / /__ / / / / / // / /_____/ / / \ \/___/ / / / /_ __\ \_\\ \/___/
/ / / / / / //\__\/_/___\\/_/ / / //\__\/_/___\/ / / / / // / /______\/
/
\_____\/ \_\___\ /____/_/ \_____\/ \/_/ \/_/ \/_________/ \/_/
\/_________/\/_/ \/_/ \/___________/
*/
#include <bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define endl '\n'
#define pb push_back
#define mkp make_pair
#define p_q priority_queue
#define INF 2000000000
#define PI 3.1415926
#define coutdb cout << fixed << setprecision(10)
const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
const int dx_8[] = {1, 1, 0, -1, -1, -1, 0, 1},
dy_8[] = {0, -1, -1, -1, 0, 1, 1, 1};
const long long MOD = 1e9 + 7;
// typedef long long ll;
#define int long long
template <typename T> inline T GCD(T a, T b) {
T c;
while (b != 0) {
c = a % b;
a = b;
b = c;
}
return a;
}
template <typename T> inline T LCM(T a, T b) {
T c = GCD(a, b);
a /= c;
return a * b;
}
template <typename T> inline T nCr(T a, T b) {
T i, r = 1;
for (i = 1; i <= b; i++) {
r *= (a + 1 - i);
r /= i;
}
return r;
}
template <typename T> inline T nHr(T a, T b) { return nCr(a + b - 1, b); }
signed main(void) {
cin.tie(0);
ios::sync_with_stdio(false);
int N, A, B, C, D;
string S;
cin >> N >> A >> B >> C >> D >> S;
for (int i = A - 1; i < max(C, D) - 1; i++) {
if (S[i] == '#' and S[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
if (C < D)
cout << "Yes" << endl;
else {
for (int i = B - 2; i < D - 2; i++) {
if (S[i] == '.' and S[i + 1] == '.' and S[i + 2] == '.') {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
}
} | /*
_ _ _ _ _ _ _
_ _ _ _
/ /\ / /\ / /\ / /\ /
/\ /\ \ /\_\/\_\ _ /\ \ /\ \ _ /\ \
/ / \ / / \ / / \ / / / / / / \ \ \ / / /
/ //\_\ \ \ \ / \ \ /\_\ / \ \
/ / /\ \__ / / /\ \ / / /\ \__ / /_/ / / / /\ \_\ /\ \/
\ \/ / / /\ \_\ / /\ \ \_/ / // /\ \_\ / / /\ \___\ / / /\ \ \ / /
/\ \___\ / /\ \__/ / / / /\/_/ / \____\__/ / / /\/_/ / / /\ \___/ // /
/\/_/ \ \ \ \/___// / / \ \ \ \ \ \ \/___// /\ \___\/ / / / / /
/\/________/ / / / / / / \/____// / / ______
\ \ \ / / /___/ /\ \ \ \ \ / / /\/___/ / / / / / /
/\/_// / / / / / / / / / / // / / /\_____\ _ \ \ \ / / /_____/ /\ \
_ \ \ \ / / / / / / / / / / / / / / / / / / / / / / / // /
/ \/____ /
/_/\__/ / / / /_________/\ \ \ /_/\__/ / / / / / / / /___/ / /__ / / / /
/ /___/ / /__ / / / / / // / /_____/ / / \ \/___/ / / / /_ __\ \_\\ \/___/
/ / / / / / //\__\/_/___\\/_/ / / //\__\/_/___\/ / / / / // / /______\/
/
\_____\/ \_\___\ /____/_/ \_____\/ \/_/ \/_/ \/_________/ \/_/
\/_________/\/_/ \/_/ \/___________/
*/
#include <bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define endl '\n'
#define pb push_back
#define mkp make_pair
#define p_q priority_queue
#define INF 2000000000
#define PI 3.1415926
#define coutdb cout << fixed << setprecision(10)
const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
const int dx_8[] = {1, 1, 0, -1, -1, -1, 0, 1},
dy_8[] = {0, -1, -1, -1, 0, 1, 1, 1};
const long long MOD = 1e9 + 7;
// typedef long long ll;
#define int long long
template <typename T> inline T GCD(T a, T b) {
T c;
while (b != 0) {
c = a % b;
a = b;
b = c;
}
return a;
}
template <typename T> inline T LCM(T a, T b) {
T c = GCD(a, b);
a /= c;
return a * b;
}
template <typename T> inline T nCr(T a, T b) {
T i, r = 1;
for (i = 1; i <= b; i++) {
r *= (a + 1 - i);
r /= i;
}
return r;
}
template <typename T> inline T nHr(T a, T b) { return nCr(a + b - 1, b); }
signed main(void) {
cin.tie(0);
ios::sync_with_stdio(false);
int N, A, B, C, D;
string S;
cin >> N >> A >> B >> C >> D >> S;
for (int i = A - 1; i < max(C, D) - 1; i++) {
if (S[i] == '#' and S[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
if (C < D)
cout << "Yes" << endl;
else {
for (int i = B - 2; i < D - 1; i++) {
if (S[i] == '.' and S[i + 1] == '.' and S[i + 2] == '.') {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
}
} | [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 832,531 | 832,532 | u748069390 | cpp |
p03017 | /*
_ _ _ _ _ _ _
_ _ _ _
/ /\ / /\ / /\ / /\ /
/\ /\ \ /\_\/\_\ _ /\ \ /\ \ _ /\ \
/ / \ / / \ / / \ / / / / / / \ \ \ / / /
/ //\_\ \ \ \ / \ \ /\_\ / \ \
/ / /\ \__ / / /\ \ / / /\ \__ / /_/ / / / /\ \_\ /\ \/
\ \/ / / /\ \_\ / /\ \ \_/ / // /\ \_\ / / /\ \___\ / / /\ \ \ / /
/\ \___\ / /\ \__/ / / / /\/_/ / \____\__/ / / /\/_/ / / /\ \___/ // /
/\/_/ \ \ \ \/___// / / \ \ \ \ \ \ \/___// /\ \___\/ / / / / /
/\/________/ / / / / / / \/____// / / ______
\ \ \ / / /___/ /\ \ \ \ \ / / /\/___/ / / / / / /
/\/_// / / / / / / / / / / // / / /\_____\ _ \ \ \ / / /_____/ /\ \
_ \ \ \ / / / / / / / / / / / / / / / / / / / / / / / // /
/ \/____ /
/_/\__/ / / / /_________/\ \ \ /_/\__/ / / / / / / / /___/ / /__ / / / /
/ /___/ / /__ / / / / / // / /_____/ / / \ \/___/ / / / /_ __\ \_\\ \/___/
/ / / / / / //\__\/_/___\\/_/ / / //\__\/_/___\/ / / / / // / /______\/
/
\_____\/ \_\___\ /____/_/ \_____\/ \/_/ \/_/ \/_________/ \/_/
\/_________/\/_/ \/_/ \/___________/
*/
#include <bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define endl '\n'
#define pb push_back
#define mkp make_pair
#define p_q priority_queue
#define INF 2000000000
#define PI 3.1415926
#define coutdb cout << fixed << setprecision(10)
const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
const int dx_8[] = {1, 1, 0, -1, -1, -1, 0, 1},
dy_8[] = {0, -1, -1, -1, 0, 1, 1, 1};
const long long MOD = 1e9 + 7;
// typedef long long ll;
#define int long long
template <typename T> inline T GCD(T a, T b) {
T c;
while (b != 0) {
c = a % b;
a = b;
b = c;
}
return a;
}
template <typename T> inline T LCM(T a, T b) {
T c = GCD(a, b);
a /= c;
return a * b;
}
template <typename T> inline T nCr(T a, T b) {
T i, r = 1;
for (i = 1; i <= b; i++) {
r *= (a + 1 - i);
r /= i;
}
return r;
}
template <typename T> inline T nHr(T a, T b) { return nCr(a + b - 1, b); }
signed main(void) {
cin.tie(0);
ios::sync_with_stdio(false);
int N, A, B, C, D;
string S;
cin >> N >> A >> B >> C >> D >> S;
for (int i = A - 1; i < max(C, D) - 1; i++) {
if (S[i] == '#' and S[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
if (C < D)
cout << "Yes" << endl;
else {
for (int i = B - 1; i < D - 2; i++) {
if (S[i] == '.' and S[i + 1] == '.' and S[i + 2] == '.') {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
}
} | /*
_ _ _ _ _ _ _
_ _ _ _
/ /\ / /\ / /\ / /\ /
/\ /\ \ /\_\/\_\ _ /\ \ /\ \ _ /\ \
/ / \ / / \ / / \ / / / / / / \ \ \ / / /
/ //\_\ \ \ \ / \ \ /\_\ / \ \
/ / /\ \__ / / /\ \ / / /\ \__ / /_/ / / / /\ \_\ /\ \/
\ \/ / / /\ \_\ / /\ \ \_/ / // /\ \_\ / / /\ \___\ / / /\ \ \ / /
/\ \___\ / /\ \__/ / / / /\/_/ / \____\__/ / / /\/_/ / / /\ \___/ // /
/\/_/ \ \ \ \/___// / / \ \ \ \ \ \ \/___// /\ \___\/ / / / / /
/\/________/ / / / / / / \/____// / / ______
\ \ \ / / /___/ /\ \ \ \ \ / / /\/___/ / / / / / /
/\/_// / / / / / / / / / / // / / /\_____\ _ \ \ \ / / /_____/ /\ \
_ \ \ \ / / / / / / / / / / / / / / / / / / / / / / / // /
/ \/____ /
/_/\__/ / / / /_________/\ \ \ /_/\__/ / / / / / / / /___/ / /__ / / / /
/ /___/ / /__ / / / / / // / /_____/ / / \ \/___/ / / / /_ __\ \_\\ \/___/
/ / / / / / //\__\/_/___\\/_/ / / //\__\/_/___\/ / / / / // / /______\/
/
\_____\/ \_\___\ /____/_/ \_____\/ \/_/ \/_/ \/_________/ \/_/
\/_________/\/_/ \/_/ \/___________/
*/
#include <bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define endl '\n'
#define pb push_back
#define mkp make_pair
#define p_q priority_queue
#define INF 2000000000
#define PI 3.1415926
#define coutdb cout << fixed << setprecision(10)
const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
const int dx_8[] = {1, 1, 0, -1, -1, -1, 0, 1},
dy_8[] = {0, -1, -1, -1, 0, 1, 1, 1};
const long long MOD = 1e9 + 7;
// typedef long long ll;
#define int long long
template <typename T> inline T GCD(T a, T b) {
T c;
while (b != 0) {
c = a % b;
a = b;
b = c;
}
return a;
}
template <typename T> inline T LCM(T a, T b) {
T c = GCD(a, b);
a /= c;
return a * b;
}
template <typename T> inline T nCr(T a, T b) {
T i, r = 1;
for (i = 1; i <= b; i++) {
r *= (a + 1 - i);
r /= i;
}
return r;
}
template <typename T> inline T nHr(T a, T b) { return nCr(a + b - 1, b); }
signed main(void) {
cin.tie(0);
ios::sync_with_stdio(false);
int N, A, B, C, D;
string S;
cin >> N >> A >> B >> C >> D >> S;
for (int i = A - 1; i < max(C, D) - 1; i++) {
if (S[i] == '#' and S[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
if (C < D)
cout << "Yes" << endl;
else {
for (int i = B - 2; i < D - 1; i++) {
if (S[i] == '.' and S[i + 1] == '.' and S[i + 2] == '.') {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
}
} | [
"literal.number.change",
"control_flow.loop.for.initializer.change",
"expression.off_by_one",
"expression.operation.binary.change",
"control_flow.branch.if.condition.change"
] | 832,533 | 832,532 | u748069390 | cpp |
p03017 | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define REP(i, n) for (ll i = 0; i < n; i++)
#define REPR(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define FORR(i, m, n) for (ll i = m; i >= n; i--)
#define REPO(i, n) for (ll i = 1; i <= n; i++)
#define ll long long
#define INF (ll)1 << 60
#define MINF (-1 * INF)
#define ALL(n) n.begin(), n.end()
#define MOD (ll)1000000007
#define P pair<ll, ll>
ll n, a, b, c, d;
string s;
int main() {
cin >> n >> a >> b >> c >> d;
a--;
b--;
c--;
d--;
cin >> s;
FOR(i, a, c) {
if (s[i] == '#' and s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
FOR(i, b, d) {
if (s[i] == '#' and s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
if (c > d) {
FOR(i, b, d) {
if (s[i - 1] == '.' and s[i + 1] == '.' and s[i] == '.') {
cout << "Yes" << endl;
return 0;
}
}
} else {
cout << "Yes" << endl;
return 0;
}
cout << "No" << endl;
} | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define REP(i, n) for (ll i = 0; i < n; i++)
#define REPR(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define FORR(i, m, n) for (ll i = m; i >= n; i--)
#define REPO(i, n) for (ll i = 1; i <= n; i++)
#define ll long long
#define INF (ll)1 << 60
#define MINF (-1 * INF)
#define ALL(n) n.begin(), n.end()
#define MOD (ll)1000000007
#define P pair<ll, ll>
ll n, a, b, c, d;
string s;
int main() {
cin >> n >> a >> b >> c >> d;
a--;
b--;
c--;
d--;
cin >> s;
FOR(i, a, c) {
if (s[i] == '#' and s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
FOR(i, b, d) {
if (s[i] == '#' and s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
if (c > d) {
FOR(i, b, d + 1) {
if (s[i - 1] == '.' and s[i + 1] == '.' and s[i] == '.') {
cout << "Yes" << endl;
return 0;
}
}
} else {
cout << "Yes" << endl;
return 0;
}
cout << "No" << endl;
} | [
"expression.operation.binary.add"
] | 832,534 | 832,535 | u196497077 | cpp |
p03017 | #include <bits/stdc++.h>
#include <climits>
#define rep(i, begin, end) \
for (__typeof(end) i = (begin) - ((begin) > (end)); \
i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define srep(i, begin, end) for (__typeof(end) i = begin; i != end; i++)
#define si(x) int x = scanInt();
#define sll(x) LL x = scanLong();
#define sci(x) \
int x; \
scanf("%d", &x);
#define scll(x) \
LL x; \
scanf("%lld", &x);
#define pi(x) printf("%d ", x)
#define pll(x) printf("%lld ", x)
#define nl printf("\n")
#define clr(a) memset(a, 0, sizeof(a))
#define PB push_back
#define MP make_pair
using namespace std;
typedef unsigned int UI; // 32 bit integer
typedef long int LI; // 32 bit integer
typedef unsigned long int ULI; // 32 bit unsigned integer
typedef long long int LL; // 64 bit integer
typedef unsigned long long int ULL; // 64 bit unsigned integer
typedef long double LD;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef deque<int> DI;
typedef deque<LL> DLL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
const LL MOD = 1e9 + 7;
/* Fast I/O */
inline int scanInt() {
int n = 0;
char ch = getchar();
int sign = 1;
while (ch < '0' || ch > '9') {
if (ch == '-')
sign = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9') {
n = (n << 1) + (n << 3) + (int)(ch - '0');
ch = getchar();
}
return n * sign;
}
inline LL scanLong() {
LL n = 0;
char ch = getchar();
LL sign = 1;
while (ch < '0' || ch > '9') {
if (ch == '-')
sign = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9') {
n = (n << 1) + (n << 3) + (LL)(ch - '0');
ch = getchar();
}
return n * sign;
}
bool check(string str, LL start, LL end) {
while (start != end) {
if (end - start == 1)
return true;
if (str[start + 1] == '.')
start++;
else if (str[start + 2] == '.')
start += 2;
else
return false;
}
return true;
}
bool checkTriple(string str, LL start, LL end) {
rep(i, start, end + 1) {
if (str[i] == '.' && str[i + 1] == '.' && str[i - 1] == '.')
return true;
}
return false;
}
int main() {
sll(n);
sll(a);
sll(b);
sll(c);
sll(d);
a--;
b--;
c--;
d--;
string str;
cin >> str;
if (check(str, a, c) && check(str, b, d)) {
if (c < d)
puts("YES");
else if (c > d && checkTriple(str, b, d))
puts("YES");
else
puts("NO");
} else
puts("NO");
}
| #include <bits/stdc++.h>
#include <climits>
#define rep(i, begin, end) \
for (__typeof(end) i = (begin) - ((begin) > (end)); \
i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define srep(i, begin, end) for (__typeof(end) i = begin; i != end; i++)
#define si(x) int x = scanInt();
#define sll(x) LL x = scanLong();
#define sci(x) \
int x; \
scanf("%d", &x);
#define scll(x) \
LL x; \
scanf("%lld", &x);
#define pi(x) printf("%d ", x)
#define pll(x) printf("%lld ", x)
#define nl printf("\n")
#define clr(a) memset(a, 0, sizeof(a))
#define PB push_back
#define MP make_pair
using namespace std;
typedef unsigned int UI; // 32 bit integer
typedef long int LI; // 32 bit integer
typedef unsigned long int ULI; // 32 bit unsigned integer
typedef long long int LL; // 64 bit integer
typedef unsigned long long int ULL; // 64 bit unsigned integer
typedef long double LD;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef deque<int> DI;
typedef deque<LL> DLL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
const LL MOD = 1e9 + 7;
/* Fast I/O */
inline int scanInt() {
int n = 0;
char ch = getchar();
int sign = 1;
while (ch < '0' || ch > '9') {
if (ch == '-')
sign = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9') {
n = (n << 1) + (n << 3) + (int)(ch - '0');
ch = getchar();
}
return n * sign;
}
inline LL scanLong() {
LL n = 0;
char ch = getchar();
LL sign = 1;
while (ch < '0' || ch > '9') {
if (ch == '-')
sign = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9') {
n = (n << 1) + (n << 3) + (LL)(ch - '0');
ch = getchar();
}
return n * sign;
}
bool check(string str, LL start, LL end) {
while (start != end) {
if (end - start == 1)
return true;
if (str[start + 1] == '.')
start++;
else if (str[start + 2] == '.')
start += 2;
else
return false;
}
return true;
}
bool checkTriple(string str, LL start, LL end) {
rep(i, start, end + 1) {
if (str[i] == '.' && str[i + 1] == '.' && str[i - 1] == '.')
return true;
}
return false;
}
int main() {
sll(n);
sll(a);
sll(b);
sll(c);
sll(d);
a--;
b--;
c--;
d--;
string str;
cin >> str;
if (check(str, a, c) && check(str, b, d)) {
if (c < d)
puts("Yes");
else if (c > d && checkTriple(str, b, d))
puts("Yes");
else
puts("No");
} else
puts("No");
}
| [
"literal.string.change",
"literal.string.case.change",
"call.arguments.change",
"io.output.change"
] | 832,536 | 832,537 | u196875870 | cpp |
p03017 | #include <bits/stdc++.h>
#define MIN_INT -2147483648
#define MAX_INT 2147483647
#define MIN_LONG -9223372036854775808L
#define MAX_LONG 9223372036854775807L
#define long long long int
using namespace std;
// @author: pashka
int main() {
ios::sync_with_stdio(false);
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
a--;
b--;
c--;
d--;
string s;
cin >> s;
for (int i = a; i < c; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = b; i < d; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No";
return 0;
}
}
if (c > d) {
bool ok = false;
for (int i = b - 1; i < d + 1; i++) {
if (s[i] == '.' && s[i - 1] == '.' && s[i + 1] == '.') {
ok = true;
}
}
if (!ok) {
cout << "No";
return 0;
}
}
cout << "Yes";
return 0;
} | #include <bits/stdc++.h>
#define MIN_INT -2147483648
#define MAX_INT 2147483647
#define MIN_LONG -9223372036854775808L
#define MAX_LONG 9223372036854775807L
#define long long long int
using namespace std;
// @author: pashka
int main() {
ios::sync_with_stdio(false);
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
a--;
b--;
c--;
d--;
string s;
cin >> s;
for (int i = a; i < c; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = b; i < d; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No";
return 0;
}
}
if (c > d) {
bool ok = false;
for (int i = b; i <= d; i++) {
if (s[i] == '.' && s[i - 1] == '.' && s[i + 1] == '.') {
ok = true;
}
}
if (!ok) {
cout << "No";
return 0;
}
}
cout << "Yes";
return 0;
} | [
"control_flow.loop.for.initializer.change",
"expression.operation.binary.remove",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 832,542 | 832,543 | u136509923 | cpp |
p03017 | #include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define FOR_LT(i, beg, end) for (int i = beg; i < end; i++)
#define FOR_LE(i, beg, end) for (int i = beg; i <= end; i++)
#define FOR_DW(i, beg, end) for (int i = beg; end <= i; i--)
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
a--;
b--;
c--;
d--;
string s;
cin >> s;
// a -> c
{
bool is_pb = false;
FOR_LE(i, a + 1, c - 1) {
if (s[i] == '#') {
if (is_pb) {
cout << "No" << endl;
return 0;
}
}
is_pb = (s[i] == '#');
}
}
// b -> d
{
bool is_pb = false;
FOR_LE(i, b + 1, d - 1) {
if (s[i] == '#') {
if (is_pb) {
cout << "No" << endl;
return 0;
}
}
is_pb = (s[i] == '#');
}
}
// クロス
if (c < d) {
cout << "Yes" << endl;
return 0;
}
int c_w = 0;
FOR_LT(i, b - 1, d + 1) {
if (s[i] == '.') {
c_w++;
if (c_w == 3) {
cout << "Yes" << endl;
return 0;
}
} else {
c_w = 0;
}
}
cout << "No" << endl;
return 0;
} | #include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define FOR_LT(i, beg, end) for (int i = beg; i < end; i++)
#define FOR_LE(i, beg, end) for (int i = beg; i <= end; i++)
#define FOR_DW(i, beg, end) for (int i = beg; end <= i; i--)
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
a--;
b--;
c--;
d--;
string s;
cin >> s;
// a -> c
{
bool is_pb = false;
FOR_LE(i, a + 1, c - 1) {
if (s[i] == '#') {
if (is_pb) {
cout << "No" << endl;
return 0;
}
}
is_pb = (s[i] == '#');
}
}
// b -> d
{
bool is_pb = false;
FOR_LE(i, b + 1, d - 1) {
if (s[i] == '#') {
if (is_pb) {
cout << "No" << endl;
return 0;
}
}
is_pb = (s[i] == '#');
}
}
// クロス
if (c < d) {
cout << "Yes" << endl;
return 0;
}
int c_w = 0;
FOR_LE(i, b - 1, d + 1) {
if (s[i] == '.') {
c_w++;
if (c_w == 3) {
cout << "Yes" << endl;
return 0;
}
} else {
c_w = 0;
}
}
cout << "No" << endl;
return 0;
} | [
"identifier.change",
"call.function.change"
] | 832,546 | 832,547 | u862095327 | cpp |
p03017 | #include <bits/stdc++.h>
#define REP(x, y, z) for (int x = y; x <= z; x++)
#define MSET(x, y) memset(x, y, sizeof(x))
#define M 200005
using namespace std;
int n, A, B, C, D;
char in[M];
int main() {
while (~scanf("%d %d %d %d %d", &n, &A, &B, &C, &D)) {
scanf("%s", in + 1);
auto chk = [&](int x, int y) {
REP(i, x + 1, y) if (in[i] == '#' && in[i - 1] == '#') return false;
return true;
};
auto chk2 = [&](int x, int y) {
REP(i, x + 1, y - 1)
if (in[i - 1] != '#' && in[i] != '#' && in[i + 1] != '#') return true;
return false;
};
if (C < D && chk(A, C) && chk(B, D))
puts("Yes");
else if (C > D && chk(A, C) && chk(B, D) && chk2(B, D))
puts("Yes");
else
puts("No");
}
return 0;
}
| #include <bits/stdc++.h>
#define REP(x, y, z) for (int x = y; x <= z; x++)
#define MSET(x, y) memset(x, y, sizeof(x))
#define M 200005
using namespace std;
int n, A, B, C, D;
char in[M];
int main() {
while (~scanf("%d %d %d %d %d", &n, &A, &B, &C, &D)) {
scanf("%s", in + 1);
auto chk = [&](int x, int y) {
REP(i, x + 1, y) if (in[i] == '#' && in[i - 1] == '#') return false;
return true;
};
auto chk2 = [&](int x, int y) {
REP(i, x, y)
if (in[i - 1] != '#' && in[i] != '#' && in[i + 1] != '#') return true;
return false;
};
if (C < D && chk(A, C) && chk(B, D))
puts("Yes");
else if (C > D && chk(A, C) && chk(B, D) && chk2(B, D))
puts("Yes");
else
puts("No");
}
return 0;
}
| [
"expression.operation.binary.remove"
] | 832,552 | 832,553 | u710687729 | cpp |
p03017 | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define int long long
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define INF 1145141919364364
#define all(vec) vec.begin(), vec.end()
#define ggr \
getchar(); \
getchar(); \
return 0;
#define ll long long
#define P pair<int, int>
#define S second
#define F first
int gcd(int x, int y) {
if (y == 0)
return x;
return gcd(y, x % y);
}
int lcm(int x, int y) { return x / gcd(x, y) * y; }
bool prime(int x) {
for (int i = 2; i <= sqrt(x); i++) {
if (x % i == 0)
return false;
}
return true;
}
int kai(int x) {
if (x == 1)
return 1;
return kai(x - 1) * x % mod;
}
int mod_pow(int x, int y, int moder) {
int res = 1;
while (y > 0) {
if (y & 1)
res = res * x % moder;
x = x * x % moder;
y >>= 1;
}
return res;
}
int comb(int x, int y) {
if (y > x)
return 0;
if (x == y)
return 1;
return kai(x) * mod_pow(kai(x - y), mod - 2, mod) % mod *
mod_pow(kai(y), mod - 2, mod) % mod;
}
int n, a, b, c, d;
string s;
signed main() {
cin >> n >> a >> b >> c >> d >> s;
if (c < d) {
for (int i = a; i < d; i++) {
if (s[i] == '#' && s[i - 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
}
for (int i = a; i < c; i++) {
if (s[i] == '#' && s[i - 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (int i = b + 1; i < d; i++) {
if (s[i] == '.' && s[i] == s[i - 1] && s[i] == s[i - 2]) {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
} | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define int long long
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define INF 1145141919364364
#define all(vec) vec.begin(), vec.end()
#define ggr \
getchar(); \
getchar(); \
return 0;
#define ll long long
#define P pair<int, int>
#define S second
#define F first
int gcd(int x, int y) {
if (y == 0)
return x;
return gcd(y, x % y);
}
int lcm(int x, int y) { return x / gcd(x, y) * y; }
bool prime(int x) {
for (int i = 2; i <= sqrt(x); i++) {
if (x % i == 0)
return false;
}
return true;
}
int kai(int x) {
if (x == 1)
return 1;
return kai(x - 1) * x % mod;
}
int mod_pow(int x, int y, int moder) {
int res = 1;
while (y > 0) {
if (y & 1)
res = res * x % moder;
x = x * x % moder;
y >>= 1;
}
return res;
}
int comb(int x, int y) {
if (y > x)
return 0;
if (x == y)
return 1;
return kai(x) * mod_pow(kai(x - y), mod - 2, mod) % mod *
mod_pow(kai(y), mod - 2, mod) % mod;
}
int n, a, b, c, d;
string s;
signed main() {
cin >> n >> a >> b >> c >> d >> s;
if (c < d) {
for (int i = a; i < d; i++) {
if (s[i] == '#' && s[i - 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
}
for (int i = a; i < c; i++) {
if (s[i] == '#' && s[i - 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (int i = b; i < d + 1; i++) {
if (s[i] == '.' && s[i] == s[i - 1] && s[i] == s[i - 2]) {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
} | [
"control_flow.loop.for.initializer.change",
"expression.operation.binary.remove",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 832,557 | 832,558 | u277153875 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define all(x) (x).begin(), (x).end()
#define m0(x) memset(x, 0, sizeof(x))
int dx4[4] = {1, 0, -1, 0}, dy4[4] = {0, 1, 0, -1};
int main() {
ll n, a, b, c, d;
string s;
cin >> n >> a >> b >> c >> d >> s;
a--;
b--;
c--;
d--;
bool ok = true;
for (ll i = a; i < c; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
ok = false;
break;
}
}
for (ll i = b; i < d; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
ok = false;
break;
}
}
if (ok && d < c) {
bool nukaseru = false;
for (int i = b; i < d; i++) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.') {
nukaseru = true;
break;
}
}
if (nukaseru == false) {
ok = false;
}
}
if (ok)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define all(x) (x).begin(), (x).end()
#define m0(x) memset(x, 0, sizeof(x))
int dx4[4] = {1, 0, -1, 0}, dy4[4] = {0, 1, 0, -1};
int main() {
ll n, a, b, c, d;
string s;
cin >> n >> a >> b >> c >> d >> s;
a--;
b--;
c--;
d--;
bool ok = true;
for (ll i = a; i < c; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
ok = false;
break;
}
}
for (ll i = b; i < d; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
ok = false;
break;
}
}
if (ok && d < c) {
bool nukaseru = false;
for (int i = b; i <= d; i++) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.') {
nukaseru = true;
break;
}
}
if (nukaseru == false) {
ok = false;
}
}
if (ok)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
} | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 832,559 | 832,560 | u773916255 | cpp |
p03017 | #include <algorithm>
#include <cmath>
#include <complex>
#include <functional>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
// 英語は 26 文字
// common
namespace {
#define CAST(T, val) ((T)(val))
#define CASE(lb) \
break; \
case lb:
#define CASE_CONT(lb) case lb:
#define CASE_DEF \
break; \
default:
#define For(i, s) for (int i = 0, forEnd##i = CAST(int, s); i < forEnd##i; ++i)
#define ForA(i, a, s) \
for (int i = CAST(int, a), forEnd##i = CAST(int, s); i < forEnd##i; ++i)
#define ForR(i, s) for (int i = s; i >= 0; i--)
#define ForRA(i, s, e) for (int i = s; i >= e; i--)
#define ForItr(itr, con) \
for (auto itr = con.begin(), forEnd##itr = con.end(); itr != forEnd##itr; \
++itr)
#define ForRItr(itr, con) \
for (auto itr = con.rbegin(), forEnd##itr = con.rend(); itr != forEnd##itr; \
++itr)
#define ForStr(i, str) for (int i = 0; str[i]; ++i)
#define GOTO(lb) goto lb
#define LABEL(lb) \
lb:
#define ALL(con) (con).begin(), (con).end()
template <typename T, typename K> struct Pair {
T fst;
K snd;
bool operator<(const Pair &p) const {
if (fst != p.fst)
return fst < p.fst;
return snd < p.snd;
}
};
template <typename T, typename K>
std::istream &operator>>(std::istream &in, Pair<T, K> &p) {
return in >> p.fst >> p.snd;
}
template <typename T, typename K, typename H> struct Trir {
T fst;
K snd;
H trd;
bool operator<(const Trir &t) const {
if (fst != t.fst)
return fst < t.fst;
if (snd != t.snd)
return snd < t.snd;
return trd < t.trd;
}
};
template <typename T, typename K, typename H>
std::istream &operator>>(std::istream &in, Trir<T, K, H> &p) {
return in >> p.fst >> p.snd >> p.trd;
}
typedef long long xint;
typedef unsigned long long uxint;
typedef unsigned int uint;
typedef unsigned char uchar;
typedef unsigned short ushort;
typedef vector<int> Vi;
typedef vector<xint> Vx;
typedef vector<double> Vd;
typedef Pair<int, int> Pii;
typedef vector<Pii> VPii;
typedef Trir<int, int, int> Tiii;
typedef vector<Pii> VTiii;
const int Ten5 = 100000; // 10^5
const int Ten6 = 1000000; // 10^6
const double EPS = 0.00000000023283064365386962890625; // 2^-32
} // namespace
// min-max-mod
namespace {
// 合同式
class Mod {
public:
typedef xint T; // 型
static T N; // 法
Mod operator+(T v) const { return Mod(x + v % N); }
Mod operator+(Mod m) const { return Mod(x + m.x); }
Mod operator+=(T v) { return *this = Mod(x + v % N); }
Mod operator+=(Mod m) { return *this = Mod(x + m.x); }
Mod operator-(T v) const { return Mod(x - v + N); }
Mod operator-(Mod m) const { return Mod(x - m.x + N); }
Mod operator-=(T v) { return *this = Mod(x - v + N); }
Mod operator-=(Mod m) { return *this = Mod(x - m.x + N); }
Mod operator*(T v) const { return Mod(x * v); }
Mod operator*(Mod m) const { return Mod(x * m.x); }
Mod operator*=(T v) { return *this = Mod(x * v); }
Mod operator*=(Mod m) { return *this = Mod(x * m.x); }
Mod operator/(
T v) const { // フェルマーの小定理より, m.x の逆元は m.x^( HOU-2 )
const T n = N - 2;
T r = x;
for (T b = 1; b < n; b <<= 1) {
if (n & b)
r = r * v % N;
v = v * v % N;
}
return r;
}
Mod operator/(
Mod m) const { // フェルマーの小定理より, m.x の逆元は m.x^( HOU-2 )
const T n = N - 2;
T v = m.x, r = x;
for (T b = 1; b < n; b <<= 1) {
if (n & b)
r = r * v % N;
v = v * v % N;
}
return r;
}
Mod operator/=(T v) { return *this = *this / v; }
Mod operator/=(Mod m) { return *this = *this / m; }
operator T() const { return x; }
Mod() {}
Mod(T v) : x(v % N) {}
private:
T x;
};
Mod::T Mod::N = 1000 * 1000 * 1000 + 7;
// 最大値
template <typename T> class Max {
public:
// 何回更新したか
int cnt() const { return c; }
// 更新したときに true を返す
bool operator=(T v) {
if (!c) {
c = 1;
x = v;
return true;
}
if (x < v) {
c++;
x = v;
return true;
}
return false;
}
operator T() const { return x; }
Max() : x(0), c(0) {}
Max(T v) : x(v), c(1) {}
Max(const T *f, const T *l) : x(*f++), c(1) {
while (f < l) {
*this = *f++;
}
}
Max(const T *a, int n) : x(0), c(0) { For(i, n) *this = *a++; }
private:
T x;
int c;
};
// 最小値
template <typename T> class Min {
public:
// 何回更新したか
int cnt() const { return c; }
// 更新したときに true を返す
bool operator=(T v) {
if (!c) {
c = 1;
x = v;
return true;
}
if (v < x) {
c++;
x = v;
return true;
}
return false;
}
operator T() const { return x; }
Min() : x(0), c(0) {}
Min(T v) : x(v), c(1) {}
Min(const T *f, const T *l) : x(*f++), c(1) {
while (f < l) {
*this = *f++;
}
}
Min(const T *a, int n) : x(0), c(0) { For(i, n) *this = *a++; }
private:
T x;
int c;
};
istream &operator>>(istream &in, Mod &m) {
Mod::T t;
in >> t;
m = Mod(t);
return in;
}
ostream &operator<<(ostream &ot, Mod m) { return ot << CAST(Mod::T, m); }
template <typename T> istream &operator>>(istream &in, Max<T> &m) {
T t;
in >> t;
m = Max<T>(t);
return in;
}
template <typename T> ostream &operator<<(ostream &ot, Max<T> m) {
return ot << CAST(T, m);
}
template <typename T> istream &operator>>(istream &in, Min<T> &m) {
T t;
in >> t;
m = Min<T>(t);
return in;
}
template <typename T> ostream &operator<<(ostream &ot, Min<T> m) {
return ot << CAST(T, m);
}
} // namespace
// vec
namespace {
// 2D int Vector
class Pint {
public:
int x, y;
static const Pint dir[8];
// util
static void setup(int width, int height, int offset = -1, bool swap = false) {
Width = width;
Height = height;
Offset = offset;
Swap = swap;
}
inline bool isInFld() const {
return 0 <= x && x < Width && 0 <= y && y < Height;
}
// vector
inline double len() const { return sqrt(sq()); }
inline double len(const Pint &p) const { return sqrt(sq(p)); }
inline int sq() const { return x * x + y * y; }
inline int sq(const Pint &p) const {
return (x - p.x) * (x - p.x) + (y - p.y) * (y - p.y);
}
inline int manhattan() const { return abs(x) + abs(y); }
inline int manhattan(const Pint &p) const {
return abs(x - p.x) + abs(y - p.y);
}
inline int dot(const Pint &p) const { return x * p.x + y * p.y; }
inline int crs(const Pint &p) const { return x * p.y - y * p.x; }
// opr, cst
inline Pint operator+() { return Pint(x, y); }
inline Pint operator-() { return Pint(-x, -y); }
inline Pint operator+(const Pint &p) const { return Pint(x + p.x, y + p.y); }
inline const Pint &operator+=(const Pint &p) {
x += p.x;
y += p.y;
return *this;
}
inline Pint operator-(const Pint &p) const { return Pint(x - p.x, y - p.y); }
inline const Pint &operator-=(const Pint &p) {
x -= p.x;
y -= p.y;
return *this;
}
inline Pint operator*(const Pint &p) const { return Pint(x * p.x, y * p.y); }
inline const Pint &operator*=(const Pint &p) {
x *= p.x;
y *= p.y;
return *this;
}
inline Pint operator/(const Pint &p) const { return Pint(x / p.x, y / p.y); }
inline const Pint &operator/=(const Pint &p) {
x /= p.x;
y /= p.y;
return *this;
}
inline Pint operator*(const int k) const { return Pint(x * k, y * k); }
inline const Pint &operator*=(const int k) {
x *= k;
y *= k;
return *this;
}
inline Pint operator/(const int k) const { return Pint(x / k, y / k); }
inline const Pint &operator/=(const int k) {
x /= k;
y /= k;
return *this;
}
inline bool operator<(const Pint &p) const {
return x == p.x ? y < p.y : x < p.x;
}
inline bool operator>(const Pint &p) const {
return x == p.x ? y > p.y : x > p.x;
}
inline bool operator==(const Pint &p) const { return x == p.x && y == p.y; }
inline bool operator!=(const Pint &p) const { return x != p.x || y != p.y; }
Pint() {}
Pint(const int x, const int y) : x(x), y(y) {}
private:
friend istream &operator>>(istream &in, Pint &p);
friend ostream &operator<<(ostream &out, const Pint &p);
static int Width, Height, Offset;
static bool Swap;
};
istream &operator>>(istream &in, Pint &p) {
int x, y;
in >> x >> y;
x += Pint::Offset;
y += Pint::Offset;
if (Pint::Swap)
p = Pint(y, x);
else
p = Pint(x, y);
return in;
}
ostream &operator<<(ostream &out, const Pint &p) {
return out << "( " << p.x << ", " << p.y << " )";
}
int Pint::Width, Pint::Height, Pint::Offset;
bool Pint::Swap;
const Pint Pint::dir[8] = {Pint(0, 1), Pint(1, 0), Pint(0, -1), Pint(-1, 0),
Pint(1, 1), Pint(1, -1), Pint(-1, 1), Pint(-1, -1)};
// 2D double Vector
class Pdouble {
public:
double x, y;
// vector
inline double len() const { return sqrt(sq()); }
inline double len(const Pdouble &p) const { return sqrt(sq(p)); }
inline double sq() const { return x * x + y * y; }
inline double sq(const Pdouble &p) const {
return (x - p.x) * (x - p.x) + (y - p.y) * (y - p.y);
}
inline Pdouble norm(const double l = 1.0) { return *this * l / len(); }
inline double dot(const Pdouble &p) const { return x * p.x + y * p.y; }
inline double crs(const Pdouble &p) const { return x * p.y - y * p.x; }
inline Pdouble proj(const Pdouble &v) const {
const double s = v.sq();
if (s < EPS * EPS)
return Pdouble(0, 0);
return v * dot(v) / s;
}
inline Pdouble rot(const double rad) const {
const double c = cos(rad), s = sin(rad);
return Pdouble(c * x - s * y, s * x + c * y);
}
// opr, cst
inline Pdouble operator+() { return Pdouble(x, y); }
inline Pdouble operator-() { return Pdouble(-x, -y); }
inline Pdouble operator+(const Pdouble &p) const {
return Pdouble(x + p.x, y + p.y);
}
inline const Pdouble &operator+=(const Pdouble &p) {
x += p.x;
y += p.y;
return *this;
}
inline Pdouble operator-(const Pdouble &p) const {
return Pdouble(x - p.x, y - p.y);
}
inline const Pdouble &operator-=(const Pdouble &p) {
x -= p.x;
y -= p.y;
return *this;
}
inline Pdouble operator*(const Pdouble &p) const {
return Pdouble(x * p.x, y * p.y);
}
inline const Pdouble &operator*=(const Pdouble &p) {
x *= p.x;
y *= p.y;
return *this;
}
inline Pdouble operator/(const Pdouble &p) const {
return Pdouble(x / p.x, y / p.y);
}
inline const Pdouble &operator/=(const Pdouble &p) {
x /= p.x;
y /= p.y;
return *this;
}
inline Pdouble operator*(const double k) const {
return Pdouble(x * k, y * k);
}
inline const Pdouble &operator*=(const double k) {
x *= k;
y *= k;
return *this;
}
inline Pdouble operator/(const double k) const {
return Pdouble(x / k, y / k);
}
inline const Pdouble &operator/=(const double k) {
x /= k;
y /= k;
return *this;
}
inline bool operator<(const Pdouble &p) const {
return x == p.x ? y < p.y : x < p.x;
}
inline bool operator>(const Pdouble &p) const {
return x == p.x ? y > p.y : x > p.x;
}
inline bool operator==(const Pdouble &p) const {
return x == p.x && y == p.y;
}
inline bool operator!=(const Pdouble &p) const {
return x != p.x || y != p.y;
}
Pdouble() {}
Pdouble(const double x, const double y) : x(x), y(y) {}
Pdouble(const Pint &p) : x(p.x), y(p.y) {}
};
istream &operator>>(istream &in, Pdouble &p) { return in >> p.x >> p.y; }
ostream &operator<<(ostream &out, const Pdouble &p) {
return out << "( " << p.x << ", " << p.y << " )";
}
// ( lP, lQ ) と ( nP, nQ ) の線分の交差判定
bool CollisionLine(const Pdouble lP, const Pdouble lQ, const Pdouble nP,
const Pdouble nQ) {
auto sign = [](double d) { return d < 0 ? -1 : d > 0 ? 1 : 0; };
Pdouble v = lQ - lP;
if (sign(v.crs(nP - lP)) == sign(v.crs(nQ - lQ)))
return false;
v = nQ - nP;
return sign(v.crs(lP - nP)) * sign(v.crs(lQ - nP)) <= 0;
}
} // namespace
// util
namespace {
// 座圧 O( N log N ). x に座圧後の座標が入る
void Zaatu(int *x, int N) {
map<int, int> map;
For(i, N) map.insert(
std::pair<int, int>(x[i], 0)); // sort すると順番が維持できない
int idx = 0;
ForItr(itr, map) itr->second = idx++;
For(i, N) x[i] = map[x[i]];
}
// double 出力
void DoubleOut(double d, char c = '\n') { printf("%.12f%c", d, c); }
} // namespace
char S[2 * Ten5 + 16];
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D >> S;
A--;
B--;
C--;
D--;
if (D < C) {
// 飛び越えなあかん場合
bool isOK = false;
ForA(i, B, D) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
isOK = true;
break;
}
}
if (!isOK)
GOTO(AKAN);
}
ForA(i, A, C) {
if (S[i] == '#' && S[i + 1] == '#')
GOTO(AKAN);
}
ForA(i, B, D) {
if (S[i] == '#' && S[i + 1] == '#')
GOTO(AKAN);
}
cout << "Yes" << endl;
return 0;
LABEL(AKAN);
cout << "No" << endl;
return 0;
}
| #include <algorithm>
#include <cmath>
#include <complex>
#include <functional>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
// 英語は 26 文字
// common
namespace {
#define CAST(T, val) ((T)(val))
#define CASE(lb) \
break; \
case lb:
#define CASE_CONT(lb) case lb:
#define CASE_DEF \
break; \
default:
#define For(i, s) for (int i = 0, forEnd##i = CAST(int, s); i < forEnd##i; ++i)
#define ForA(i, a, s) \
for (int i = CAST(int, a), forEnd##i = CAST(int, s); i < forEnd##i; ++i)
#define ForR(i, s) for (int i = s; i >= 0; i--)
#define ForRA(i, s, e) for (int i = s; i >= e; i--)
#define ForItr(itr, con) \
for (auto itr = con.begin(), forEnd##itr = con.end(); itr != forEnd##itr; \
++itr)
#define ForRItr(itr, con) \
for (auto itr = con.rbegin(), forEnd##itr = con.rend(); itr != forEnd##itr; \
++itr)
#define ForStr(i, str) for (int i = 0; str[i]; ++i)
#define GOTO(lb) goto lb
#define LABEL(lb) \
lb:
#define ALL(con) (con).begin(), (con).end()
template <typename T, typename K> struct Pair {
T fst;
K snd;
bool operator<(const Pair &p) const {
if (fst != p.fst)
return fst < p.fst;
return snd < p.snd;
}
};
template <typename T, typename K>
std::istream &operator>>(std::istream &in, Pair<T, K> &p) {
return in >> p.fst >> p.snd;
}
template <typename T, typename K, typename H> struct Trir {
T fst;
K snd;
H trd;
bool operator<(const Trir &t) const {
if (fst != t.fst)
return fst < t.fst;
if (snd != t.snd)
return snd < t.snd;
return trd < t.trd;
}
};
template <typename T, typename K, typename H>
std::istream &operator>>(std::istream &in, Trir<T, K, H> &p) {
return in >> p.fst >> p.snd >> p.trd;
}
typedef long long xint;
typedef unsigned long long uxint;
typedef unsigned int uint;
typedef unsigned char uchar;
typedef unsigned short ushort;
typedef vector<int> Vi;
typedef vector<xint> Vx;
typedef vector<double> Vd;
typedef Pair<int, int> Pii;
typedef vector<Pii> VPii;
typedef Trir<int, int, int> Tiii;
typedef vector<Pii> VTiii;
const int Ten5 = 100000; // 10^5
const int Ten6 = 1000000; // 10^6
const double EPS = 0.00000000023283064365386962890625; // 2^-32
} // namespace
// min-max-mod
namespace {
// 合同式
class Mod {
public:
typedef xint T; // 型
static T N; // 法
Mod operator+(T v) const { return Mod(x + v % N); }
Mod operator+(Mod m) const { return Mod(x + m.x); }
Mod operator+=(T v) { return *this = Mod(x + v % N); }
Mod operator+=(Mod m) { return *this = Mod(x + m.x); }
Mod operator-(T v) const { return Mod(x - v + N); }
Mod operator-(Mod m) const { return Mod(x - m.x + N); }
Mod operator-=(T v) { return *this = Mod(x - v + N); }
Mod operator-=(Mod m) { return *this = Mod(x - m.x + N); }
Mod operator*(T v) const { return Mod(x * v); }
Mod operator*(Mod m) const { return Mod(x * m.x); }
Mod operator*=(T v) { return *this = Mod(x * v); }
Mod operator*=(Mod m) { return *this = Mod(x * m.x); }
Mod operator/(
T v) const { // フェルマーの小定理より, m.x の逆元は m.x^( HOU-2 )
const T n = N - 2;
T r = x;
for (T b = 1; b < n; b <<= 1) {
if (n & b)
r = r * v % N;
v = v * v % N;
}
return r;
}
Mod operator/(
Mod m) const { // フェルマーの小定理より, m.x の逆元は m.x^( HOU-2 )
const T n = N - 2;
T v = m.x, r = x;
for (T b = 1; b < n; b <<= 1) {
if (n & b)
r = r * v % N;
v = v * v % N;
}
return r;
}
Mod operator/=(T v) { return *this = *this / v; }
Mod operator/=(Mod m) { return *this = *this / m; }
operator T() const { return x; }
Mod() {}
Mod(T v) : x(v % N) {}
private:
T x;
};
Mod::T Mod::N = 1000 * 1000 * 1000 + 7;
// 最大値
template <typename T> class Max {
public:
// 何回更新したか
int cnt() const { return c; }
// 更新したときに true を返す
bool operator=(T v) {
if (!c) {
c = 1;
x = v;
return true;
}
if (x < v) {
c++;
x = v;
return true;
}
return false;
}
operator T() const { return x; }
Max() : x(0), c(0) {}
Max(T v) : x(v), c(1) {}
Max(const T *f, const T *l) : x(*f++), c(1) {
while (f < l) {
*this = *f++;
}
}
Max(const T *a, int n) : x(0), c(0) { For(i, n) *this = *a++; }
private:
T x;
int c;
};
// 最小値
template <typename T> class Min {
public:
// 何回更新したか
int cnt() const { return c; }
// 更新したときに true を返す
bool operator=(T v) {
if (!c) {
c = 1;
x = v;
return true;
}
if (v < x) {
c++;
x = v;
return true;
}
return false;
}
operator T() const { return x; }
Min() : x(0), c(0) {}
Min(T v) : x(v), c(1) {}
Min(const T *f, const T *l) : x(*f++), c(1) {
while (f < l) {
*this = *f++;
}
}
Min(const T *a, int n) : x(0), c(0) { For(i, n) *this = *a++; }
private:
T x;
int c;
};
istream &operator>>(istream &in, Mod &m) {
Mod::T t;
in >> t;
m = Mod(t);
return in;
}
ostream &operator<<(ostream &ot, Mod m) { return ot << CAST(Mod::T, m); }
template <typename T> istream &operator>>(istream &in, Max<T> &m) {
T t;
in >> t;
m = Max<T>(t);
return in;
}
template <typename T> ostream &operator<<(ostream &ot, Max<T> m) {
return ot << CAST(T, m);
}
template <typename T> istream &operator>>(istream &in, Min<T> &m) {
T t;
in >> t;
m = Min<T>(t);
return in;
}
template <typename T> ostream &operator<<(ostream &ot, Min<T> m) {
return ot << CAST(T, m);
}
} // namespace
// vec
namespace {
// 2D int Vector
class Pint {
public:
int x, y;
static const Pint dir[8];
// util
static void setup(int width, int height, int offset = -1, bool swap = false) {
Width = width;
Height = height;
Offset = offset;
Swap = swap;
}
inline bool isInFld() const {
return 0 <= x && x < Width && 0 <= y && y < Height;
}
// vector
inline double len() const { return sqrt(sq()); }
inline double len(const Pint &p) const { return sqrt(sq(p)); }
inline int sq() const { return x * x + y * y; }
inline int sq(const Pint &p) const {
return (x - p.x) * (x - p.x) + (y - p.y) * (y - p.y);
}
inline int manhattan() const { return abs(x) + abs(y); }
inline int manhattan(const Pint &p) const {
return abs(x - p.x) + abs(y - p.y);
}
inline int dot(const Pint &p) const { return x * p.x + y * p.y; }
inline int crs(const Pint &p) const { return x * p.y - y * p.x; }
// opr, cst
inline Pint operator+() { return Pint(x, y); }
inline Pint operator-() { return Pint(-x, -y); }
inline Pint operator+(const Pint &p) const { return Pint(x + p.x, y + p.y); }
inline const Pint &operator+=(const Pint &p) {
x += p.x;
y += p.y;
return *this;
}
inline Pint operator-(const Pint &p) const { return Pint(x - p.x, y - p.y); }
inline const Pint &operator-=(const Pint &p) {
x -= p.x;
y -= p.y;
return *this;
}
inline Pint operator*(const Pint &p) const { return Pint(x * p.x, y * p.y); }
inline const Pint &operator*=(const Pint &p) {
x *= p.x;
y *= p.y;
return *this;
}
inline Pint operator/(const Pint &p) const { return Pint(x / p.x, y / p.y); }
inline const Pint &operator/=(const Pint &p) {
x /= p.x;
y /= p.y;
return *this;
}
inline Pint operator*(const int k) const { return Pint(x * k, y * k); }
inline const Pint &operator*=(const int k) {
x *= k;
y *= k;
return *this;
}
inline Pint operator/(const int k) const { return Pint(x / k, y / k); }
inline const Pint &operator/=(const int k) {
x /= k;
y /= k;
return *this;
}
inline bool operator<(const Pint &p) const {
return x == p.x ? y < p.y : x < p.x;
}
inline bool operator>(const Pint &p) const {
return x == p.x ? y > p.y : x > p.x;
}
inline bool operator==(const Pint &p) const { return x == p.x && y == p.y; }
inline bool operator!=(const Pint &p) const { return x != p.x || y != p.y; }
Pint() {}
Pint(const int x, const int y) : x(x), y(y) {}
private:
friend istream &operator>>(istream &in, Pint &p);
friend ostream &operator<<(ostream &out, const Pint &p);
static int Width, Height, Offset;
static bool Swap;
};
istream &operator>>(istream &in, Pint &p) {
int x, y;
in >> x >> y;
x += Pint::Offset;
y += Pint::Offset;
if (Pint::Swap)
p = Pint(y, x);
else
p = Pint(x, y);
return in;
}
ostream &operator<<(ostream &out, const Pint &p) {
return out << "( " << p.x << ", " << p.y << " )";
}
int Pint::Width, Pint::Height, Pint::Offset;
bool Pint::Swap;
const Pint Pint::dir[8] = {Pint(0, 1), Pint(1, 0), Pint(0, -1), Pint(-1, 0),
Pint(1, 1), Pint(1, -1), Pint(-1, 1), Pint(-1, -1)};
// 2D double Vector
class Pdouble {
public:
double x, y;
// vector
inline double len() const { return sqrt(sq()); }
inline double len(const Pdouble &p) const { return sqrt(sq(p)); }
inline double sq() const { return x * x + y * y; }
inline double sq(const Pdouble &p) const {
return (x - p.x) * (x - p.x) + (y - p.y) * (y - p.y);
}
inline Pdouble norm(const double l = 1.0) { return *this * l / len(); }
inline double dot(const Pdouble &p) const { return x * p.x + y * p.y; }
inline double crs(const Pdouble &p) const { return x * p.y - y * p.x; }
inline Pdouble proj(const Pdouble &v) const {
const double s = v.sq();
if (s < EPS * EPS)
return Pdouble(0, 0);
return v * dot(v) / s;
}
inline Pdouble rot(const double rad) const {
const double c = cos(rad), s = sin(rad);
return Pdouble(c * x - s * y, s * x + c * y);
}
// opr, cst
inline Pdouble operator+() { return Pdouble(x, y); }
inline Pdouble operator-() { return Pdouble(-x, -y); }
inline Pdouble operator+(const Pdouble &p) const {
return Pdouble(x + p.x, y + p.y);
}
inline const Pdouble &operator+=(const Pdouble &p) {
x += p.x;
y += p.y;
return *this;
}
inline Pdouble operator-(const Pdouble &p) const {
return Pdouble(x - p.x, y - p.y);
}
inline const Pdouble &operator-=(const Pdouble &p) {
x -= p.x;
y -= p.y;
return *this;
}
inline Pdouble operator*(const Pdouble &p) const {
return Pdouble(x * p.x, y * p.y);
}
inline const Pdouble &operator*=(const Pdouble &p) {
x *= p.x;
y *= p.y;
return *this;
}
inline Pdouble operator/(const Pdouble &p) const {
return Pdouble(x / p.x, y / p.y);
}
inline const Pdouble &operator/=(const Pdouble &p) {
x /= p.x;
y /= p.y;
return *this;
}
inline Pdouble operator*(const double k) const {
return Pdouble(x * k, y * k);
}
inline const Pdouble &operator*=(const double k) {
x *= k;
y *= k;
return *this;
}
inline Pdouble operator/(const double k) const {
return Pdouble(x / k, y / k);
}
inline const Pdouble &operator/=(const double k) {
x /= k;
y /= k;
return *this;
}
inline bool operator<(const Pdouble &p) const {
return x == p.x ? y < p.y : x < p.x;
}
inline bool operator>(const Pdouble &p) const {
return x == p.x ? y > p.y : x > p.x;
}
inline bool operator==(const Pdouble &p) const {
return x == p.x && y == p.y;
}
inline bool operator!=(const Pdouble &p) const {
return x != p.x || y != p.y;
}
Pdouble() {}
Pdouble(const double x, const double y) : x(x), y(y) {}
Pdouble(const Pint &p) : x(p.x), y(p.y) {}
};
istream &operator>>(istream &in, Pdouble &p) { return in >> p.x >> p.y; }
ostream &operator<<(ostream &out, const Pdouble &p) {
return out << "( " << p.x << ", " << p.y << " )";
}
// ( lP, lQ ) と ( nP, nQ ) の線分の交差判定
bool CollisionLine(const Pdouble lP, const Pdouble lQ, const Pdouble nP,
const Pdouble nQ) {
auto sign = [](double d) { return d < 0 ? -1 : d > 0 ? 1 : 0; };
Pdouble v = lQ - lP;
if (sign(v.crs(nP - lP)) == sign(v.crs(nQ - lQ)))
return false;
v = nQ - nP;
return sign(v.crs(lP - nP)) * sign(v.crs(lQ - nP)) <= 0;
}
} // namespace
// util
namespace {
// 座圧 O( N log N ). x に座圧後の座標が入る
void Zaatu(int *x, int N) {
map<int, int> map;
For(i, N) map.insert(
std::pair<int, int>(x[i], 0)); // sort すると順番が維持できない
int idx = 0;
ForItr(itr, map) itr->second = idx++;
For(i, N) x[i] = map[x[i]];
}
// double 出力
void DoubleOut(double d, char c = '\n') { printf("%.12f%c", d, c); }
} // namespace
char S[2 * Ten5 + 16];
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D >> S;
A--;
B--;
C--;
D--;
if (D < C) {
// 飛び越えなあかん場合
bool isOK = false;
ForA(i, B - 1, D) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
isOK = true;
break;
}
}
if (!isOK)
GOTO(AKAN);
}
ForA(i, A, C) {
if (S[i] == '#' && S[i + 1] == '#')
GOTO(AKAN);
}
ForA(i, B, D) {
if (S[i] == '#' && S[i + 1] == '#')
GOTO(AKAN);
}
cout << "Yes" << endl;
return 0;
LABEL(AKAN);
cout << "No" << endl;
return 0;
}
| [
"expression.operation.binary.add"
] | 832,561 | 832,562 | u453246394 | cpp |
p03017 | #include <bits/stdc++.h>
#include <iomanip>
//#define DEBUG 1
using namespace std;
typedef long long LL;
typedef long double LD;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<LD, LD> PLDLD;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef vector<char> VB;
#define FOR(i, a, b) for (int i = (a); i < (int)(b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define RFOR(i, a, b) for (int i = (a)-1; i >= (int)(b); --i)
#define RREP(i, n) RFOR(i, n, 0)
#define CLR(a) memset((a), 0, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNQ(a) a.erase(std::unique(ALL(a)), a.end());
#define endl "\n"
#define BEGIN_STACK(size) \
void *dummy = malloc(size); \
void *org_stack; \
char *my = (char *)alloca((1 + (int)(((long long)dummy) & 127)) * 16); \
*my = 0; \
asm volatile("mov %%rsp, %%rbx\n" \
"mov %%rax, %%rsp" \
: "=b"(org_stack) \
: "a"((char *)dummy + (size)-1024));
#define END_STACK \
asm volatile("mov %%rax, %%rsp" ::"a"(org_stack)); \
free(dummy);
const LD EPS = 1e-10;
const long long INFLL = (LL)(1e9) * (LL)(1e9);
const int INF = 1e9 + 7;
template <class T> void chmin(T &a, const T b) {
if (a > b)
a = b;
}
template <class T> void chmax(T &a, const T b) {
if (a < b)
a = b;
}
const LL powLL(const LL p, const LL q) {
LL t = 1;
for (int i = 0; i < q; i++)
t *= p;
return t;
}
template <typename T> struct has_iter {
private:
template <typename U>
static constexpr true_type check(typename U::iterator *);
template <typename U> static constexpr false_type check(...);
public:
static constexpr bool value = decltype(check<T>(nullptr))::value;
};
template <typename T, typename U = typename T::iterator>
void print(const T &container) {
auto &&first = begin(container), last = end(container);
auto &&back = prev(last);
for (auto e = first; e != last; e = next(e))
cout << *e << " \n"[e == back];
}
extern void *enabler;
template <typename Head,
typename enable_if<!has_iter<Head>::value>::type *& = enabler>
void print(const Head &head) {
cout << head << endl;
}
template <> void print<string>(const string &container) {
cout << container << endl;
}
template <typename Head, typename... Tail>
void print(const Head &head, const Tail &...tail) {
cout << head << " ";
print(tail...);
}
template <typename... Args> void printd(const Args &...args) {
#ifdef DEBUG
print(args...);
#endif
}
template <typename Head> void input(Head &head) { cin >> head; }
template <typename Head, typename... Tail>
void input(Head &head, Tail &...tail) {
cin >> head;
input(tail...);
}
void io_speedup() {
cin.tie(0);
cout.tie(0);
ios::sync_with_stdio(false);
}
template <typename T> istream &operator>>(istream &is, vector<T> &vec) {
for (T &x : vec)
is >> x;
return is;
}
template <typename T, typename U>
istream &operator>>(istream &is, pair<T, U> &t) {
is >> t.first >> t.second;
return is;
}
template <int N, typename... Ts,
typename enable_if<N == sizeof...(Ts) - 1>::type *& = enabler>
void tuple_in(istream &is, tuple<Ts...> &t) {
is >> get<N>(t);
}
template <int N, typename... Ts,
typename enable_if<N<sizeof...(Ts) - 1>::type *& = enabler> void
tuple_in(istream &is, tuple<Ts...> &t) {
is >> get<N>(t);
tuple_in<N + 1, Ts...>(is, t);
}
template <typename... Ts> istream &operator>>(istream &is, tuple<Ts...> &t) {
tuple_in<0, Ts...>(is, t);
return is;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &t) {
os << '(' << t.first << ", " << t.second << ')';
return os;
}
template <int N, typename... Ts,
typename enable_if<N == sizeof...(Ts) - 1>::type *& = enabler>
void tuple_out(ostream &os, const tuple<Ts...> &t) {
os << get<N>(t);
}
template <int N, typename... Ts,
typename enable_if<N<sizeof...(Ts) - 1>::type *& = enabler> void
tuple_out(ostream &os, const tuple<Ts...> &t) {
os << get<N>(t) << ", ";
tuple_out<N + 1, Ts...>(os, t);
}
template <typename... Ts>
ostream &operator<<(ostream &os, const tuple<Ts...> &t) {
os << '(';
tuple_out<0, Ts...>(os, t);
os << ')';
return os;
}
template <typename T> vector<T> read(int n) {
vector<T> t(n);
cin >> t;
return t;
}
template <typename T> T read() {
T t;
cin >> t;
return t;
}
int main() {
int n;
cin >> n;
int a, b, c, d;
input(a, b, c, d);
auto s = read<string>();
a--;
b--;
c--;
d--;
bool f = 1;
FOR(i, a, c) {
if (s[i] == '#' && s[i + 1] == '#') {
f = 0;
printd(i);
break;
}
}
FOR(i, b, d) {
if (s[i] == '#' && s[i + 1] == '#') {
f = 0;
printd(i);
break;
}
}
if (c > d) {
bool f2 = 0;
FOR(i, b, d - 1) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
f2 = 1;
printd(i);
break;
}
}
f &= f2;
}
if (f)
print("Yes");
else
print("No");
} | #include <bits/stdc++.h>
#include <iomanip>
//#define DEBUG 1
using namespace std;
typedef long long LL;
typedef long double LD;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<LD, LD> PLDLD;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef vector<char> VB;
#define FOR(i, a, b) for (int i = (a); i < (int)(b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define RFOR(i, a, b) for (int i = (a)-1; i >= (int)(b); --i)
#define RREP(i, n) RFOR(i, n, 0)
#define CLR(a) memset((a), 0, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNQ(a) a.erase(std::unique(ALL(a)), a.end());
#define endl "\n"
#define BEGIN_STACK(size) \
void *dummy = malloc(size); \
void *org_stack; \
char *my = (char *)alloca((1 + (int)(((long long)dummy) & 127)) * 16); \
*my = 0; \
asm volatile("mov %%rsp, %%rbx\n" \
"mov %%rax, %%rsp" \
: "=b"(org_stack) \
: "a"((char *)dummy + (size)-1024));
#define END_STACK \
asm volatile("mov %%rax, %%rsp" ::"a"(org_stack)); \
free(dummy);
const LD EPS = 1e-10;
const long long INFLL = (LL)(1e9) * (LL)(1e9);
const int INF = 1e9 + 7;
template <class T> void chmin(T &a, const T b) {
if (a > b)
a = b;
}
template <class T> void chmax(T &a, const T b) {
if (a < b)
a = b;
}
const LL powLL(const LL p, const LL q) {
LL t = 1;
for (int i = 0; i < q; i++)
t *= p;
return t;
}
template <typename T> struct has_iter {
private:
template <typename U>
static constexpr true_type check(typename U::iterator *);
template <typename U> static constexpr false_type check(...);
public:
static constexpr bool value = decltype(check<T>(nullptr))::value;
};
template <typename T, typename U = typename T::iterator>
void print(const T &container) {
auto &&first = begin(container), last = end(container);
auto &&back = prev(last);
for (auto e = first; e != last; e = next(e))
cout << *e << " \n"[e == back];
}
extern void *enabler;
template <typename Head,
typename enable_if<!has_iter<Head>::value>::type *& = enabler>
void print(const Head &head) {
cout << head << endl;
}
template <> void print<string>(const string &container) {
cout << container << endl;
}
template <typename Head, typename... Tail>
void print(const Head &head, const Tail &...tail) {
cout << head << " ";
print(tail...);
}
template <typename... Args> void printd(const Args &...args) {
#ifdef DEBUG
print(args...);
#endif
}
template <typename Head> void input(Head &head) { cin >> head; }
template <typename Head, typename... Tail>
void input(Head &head, Tail &...tail) {
cin >> head;
input(tail...);
}
void io_speedup() {
cin.tie(0);
cout.tie(0);
ios::sync_with_stdio(false);
}
template <typename T> istream &operator>>(istream &is, vector<T> &vec) {
for (T &x : vec)
is >> x;
return is;
}
template <typename T, typename U>
istream &operator>>(istream &is, pair<T, U> &t) {
is >> t.first >> t.second;
return is;
}
template <int N, typename... Ts,
typename enable_if<N == sizeof...(Ts) - 1>::type *& = enabler>
void tuple_in(istream &is, tuple<Ts...> &t) {
is >> get<N>(t);
}
template <int N, typename... Ts,
typename enable_if<N<sizeof...(Ts) - 1>::type *& = enabler> void
tuple_in(istream &is, tuple<Ts...> &t) {
is >> get<N>(t);
tuple_in<N + 1, Ts...>(is, t);
}
template <typename... Ts> istream &operator>>(istream &is, tuple<Ts...> &t) {
tuple_in<0, Ts...>(is, t);
return is;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &t) {
os << '(' << t.first << ", " << t.second << ')';
return os;
}
template <int N, typename... Ts,
typename enable_if<N == sizeof...(Ts) - 1>::type *& = enabler>
void tuple_out(ostream &os, const tuple<Ts...> &t) {
os << get<N>(t);
}
template <int N, typename... Ts,
typename enable_if<N<sizeof...(Ts) - 1>::type *& = enabler> void
tuple_out(ostream &os, const tuple<Ts...> &t) {
os << get<N>(t) << ", ";
tuple_out<N + 1, Ts...>(os, t);
}
template <typename... Ts>
ostream &operator<<(ostream &os, const tuple<Ts...> &t) {
os << '(';
tuple_out<0, Ts...>(os, t);
os << ')';
return os;
}
template <typename T> vector<T> read(int n) {
vector<T> t(n);
cin >> t;
return t;
}
template <typename T> T read() {
T t;
cin >> t;
return t;
}
int main() {
int n;
cin >> n;
int a, b, c, d;
input(a, b, c, d);
auto s = read<string>();
a--;
b--;
c--;
d--;
bool f = 1;
FOR(i, a, c) {
if (s[i] == '#' && s[i + 1] == '#') {
f = 0;
printd(i);
break;
}
}
FOR(i, b, d) {
if (s[i] == '#' && s[i + 1] == '#') {
f = 0;
printd(i);
break;
}
}
if (c > d) {
bool f2 = 0;
FOR(i, b - 1, d) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
f2 = 1;
printd(i);
break;
}
}
f &= f2;
}
if (f)
print("Yes");
else
print("No");
} | [
"call.arguments.change",
"call.arguments.add"
] | 832,563 | 832,564 | u284759714 | cpp |
p03017 | #include <bits/stdc++.h>
#include <iomanip>
//#define DEBUG 1
using namespace std;
typedef long long LL;
typedef long double LD;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<LD, LD> PLDLD;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef vector<char> VB;
#define FOR(i, a, b) for (int i = (a); i < (int)(b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define RFOR(i, a, b) for (int i = (a)-1; i >= (int)(b); --i)
#define RREP(i, n) RFOR(i, n, 0)
#define CLR(a) memset((a), 0, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNQ(a) a.erase(std::unique(ALL(a)), a.end());
#define endl "\n"
#define BEGIN_STACK(size) \
void *dummy = malloc(size); \
void *org_stack; \
char *my = (char *)alloca((1 + (int)(((long long)dummy) & 127)) * 16); \
*my = 0; \
asm volatile("mov %%rsp, %%rbx\n" \
"mov %%rax, %%rsp" \
: "=b"(org_stack) \
: "a"((char *)dummy + (size)-1024));
#define END_STACK \
asm volatile("mov %%rax, %%rsp" ::"a"(org_stack)); \
free(dummy);
const LD EPS = 1e-10;
const long long INFLL = (LL)(1e9) * (LL)(1e9);
const int INF = 1e9 + 7;
template <class T> void chmin(T &a, const T b) {
if (a > b)
a = b;
}
template <class T> void chmax(T &a, const T b) {
if (a < b)
a = b;
}
const LL powLL(const LL p, const LL q) {
LL t = 1;
for (int i = 0; i < q; i++)
t *= p;
return t;
}
template <typename T> struct has_iter {
private:
template <typename U>
static constexpr true_type check(typename U::iterator *);
template <typename U> static constexpr false_type check(...);
public:
static constexpr bool value = decltype(check<T>(nullptr))::value;
};
template <typename T, typename U = typename T::iterator>
void print(const T &container) {
auto &&first = begin(container), last = end(container);
auto &&back = prev(last);
for (auto e = first; e != last; e = next(e))
cout << *e << " \n"[e == back];
}
extern void *enabler;
template <typename Head,
typename enable_if<!has_iter<Head>::value>::type *& = enabler>
void print(const Head &head) {
cout << head << endl;
}
template <> void print<string>(const string &container) {
cout << container << endl;
}
template <typename Head, typename... Tail>
void print(const Head &head, const Tail &...tail) {
cout << head << " ";
print(tail...);
}
template <typename... Args> void printd(const Args &...args) {
#ifdef DEBUG
print(args...);
#endif
}
template <typename Head> void input(Head &head) { cin >> head; }
template <typename Head, typename... Tail>
void input(Head &head, Tail &...tail) {
cin >> head;
input(tail...);
}
void io_speedup() {
cin.tie(0);
cout.tie(0);
ios::sync_with_stdio(false);
}
template <typename T> istream &operator>>(istream &is, vector<T> &vec) {
for (T &x : vec)
is >> x;
return is;
}
template <typename T, typename U>
istream &operator>>(istream &is, pair<T, U> &t) {
is >> t.first >> t.second;
return is;
}
template <int N, typename... Ts,
typename enable_if<N == sizeof...(Ts) - 1>::type *& = enabler>
void tuple_in(istream &is, tuple<Ts...> &t) {
is >> get<N>(t);
}
template <int N, typename... Ts,
typename enable_if<N<sizeof...(Ts) - 1>::type *& = enabler> void
tuple_in(istream &is, tuple<Ts...> &t) {
is >> get<N>(t);
tuple_in<N + 1, Ts...>(is, t);
}
template <typename... Ts> istream &operator>>(istream &is, tuple<Ts...> &t) {
tuple_in<0, Ts...>(is, t);
return is;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &t) {
os << '(' << t.first << ", " << t.second << ')';
return os;
}
template <int N, typename... Ts,
typename enable_if<N == sizeof...(Ts) - 1>::type *& = enabler>
void tuple_out(ostream &os, const tuple<Ts...> &t) {
os << get<N>(t);
}
template <int N, typename... Ts,
typename enable_if<N<sizeof...(Ts) - 1>::type *& = enabler> void
tuple_out(ostream &os, const tuple<Ts...> &t) {
os << get<N>(t) << ", ";
tuple_out<N + 1, Ts...>(os, t);
}
template <typename... Ts>
ostream &operator<<(ostream &os, const tuple<Ts...> &t) {
os << '(';
tuple_out<0, Ts...>(os, t);
os << ')';
return os;
}
template <typename T> vector<T> read(int n) {
vector<T> t(n);
cin >> t;
return t;
}
template <typename T> T read() {
T t;
cin >> t;
return t;
}
int main() {
int n;
cin >> n;
int a, b, c, d;
input(a, b, c, d);
auto s = read<string>();
a--;
b--;
c--;
d--;
bool f = 1;
FOR(i, a, c) {
if (s[i] == '#' && s[i + 1] == '#') {
f = 0;
printd(i);
break;
}
}
FOR(i, b, d) {
if (s[i] == '#' && s[i + 1] == '#') {
f = 0;
printd(i);
break;
}
}
if (c > d) {
bool f2 = 0;
FOR(i, b, d) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
f2 = 1;
printd(i);
break;
}
}
f &= f2;
}
if (f)
print("Yes");
else
print("No");
} | #include <bits/stdc++.h>
#include <iomanip>
//#define DEBUG 1
using namespace std;
typedef long long LL;
typedef long double LD;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<LD, LD> PLDLD;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef vector<char> VB;
#define FOR(i, a, b) for (int i = (a); i < (int)(b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define RFOR(i, a, b) for (int i = (a)-1; i >= (int)(b); --i)
#define RREP(i, n) RFOR(i, n, 0)
#define CLR(a) memset((a), 0, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNQ(a) a.erase(std::unique(ALL(a)), a.end());
#define endl "\n"
#define BEGIN_STACK(size) \
void *dummy = malloc(size); \
void *org_stack; \
char *my = (char *)alloca((1 + (int)(((long long)dummy) & 127)) * 16); \
*my = 0; \
asm volatile("mov %%rsp, %%rbx\n" \
"mov %%rax, %%rsp" \
: "=b"(org_stack) \
: "a"((char *)dummy + (size)-1024));
#define END_STACK \
asm volatile("mov %%rax, %%rsp" ::"a"(org_stack)); \
free(dummy);
const LD EPS = 1e-10;
const long long INFLL = (LL)(1e9) * (LL)(1e9);
const int INF = 1e9 + 7;
template <class T> void chmin(T &a, const T b) {
if (a > b)
a = b;
}
template <class T> void chmax(T &a, const T b) {
if (a < b)
a = b;
}
const LL powLL(const LL p, const LL q) {
LL t = 1;
for (int i = 0; i < q; i++)
t *= p;
return t;
}
template <typename T> struct has_iter {
private:
template <typename U>
static constexpr true_type check(typename U::iterator *);
template <typename U> static constexpr false_type check(...);
public:
static constexpr bool value = decltype(check<T>(nullptr))::value;
};
template <typename T, typename U = typename T::iterator>
void print(const T &container) {
auto &&first = begin(container), last = end(container);
auto &&back = prev(last);
for (auto e = first; e != last; e = next(e))
cout << *e << " \n"[e == back];
}
extern void *enabler;
template <typename Head,
typename enable_if<!has_iter<Head>::value>::type *& = enabler>
void print(const Head &head) {
cout << head << endl;
}
template <> void print<string>(const string &container) {
cout << container << endl;
}
template <typename Head, typename... Tail>
void print(const Head &head, const Tail &...tail) {
cout << head << " ";
print(tail...);
}
template <typename... Args> void printd(const Args &...args) {
#ifdef DEBUG
print(args...);
#endif
}
template <typename Head> void input(Head &head) { cin >> head; }
template <typename Head, typename... Tail>
void input(Head &head, Tail &...tail) {
cin >> head;
input(tail...);
}
void io_speedup() {
cin.tie(0);
cout.tie(0);
ios::sync_with_stdio(false);
}
template <typename T> istream &operator>>(istream &is, vector<T> &vec) {
for (T &x : vec)
is >> x;
return is;
}
template <typename T, typename U>
istream &operator>>(istream &is, pair<T, U> &t) {
is >> t.first >> t.second;
return is;
}
template <int N, typename... Ts,
typename enable_if<N == sizeof...(Ts) - 1>::type *& = enabler>
void tuple_in(istream &is, tuple<Ts...> &t) {
is >> get<N>(t);
}
template <int N, typename... Ts,
typename enable_if<N<sizeof...(Ts) - 1>::type *& = enabler> void
tuple_in(istream &is, tuple<Ts...> &t) {
is >> get<N>(t);
tuple_in<N + 1, Ts...>(is, t);
}
template <typename... Ts> istream &operator>>(istream &is, tuple<Ts...> &t) {
tuple_in<0, Ts...>(is, t);
return is;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &t) {
os << '(' << t.first << ", " << t.second << ')';
return os;
}
template <int N, typename... Ts,
typename enable_if<N == sizeof...(Ts) - 1>::type *& = enabler>
void tuple_out(ostream &os, const tuple<Ts...> &t) {
os << get<N>(t);
}
template <int N, typename... Ts,
typename enable_if<N<sizeof...(Ts) - 1>::type *& = enabler> void
tuple_out(ostream &os, const tuple<Ts...> &t) {
os << get<N>(t) << ", ";
tuple_out<N + 1, Ts...>(os, t);
}
template <typename... Ts>
ostream &operator<<(ostream &os, const tuple<Ts...> &t) {
os << '(';
tuple_out<0, Ts...>(os, t);
os << ')';
return os;
}
template <typename T> vector<T> read(int n) {
vector<T> t(n);
cin >> t;
return t;
}
template <typename T> T read() {
T t;
cin >> t;
return t;
}
int main() {
int n;
cin >> n;
int a, b, c, d;
input(a, b, c, d);
auto s = read<string>();
a--;
b--;
c--;
d--;
bool f = 1;
FOR(i, a, c) {
if (s[i] == '#' && s[i + 1] == '#') {
f = 0;
printd(i);
break;
}
}
FOR(i, b, d) {
if (s[i] == '#' && s[i + 1] == '#') {
f = 0;
printd(i);
break;
}
}
if (c > d) {
bool f2 = 0;
FOR(i, b - 1, d) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
f2 = 1;
printd(i);
break;
}
}
f &= f2;
}
if (f)
print("Yes");
else
print("No");
} | [
"expression.operation.binary.add"
] | 832,565 | 832,564 | u284759714 | cpp |
p03017 | #define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <bitset>
#include <climits>
#include <float.h>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <time.h>
#include <utility>
#include <vector>
using namespace std;
typedef pair<long long, long long> p;
long long gcd(long long a, long long b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
vector<long long> divisor(long long n) {
vector<long long> ret;
for (long long i = 1; i * i <= n; i++) {
if (n % i == 0) {
ret.push_back(i);
if (i * i != n)
ret.push_back(n / i);
}
}
sort(begin(ret), end(ret));
return (ret);
}
long long mod = 1e9 + 7;
struct LazySegmentTree {
private:
int n;
vector<int> node, lazy;
vector<bool> lazyFlag;
public:
LazySegmentTree(vector<int> v) {
int sz = (int)v.size();
n = 1;
while (n < sz)
n *= 2;
node.resize(2 * n - 1);
lazy.resize(2 * n - 1, INT_MAX);
lazyFlag.resize(2 * n - 1, false);
for (int i = 0; i < sz; i++)
node[i + n - 1] = v[i];
for (int i = n - 2; i >= 0; i--)
node[i] = min(node[i * 2 + 1], node[i * 2 + 2]);
}
void lazyEvaluate(int k, int l, int r) {
if (lazyFlag[k]) {
node[k] = lazy[k];
if (r - l > 1) {
lazy[k * 2 + 1] = lazy[k * 2 + 2] = lazy[k];
lazyFlag[k * 2 + 1] = lazyFlag[k * 2 + 2] = true;
}
lazyFlag[k] = false;
}
}
void update(int a, int b, int x, int k = 0, int l = 0, int r = -1) {
if (r < 0)
r = n;
lazyEvaluate(k, l, r);
if (b <= l || r <= a)
return;
if (a <= l && r <= b) {
lazy[k] = x;
lazyFlag[k] = true;
lazyEvaluate(k, l, r);
} else {
update(a, b, x, 2 * k + 1, l, (l + r) / 2);
update(a, b, x, 2 * k + 2, (l + r) / 2, r);
node[k] = min(node[2 * k + 1], node[2 * k + 2]);
}
}
int find(int a, int b, int k = 0, int l = 0, int r = -1) {
if (r < 0)
r = n;
lazyEvaluate(k, l, r);
if (b <= l || r <= a)
return INT_MAX;
if (a <= l && r <= b)
return node[k];
int vl = find(a, b, 2 * k + 1, l, (l + r) / 2);
int vr = find(a, b, 2 * k + 2, (l + r) / 2, r);
return min(vl, vr);
}
};
typedef pair<int, p> pai;
signed main() {
cin.tie(0);
ios::sync_with_stdio(false);
cout << fixed << setprecision(16);
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
string ans = "Yes";
for (int i = b - 1; i <= d - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
ans = "No";
}
for (int i = a - 1; i <= c - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
ans = "No";
}
if (c > d) {
int judge = 0;
for (int i = b - 1 - 1; i <= d - 1 - 2; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.')
judge = 1;
}
if (judge == 0)
ans = "No";
}
cout << ans;
} | #define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <bitset>
#include <climits>
#include <float.h>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <time.h>
#include <utility>
#include <vector>
using namespace std;
typedef pair<long long, long long> p;
long long gcd(long long a, long long b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
vector<long long> divisor(long long n) {
vector<long long> ret;
for (long long i = 1; i * i <= n; i++) {
if (n % i == 0) {
ret.push_back(i);
if (i * i != n)
ret.push_back(n / i);
}
}
sort(begin(ret), end(ret));
return (ret);
}
long long mod = 1e9 + 7;
struct LazySegmentTree {
private:
int n;
vector<int> node, lazy;
vector<bool> lazyFlag;
public:
LazySegmentTree(vector<int> v) {
int sz = (int)v.size();
n = 1;
while (n < sz)
n *= 2;
node.resize(2 * n - 1);
lazy.resize(2 * n - 1, INT_MAX);
lazyFlag.resize(2 * n - 1, false);
for (int i = 0; i < sz; i++)
node[i + n - 1] = v[i];
for (int i = n - 2; i >= 0; i--)
node[i] = min(node[i * 2 + 1], node[i * 2 + 2]);
}
void lazyEvaluate(int k, int l, int r) {
if (lazyFlag[k]) {
node[k] = lazy[k];
if (r - l > 1) {
lazy[k * 2 + 1] = lazy[k * 2 + 2] = lazy[k];
lazyFlag[k * 2 + 1] = lazyFlag[k * 2 + 2] = true;
}
lazyFlag[k] = false;
}
}
void update(int a, int b, int x, int k = 0, int l = 0, int r = -1) {
if (r < 0)
r = n;
lazyEvaluate(k, l, r);
if (b <= l || r <= a)
return;
if (a <= l && r <= b) {
lazy[k] = x;
lazyFlag[k] = true;
lazyEvaluate(k, l, r);
} else {
update(a, b, x, 2 * k + 1, l, (l + r) / 2);
update(a, b, x, 2 * k + 2, (l + r) / 2, r);
node[k] = min(node[2 * k + 1], node[2 * k + 2]);
}
}
int find(int a, int b, int k = 0, int l = 0, int r = -1) {
if (r < 0)
r = n;
lazyEvaluate(k, l, r);
if (b <= l || r <= a)
return INT_MAX;
if (a <= l && r <= b)
return node[k];
int vl = find(a, b, 2 * k + 1, l, (l + r) / 2);
int vr = find(a, b, 2 * k + 2, (l + r) / 2, r);
return min(vl, vr);
}
};
typedef pair<int, p> pai;
signed main() {
cin.tie(0);
ios::sync_with_stdio(false);
cout << fixed << setprecision(16);
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
string ans = "Yes";
for (int i = b - 1; i <= d - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
ans = "No";
}
for (int i = a - 1; i <= c - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
ans = "No";
}
if (c > d) {
int judge = 0;
for (int i = b - 1 - 1; i <= d - 1 - 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.')
judge = 1;
}
if (judge == 0)
ans = "No";
}
cout << ans;
} | [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 832,570 | 832,571 | u313288017 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i, n) FOR(i, 0, (n))
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define LAR(a, b) ((a) = max((a), (b)))
#define SML(a, b) ((a) = min((a), (b)))
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pair<int, int>> vpii;
typedef pair<int, int> pii;
#define PB push_back
#define EB emplace_back
#ifdef LOCAL_DEBUG
#define DEBUG(...) printf(__VA_ARGS__)
#else
#define DEBUG(...)
#endif
#define N 212345
char s[N];
void ng() {
printf("No\n");
exit(0);
}
bool chk(int x, int y) {
for (int i = x; i + 1 < y; i++) {
if (s[i] == '#' && s[i + 1] == '#')
return false;
}
return true;
}
int main() {
int n, a, b, c, d;
scanf("%d%d%d%d%d%s", &n, &a, &b, &c, &d, s);
a--;
b--;
c--;
d--;
if (!chk(a, c))
ng();
if (!chk(b, d))
ng();
if (d < c) {
bool ok = false;
for (int i = b; i < d; i++) {
int j = i - 1, k = i + 1;
if (j < 0 || k >= n)
continue;
if (s[j] == '.' && s[i] == '.' && s[k] == '.')
ok = true;
}
if (!ok)
ng();
}
printf("Yes\n");
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i, n) FOR(i, 0, (n))
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define LAR(a, b) ((a) = max((a), (b)))
#define SML(a, b) ((a) = min((a), (b)))
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pair<int, int>> vpii;
typedef pair<int, int> pii;
#define PB push_back
#define EB emplace_back
#ifdef LOCAL_DEBUG
#define DEBUG(...) printf(__VA_ARGS__)
#else
#define DEBUG(...)
#endif
#define N 212345
char s[N];
void ng() {
printf("No\n");
exit(0);
}
bool chk(int x, int y) {
for (int i = x; i + 1 < y; i++) {
if (s[i] == '#' && s[i + 1] == '#')
return false;
}
return true;
}
int main() {
int n, a, b, c, d;
scanf("%d%d%d%d%d%s", &n, &a, &b, &c, &d, s);
a--;
b--;
c--;
d--;
if (!chk(a, c))
ng();
if (!chk(b, d))
ng();
if (d < c) {
bool ok = false;
for (int i = b; i <= d; i++) {
int j = i - 1, k = i + 1;
if (j < 0 || k >= n)
continue;
if (s[j] == '.' && s[i] == '.' && s[k] == '.')
ok = true;
}
if (!ok)
ng();
}
printf("Yes\n");
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 832,572 | 832,573 | u483277935 | cpp |
p03017 | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#pragma comment(linker, "/STACK:36777216")
using namespace std;
#define MP make_pair
#define all(v) (v).begin(), (v).end()
#define PROBLEM_ID "A"
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<bool> vb;
typedef long double ld;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef pair<ll, ll> pll;
bool IsPossible(const string &s, int from, int to) {
for (int i = from + 1; i + 2 <= to; ++i) {
if (s[i] == '#' && s[i + 1] == '#') {
return false;
}
}
return true;
}
int main() {
// freopen(PROBLEM_ID".in", "r", stdin);
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
--a;
--b;
--c;
--d;
string s;
cin >> s;
bool result = false;
if (c < d) {
result = IsPossible(s, a, c) && IsPossible(s, b, d);
} else {
for (int i = b; i + 2 <= d + 1; ++i) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
result = IsPossible(s, a, i) && IsPossible(s, b, i + 1) &&
IsPossible(s, i + 1, d) && IsPossible(s, i + 2, c);
break;
}
}
}
if (result) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#pragma comment(linker, "/STACK:36777216")
using namespace std;
#define MP make_pair
#define all(v) (v).begin(), (v).end()
#define PROBLEM_ID "A"
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<bool> vb;
typedef long double ld;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef pair<ll, ll> pll;
bool IsPossible(const string &s, int from, int to) {
for (int i = from + 1; i + 2 <= to; ++i) {
if (s[i] == '#' && s[i + 1] == '#') {
return false;
}
}
return true;
}
int main() {
// freopen(PROBLEM_ID".in", "r", stdin);
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
--a;
--b;
--c;
--d;
string s;
cin >> s;
bool result = false;
if (c < d) {
result = IsPossible(s, a, c) && IsPossible(s, b, d);
} else {
for (int i = b - 1; i + 2 <= d + 1; ++i) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
result = IsPossible(s, a, i) && IsPossible(s, b, i + 1) &&
IsPossible(s, i + 1, d) && IsPossible(s, i + 2, c);
break;
}
}
}
if (result) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| [
"control_flow.loop.for.initializer.change"
] | 832,574 | 832,575 | u712981454 | cpp |
p03017 | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#pragma comment(linker, "/STACK:36777216")
using namespace std;
#define MP make_pair
#define all(v) (v).begin(), (v).end()
#define PROBLEM_ID "A"
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<bool> vb;
typedef long double ld;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef pair<ll, ll> pll;
bool IsPossible(const string &s, int from, int to) {
for (int i = from + 1; i + 2 <= to; ++i) {
if (s[i] == '#' && s[i + 1] == '#') {
return false;
}
}
return true;
}
int main() {
// freopen(PROBLEM_ID".in", "r", stdin);
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
--a;
--b;
--c;
--d;
string s;
cin >> s;
bool result = false;
if (c < d) {
result = IsPossible(s, a, c) && IsPossible(s, b, d);
} else {
for (int i = b; i + 2 <= d; ++i) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
result = IsPossible(s, a, i) && IsPossible(s, b, i + 1) &&
IsPossible(s, i + 1, d) && IsPossible(s, i + 2, c);
break;
}
}
}
if (result) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#pragma comment(linker, "/STACK:36777216")
using namespace std;
#define MP make_pair
#define all(v) (v).begin(), (v).end()
#define PROBLEM_ID "A"
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<bool> vb;
typedef long double ld;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef pair<ll, ll> pll;
bool IsPossible(const string &s, int from, int to) {
for (int i = from + 1; i + 2 <= to; ++i) {
if (s[i] == '#' && s[i + 1] == '#') {
return false;
}
}
return true;
}
int main() {
// freopen(PROBLEM_ID".in", "r", stdin);
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
--a;
--b;
--c;
--d;
string s;
cin >> s;
bool result = false;
if (c < d) {
result = IsPossible(s, a, c) && IsPossible(s, b, d);
} else {
for (int i = b - 1; i + 2 <= d + 1; ++i) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
result = IsPossible(s, a, i) && IsPossible(s, b, i + 1) &&
IsPossible(s, i + 1, d) && IsPossible(s, i + 2, c);
break;
}
}
}
if (result) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| [
"control_flow.loop.for.initializer.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 832,576 | 832,575 | u712981454 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
A--;
B--;
C--;
D--;
string S;
cin >> S;
for (int i = min(A, B); i < max(C, D); i++) {
if (S[i] == '#' && S[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
if ((A < B) && (C < D) || (A > B) && (C > D)) {
cout << "Yes" << endl;
return 0;
}
for (int i = max(A, B); i < min(C, D) - 1; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main(void) {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
A--;
B--;
C--;
D--;
string S;
cin >> S;
for (int i = min(A, B); i < max(C, D); i++) {
if (S[i] == '#' && S[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
if ((A < B) && (C < D) || (A > B) && (C > D)) {
cout << "Yes" << endl;
return 0;
}
for (int i = max(A, B) - 1; i < min(C, D); i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0;
}
| [
"control_flow.loop.for.initializer.change",
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove"
] | 832,577 | 832,578 | u898331860 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
int n, A, B, C, D;
char ch[400010];
int main() {
scanf("%d%d%d%d%d", &n, &A, &B, &C, &D);
scanf("%s", ch + 1);
if (C < D) {
for (int i = B + 1; i < D; i++)
if (ch[i - 1] == '#' && ch[i] == '#') {
puts("No");
return 0;
}
for (int i = A + 1; i < C; i++)
if (ch[i - 1] == '#' && ch[i] == '#') {
puts("No");
return 0;
}
puts("Yes");
return 0;
} else {
int flag = 0;
for (int i = B + 1; i < D; i++)
if (ch[i - 1] == '#' && ch[i] == '#') {
puts("No");
return 0;
} else if (ch[i - 1] == '.' && ch[i] == '.' && ch[i + 1] == '.')
flag = 1;
if (!flag) {
puts("No");
return 0;
}
for (int i = A + 1; i < C; i++)
if (ch[i - 1] == '#' && ch[i] == '#') {
puts("No");
return 0;
}
puts("Yes");
return 0;
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int n, A, B, C, D;
char ch[400010];
int main() {
scanf("%d%d%d%d%d", &n, &A, &B, &C, &D);
scanf("%s", ch + 1);
if (C < D) {
for (int i = B + 1; i < D; i++)
if (ch[i - 1] == '#' && ch[i] == '#') {
puts("No");
return 0;
}
for (int i = A + 1; i < C; i++)
if (ch[i - 1] == '#' && ch[i] == '#') {
puts("No");
return 0;
}
puts("Yes");
return 0;
} else {
int flag = 0;
for (int i = B; i <= D; i++)
if (ch[i - 1] == '#' && ch[i] == '#') {
puts("No");
return 0;
} else if (ch[i - 1] == '.' && ch[i] == '.' && ch[i + 1] == '.')
flag = 1;
if (!flag) {
puts("No");
return 0;
}
for (int i = A + 1; i < C; i++)
if (ch[i - 1] == '#' && ch[i] == '#') {
puts("No");
return 0;
}
puts("Yes");
return 0;
}
return 0;
} | [
"control_flow.loop.for.initializer.change",
"expression.operation.binary.remove",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 832,579 | 832,580 | u902487619 | cpp |
p03017 | #include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
int n, a, b, c, d;
char s[200020];
int main() {
scanf("%d %d %d %d %d", &n, &a, &b, &c, &d);
scanf("%s", s + 1);
int flag = 1;
for (int i = a; i < c; ++i)
if (s[i] == '#' && s[i + 1] == '#') {
flag = 0;
break;
}
for (int i = b; i < d; ++i)
if (s[i] == '#' && s[i + 1] == '#') {
flag = 0;
break;
}
if (c > d) {
int fl = 0;
for (int i = b + 1; i < d; ++i)
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.') {
fl = 1;
break;
}
flag &= fl;
}
if (flag)
printf("Yes");
else
printf("No");
return 0;
}
| #include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
int n, a, b, c, d;
char s[200020];
int main() {
scanf("%d %d %d %d %d", &n, &a, &b, &c, &d);
scanf("%s", s + 1);
int flag = 1;
for (int i = a; i < c; ++i)
if (s[i] == '#' && s[i + 1] == '#') {
flag = 0;
break;
}
for (int i = b; i < d; ++i)
if (s[i] == '#' && s[i + 1] == '#') {
flag = 0;
break;
}
if (c > d) {
int fl = 0;
for (int i = b; i <= d; ++i)
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.') {
fl = 1;
break;
}
flag &= fl;
}
if (flag)
printf("Yes");
else
printf("No");
return 0;
}
| [
"control_flow.loop.for.initializer.change",
"expression.operation.binary.remove",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 832,581 | 832,582 | u361707943 | cpp |
p03017 | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
clock_t __my_start_clock = clock();
#else
#define eprintf(...)
#endif
#define TIMESTAMP(x) \
eprintf("[" #x "] Time : %.3lf s.\n", \
(clock() - __my_start_clock) * 1.0 / CLOCKS_PER_SEC)
#define TIMESTAMPf(x, ...) \
eprintf("[" x "] Time : %.3lf s.\n", __VA_ARGS__, \
(clock() - __my_start_clock) * 1.0 / CLOCKS_PER_SEC)
using namespace std;
#ifdef LOCAL
static struct __timestamper {
string what;
__timestamper(const char *what) : what(what){};
__timestamper(const string &what) : what(what){};
~__timestamper() { TIMESTAMPf("%s", what.data()); }
} __TIMESTAMPER("end");
#else
struct __timestamper {};
#endif
typedef long long ll;
typedef long double ld;
char s[300000];
int main() {
#ifdef LOCAL
freopen("a.in", "r", stdin);
freopen("a.out", "w", stdout);
#endif
int n;
while (scanf("%d", &n) == 1) {
int a, b, c, d;
scanf("%d%d%d%d", &a, &b, &c, &d);
--a, --b, --c, --d;
scanf("%s", s);
auto check = [](int a, int b) {
for (int i = a; i < b - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
return false;
}
}
return true;
};
bool result = check(a, c) && check(b, d);
if (result && c > d) {
bool change = false;
for (int i = b; i <= d; i++) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.') {
change = true;
}
}
result &= change;
}
printf("%s\n", result ? "YES" : "NO");
}
return 0;
}
| #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
clock_t __my_start_clock = clock();
#else
#define eprintf(...)
#endif
#define TIMESTAMP(x) \
eprintf("[" #x "] Time : %.3lf s.\n", \
(clock() - __my_start_clock) * 1.0 / CLOCKS_PER_SEC)
#define TIMESTAMPf(x, ...) \
eprintf("[" x "] Time : %.3lf s.\n", __VA_ARGS__, \
(clock() - __my_start_clock) * 1.0 / CLOCKS_PER_SEC)
using namespace std;
#ifdef LOCAL
static struct __timestamper {
string what;
__timestamper(const char *what) : what(what){};
__timestamper(const string &what) : what(what){};
~__timestamper() { TIMESTAMPf("%s", what.data()); }
} __TIMESTAMPER("end");
#else
struct __timestamper {};
#endif
typedef long long ll;
typedef long double ld;
char s[300000];
int main() {
#ifdef LOCAL
freopen("a.in", "r", stdin);
freopen("a.out", "w", stdout);
#endif
int n;
while (scanf("%d", &n) == 1) {
int a, b, c, d;
scanf("%d%d%d%d", &a, &b, &c, &d);
--a, --b, --c, --d;
scanf("%s", s);
auto check = [](int a, int b) {
for (int i = a; i < b - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
return false;
}
}
return true;
};
bool result = check(a, c) && check(b, d);
if (result && c > d) {
bool change = false;
for (int i = b; i <= d; i++) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.') {
change = true;
}
}
result &= change;
}
printf("%s\n", result ? "Yes" : "No");
}
return 0;
}
| [
"literal.string.change",
"literal.string.case.change",
"call.arguments.change",
"io.output.change"
] | 832,587 | 832,588 | u389366406 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORd(i, a, b) for (int i = (a)-1; i >= (b); --i)
#define FORall(it, a) \
for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define sz(a) int((a).size())
#define present(t, x) (t.find(x) != t.end())
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define prec(n) fixed << setprecision(n)
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
const int MOD = (int)1e9 + 7;
const int FFTMOD = 119 << 23 | 1;
const int INF = (int)1e9 + 23111992;
const ll LINF = (ll)1e18 + 23111992;
const ld PI = acos((ld)-1);
const ld EPS = 1e-9;
inline ll gcd(ll a, ll b) {
ll r;
while (b) {
r = a % b;
a = b;
b = r;
}
return a;
}
inline ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
inline ll fpow(ll n, ll k, int p = MOD) {
ll r = 1;
for (; k; k >>= 1) {
if (k & 1)
r = r * n % p;
n = n * n % p;
}
return r;
}
template <class T> inline int chkmin(T &a, const T &val) {
return val < a ? a = val, 1 : 0;
}
template <class T> inline int chkmax(T &a, const T &val) {
return a < val ? a = val, 1 : 0;
}
inline ull isqrt(ull k) {
ull r = sqrt(k) + 1;
while (r * r > k)
r--;
return r;
}
inline ll icbrt(ll k) {
ll r = cbrt(k) + 1;
while (r * r * r > k)
r--;
return r;
}
inline void addmod(int &a, int val, int p = MOD) {
if ((a = (a + val)) >= p)
a -= p;
}
inline void submod(int &a, int val, int p = MOD) {
if ((a = (a - val)) < 0)
a += p;
}
inline int mult(int a, int b, int p = MOD) { return (ll)a * b % p; }
inline int inv(int a, int p = MOD) { return fpow(a, p - 2, p); }
inline int sign(ld x) { return x < -EPS ? -1 : x > +EPS; }
inline int sign(ld x, ld y) { return sign(x - y); }
mt19937 mt(chrono::high_resolution_clock::now().time_since_epoch().count());
inline int mrand() { return abs((int)mt()); }
#define db(x) cerr << "[" << #x << ": " << (x) << "] ";
#define endln cerr << "\n";
void chemthan() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
a--, b--, c--, d--;
string s;
cin >> s;
FOR(i, a, c) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "NO\n";
return;
}
}
FOR(i, b, d) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "NO\n";
return;
}
}
if (c <= d) {
cout << "YES\n";
return;
}
FOR(i, b, d + 1) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.') {
cout << "YES\n";
return;
}
}
cout << "NO\n";
}
int main(int argc, char *argv[]) {
ios_base::sync_with_stdio(0), cin.tie(0);
if (argc > 1) {
assert(freopen(argv[1], "r", stdin));
}
if (argc > 2) {
assert(freopen(argv[2], "wb", stdout));
}
chemthan();
cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORd(i, a, b) for (int i = (a)-1; i >= (b); --i)
#define FORall(it, a) \
for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define sz(a) int((a).size())
#define present(t, x) (t.find(x) != t.end())
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define prec(n) fixed << setprecision(n)
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
const int MOD = (int)1e9 + 7;
const int FFTMOD = 119 << 23 | 1;
const int INF = (int)1e9 + 23111992;
const ll LINF = (ll)1e18 + 23111992;
const ld PI = acos((ld)-1);
const ld EPS = 1e-9;
inline ll gcd(ll a, ll b) {
ll r;
while (b) {
r = a % b;
a = b;
b = r;
}
return a;
}
inline ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
inline ll fpow(ll n, ll k, int p = MOD) {
ll r = 1;
for (; k; k >>= 1) {
if (k & 1)
r = r * n % p;
n = n * n % p;
}
return r;
}
template <class T> inline int chkmin(T &a, const T &val) {
return val < a ? a = val, 1 : 0;
}
template <class T> inline int chkmax(T &a, const T &val) {
return a < val ? a = val, 1 : 0;
}
inline ull isqrt(ull k) {
ull r = sqrt(k) + 1;
while (r * r > k)
r--;
return r;
}
inline ll icbrt(ll k) {
ll r = cbrt(k) + 1;
while (r * r * r > k)
r--;
return r;
}
inline void addmod(int &a, int val, int p = MOD) {
if ((a = (a + val)) >= p)
a -= p;
}
inline void submod(int &a, int val, int p = MOD) {
if ((a = (a - val)) < 0)
a += p;
}
inline int mult(int a, int b, int p = MOD) { return (ll)a * b % p; }
inline int inv(int a, int p = MOD) { return fpow(a, p - 2, p); }
inline int sign(ld x) { return x < -EPS ? -1 : x > +EPS; }
inline int sign(ld x, ld y) { return sign(x - y); }
mt19937 mt(chrono::high_resolution_clock::now().time_since_epoch().count());
inline int mrand() { return abs((int)mt()); }
#define db(x) cerr << "[" << #x << ": " << (x) << "] ";
#define endln cerr << "\n";
void chemthan() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
a--, b--, c--, d--;
string s;
cin >> s;
FOR(i, a, c) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No\n";
return;
}
}
FOR(i, b, d) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No\n";
return;
}
}
if (c <= d) {
cout << "Yes\n";
return;
}
FOR(i, b, d + 1) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.') {
cout << "Yes\n";
return;
}
}
cout << "No\n";
}
int main(int argc, char *argv[]) {
ios_base::sync_with_stdio(0), cin.tie(0);
if (argc > 1) {
assert(freopen(argv[1], "r", stdin));
}
if (argc > 2) {
assert(freopen(argv[2], "wb", stdout));
}
chemthan();
cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
return 0;
}
| [
"literal.string.change",
"literal.string.case.change",
"io.output.change"
] | 832,589 | 832,590 | u264312457 | cpp |
p03018 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int main() {
string s;
cin >> s;
int n = s.size();
ll ans = 0;
ll cnt = 0;
for (int i = 0; i < n - 2; i++) {
if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C') {
ans += cnt + 1;
s[i + 2] = 'A';
} else if (s[i] == 'A') {
cnt++;
} else {
cnt = 0;
}
}
cout << ans << endl;
return 0;
} | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int main() {
string s;
cin >> s;
int n = s.size();
ll ans = 0;
ll cnt = 0;
for (int i = 0; i < n - 2; i++) {
if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C') {
ans += cnt + 1;
s[i + 2] = 'A';
i++;
} else if (s[i] == 'A') {
cnt++;
} else {
cnt = 0;
}
}
cout << ans << endl;
return 0;
} | [
"expression.unary.arithmetic.add"
] | 832,601 | 832,602 | u859566721 | cpp |
p03017 | #include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <vector>
typedef long long ll;
typedef unsigned short int unsi;
typedef unsigned int uni;
typedef unsigned long int unli;
using namespace std;
int main() {
int N, A, B, C, D;
string S;
bool IsRock = false;
bool FirstSpace = false;
bool SecondSpace = false;
bool Escapable = false;
bool UnPossible = false;
cin >> N;
cin >> A;
cin >> B;
cin >> C;
cin >> D;
cin >> S;
if (C < B) {
for (int i = A + 1; i <= C; i++) {
if (S[i - 1] == '#') {
if (!IsRock) {
IsRock = true;
} else if (IsRock) {
UnPossible = true;
break;
}
} else {
IsRock = false;
}
}
if (UnPossible) {
cout << "No" << endl;
} else {
for (int i = B + 1; i <= D; i++) {
if (S[i - 1] == '#') {
if (!IsRock) {
IsRock = true;
} else if (IsRock) {
UnPossible = true;
break;
}
} else {
IsRock = false;
}
}
if (UnPossible) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
}
} else if (C < D) {
for (int i = A + 1; i <= D; i++) {
if (S[i - 1] == '#') {
if (!IsRock) {
IsRock = true;
} else if (IsRock) {
UnPossible = true;
break;
}
} else {
IsRock = false;
}
}
if (UnPossible) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
} else if (D < C) {
for (int i = B; i <= D + 1; i++) {
if (S[i - 1] != '#') {
if (!FirstSpace) {
FirstSpace = true;
} else if (!SecondSpace) {
SecondSpace = true;
} else {
Escapable = true;
break;
}
} else {
FirstSpace = false;
SecondSpace = false;
}
}
if (Escapable) {
for (int i = A + 1; i <= C; i++) {
if (S[i - 1] == '#') {
if (!IsRock) {
IsRock = true;
} else if (IsRock) {
UnPossible = true;
break;
}
} else {
IsRock = false;
}
}
} else {
UnPossible = true;
}
if (UnPossible) {
cout << "No" << endl;
} else if (!UnPossible) {
cout << "Yes" << endl;
}
}
} | #include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <vector>
typedef long long ll;
typedef unsigned short int unsi;
typedef unsigned int uni;
typedef unsigned long int unli;
using namespace std;
int main() {
int N, A, B, C, D;
string S;
bool IsRock = false;
bool FirstSpace = false;
bool SecondSpace = false;
bool Escapable = false;
bool UnPossible = false;
cin >> N;
cin >> A;
cin >> B;
cin >> C;
cin >> D;
cin >> S;
if (C < B) {
//岩2連の詰み探索
for (int i = A + 1; i <= C; i++) {
if (S[i - 1] == '#') {
if (!IsRock) {
IsRock = true;
} else if (IsRock) {
UnPossible = true;
break;
}
} else {
IsRock = false;
}
}
if (UnPossible) {
cout << "No" << endl;
} else {
//岩2連の詰み探索
for (int i = B + 1; i <= D; i++) {
if (S[i - 1] == '#') {
if (!IsRock) {
IsRock = true;
} else if (IsRock) {
UnPossible = true;
break;
}
} else {
IsRock = false;
}
}
if (UnPossible) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
}
} else if (C < D) {
//岩2連の詰み探索
for (int i = A + 1; i <= D; i++) {
if (S[i - 1] == '#') {
if (!IsRock) {
IsRock = true;
} else if (IsRock) {
UnPossible = true;
break;
}
} else {
IsRock = false;
}
}
if (UnPossible) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
} else if (D < C) {
//空きマス3連探索
for (int i = B - 1; i <= D + 1; i++) {
if (S[i - 1] != '#') {
if (!FirstSpace) {
FirstSpace = true;
} else if (!SecondSpace) {
SecondSpace = true;
} else {
Escapable = true;
break;
}
} else {
FirstSpace = false;
SecondSpace = false;
}
}
//岩2連の詰み探索
if (Escapable) {
for (int i = A + 1; i <= C; i++) {
if (S[i - 1] == '#') {
if (!IsRock) {
IsRock = true;
} else if (IsRock) {
UnPossible = true;
break;
}
} else {
IsRock = false;
}
}
} else {
UnPossible = true;
}
if (UnPossible) {
cout << "No" << endl;
} else if (!UnPossible) {
cout << "Yes" << endl;
}
}
} | [
"control_flow.loop.for.initializer.change"
] | 832,617 | 832,618 | u848871413 | cpp |
p03017 | #include <algorithm>
#include <cmath>
#include <iostream>
#include <limits>
#include <numeric>
#include <string>
#include <utility>
#include <vector>
int main() {
int N, A, B, C, D;
std::string S;
std::cin >> N >> A >> B >> C >> D;
std::cin >> S;
if (C < D) {
int re_rock = 0;
for (int i = A - 1; i < D; i++) {
if (S[i] == '#')
re_rock++;
else
re_rock = 0;
if (re_rock == 2) {
std::cout << "No" << std::endl;
return 0;
}
}
} else {
int re_rock = 0;
int B_cnt = 0;
int max_B_cnt = 0;
for (int i = A - 1; i < C; i++) {
if (S[i] == '#')
re_rock++;
else
re_rock = 0;
if (re_rock == 2) {
std::cout << "No" << std::endl;
return 0;
}
if (i >= B - 1 && i <= D - 1) {
if (S[i] == '.')
B_cnt++;
else
B_cnt = 0;
if (max_B_cnt < B_cnt)
max_B_cnt = B_cnt;
}
}
if (max_B_cnt < 3) {
if (S[D - 2] == '#' || S[D] == '#') {
std::cout << "No" << std::endl;
return 0;
}
} else {
if (D - B > 1) {
}
}
}
std::cout << "Yes" << std::endl;
return 0;
} | #include <algorithm>
#include <cmath>
#include <iostream>
#include <limits>
#include <numeric>
#include <string>
#include <utility>
#include <vector>
int main() {
int N, A, B, C, D;
std::string S;
std::cin >> N >> A >> B >> C >> D;
std::cin >> S;
if (C < D) {
int re_rock = 0;
for (int i = A - 1; i < D; i++) {
if (S[i] == '#')
re_rock++;
else
re_rock = 0;
if (re_rock == 2) {
std::cout << "No" << std::endl;
return 0;
}
}
} else {
int re_rock = 0;
int B_cnt = 0;
int max_B_cnt = 0;
for (int i = A - 1; i < C; i++) {
if (S[i] == '#')
re_rock++;
else
re_rock = 0;
if (re_rock == 2) {
std::cout << "No" << std::endl;
return 0;
}
if (i >= B - 2 && i <= D - 1) {
if (S[i] == '.')
B_cnt++;
else
B_cnt = 0;
if (max_B_cnt < B_cnt)
max_B_cnt = B_cnt;
}
}
if (max_B_cnt < 3) {
if (S[D - 2] == '#' || S[D] == '#') {
std::cout << "No" << std::endl;
return 0;
}
} else {
if (D - B > 1) {
}
}
}
std::cout << "Yes" << std::endl;
return 0;
} | [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 832,621 | 832,622 | u005702636 | cpp |
p03017 | #include <cmath>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
int a, b, c, d;
cin >> a >> b >> c >> d;
string s;
cin >> s;
for (int i = b - 1; i < d - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
bool dot = false;
if (c > d) {
for (int i = b - 1; i < d - 2; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
dot = true;
break;
}
}
}
if (dot == false) {
s[d - 1] = '#';
}
for (int i = a - 1; i < c - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
} | #include <cmath>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
int a, b, c, d;
cin >> a >> b >> c >> d;
string s;
cin >> s;
for (int i = b - 1; i < d - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
bool dot = false;
if (c > d) {
for (int i = b - 2; i < d - 2; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
dot = true;
break;
}
}
}
if (dot == false) {
s[d - 1] = '#';
}
for (int i = a - 1; i < c - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
} | [
"literal.number.change",
"control_flow.loop.for.initializer.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 832,626 | 832,627 | u135203576 | cpp |
p03017 | #include <cmath>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
int a, b, c, d;
cin >> a >> b >> c >> d;
string s;
cin >> s;
for (int i = b - 1; i < d - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
bool dot = false;
if (c > d) {
for (int i = a - 1; i < c - 2; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
dot = true;
break;
}
}
}
if (dot == false) {
s[d - 1] = '#';
}
for (int i = a - 1; i < c - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
} | #include <cmath>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
int a, b, c, d;
cin >> a >> b >> c >> d;
string s;
cin >> s;
for (int i = b - 1; i < d - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
bool dot = false;
if (c > d) {
for (int i = b - 2; i < d - 2; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
dot = true;
break;
}
}
}
if (dot == false) {
s[d - 1] = '#';
}
for (int i = a - 1; i < c - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
} | [
"identifier.change",
"control_flow.loop.for.initializer.change",
"expression.operation.binary.change",
"literal.number.change",
"expression.off_by_one",
"control_flow.branch.if.condition.change"
] | 832,628 | 832,627 | u135203576 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
int count = 0;
for (ll i = a - 1; i < c - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
count++;
break;
}
}
for (ll i = b - 1; i < d - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
count++;
break;
}
}
if (count != 0)
cout << "No" << endl;
else {
if (c < d) {
cout << "Yes" << endl;
} else {
if (s[d - 2] == '#' || s[d] == '#') {
int count2 = 0;
for (ll i = 0; i < d - 2; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
count2++;
break;
}
}
if (count2 == 0)
cout << "No" << endl;
else
cout << "Yes" << endl;
} else
cout << "Yes" << endl;
}
}
}
| #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
int count = 0;
for (ll i = a - 1; i < c - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
count++;
break;
}
}
for (ll i = b - 1; i < d - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
count++;
break;
}
}
if (count != 0)
cout << "No" << endl;
else {
if (c < d) {
cout << "Yes" << endl;
} else {
if (s[d - 2] == '#' || s[d] == '#') {
int count2 = 0;
for (ll i = b - 2; i < d - 2; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
count2++;
break;
}
}
if (count2 == 0)
cout << "No" << endl;
else
cout << "Yes" << endl;
} else
cout << "Yes" << endl;
}
}
}
| [
"identifier.replace.add",
"literal.replace.remove",
"control_flow.loop.for.initializer.change"
] | 832,629 | 832,630 | u330689597 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
int n, a, b, c, d;
char s[200005];
int sign = 0;
int main() {
scanf("%d%d%d%d%d", &n, &a, &b, &c, &d);
scanf("%s", s);
int n = strlen(s);
if (s[c - 1] == '#' || s[d - 1] == '#') {
printf("No\n");
return 0;
}
if (c < d) {
for (int i = a - 1; i < d - 1; i++) {
if (s[i + 1] == '#' && s[i] == '#') {
printf("No\n");
return 0;
}
}
printf("Yes\n");
return 0;
} else {
for (int i = a - 1; i < c - 1; i++) {
if (s[i + 1] == '#' && s[i] == '#') {
printf("No\n");
return 0;
}
}
for (int i = b - 1; i < d - 1; i++) {
if (s[i + 1] == '.' && s[i] == '.' && s[i - 1] == '.') {
sign++;
}
}
}
if (sign > 0)
printf("Yes\n");
else
printf("No\n");
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int n, a, b, c, d;
char s[200005];
int sign = 0;
int main() {
scanf("%d%d%d%d%d", &n, &a, &b, &c, &d);
scanf("%s", s);
int n = strlen(s);
if (s[c - 1] == '#' || s[d - 1] == '#') {
printf("No\n");
return 0;
}
if (c < d) {
for (int i = a - 1; i < d - 1; i++) {
if (s[i + 1] == '#' && s[i] == '#') {
printf("No\n");
return 0;
}
}
printf("Yes\n");
return 0;
} else {
for (int i = a - 1; i < c - 1; i++) {
if (s[i + 1] == '#' && s[i] == '#') {
printf("No\n");
return 0;
}
}
for (int i = b - 1; i <= d - 1; i++) {
if (s[i + 1] == '.' && s[i] == '.' && s[i - 1] == '.') {
sign++;
}
}
}
if (sign > 0)
printf("Yes\n");
else
printf("No\n");
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 832,633 | 832,634 | u433665020 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
string ans = "";
if (ans.empty()) {
for (int i = A - 1; i < C; i++)
if (S[i] == '#' && S[i + 1] == '#')
ans = "No";
for (int i = B - 1; i < D; i++)
if (S[i] == '#' && S[i + 1] == '#')
ans = "No";
}
if (ans.empty()) {
int maxab = max(A, B);
int mincd = min(C, D);
for (int i = maxab - 2; i < mincd - 2; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.')
ans = "Yes";
}
}
if (ans.empty()) {
if (C < D)
ans = "Yes";
else
ans = "No";
}
cout << ans << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
string ans = "";
if (ans.empty()) {
for (int i = A - 1; i < C; i++)
if (S[i] == '#' && S[i + 1] == '#')
ans = "No";
for (int i = B - 1; i < D; i++)
if (S[i] == '#' && S[i + 1] == '#')
ans = "No";
}
if (ans.empty()) {
int maxab = max(A, B);
int mincd = min(C, D);
for (int i = maxab - 2; i < mincd - 1; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.')
ans = "Yes";
}
}
if (ans.empty()) {
if (C < D)
ans = "Yes";
else
ans = "No";
}
cout << ans << endl;
return 0;
} | [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 832,635 | 832,636 | u581018765 | cpp |
p03017 | #include "bits/stdc++.h"
int main() {
int N, A, B, C, D;
std::cin >> N >> A >> B >> C >> D;
std::string S;
std::cin >> S;
bool ans = true;
bool swappable = false;
int rock = 0;
int none = 0;
int bigger = std::max(C, D);
for (int i = 0; i < N; ++i) {
if (S[i] == '#') {
none = 0;
if (++rock > 1 && A - 1 < i && i < bigger)
ans = false;
} else {
rock = 0;
if (B - 2 <= i && i < D)
if (++none >= 3)
swappable = true;
}
}
if (D < C && ans)
ans = swappable;
std::cout << (ans ? "Yes" : "No") << std::endl;
} | #include "bits/stdc++.h"
int main() {
int N, A, B, C, D;
std::cin >> N >> A >> B >> C >> D;
std::string S;
std::cin >> S;
bool ans = true;
bool swappable = false;
int rock = 0;
int none = 0;
int bigger = std::max(C, D);
for (int i = 0; i < N; ++i) {
if (S[i] == '#') {
none = 0;
if (++rock > 1 && A - 1 < i && i < bigger)
ans = false;
} else {
rock = 0;
if (B - 2 <= i && i < D + 1)
if (++none >= 3)
swappable = true;
}
}
if (D < C && ans)
ans = swappable;
std::cout << (ans ? "Yes" : "No") << std::endl;
} | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 832,637 | 832,638 | u264304509 | cpp |
p03017 | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
long long int n, a, b, c, d, k, i, j, ng = 0, ok = 0;
scanf("%lld %lld %lld %lld %lld", &n, &a, &b, &c, &d);
char s[n + 1];
a--;
b--;
c--;
d--;
scanf("%s", s);
if (c < d)
ok = 1;
for (i = a; i <= c || i <= d; i++) {
if (i > 0) {
if (s[i - 1] == '#' && s[i] == '#')
ng = 1;
}
if (c > d && i > b + 1 && i <= d + 1) {
if (s[i - 2] == '.' && s[i - 1] == '.' && s[i] == '.')
ok = 1;
}
}
// printf("%lld %lld", ok, ng);
if (ok == 1 && ng == 0)
printf("Yes");
else
printf("No");
} | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
long long int n, a, b, c, d, k, i, j, ng = 0, ok = 0;
scanf("%lld %lld %lld %lld %lld", &n, &a, &b, &c, &d);
char s[n + 1];
a--;
b--;
c--;
d--;
scanf("%s", s);
if (c < d)
ok = 1;
for (i = a; i <= c || i <= d; i++) {
if (i > 0) {
if (s[i - 1] == '#' && s[i] == '#')
ng = 1;
}
if (c > d && i >= b + 1 && i <= d + 1) {
if (s[i - 2] == '.' && s[i - 1] == '.' && s[i] == '.')
ok = 1;
}
}
// printf("%lld %lld", ok, ng);
if (ok == 1 && ng == 0)
printf("Yes");
else
printf("No");
} | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 832,641 | 832,642 | u356991267 | cpp |
p03017 | #include <algorithm>
#include <bitset>
#include <climits>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define __int64 long long
#define long __int64
#define REP(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
const int Vec = 4;
const int Vecy[Vec] = {0, -1, 0, 1};
const int Vecx[Vec] = {1, 0, -1, 0};
const int Modd = 1000000007;
string s;
int N, A, B, C, D;
bool hasDoubleBlock(int from, int to) {
for (int i = from; i < to; i++) {
if (s[i] == '#' && s[i + 1] == '#')
return true;
}
return false;
}
bool hasTripleBlank(int from, int to) {
for (int i = max(1, from); i < min(N - 1, to); i++) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.')
return true;
}
return false;
}
int main() {
cin >> N >> A >> B >> C >> D >> s;
s = "s" + s;
if (!(A < B && B < D && D < C) && !(B < A && A < C && C < D)) {
if (!hasDoubleBlock(A, C) && !hasDoubleBlock(B, D)) {
cout << "Yes" << endl; // Yes
} else {
cout << "Yes" << endl; // No
}
} else {
if (!hasDoubleBlock(A, C) && !hasDoubleBlock(B, D)) {
if ((A < B && B < D && D < C && hasTripleBlank(B, D)) ||
(B < A && A < C && C < D && hasTripleBlank(A, C))) {
cout << "Yes" << endl; // Yes
} else {
cout << "No" << endl; // No
}
} else {
cout << "No" << endl; // No
}
}
} | #include <algorithm>
#include <bitset>
#include <climits>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define __int64 long long
#define long __int64
#define REP(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
const int Vec = 4;
const int Vecy[Vec] = {0, -1, 0, 1};
const int Vecx[Vec] = {1, 0, -1, 0};
const int Modd = 1000000007;
string s;
int N, A, B, C, D;
bool hasDoubleBlock(int from, int to) {
for (int i = from; i <= to; i++) {
if (s[i] == '#' && s[i + 1] == '#')
return true;
}
return false;
}
bool hasTripleBlank(int from, int to) {
for (int i = max(1, from); i <= min(N - 1, to); i++) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.')
return true;
}
return false;
}
int main() {
cin >> N >> A >> B >> C >> D >> s;
s = "s" + s;
if (!(A < B && B < D && D < C) && !(B < A && A < C && C < D)) {
if (!hasDoubleBlock(A, C) && !hasDoubleBlock(B, D)) {
cout << "Yes" << endl; // Yes
} else {
cout << "No" << endl; // No
}
} else {
if (!hasDoubleBlock(A, C) && !hasDoubleBlock(B, D)) {
if ((A < B && B < D && D < C && hasTripleBlank(B, D)) ||
(B < A && A < C && C < D && hasTripleBlank(A, C))) {
cout << "Yes" << endl; // Yes
} else {
cout << "No" << endl; // No
}
} else {
cout << "No" << endl; // No
}
}
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change",
"literal.string.change",
"io.output.change"
] | 832,645 | 832,646 | u805346907 | cpp |
p03017 | #include <algorithm>
#include <bitset>
#include <climits>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define __int64 long long
#define long __int64
#define REP(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
const int Vec = 4;
const int Vecy[Vec] = {0, -1, 0, 1};
const int Vecx[Vec] = {1, 0, -1, 0};
const int Modd = 1000000007;
string s;
int N, A, B, C, D;
bool hasDoubleBlock(int from, int to) {
for (int i = from; i < to; i++) {
if (s[i] == '#' && s[i + 1] == '#')
return true;
}
return false;
}
bool hasTripleBlank(int from, int to) {
for (int i = max(1, from); i < min(N - 1, to); i++) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.')
return true;
}
return false;
}
int main() {
cin >> N >> A >> B >> C >> D >> s;
s = "s" + s;
if (!(A < B && B < D && D < C) && !(B < A && A < C && C < D)) {
if (!hasDoubleBlock(A, C) && !hasDoubleBlock(B, D)) {
cout << "No" << endl; // Yes
} else {
cout << "No" << endl; // No
}
} else {
if (!hasDoubleBlock(A, C) && !hasDoubleBlock(B, D)) {
if ((A < B && B < D && D < C && hasTripleBlank(B, D)) ||
(B < A && A < C && C < D && hasTripleBlank(A, C))) {
cout << "Yes" << endl; // Yes
} else {
cout << "No" << endl; // No
}
} else {
cout << "No" << endl; // No
}
}
} | #include <algorithm>
#include <bitset>
#include <climits>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define __int64 long long
#define long __int64
#define REP(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
const int Vec = 4;
const int Vecy[Vec] = {0, -1, 0, 1};
const int Vecx[Vec] = {1, 0, -1, 0};
const int Modd = 1000000007;
string s;
int N, A, B, C, D;
bool hasDoubleBlock(int from, int to) {
for (int i = from; i <= to; i++) {
if (s[i] == '#' && s[i + 1] == '#')
return true;
}
return false;
}
bool hasTripleBlank(int from, int to) {
for (int i = max(1, from); i <= min(N - 1, to); i++) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.')
return true;
}
return false;
}
int main() {
cin >> N >> A >> B >> C >> D >> s;
s = "s" + s;
if (!(A < B && B < D && D < C) && !(B < A && A < C && C < D)) {
if (!hasDoubleBlock(A, C) && !hasDoubleBlock(B, D)) {
cout << "Yes" << endl; // Yes
} else {
cout << "No" << endl; // No
}
} else {
if (!hasDoubleBlock(A, C) && !hasDoubleBlock(B, D)) {
if ((A < B && B < D && D < C && hasTripleBlank(B, D)) ||
(B < A && A < C && C < D && hasTripleBlank(A, C))) {
cout << "Yes" << endl; // Yes
} else {
cout << "No" << endl; // No
}
} else {
cout << "No" << endl; // No
}
}
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change",
"literal.string.change",
"io.output.change"
] | 832,647 | 832,646 | u805346907 | cpp |
p03017 | #include <algorithm>
#include <bitset>
#include <climits>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define __int64 long long
#define long __int64
#define REP(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
const int Vec = 4;
const int Vecy[Vec] = {0, -1, 0, 1};
const int Vecx[Vec] = {1, 0, -1, 0};
const int Modd = 1000000007;
string s;
int N, A, B, C, D;
bool hasDoubleBlock(int from, int to) {
for (int i = from; i < to; i++) {
if (s[i] == '#' && s[i + 1] == '#')
return true;
}
return false;
}
bool hasTripleBlank(int from, int to) {
for (int i = max(1, from); i < min(N - 1, to); i++) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.')
return true;
}
return false;
}
int main() {
cin >> N >> A >> B >> C >> D >> s;
s = "s" + s;
if (!(A < B && B < D && D < C) && !(B < A && A < C && C < D)) {
if (!hasDoubleBlock(A, C) && !hasDoubleBlock(B, D)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} else {
if (!hasDoubleBlock(A, C) && !hasDoubleBlock(B, D)) {
if ((A < B && B < D && D < C && hasTripleBlank(B, D)) ||
(B < A && A < C && C < D && hasTripleBlank(A, C))) {
cout << "Yes" << endl; // Yes
} else {
cout << "No" << endl; // No
}
} else {
cout << "Yes" << endl; // No
}
}
} | #include <algorithm>
#include <bitset>
#include <climits>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define __int64 long long
#define long __int64
#define REP(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
const int Vec = 4;
const int Vecy[Vec] = {0, -1, 0, 1};
const int Vecx[Vec] = {1, 0, -1, 0};
const int Modd = 1000000007;
string s;
int N, A, B, C, D;
bool hasDoubleBlock(int from, int to) {
for (int i = from; i <= to; i++) {
if (s[i] == '#' && s[i + 1] == '#')
return true;
}
return false;
}
bool hasTripleBlank(int from, int to) {
for (int i = max(1, from); i <= min(N - 1, to); i++) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.')
return true;
}
return false;
}
int main() {
cin >> N >> A >> B >> C >> D >> s;
s = "s" + s;
if (!(A < B && B < D && D < C) && !(B < A && A < C && C < D)) {
if (!hasDoubleBlock(A, C) && !hasDoubleBlock(B, D)) {
cout << "Yes" << endl; // Yes
} else {
cout << "No" << endl; // No
}
} else {
if (!hasDoubleBlock(A, C) && !hasDoubleBlock(B, D)) {
if ((A < B && B < D && D < C && hasTripleBlank(B, D)) ||
(B < A && A < C && C < D && hasTripleBlank(A, C))) {
cout << "Yes" << endl; // Yes
} else {
cout << "No" << endl; // No
}
} else {
cout << "No" << endl; // No
}
}
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change",
"literal.string.change",
"io.output.change"
] | 832,648 | 832,646 | u805346907 | cpp |
p03017 | #include <algorithm>
#include <bitset>
#include <climits>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define __int64 long long
#define long __int64
#define REP(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
const int Vec = 4;
const int Vecy[Vec] = {0, -1, 0, 1};
const int Vecx[Vec] = {1, 0, -1, 0};
const int Modd = 1000000007;
string s;
int N, A, B, C, D;
bool hasDoubleBlock(int from, int to) {
for (int i = from; i < to; i++) {
if (s[i] == '#' && s[i + 1] == '#')
return true;
}
return false;
}
bool hasTripleBlank(int from, int to) {
for (int i = max(1, from); i < min(N - 1, to); i++) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.')
return true;
}
return false;
}
int main() {
cin >> N >> A >> B >> C >> D >> s;
s = "s" + s;
if (!(A < B && B < D && D < C) && !(B < A && A < C && C < D)) {
if (!hasDoubleBlock(A, C) && !hasDoubleBlock(B, D)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} else {
if (!hasDoubleBlock(A, C) && !hasDoubleBlock(B, D)) {
if ((A < B && B < D && D < C && hasTripleBlank(B, D)) ||
(B < A && A < C && C < D && hasTripleBlank(A, C))) {
cout << "No" << endl; // Yes
} else {
cout << "No" << endl; // No
}
} else {
cout << "No" << endl; // No
}
}
} | #include <algorithm>
#include <bitset>
#include <climits>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define __int64 long long
#define long __int64
#define REP(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
const int Vec = 4;
const int Vecy[Vec] = {0, -1, 0, 1};
const int Vecx[Vec] = {1, 0, -1, 0};
const int Modd = 1000000007;
string s;
int N, A, B, C, D;
bool hasDoubleBlock(int from, int to) {
for (int i = from; i <= to; i++) {
if (s[i] == '#' && s[i + 1] == '#')
return true;
}
return false;
}
bool hasTripleBlank(int from, int to) {
for (int i = max(1, from); i <= min(N - 1, to); i++) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.')
return true;
}
return false;
}
int main() {
cin >> N >> A >> B >> C >> D >> s;
s = "s" + s;
if (!(A < B && B < D && D < C) && !(B < A && A < C && C < D)) {
if (!hasDoubleBlock(A, C) && !hasDoubleBlock(B, D)) {
cout << "Yes" << endl; // Yes
} else {
cout << "No" << endl; // No
}
} else {
if (!hasDoubleBlock(A, C) && !hasDoubleBlock(B, D)) {
if ((A < B && B < D && D < C && hasTripleBlank(B, D)) ||
(B < A && A < C && C < D && hasTripleBlank(A, C))) {
cout << "Yes" << endl; // Yes
} else {
cout << "No" << endl; // No
}
} else {
cout << "No" << endl; // No
}
}
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change",
"literal.string.change",
"io.output.change"
] | 832,649 | 832,646 | u805346907 | cpp |
p03017 | #include <algorithm>
#include <bitset>
#include <climits>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define __int64 long long
#define long __int64
#define REP(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
const int Vec = 4;
const int Vecy[Vec] = {0, -1, 0, 1};
const int Vecx[Vec] = {1, 0, -1, 0};
const int Modd = 1000000007;
string s;
int N, A, B, C, D;
bool hasDoubleBlock(int from, int to) {
for (int i = from; i < to; i++) {
if (s[i] == '#' && s[i + 1] == '#')
return true;
}
return false;
}
bool hasTripleBlank(int from, int to) {
for (int i = max(1, from); i < min(N - 1, to); i++) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.')
return true;
}
return false;
}
int main() {
cin >> N >> A >> B >> C >> D >> s;
s = "s" + s;
if (!(A < B && B < D && D < C) && !(B < A && A < C && C < D)) {
if (!hasDoubleBlock(A, C) && !hasDoubleBlock(B, D)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} else {
if (!hasDoubleBlock(A, C) && !hasDoubleBlock(B, D)) {
if ((A < B && B < D && D < C && hasTripleBlank(B, D)) ||
(B < A && A < C && C < D && hasTripleBlank(A, C))) {
cout << "Yes" << endl;
} else {
cout << "Yes" << endl;
}
} else {
cout << "No" << endl;
}
}
} | #include <algorithm>
#include <bitset>
#include <climits>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define __int64 long long
#define long __int64
#define REP(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
const int Vec = 4;
const int Vecy[Vec] = {0, -1, 0, 1};
const int Vecx[Vec] = {1, 0, -1, 0};
const int Modd = 1000000007;
string s;
int N, A, B, C, D;
bool hasDoubleBlock(int from, int to) {
for (int i = from; i <= to; i++) {
if (s[i] == '#' && s[i + 1] == '#')
return true;
}
return false;
}
bool hasTripleBlank(int from, int to) {
for (int i = max(1, from); i <= min(N - 1, to); i++) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.')
return true;
}
return false;
}
int main() {
cin >> N >> A >> B >> C >> D >> s;
s = "s" + s;
if (!(A < B && B < D && D < C) && !(B < A && A < C && C < D)) {
if (!hasDoubleBlock(A, C) && !hasDoubleBlock(B, D)) {
cout << "Yes" << endl; // Yes
} else {
cout << "No" << endl; // No
}
} else {
if (!hasDoubleBlock(A, C) && !hasDoubleBlock(B, D)) {
if ((A < B && B < D && D < C && hasTripleBlank(B, D)) ||
(B < A && A < C && C < D && hasTripleBlank(A, C))) {
cout << "Yes" << endl; // Yes
} else {
cout << "No" << endl; // No
}
} else {
cout << "No" << endl; // No
}
}
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change",
"literal.string.change",
"io.output.change"
] | 832,650 | 832,646 | u805346907 | cpp |
p03017 | #include <algorithm>
#include <bitset>
#include <climits>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define __int64 long long
#define long __int64
#define REP(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
const int Vec = 4;
const int Vecy[Vec] = {0, -1, 0, 1};
const int Vecx[Vec] = {1, 0, -1, 0};
const int Modd = 1000000007;
string s;
int N, A, B, C, D;
bool hasDoubleBlock(int from, int to) {
for (int i = from; i < to; i++) {
if (s[i] == '#' && s[i + 1] == '#')
return true;
}
return false;
}
bool hasTripleBlank(int from, int to) {
for (int i = max(1, from); i < min(N - 1, to); i++) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.')
return true;
}
return false;
}
int main() {
cin >> N >> A >> B >> C >> D >> s;
s = "s" + s;
if (!(A < B && B < D && D < C) && !(B < A && A < C && C < D)) {
if (!hasDoubleBlock(A, C) && !hasDoubleBlock(B, D)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} else {
if (!hasDoubleBlock(A, C) && !hasDoubleBlock(B, D)) {
if ((A < B && B < D && D < C && hasTripleBlank(B, D)) ||
(B < A && A < C && C < D && hasTripleBlank(A, C))) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} else {
cout << "No" << endl;
}
}
} | #include <algorithm>
#include <bitset>
#include <climits>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define __int64 long long
#define long __int64
#define REP(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
const int Vec = 4;
const int Vecy[Vec] = {0, -1, 0, 1};
const int Vecx[Vec] = {1, 0, -1, 0};
const int Modd = 1000000007;
string s;
int N, A, B, C, D;
bool hasDoubleBlock(int from, int to) {
for (int i = from; i <= to; i++) {
if (s[i] == '#' && s[i + 1] == '#')
return true;
}
return false;
}
bool hasTripleBlank(int from, int to) {
for (int i = max(1, from); i <= min(N - 1, to); i++) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.')
return true;
}
return false;
}
int main() {
cin >> N >> A >> B >> C >> D >> s;
s = "s" + s;
if (!(A < B && B < D && D < C) && !(B < A && A < C && C < D)) {
if (!hasDoubleBlock(A, C) && !hasDoubleBlock(B, D)) {
cout << "Yes" << endl; // Yes
} else {
cout << "No" << endl; // No
}
} else {
if (!hasDoubleBlock(A, C) && !hasDoubleBlock(B, D)) {
if ((A < B && B < D && D < C && hasTripleBlank(B, D)) ||
(B < A && A < C && C < D && hasTripleBlank(A, C))) {
cout << "Yes" << endl; // Yes
} else {
cout << "No" << endl; // No
}
} else {
cout << "No" << endl; // No
}
}
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 832,651 | 832,646 | u805346907 | cpp |
p03017 |
/*vvv>
zzzzzI
.---. zzuzuI .vgggg&,.
+++++= dunkoI .WbbWo JMM9^```?TMB` ..&gNNg,. gggggggJ, qgggggggg]
(&&&&&&&&[ c+OA&J, (&&&&&&+J, .cJeAA&-. (&&&&&&&&x .&AA&=-.
+++++= dunkoI Xpbpbp JM#` (M#^ ?MMp MM| +TMN. JMF '
|yk ` dVY 7Vk, Vy XV cVf ?Y! JM V$ `
+++++= OunkoI Xppppp dMN .MM+ .MM MM| MM] JMMMMMM+
|@tqkoh) ,y0 (V$ yyyyyyyV7 VV JMWyZWr TWVVVVW&,
++++++ dZZZZ0 Xppppp ^HMN, _.db WMm, .MMF MM| ..MM` JMF .
|yk .WV&. .XW' yy 4yn. jyn +. JM #S
`++++` ?ZZZX= ?WWWW= -THMMMMH9^ (TMMMMM9! MMMMMMM"" JMMMMMMMME
|UU. ?TUUUUY= UU. (UU- ^7TUUUV7! JUUUUUUUU 7TUNKO*/
// Ricty Diminished
#include "bits/stdc++.h"
using namespace std;
typedef long long lint;
typedef vector<lint> liv;
//#define rep(i,n) for(int i=0;i<n;++i)
#define all(v) v.begin(), v.end()
#define linf 1152921504606846976
#define MAXN 100100
#define md 1000000007 // 998244353
#define pb push_back
#define _vcppunko4(tuple) _getname4 tuple
#define _getname4(_1, _2, _3, _4, name, ...) name
#define _getname3(_1, _2, _3, name, ...) name
#define _trep2(tuple) _rep2 tuple
#define _trep3(tuple) _rep3 tuple
#define _trep4(tuple) _rep4 tuple
#define _rep1(n) for (lint i = 0; i < n; ++i)
#define _rep2(i, n) for (lint i = 0; i < n; ++i)
#define _rep3(i, a, b) for (lint i = a; i < b; ++i)
#define _rep4(i, a, b, c) for (lint i = a; i < b; i += c)
#define _trrep2(tuple) _rrep2 tuple
#define _trrep3(tuple) _rrep3 tuple
#define _trrep4(tuple) _rrep4 tuple
#define _rrep1(n) for (lint i = n - 1; i >= 0; --i)
#define _rrep2(i, n) for (lint i = n - 1; i >= 0; --i)
#define _rrep3(i, a, b) for (lint i = b - 1; i >= a; --i)
#define _rrep4(i, a, b, c) \
for (lint i = a + (b - a - 1) / c * c; i >= a; i -= c)
template <class T> istream &operator>>(istream &is, vector<T> &vec);
template <class T, size_t size>
istream &operator>>(istream &is, array<T, size> &vec);
template <class T, class L> istream &operator>>(istream &is, pair<T, L> &p);
template <class T> ostream &operator<<(ostream &os, vector<T> &vec);
template <class T, class L> ostream &operator<<(ostream &os, pair<T, L> &p);
template <class T> istream &operator>>(istream &is, vector<T> &vec) {
for (T &x : vec)
is >> x;
return is;
}
template <class T, class L> istream &operator>>(istream &is, pair<T, L> &p) {
is >> p.first;
is >> p.second;
return is;
}
// template<class T>
// ostream& operator<<(ostream& os,vector<T>& vec){
// os<<vec[0];rep(i,1,vec.size())os<<' '<<vec[i];return os; } template<class T>
// ostream& operator<<(ostream& os,deque<T>& deq){
// os<<deq[0];rep(i,1,deq.size())os<<' '<<deq[i];return os; }
template <class T, class L> ostream &operator<<(ostream &os, pair<T, L> &p) {
os << p.first << " " << p.second;
return os;
}
inline void in() {}
template <class Head, class... Tail>
inline void in(Head &&head, Tail &&...tail) {
cin >> head;
in(move(tail)...);
}
template <class T> inline bool out(T t) {
cout << t << '\n';
return 0;
}
inline bool out() {
cout << '\n';
return 0;
}
template <class Head, class... Tail> inline bool out(Head head, Tail... tail) {
cout << head << ' ';
out(move(tail)...);
return 0;
}
template <typename T> vector<T> make_v(size_t a) { return vector<T>(a); }
template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) {
return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template <typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type fill_v(T &t, const V &v) {
t = v;
}
template <typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type fill_v(T &t, const V &v) {
for (auto &e : t)
fill_v(e, v);
} // http://beet-aizu.hatenablog.com/entry/2018/04/08/145516
#define rep(...) \
_vcppunko4((__VA_ARGS__, _trep4, _trep3, _trep2, _rep1))((__VA_ARGS__))
#define rrep(...) \
_vcppunko4((__VA_ARGS__, _trrep4, _trrep3, _trrep2, _rrep1))((__VA_ARGS__))
#define each(v) for (auto &i : v)
#define lin(...) \
lint __VA_ARGS__; \
in(__VA_ARGS__)
#define stin(...) \
string __VA_ARGS__; \
in(__VA_ARGS__)
#define vin(type, name, size) \
vector<type> name(size); \
in(name)
#define fi i.first
#define se i.second
#define YES(c) cout << ((c) ? "YES\n" : "NO\n"), 0
#define Yes(c) cout << ((c) ? "Yes\n" : "No\n"), 0
#define o(p) cout << p << endl, 0
#define sp(p) cout << p << " "
#define deb(p) cerr << p << endl, 0
#define dd(n) cout << fixed << setprecision(n)
#define inf linf
//死ね
int main() {
lint n, a, b, c, d;
in(n, a, b, c, d);
--a;
--b;
--c;
--d;
stin(s);
int ans = 1, nukasu = 0, aku = 0;
if ((a < b) ^ (c < d))
nukasu = (a > b ? 1 : 2);
rep(i, min(a, b), max(c, d) - 1) {
if (s[i] == '#' && s[i + 1] == '#')
ans = 0;
}
rep(i, max({a, b, 1ll}) - 1, min({c, d, n - 1}) - 1) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.')
aku = 1;
}
if (nukasu && !aku)
ans = 0;
Yes(ans);
}
// struct st{
// lint b,l,u;
//};
// bool cmp1(st l,st r){ return l.l<r.l; };
// bool cmp2(st l,st r){ return l.u>r.u; };
// bool used[100100];
//
// int main(){
// lint n,x;in(n,x);
// vector<st>a(n),b;
// rep(n)cin>>a[i].b>>a[i].l>>a[i].u;
// b=a;
// sort(all(a),cmp1);sort(all(b),cmp2);
//
//}
// sub_EOF
// map<lint,lint> zip;
// lint unzip[MAXN];
//
// void compress(vector<lint> &a,map<lint,lint> &z,lint u[]){
// vector<lint> v=a;
// sort(all(v));
// v.erase(unique(all(v)),v.end());
// rep(i,v.size()){
// z[v[i]]=i;
// u[i]=v[i];
// }return;
//}
//
// int main(){
// lint n,qn;in(n,qn);
// vector<lint> a;
// struct query{ lint t,x,y; };
// vector<query>q(n);
// rep(qn){
// cin>>q[i].t>>q[i].x>>q[i].y;
// a.pb(q[i].x);
// a.pb(q[i].y);
// }compress(a,zip,unzip);
// lint m=a.size();
//}
// sub-EOF
|
/*vvv>
zzzzzI
.---. zzuzuI .vgggg&,.
+++++= dunkoI .WbbWo JMM9^```?TMB` ..&gNNg,. gggggggJ, qgggggggg]
(&&&&&&&&[ c+OA&J, (&&&&&&+J, .cJeAA&-. (&&&&&&&&x .&AA&=-.
+++++= dunkoI Xpbpbp JM#` (M#^ ?MMp MM| +TMN. JMF '
|yk ` dVY 7Vk, Vy XV cVf ?Y! JM V$ `
+++++= OunkoI Xppppp dMN .MM+ .MM MM| MM] JMMMMMM+
|@tqkoh) ,y0 (V$ yyyyyyyV7 VV JMWyZWr TWVVVVW&,
++++++ dZZZZ0 Xppppp ^HMN, _.db WMm, .MMF MM| ..MM` JMF .
|yk .WV&. .XW' yy 4yn. jyn +. JM #S
`++++` ?ZZZX= ?WWWW= -THMMMMH9^ (TMMMMM9! MMMMMMM"" JMMMMMMMME
|UU. ?TUUUUY= UU. (UU- ^7TUUUV7! JUUUUUUUU 7TUNKO*/
// Ricty Diminished
#include "bits/stdc++.h"
using namespace std;
typedef long long lint;
typedef vector<lint> liv;
//#define rep(i,n) for(int i=0;i<n;++i)
#define all(v) v.begin(), v.end()
#define linf 1152921504606846976
#define MAXN 100100
#define md 1000000007 // 998244353
#define pb push_back
#define _vcppunko4(tuple) _getname4 tuple
#define _getname4(_1, _2, _3, _4, name, ...) name
#define _getname3(_1, _2, _3, name, ...) name
#define _trep2(tuple) _rep2 tuple
#define _trep3(tuple) _rep3 tuple
#define _trep4(tuple) _rep4 tuple
#define _rep1(n) for (lint i = 0; i < n; ++i)
#define _rep2(i, n) for (lint i = 0; i < n; ++i)
#define _rep3(i, a, b) for (lint i = a; i < b; ++i)
#define _rep4(i, a, b, c) for (lint i = a; i < b; i += c)
#define _trrep2(tuple) _rrep2 tuple
#define _trrep3(tuple) _rrep3 tuple
#define _trrep4(tuple) _rrep4 tuple
#define _rrep1(n) for (lint i = n - 1; i >= 0; --i)
#define _rrep2(i, n) for (lint i = n - 1; i >= 0; --i)
#define _rrep3(i, a, b) for (lint i = b - 1; i >= a; --i)
#define _rrep4(i, a, b, c) \
for (lint i = a + (b - a - 1) / c * c; i >= a; i -= c)
template <class T> istream &operator>>(istream &is, vector<T> &vec);
template <class T, size_t size>
istream &operator>>(istream &is, array<T, size> &vec);
template <class T, class L> istream &operator>>(istream &is, pair<T, L> &p);
template <class T> ostream &operator<<(ostream &os, vector<T> &vec);
template <class T, class L> ostream &operator<<(ostream &os, pair<T, L> &p);
template <class T> istream &operator>>(istream &is, vector<T> &vec) {
for (T &x : vec)
is >> x;
return is;
}
template <class T, class L> istream &operator>>(istream &is, pair<T, L> &p) {
is >> p.first;
is >> p.second;
return is;
}
// template<class T>
// ostream& operator<<(ostream& os,vector<T>& vec){
// os<<vec[0];rep(i,1,vec.size())os<<' '<<vec[i];return os; } template<class T>
// ostream& operator<<(ostream& os,deque<T>& deq){
// os<<deq[0];rep(i,1,deq.size())os<<' '<<deq[i];return os; }
template <class T, class L> ostream &operator<<(ostream &os, pair<T, L> &p) {
os << p.first << " " << p.second;
return os;
}
inline void in() {}
template <class Head, class... Tail>
inline void in(Head &&head, Tail &&...tail) {
cin >> head;
in(move(tail)...);
}
template <class T> inline bool out(T t) {
cout << t << '\n';
return 0;
}
inline bool out() {
cout << '\n';
return 0;
}
template <class Head, class... Tail> inline bool out(Head head, Tail... tail) {
cout << head << ' ';
out(move(tail)...);
return 0;
}
template <typename T> vector<T> make_v(size_t a) { return vector<T>(a); }
template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) {
return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template <typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type fill_v(T &t, const V &v) {
t = v;
}
template <typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type fill_v(T &t, const V &v) {
for (auto &e : t)
fill_v(e, v);
} // http://beet-aizu.hatenablog.com/entry/2018/04/08/145516
#define rep(...) \
_vcppunko4((__VA_ARGS__, _trep4, _trep3, _trep2, _rep1))((__VA_ARGS__))
#define rrep(...) \
_vcppunko4((__VA_ARGS__, _trrep4, _trrep3, _trrep2, _rrep1))((__VA_ARGS__))
#define each(v) for (auto &i : v)
#define lin(...) \
lint __VA_ARGS__; \
in(__VA_ARGS__)
#define stin(...) \
string __VA_ARGS__; \
in(__VA_ARGS__)
#define vin(type, name, size) \
vector<type> name(size); \
in(name)
#define fi i.first
#define se i.second
#define YES(c) cout << ((c) ? "YES\n" : "NO\n"), 0
#define Yes(c) cout << ((c) ? "Yes\n" : "No\n"), 0
#define o(p) cout << p << endl, 0
#define sp(p) cout << p << " "
#define deb(p) cerr << p << endl, 0
#define dd(n) cout << fixed << setprecision(n)
#define inf linf
//死ね
int main() {
lint n, a, b, c, d;
in(n, a, b, c, d);
--a;
--b;
--c;
--d;
stin(s);
int ans = 1, nukasu = 0, aku = 0;
if ((a < b) ^ (c < d))
nukasu = (a > b ? 1 : 2);
rep(i, min(a, b), max(c, d) - 1) {
if (s[i] == '#' && s[i + 1] == '#')
ans = 0;
}
rep(i, max({a, b, 1ll}) - 1, min({c, d, n - 1})) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.')
aku = 1;
}
if (nukasu && !aku)
ans = 0;
Yes(ans);
}
// struct st{
// lint b,l,u;
//};
// bool cmp1(st l,st r){ return l.l<r.l; };
// bool cmp2(st l,st r){ return l.u>r.u; };
// bool used[100100];
//
// int main(){
// lint n,x;in(n,x);
// vector<st>a(n),b;
// rep(n)cin>>a[i].b>>a[i].l>>a[i].u;
// b=a;
// sort(all(a),cmp1);sort(all(b),cmp2);
//
//}
// sub_EOF
// map<lint,lint> zip;
// lint unzip[MAXN];
//
// void compress(vector<lint> &a,map<lint,lint> &z,lint u[]){
// vector<lint> v=a;
// sort(all(v));
// v.erase(unique(all(v)),v.end());
// rep(i,v.size()){
// z[v[i]]=i;
// u[i]=v[i];
// }return;
//}
//
// int main(){
// lint n,qn;in(n,qn);
// vector<lint> a;
// struct query{ lint t,x,y; };
// vector<query>q(n);
// rep(qn){
// cin>>q[i].t>>q[i].x>>q[i].y;
// a.pb(q[i].x);
// a.pb(q[i].y);
// }compress(a,zip,unzip);
// lint m=a.size();
//}
// sub-EOF
| [
"expression.operation.binary.remove"
] | 832,656 | 832,657 | u675296835 | cpp |
p03017 | #include <iostream>
#include <string>
using namespace std;
int main() {
int N, A, B, C, D;
string S;
cin >> N >> A >> B >> C >> D >> S;
bool three_dot_exists = false;
bool two_sharp_exists = false;
for (int i = A + 1; i < max(C, D); ++i) {
if (S[i] == 35 && S[i - 1] == 35)
two_sharp_exists = true;
if (B <= i && S[i] == 46 && S[i - 1] == 46 && S[i - 2] == 46 &&
i < min(C, D))
three_dot_exists = true;
}
bool ans = false;
if (C < D) {
ans = !two_sharp_exists;
} else {
ans = three_dot_exists && !two_sharp_exists;
}
cout << (ans ? "Yes" : "No") << endl;
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
int N, A, B, C, D;
string S;
cin >> N >> A >> B >> C >> D >> S;
bool three_dot_exists = false;
bool two_sharp_exists = false;
for (int i = A + 1; i < max(C, D); ++i) {
if (S[i] == 35 && S[i - 1] == 35)
two_sharp_exists = true;
if (B <= i && S[i] == 46 && S[i - 1] == 46 && S[i - 2] == 46 && i <= D)
three_dot_exists = true;
}
bool ans = false;
if (C < D) {
ans = !two_sharp_exists;
} else {
ans = three_dot_exists && !two_sharp_exists;
}
cout << (ans ? "Yes" : "No") << endl;
return 0;
} | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"call.remove"
] | 832,661 | 832,662 | u128142352 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
a--;
b--;
c--;
d--;
string s;
cin >> s;
if (c < d) {
int pos = a;
while (pos < d) {
int count = 0;
while (pos < d && s[pos] == '.') {
pos++;
}
if (pos >= d - 1)
break;
if (s[pos + 1] == '#') {
cout << "No" << endl;
return 0;
}
pos++;
}
cout << "Yes" << endl;
} else {
int pos = a;
while (pos < c) {
int count = 0;
while (pos < c && s[pos] == '.') {
pos++;
}
if (pos >= c - 1)
break;
if (s[pos + 1] == '#') {
cout << "No" << endl;
return 0;
}
pos++;
}
pos = b - 1;
bool ok = false;
while (pos <= d) {
int count = 0;
while (pos <= d && s[pos] == '.') {
pos++;
count++;
}
if (count >= 3) {
ok = true;
break;
}
pos++;
}
if (!ok) {
cout << "No" << endl;
return 0;
}
cout << "Yes" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
a--;
b--;
c--;
d--;
string s;
cin >> s;
if (c < d) {
int pos = a;
while (pos < d) {
int count = 0;
while (pos < d && s[pos] == '.') {
pos++;
}
if (pos >= d - 1)
break;
if (s[pos + 1] == '#') {
cout << "No" << endl;
return 0;
}
pos++;
}
cout << "Yes" << endl;
} else {
int pos = a;
while (pos < c) {
int count = 0;
while (pos < c && s[pos] == '.') {
pos++;
}
if (pos >= c - 1)
break;
if (s[pos + 1] == '#') {
cout << "No" << endl;
return 0;
}
pos++;
}
pos = b - 1;
bool ok = false;
while (pos <= d + 1) {
int count = 0;
while (pos <= d + 1 && s[pos] == '.') {
pos++;
count++;
}
if (count >= 3) {
ok = true;
break;
}
pos++;
}
if (!ok) {
cout << "No" << endl;
return 0;
}
cout << "Yes" << endl;
}
}
| [
"control_flow.loop.condition.change"
] | 832,687 | 832,688 | u410878763 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
#define MP make_pair
#define PB push_back
#define ALL(x) (x).begin(), (x).end()
#define REP(i, n) for (int i = 0; i < (n); i++)
#define REP1(i, n) for (int i = 1; i < (n); i++)
#define REP2(i, d, n) for (int i = (d); i < (n); i++)
#define RREP(i, n) for (int i = (n); i >= 0; i--)
#define CLR(a) memset((a), 0, sizeof(a))
#define MCLR(a) memset((a), -1, sizeof(a))
#define RANGE(x, y, maxX, maxY) \
(0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<LL> VLL;
typedef pair<int, int> PII;
const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;
const int DX[] = {1, 0, -1, 0}, DY[] = {0, -1, 0, 1};
const string YES = "Yes";
const string NO = "No";
void solve(long long N, long long A, long long B, long long C, long long D,
std::string S) {
bool double_shape = false;
REP2(i, A, C) {
if (i + 1 != N && S[i] == '#' && S[i + 1] == '#')
double_shape = true;
}
REP2(i, B, D) {
if (i + 1 != N && S[i] == '#' && S[i + 1] == '#')
double_shape = true;
}
if (double_shape) {
cout << NO << endl;
return;
}
if (D < C) {
if (S[B - 2] == '.' && S[B] == '.') {
cout << YES << endl;
return;
}
for (int i = B; i < D - 1; i++) {
if (i + 2 != N && S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
cout << YES << endl;
return;
}
}
cout << NO << endl;
} else {
cout << YES << endl;
}
}
int main() {
long long N;
scanf("%lld", &N);
long long A;
scanf("%lld", &A);
long long B;
scanf("%lld", &B);
long long C;
scanf("%lld", &C);
long long D;
scanf("%lld", &D);
std::string S;
std::cin >> S;
solve(N, A, B, C, D, S);
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define MP make_pair
#define PB push_back
#define ALL(x) (x).begin(), (x).end()
#define REP(i, n) for (int i = 0; i < (n); i++)
#define REP1(i, n) for (int i = 1; i < (n); i++)
#define REP2(i, d, n) for (int i = (d); i < (n); i++)
#define RREP(i, n) for (int i = (n); i >= 0; i--)
#define CLR(a) memset((a), 0, sizeof(a))
#define MCLR(a) memset((a), -1, sizeof(a))
#define RANGE(x, y, maxX, maxY) \
(0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<LL> VLL;
typedef pair<int, int> PII;
const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;
const int DX[] = {1, 0, -1, 0}, DY[] = {0, -1, 0, 1};
const string YES = "Yes";
const string NO = "No";
void solve(long long N, long long A, long long B, long long C, long long D,
std::string S) {
bool double_shape = false;
REP2(i, A, C) {
if (i + 1 != N && S[i] == '#' && S[i + 1] == '#')
double_shape = true;
}
REP2(i, B, D) {
if (i + 1 != N && S[i] == '#' && S[i + 1] == '#')
double_shape = true;
}
if (double_shape) {
cout << NO << endl;
return;
}
if (D < C) {
if (S[B - 2] == '.' && S[B] == '.') {
cout << YES << endl;
return;
}
for (int i = B - 1; i < D - 1; i++) {
if (i + 2 != N && S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
cout << YES << endl;
return;
}
}
cout << NO << endl;
} else {
cout << YES << endl;
}
}
int main() {
long long N;
scanf("%lld", &N);
long long A;
scanf("%lld", &A);
long long B;
scanf("%lld", &B);
long long C;
scanf("%lld", &C);
long long D;
scanf("%lld", &D);
std::string S;
std::cin >> S;
solve(N, A, B, C, D, S);
return 0;
}
| [
"control_flow.loop.for.initializer.change"
] | 832,691 | 832,692 | u250996767 | cpp |
p03017 | // Shift-JIS(シフトジス)
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, A, B, C, D;
string S;
cin >> N >> A >> B >> C >> D >> S;
int stones;
bool flag1 = true, flag2 = true;
stones = 0;
for (int i = A; i < C - 1; i++) {
if (S[i] == '#') {
stones++;
} else {
stones = 0;
}
if (stones > 1) {
flag2 = false;
}
}
stones = 0;
for (int i = B; i < D - 1; i++) {
if (S[i] == '#') {
stones++;
} else {
stones = 0;
}
if (stones > 1) {
flag1 = false;
}
}
if (flag1 && flag2 && C > D) {
int count = 0;
for (int i = B - 1; i < D + 1; i++) {
if (S[i] == '.') {
count++;
} else {
count = 0;
}
if (count > 2) {
break;
}
}
if (count < 3) {
flag2 = false;
}
}
if (flag1 && flag2) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | // Shift-JIS(シフトジス)
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, A, B, C, D;
string S;
cin >> N >> A >> B >> C >> D >> S;
int stones;
bool flag1 = true, flag2 = true;
stones = 0;
for (int i = A; i < C - 1; i++) {
if (S[i] == '#') {
stones++;
} else {
stones = 0;
}
if (stones > 1) {
flag2 = false;
}
}
stones = 0;
for (int i = B; i < D - 1; i++) {
if (S[i] == '#') {
stones++;
} else {
stones = 0;
}
if (stones > 1) {
flag1 = false;
}
}
if (flag1 && flag2) {
if (C > D) {
int count = 0;
for (int i = B - 2; i < D + 1; i++) {
if (S[i] == '.') {
count++;
} else {
count = 0;
}
if (count > 2) {
break;
}
}
if (count < 3) {
flag2 = false;
}
}
}
if (flag1 && flag2) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | [
"control_flow.branch.if.condition.change",
"control_flow.branch.if.add",
"literal.number.change",
"control_flow.loop.for.initializer.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 832,706 | 832,707 | u380317210 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll N, A, B, C, D;
string S;
bool cont(int X, int Y) {
for (int i = X; i <= Y - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
return false;
}
}
return true;
}
void solve() {
A--;
B--;
C--;
D--;
if (!cont(A, C) || !cont(B, D)) {
cout << "No\n";
return;
}
if (C < D) {
cout << "Yes\n";
return;
} else {
int marginL = B;
int marginR = D;
bool can_excange = false;
for (int i = marginL; i <= marginR - 1; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
can_excange = true;
break;
}
}
if (can_excange) {
cout << "Yes\n";
return;
} else {
cout << "No\n";
return;
}
}
}
int main() {
cin >> N >> A >> B >> C >> D;
cin >> S;
solve();
return 0;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll N, A, B, C, D;
string S;
bool cont(int X, int Y) {
for (int i = X; i <= Y - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
return false;
}
}
return true;
}
void solve() {
A--;
B--;
C--;
D--;
if (!cont(A, C) || !cont(B, D)) {
cout << "No\n";
return;
}
if (C < D) {
cout << "Yes\n";
return;
} else {
int marginL = B - 1;
int marginR = D;
bool can_excange = false;
for (int i = marginL; i <= marginR - 1; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
can_excange = true;
break;
}
}
if (can_excange) {
cout << "Yes\n";
return;
} else {
cout << "No\n";
return;
}
}
}
int main() {
cin >> N >> A >> B >> C >> D;
cin >> S;
solve();
return 0;
} | [
"assignment.change"
] | 832,710 | 832,711 | u319242216 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll N, A, B, C, D;
string S;
bool cont(int X, int Y) {
for (int i = X; i <= Y - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
return false;
}
}
return true;
}
void solve() {
A--;
B--;
C--;
D--;
if (!cont(A, C) || !cont(B, D)) {
cout << "No\n";
return;
}
if (C < D) {
cout << "Yes\n";
return;
} else {
int marginL = A;
int marginR = D;
bool can_excange = false;
for (int i = marginL; i <= marginR - 1; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
can_excange = true;
break;
}
}
if (can_excange) {
cout << "Yes\n";
return;
} else {
cout << "No\n";
return;
}
}
}
int main() {
cin >> N >> A >> B >> C >> D;
cin >> S;
solve();
return 0;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll N, A, B, C, D;
string S;
bool cont(int X, int Y) {
for (int i = X; i <= Y - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
return false;
}
}
return true;
}
void solve() {
A--;
B--;
C--;
D--;
if (!cont(A, C) || !cont(B, D)) {
cout << "No\n";
return;
}
if (C < D) {
cout << "Yes\n";
return;
} else {
int marginL = B - 1;
int marginR = D;
bool can_excange = false;
for (int i = marginL; i <= marginR - 1; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
can_excange = true;
break;
}
}
if (can_excange) {
cout << "Yes\n";
return;
} else {
cout << "No\n";
return;
}
}
}
int main() {
cin >> N >> A >> B >> C >> D;
cin >> S;
solve();
return 0;
} | [
"assignment.change"
] | 832,712 | 832,711 | u319242216 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
int main() {
long n, a, b, c, d;
string str;
cin >> n >> a >> b >> c >> d >> str;
a -= 1;
b -= 1;
c -= 1;
d -= 1;
if (c < d || c < b) {
for (long i = a; i < c - 1; i++) {
if (str[i] == '#' && str[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (long i = b; i < d - 1; i++) {
if (str[i] == '#' && str[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
}
bool ans = false;
for (long i = a; i < c - 1; i++) {
if (str[i] == '#' && str[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
if (i >= b - 1 && i < c - 1) {
// cout << str[i+2];
if (str[i] == '.' && str[i + 1] == '.' && str[i + 2] == '.')
ans = true;
}
}
/*
if(str[b-2] == '.' && str[b] == '.'){
ans = true;
}
if(str[d-2] == '.' && str[d] == '.' ){
ans = true;
}*/
if (ans) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long n, a, b, c, d;
string str;
cin >> n >> a >> b >> c >> d >> str;
a -= 1;
b -= 1;
c -= 1;
d -= 1;
if (c < d || c < b) {
for (long i = a; i < c - 1; i++) {
if (str[i] == '#' && str[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (long i = b; i < d - 1; i++) {
if (str[i] == '#' && str[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
}
bool ans = false;
for (long i = a; i < c - 1; i++) {
if (str[i] == '#' && str[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
if (i >= b - 1 && i <= d - 1) {
// cout << str[i+2];
if (str[i] == '.' && str[i + 1] == '.' && str[i + 2] == '.')
ans = true;
}
}
if (ans) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
} | [
"control_flow.loop.for.condition.change"
] | 832,723 | 832,724 | u777864981 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define vi vector<int>
#define vll vector<ll>
#define vvi vector<vi>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define vpll vector<pair<long long, long long>>
#define fill(a, val) memset(a, val, sizeof(a))
#define sort_unique(c) \
(sort(c.begin(), c.end()), \
c.resize(distance(c.begin(), unique(c.begin(), c.end()))))
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define all(cont) cont.begin(), cont.end()
#define max3(a, b, c) max(a, max(b, c))
#define min3(a, b, c) min(a, min(b, c))
#define MAX 1e9
#define MIN -1e9
typedef map<int, int> mpi;
typedef set<int> seti;
typedef multiset<int> mseti;
#define fio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)
#define rep(i, n) for (long long int i = 0; i < (n); ++i)
#define repA(i, a, n) for (int i = a; i <= (n); ++i)
#define repD(i, a, n) for (int i = a; i >= (n); --i)
#define trav(a, x) for (auto &a : x)
struct Interval {
int start, end;
};
bool compare(Interval i1, Interval i2) { return (i1.start < i2.start); }
int main() {
ll n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
a--;
b--;
c--;
d--;
string s;
cin >> s;
ll e = 0;
repA(i, a + 1, max(c, d)) if (s[i] == '#' && s[i - 1] == '#') e = 1;
if (e == 1)
cout << "No";
else if (c < d)
cout << "Yes";
else {
if (s[b - 1] == '.' && s[b + 1] == '.')
cout << "Yes";
else {
repA(i, b + 1,
d - 1) if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
cout << "Yes";
return 0;
}
cout << "No";
}
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define vi vector<int>
#define vll vector<ll>
#define vvi vector<vi>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define vpll vector<pair<long long, long long>>
#define fill(a, val) memset(a, val, sizeof(a))
#define sort_unique(c) \
(sort(c.begin(), c.end()), \
c.resize(distance(c.begin(), unique(c.begin(), c.end()))))
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define all(cont) cont.begin(), cont.end()
#define max3(a, b, c) max(a, max(b, c))
#define min3(a, b, c) min(a, min(b, c))
#define MAX 1e9
#define MIN -1e9
typedef map<int, int> mpi;
typedef set<int> seti;
typedef multiset<int> mseti;
#define fio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)
#define rep(i, n) for (long long int i = 0; i < (n); ++i)
#define repA(i, a, n) for (int i = a; i <= (n); ++i)
#define repD(i, a, n) for (int i = a; i >= (n); --i)
#define trav(a, x) for (auto &a : x)
struct Interval {
int start, end;
};
bool compare(Interval i1, Interval i2) { return (i1.start < i2.start); }
int main() {
ll n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
a--;
b--;
c--;
d--;
string s;
cin >> s;
ll e = 0;
repA(i, a + 1, max(c, d)) if (s[i] == '#' && s[i - 1] == '#') e = 1;
if (e == 1)
cout << "No";
else if (c < d)
cout << "Yes";
else {
if (s[b - 1] == '.' && s[b + 1] == '.')
cout << "Yes";
else {
repA(i, b, d - 1) if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
cout << "Yes";
return 0;
}
cout << "No";
}
}
return 0;
}
| [
"expression.operation.binary.remove"
] | 832,732 | 832,733 | u251695874 | cpp |
p03017 | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i = (a); i < (int)(b); i++)
void chmin(int &a, int b) {
if (a > b)
a = b;
}
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vint;
typedef vector<string> vstr;
typedef pair<ll, ll> pint;
unsigned long long inf = (1LL << 62);
ll MOD = (ll)pow(10.0, 9.0) + 7;
pint dx[4] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
char da[4] = {'R', 'L', 'D', 'U'};
char dax[4] = {-1, 1, -1, 1};
char dax2[4] = {1, -1, 1, -1};
ll min(ll a, ll b) { return (a < b) ? a : b; }
ll max(ll a, ll b) { return (a > b) ? a : b; }
int main() {
ll N, A, B, C, D;
string S;
cin >> N >> A >> B >> C >> D;
cin >> S;
A--, B--, C--, D--;
bool flag = false;
rep(i, S.size() - 1) {
if (S[i] == '#' && S[i + 1] == '#' &&
((A < i && i < C) || (B < i && i < D))) {
cout << "No" << endl;
return 0;
}
}
if (C < D) {
cout << "Yes" << endl;
}
else {
rep(i, S.size() - 2) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.' &&
(B - 2 <= i && i <= D)) {
flag = true;
}
}
if (flag == true)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
return 0;
} | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i = (a); i < (int)(b); i++)
void chmin(int &a, int b) {
if (a > b)
a = b;
}
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vint;
typedef vector<string> vstr;
typedef pair<ll, ll> pint;
unsigned long long inf = (1LL << 62);
ll MOD = (ll)pow(10.0, 9.0) + 7;
pint dx[4] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
char da[4] = {'R', 'L', 'D', 'U'};
char dax[4] = {-1, 1, -1, 1};
char dax2[4] = {1, -1, 1, -1};
ll min(ll a, ll b) { return (a < b) ? a : b; }
ll max(ll a, ll b) { return (a > b) ? a : b; }
int main() {
ll N, A, B, C, D;
string S;
cin >> N >> A >> B >> C >> D;
cin >> S;
A--, B--, C--, D--;
bool flag = false;
rep(i, S.size() - 1) {
if (S[i] == '#' && S[i + 1] == '#' &&
((A < i && i < C) || (B < i && i < D))) {
cout << "No" << endl;
return 0;
}
}
if (C < D) {
cout << "Yes" << endl;
}
else {
rep(i, S.size() - 2) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.' &&
(B - 1 <= i && i <= D - 1)) {
flag = true;
break;
}
}
if (flag == true)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
return 0;
} | [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 832,739 | 832,740 | u305138467 | cpp |
p03017 | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i = (a); i < (int)(b); i++)
void chmin(int &a, int b) {
if (a > b)
a = b;
}
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vint;
typedef vector<string> vstr;
typedef pair<ll, ll> pint;
unsigned long long inf = (1LL << 62);
ll MOD = (ll)pow(10.0, 9.0) + 7;
pint dx[4] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
char da[4] = {'R', 'L', 'D', 'U'};
char dax[4] = {-1, 1, -1, 1};
char dax2[4] = {1, -1, 1, -1};
ll min(ll a, ll b) { return (a < b) ? a : b; }
ll max(ll a, ll b) { return (a > b) ? a : b; }
int main() {
ll N, A, B, C, D;
string S;
cin >> N >> A >> B >> C >> D;
cin >> S;
A--, B--, C--, D--;
bool flag = false;
rep(i, S.size() - 1) {
if (S[i] == '#' && S[i + 1] == '#' &&
((A < i && i < C) || (B < i && i < D))) {
cout << "No" << endl;
return 0;
}
}
if (C < D) {
cout << "Yes" << endl;
}
else {
rep(i, S.size() - 2) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.' &&
(B - 1 <= i && i <= D)) {
flag = true;
}
}
if (flag == true)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
return 0;
} | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i = (a); i < (int)(b); i++)
void chmin(int &a, int b) {
if (a > b)
a = b;
}
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vint;
typedef vector<string> vstr;
typedef pair<ll, ll> pint;
unsigned long long inf = (1LL << 62);
ll MOD = (ll)pow(10.0, 9.0) + 7;
pint dx[4] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
char da[4] = {'R', 'L', 'D', 'U'};
char dax[4] = {-1, 1, -1, 1};
char dax2[4] = {1, -1, 1, -1};
ll min(ll a, ll b) { return (a < b) ? a : b; }
ll max(ll a, ll b) { return (a > b) ? a : b; }
int main() {
ll N, A, B, C, D;
string S;
cin >> N >> A >> B >> C >> D;
cin >> S;
A--, B--, C--, D--;
bool flag = false;
rep(i, S.size() - 1) {
if (S[i] == '#' && S[i + 1] == '#' &&
((A < i && i < C) || (B < i && i < D))) {
cout << "No" << endl;
return 0;
}
}
if (C < D) {
cout << "Yes" << endl;
}
else {
rep(i, S.size() - 2) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.' &&
(B - 1 <= i && i <= D - 1)) {
flag = true;
break;
}
}
if (flag == true)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
return 0;
} | [
"control_flow.branch.if.condition.change"
] | 832,741 | 832,740 | u305138467 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int n, a, b, c, d;
string s;
cin >> n >> a >> b >> c >> d;
cin.ignore();
cin >> s;
cin.ignore();
// a<b<dより、ふぬけ君から先に行けばいい
// 0-origin
a--;
b--;
c--;
d--;
// ふぬけ
int len = s.length();
int su = a;
int fu = b;
// for(int i =b; i < len; i++){
if (d < c) {
// d < c の場合、まずすぬけがふぬけを追い越す必要がある
// 追い抜ける場所は、前後に岩がないところ=p
// とりあえずふぬけをそっちに移動
// すぬけが先にゴールにいく
// ふぬけが後
// pを見つける
int p = b;
// 0方向にすぬけ、前が空白の場合はそのまま
if ((p > 0) && (s[p + 1] == '.') && (a == p - 1)) {
p = b;
} else {
while (p <= d) {
// 場所が条件を満たすか判定
if ((s[p - 1] == '.') && (s[p + 1] == ',')) {
break;
}
// pの条件判定
// pが末尾dの場合、すでに無理
if (p >= d) {
cout << "No" << endl;
return 0;
} else if ((p == d - 1) && (s[d] == '#')) { // n
// pが後ろから2つめ、前が岩
cout << "No" << endl;
return 0;
} else if ((s[d] == '#') &&
(s[d - 1] == '#')) { // 2連続で岩ならその時点でNG
cout << "No" << endl;
return 0;
}
// 前が岩なら2つ進める
// 文の条件から、ぜったいにdにたどり着く
if (s[p + 1] == '#') {
p += 2;
} else {
p++;
}
}
}
fu = p;
// すぬけはふぬけの開始位置-1までいければ追い抜ける
// その途中に岩が2連続でなければOK
for (int i = a + 1; i < b - 1; i++) {
if ((s[i] == '#') && (s[i + 1] == '#')) {
cout << "No" << endl;
return 0;
}
}
// すぬけはふぬけを追い越した
su = fu + 1;
// すぬけから先にゴール
for (int i = su + 1; i < c - 1; i++) {
if ((s[i] == '#') && (s[i + 1] == '#')) {
cout << "No" << endl;
return 0;
}
}
for (int i = fu + 1; i < d - 1; i++) {
if ((s[i] == '#') && (s[i + 1] == '#')) {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
} else { // c < d
// ふぬけから先に動かす
for (int i = b + 1; i < d - 1; i++) {
if ((s[i] == '#') && (s[i + 1] == '#')) {
cout << "No" << endl;
return 0;
}
}
for (int i = a + 1; i < c - 1; i++) {
if ((s[i] == '#') && (s[i + 1] == '#')) {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
}
cout << "Illegal" << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main(void) {
int n, a, b, c, d;
string s;
cin >> n >> a >> b >> c >> d;
cin.ignore();
cin >> s;
cin.ignore();
// a<b<dより、ふぬけ君から先に行けばいい
// 0-origin
a--;
b--;
c--;
d--;
// ふぬけ
int len = s.length();
int su = a;
int fu = b;
// for(int i =b; i < len; i++){
if (d < c) {
// d < c の場合、まずすぬけがふぬけを追い越す必要がある
// 追い抜ける場所は、前後に岩がないところ=p
// とりあえずふぬけをそっちに移動
// すぬけが先にゴールにいく
// ふぬけが後
// pを見つける
int p = b;
// 0方向にすぬけ、前が空白の場合はそのまま
if ((p > 0) && (s[p + 1] == '.') && (a == p - 1)) {
p = b;
} else {
while (p <= d) {
// 場所が条件を満たすか判定
if ((s[p - 1] == '.') && (s[p + 1] == '.')) {
break;
}
// pの条件判定
// pが末尾dの場合、すでに無理
if (p >= d) {
cout << "No" << endl;
return 0;
} else if ((p == d - 1) && (s[d] == '#')) { // n
// pが後ろから2つめ、前が岩
cout << "No" << endl;
return 0;
} else if ((s[p] == '#') &&
(s[p + 1] == '#')) { // 2連続で岩ならその時点でNG
cout << "No" << endl;
return 0;
}
// 前が岩なら2つ進める
// 文の条件から、ぜったいにdにたどり着く
if (s[p + 1] == '#') {
p += 2;
} else {
p++;
}
}
}
fu = p;
// すぬけはふぬけの開始位置-1までいければ追い抜ける
// その途中に岩が2連続でなければOK
for (int i = a + 1; i < b - 1; i++) {
if ((s[i] == '#') && (s[i + 1] == '#')) {
cout << "No" << endl;
return 0;
}
}
// すぬけはふぬけを追い越した
su = fu + 1;
// すぬけから先にゴール
for (int i = su + 1; i < c - 1; i++) {
if ((s[i] == '#') && (s[i + 1] == '#')) {
cout << "No" << endl;
return 0;
}
}
for (int i = fu + 1; i < d - 1; i++) {
if ((s[i] == '#') && (s[i + 1] == '#')) {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
} else { // c < d
// ふぬけから先に動かす
for (int i = b + 1; i < d - 1; i++) {
if ((s[i] == '#') && (s[i + 1] == '#')) {
cout << "No" << endl;
return 0;
}
}
for (int i = a + 1; i < c - 1; i++) {
if ((s[i] == '#') && (s[i + 1] == '#')) {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
}
cout << "Illegal" << endl;
return 0;
}
| [
"literal.string.change",
"control_flow.branch.if.condition.change",
"identifier.change",
"variable_access.subscript.index.change"
] | 832,746 | 832,747 | u042605975 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
int fstoneA = 0, fstoneB = 0;
for (int i = A - 1; i < C - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#')
fstoneA = 1;
}
for (int i = B - 1; i < D - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#')
fstoneB = 1;
}
if (fstoneA || fstoneB) {
cout << "No";
return 0;
}
if (C <= B || C <= D) {
cout << "Yes";
return 0;
}
int flag = 0;
for (int i = B - 1; i <= C - 1; i++) {
if (S.substr(i - 1, 3) == "...")
flag = 1;
}
if (flag == 1)
cout << "Yes";
else
cout << "No";
return 0;
} | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
int fstoneA = 0, fstoneB = 0;
for (int i = A - 1; i < C - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#')
fstoneA = 1;
}
for (int i = B - 1; i < D - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#')
fstoneB = 1;
}
if (fstoneA || fstoneB) {
cout << "No";
return 0;
}
if (C <= B || C <= D) {
cout << "Yes";
return 0;
}
int flag = 0;
for (int i = B - 1; i <= D - 1; i++) {
if (S.substr(i - 1, 3) == "...")
flag = 1;
}
if (flag == 1)
cout << "Yes";
else
cout << "No";
return 0;
} | [
"identifier.change",
"control_flow.loop.for.condition.change",
"expression.operation.binary.change"
] | 832,754 | 832,755 | u129667379 | cpp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.