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 <iostream>
using namespace std;
int main() {
int n, a, b, c, d, e = 0, f = 0, g = 0;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
if (c < d) {
for (int i = a; i < d - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
e++;
}
}
if (e == 0) {
cout << "Yes" << endl;
} else
cout << "No" << endl;
} else {
for (int i = b - 1; i < d; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
f++;
}
}
for (int i = a; i < c; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
g++;
}
}
if (f == 0 && g == 0) {
cout << "Yes" << endl;
} else
cout << "No" << endl;
}
}
| #include <iostream>
using namespace std;
int main() {
int n, a, b, c, d, e = 0, f = 0, g = 0;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
if (c < d) {
for (int i = a; i < d - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
e++;
}
}
if (e == 0) {
cout << "Yes" << endl;
} else
cout << "No" << endl;
} else {
for (int i = b - 2; i < d - 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
f++;
}
}
for (int i = a; i < c; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
g++;
}
}
if (f > 0 && g == 0) {
cout << "Yes" << endl;
} else
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",
"control_flow.loop.for.condition.change",
"misc.off_by_one",
"expression.operator.compare.change"
] | 836,612 | 836,613 | u883323885 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, m, n) for (int i = (m); i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define MOD 1000000007
#define INF (1e9)
#define PI (acos(-1))
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
int N, A, B, C, D;
string S;
bool flag;
void dfs(int cur, int goal) {
// ็ตไบๆกไปถ
if (cur > goal) {
flag = false;
return;
}
if (cur == goal) {
flag = true;
return;
}
if (S[cur + 1] == '#' && S[cur + 2] == '#') {
flag = false;
return;
}
// next
if (S[cur + 1] == '.')
dfs(cur + 1, goal);
if (S[cur + 2] == '.')
dfs(cur + 2, goal);
return;
}
int main() {
cin >> N >> A >> B >> C >> D;
cin >> S;
S.push_back('#');
if (C < D) {
// B โ D
dfs(B - 1, D - 1);
// ็ก็ใชใNo return 0;
if (!flag) {
no;
return 0;
}
// A โ C
dfs(A - 1, C - 1);
// ็ก็ใชใNo return 0;
if (!flag) {
no;
return 0;
}
// Yes return 0;
yes;
return 0;
} else {
// D < C
// B โ D
dfs(B - 1, D - 1);
// ็ก็ใชใNo return 0;
if (!flag) {
no;
return 0;
}
// ไธๆบๅ
bool flagt = false;
REP(i, B - 1, D - 1) {
if (S[i - 1] == '.' && S[i] == '.' && S[i + 1] == '.') {
S[i] = '#';
flagt = true;
break;
}
}
if (!flagt) {
no;
return 0;
}
// A โ C
dfs(A - 1, C - 1);
// ็ก็ใชใNo return 0;
if (!flag) {
no;
return 0;
}
// Yes return 0;
yes;
return 0;
}
}
| #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, m, n) for (int i = (m); i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define MOD 1000000007
#define INF (1e9)
#define PI (acos(-1))
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
int N, A, B, C, D;
string S;
bool flag;
void dfs(int cur, int goal) {
// ็ตไบๆกไปถ
if (cur > goal) {
return;
}
if (cur == goal) {
flag = true;
return;
}
if (S[cur + 1] == '#' && S[cur + 2] == '#') {
flag = false;
return;
}
// next
if (S[cur + 1] == '.')
dfs(cur + 1, goal);
if (S[cur + 2] == '.')
dfs(cur + 2, goal);
return;
}
int main() {
cin >> N >> A >> B >> C >> D;
cin >> S;
S.push_back('#');
if (C < D) {
// B โ D
dfs(B - 1, D - 1);
// ็ก็ใชใNo return 0;
if (!flag) {
no;
return 0;
}
// A โ C
dfs(A - 1, C - 1);
// ็ก็ใชใNo return 0;
if (!flag) {
no;
return 0;
}
// Yes return 0;
yes;
return 0;
} else { // D < C
// B โ D
dfs(B - 1, D - 1);
// ็ก็ใชใNo return 0;
if (!flag) {
no;
return 0;
}
// ไธๆบๅ
bool flagt = false;
REP(i, B - 1, D) {
if (S[i - 1] == '.' && S[i] == '.' && S[i + 1] == '.') {
S[i] = '#';
flagt = true;
break;
}
}
if (!flagt) {
no;
return 0;
}
// A โ C
dfs(A - 1, C - 1);
// ็ก็ใชใNo return 0;
if (!flag) {
no;
return 0;
}
// Yes return 0;
yes;
return 0;
}
}
| [
"expression.operation.binary.remove"
] | 836,628 | 836,627 | u319234342 | cpp |
p03017 | #include "bits/stdc++.h"
using namespace std;
#define ll long long
#define endl '\n'
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, a, b) for (int i = int(a); i < int(b); i++)
#define pb emplace_back
#define all(x) (x).begin(), (x).end()
ll mod = 1e9 + 7;
ll mod2 = 998244353;
const int INF = 1e9;
signed main() {
ll n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
a--;
b--;
c--;
d--;
string s;
cin >> s;
rep2(i, min(a, b), max(c, d) - 1) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
if (a < b == c < d) {
cout << "Yes" << endl;
return 0;
}
bool f = false;
if (s[max(a, b) + 1] == '.' && s[max(a, b) - 1] == '.')
f = true;
if (s[min(c, d) + 1] == '.' && s[min(c, d) - 1] == '.')
f = true;
rep2(i, max(a, b), min(c, d) - 2) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.')
f = true;
}
if (f)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
// `.`..`(WNNNNNNMNWWWH9rttwgHM8OtttwwVtttrrtrttrw0rtrtwrrrtrZUAOOrrrXWppHMHyZHpWHMHMkWWVHMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
// `.`.`..`(WMNMHfWH9ZtrtAdNM8ttttOwVtrrtrrtrrrrrdrrttrZkOrrrrrrXWyrtrrZWWWWMmwXWppWHHMmWHkWMMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
// .`.```_..(HMfWH9OtttwXWHBrttrOw0rttrOvrrrtrZrrRrtrrrtZHwrrrrrwwZHyrrrrZWWpWMmwWppkWHHMkHNkVWMNNNNN#NN#NN#NN#NN#NN#NN#NN#NN#NN#NNNN
// .``..
// ..HNfWW9wtrrOdWHM0trttOdSrtrtwwrtrtrw0twSrtOrrrrZHwtrrrrrXwdWwrrrrXHppWNkXWpkvWH@MkHMHkWMMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
// `.`.
// -jMWWXXwtrttO0d@BrtrttwXVrtrrwVrrrtrtXrrd0rrXrrrrrZWyrrrrrrZXwWyZOrrvWWpWMkZHbkwrdHMMKMMNHkHMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
// `.`.
// v8Xdk9ttttrOwXM0tttrtwXwwrtrw0rrtrrtwKrrd0rrXrtrrrrZHkwrrrrrrXkVkrrrvrZHWpHHkWkwrwvVHHNWMMMMkWMNNNNNNN#NN#NN#NN#NN#NN#NN#NNNN
// ..
// JHZdbKOrrrtrtwWWOOttrOwSzVrOrw0rrttrrrdRrrdZrrdOrtrtrrZHkXwrrrrrZWXHwwrrrvWWWWNkWkvrrrwWM@RMMMNNmWMNNNNNNNNNNNNNNNNNNNNNNNNNNNN
// .
// .JGXHStttttrtwW9OrtrrrdSX0rtrdStrtrtrrwHVrrdkrrtSrrrrrrrdMyXrrrrrvXWXWmwvrrvdHWWNkWyvvvvvT@MNWM#N#MNWMMNNNNNNNNNNNNNNNNNNNNNNNNN
// (.zqHXZtrttrrOwU0trttrOdWX0OtOdRrrtrrrrrdNrrrdkrrrXOwrrrrrrdNySrrrrrwXXkUmvvwvrZHWfNkUkvwvvvdMMMRM#MMNNNkMMNNNNNN#NN#NN#NN#NN#NNNN
// (wdS0OttrtOOrwSrtttrrtwKukrrrwKrrrrrtrrwW@rrrXKrrrZkr0OrrrrrWNwkrvvrrvzXkXHwvvrvwWVVHkUyrvvvvZHMMNWMMNNNNNkWMNNNNNNNNNNNNNNNNNNNNN
// wWtrrttrrOwrwStrttrtrwWZXOrtwX0rrrttrrrXMSrrrXWrrrrXrwvrrrrvZHHXkrrrrvrzWkXNyvrvvvWWWHHWwvvvvvwHNMHRM#NNNNNMmWMMNNNNNNNNNNNNNNNNNN
// 8OtttrwZwwtwSrrttrrrwdyXwtrrdWrrtrrrrrdWH0rrrXWOrrrwRz0rrvrrrdMHWwvvrrvvXWkWHyrvvvrWWWHkHvvvvvvwWMMMNWMMNNNNNMHWMMNMNNNN#NN#NNNNNN
// wttrrdVrZrwWwtOrrrrwdWX0rrtdH0rrrtrrtwWHHrrrrXWRrrvrXXXrrvrrrvXHkSwvvrvrrXWkVHyvvvvwHVWHWRvvvvvvdHdMMMKMNNNNNNNMNkWMNNNNNNNNNNNNNM
// ttrrd0rwrOX0rrtrrtwXHXSrwrwHKrtrtrrtrdWH#rrrrdpkrrrrvHwkwvrrvrZWHXkzzvvvvwUWkpNwvrvvZHfVNHwvvvvvzXHWMNMNMNNNNNNNN#NkWMNNNNNNNNNM3>
// rrrdSrwwtXSrrtrrrwXWWKwrrrdHXrrrrrrrwWWH#vrrrvWpvrrvrdRXwvrvrvvXHWWwkvvrvvwWWKWHzwvvvXHVWWHvzzzzvzWRHMMMNHMNNNNNNNNMNkMMNNNNNN@<<>
// OOd9rw0rdKOtrtrrruXHW0rrrdH#rrrrrrrrdpWp#rrrrrXWkvrvvrWwkrvrrvwwWHpKdvvrrvvXHHfWmdwvzwWHVHWkzzzzzzwWXHMHHNWMNNNNNNNNNMNkMNNNN#z>>>
// OdSOwSwwW0rrrrtrwXNW8rrtrWWSrtrrrrrrXpHWHvrrrrXpHrrrvwZHdyvvvvvvXHpHwkvvvvvrXHHfNwXvzzwWWWKHzzzzzzzWSWHHHMMKMNNNNNNNNNNMNKMNN#>>;>
// wWwOXrwX8rtrrrrwWWpHrrrrdNNrrrrrrrrwppNWHrvrvrypWwvvrrvXKWvrvrvvZXHHkXzvvvvvwWWWWNdkvvzXHfHWkXzzzzzwWXHHHHNMHMNNNNNNNNNNNNNWMN+>>>
// R0rd0rdKrrtrtrrdWHWSrrrwWWDrrrrrrrrXpWHqWvrrrvdWbRvvrvvwWZkvvvrvvXHbHzRvvvvvvdHHpHkWwvzXWHWHHzuzzzzzXXWHHHMHMNHMNNNNNNNNNNNMNWh<>>
// wOwSrwXSrtrtrrwHWWMwrrrdNWSrrrrrrrvppWpHprrvrvddWHwvvrrvXHXwvvvrvzXWHkXzvvvvvzWWKWNdRvzzXWWHHXzzzzzzzudWHbH@HNNWMNNNNNNNNNNNNNkHe>
// rOXwwwKrrrrrrrXWHHDrrwrdHHXwrrrrrrwpWWbHWvvvrvwHHpHrvvvrXWHWwvvrwwXHkHdkvzvvvvZHHpHKWzzzwWHWHRzzzzuzzzzWHHkHHMMNWMNNNNNNNNNNNNNNKm
// rdX0OXSrrtrrrdHHWMXrrrwHWHrrrrrrrrXppqWHWkrrvvwWMHHXwwvvvZWKRvvvvrWHWHwWvzvzzzzXWKWNXRzzwXWWNHzzzzzzzzzXUHkHWMMHNWMNNNNNNNNNNNNNNN
// wSwww#rrrrrrwWWHM#vrrrd#WKvrrrrrvvXppmWMWkvvvvwXNNpNvSXzzvdHkkvvzvdWWWRXwzzzzzzdNNpMkHzzzWVHHpXzzzzzzzzdkHkHHHNMHNkMNNNNNNNNNNNNNN
// XwSwWwrrrrrrdHWWMKrvrvWHWSrvrvvvvwpppHW#HRwUUUWWMMMMMHHHHmmXHWwvvzwWHbNwRzzzzzzzWWWWHWkzzdXWWWRzzzzzzzuzWWbHHWMNMMNkMNNNNNNNNNNNNN
// 8drd#rrrrrrwWWkHMmXmywMfWXrvrrrvrwppWNWMNWvrvvwvW#MNHmdkrvvXHMMmmwzdWpM0WzzzzzzzdHHWNUHzzzWWmHHzzuzzuzuzWXbbNkHMqMHNkHNNNNNNNNNNNN
// dSwWSrrrrrrdHHHMHrrrwWMfWvvvrvrrrdppWNW#WWRvvrvvdM?WNHkXkzvvdWMHXHNmHHHkfwzzzzzzXHHpMWHkzuXWHNWXzzuzzuzzXXkkHbHMHMMMMkMNNNNNNNNNNN
// Xrd#wrrrrrrXpHWH#rrrvdMWWvrrvrvvrdppWHW#(NWwvvvvwMr~TNHmdkvzvXWMKzzzWMHKXXzzzzzzuWHbHkWKuzdWWHWkzzzuzzuuXXHkHkgHk@H@HHkMNNNNNNNNNN
// RvWDrrrrrrwHWkMW#rvvrMMfWwrvrrvvrdppWHW@~?HHuvvrvdb_~?NWkdkzzzUWMkzuuWWHWXuzwzzuzXHHHKWHuzzWW@WRuzuzzzzzduWbHHgMH@HHHMMHMNNNNNNNNN
// rdHwrrrrrrXHHWNW#vvvdMMHWkvrvrrvrdppWbWD~~?XKkrrrwMc~~~THHZHwzzWHNkvzwMRdHHzuzzzzXHHWHXNkuzdWHkWuzzuzuzzXzWkHHHMHHHkH@MMNWMNNNNNNN
// rdHvrrrrrrWkHHHW#rrrd#dNWKrvrvvrvwbpWWW$...vVkkOrtXb~~~~(WHkWkvwWWMkzzWRXkSWXzzzuwmNWHXHRuuwHMKWzzuzzzuzXzWHWHHMHHHkkMMMHHWNNNNNNN
// wW#rrvrrrwHWHMpWNrvrd@(NWWvrrrrrvvWpWXH$..._?dkkttOWl~~~~~?HHdHXXbWMkzUHXWkzzzzzzuHNk#XHHzzukHHXzuzzzuzuXuXqkMHMHMbbkHHH@HNWMNNNNN
// dH#rrrvrrdNWWNpHHwrrd@_WHWkrvvrrrrZpWXWr...__?WkWyOvN~~~~~__7HkWkbbkNkzXHZkzzzuzzzWHW#ugbXuzWWHXXuzzuzuuuzXkkHHH@MbkHMHMHMMNWMNNNN
// X@KrrvrvrXNHWHpHHHrrdb~(NWHrrrrrrrrXWXWr..`...-7HZkzvn~~~~~~~_TNyHHkHMyzXkXuzzzzuuWHW#uHkkzzWHHXuzzzzuzzuuXHkHHHMNbkHHHHHHMMNWMNNN
// WHKvvrvrvXHNMbpHmHkOwb..?HWRrwOrtrtrWKWr`.`.`..._?6dkJn~~~~~~-_~7NHMHbNkuUkzzuzzzuWHW#uHbRzuXHHXzzuuuuzuuzXHkHHMMbkkHkMkkkMMMNUMMN
// WHKrrvrrvXqHMpfHHHWkrb...vkHyOrtttttdNXr.`.J>~-((J+ggQkHXHHHmaJz7&JWHMMWkuHXzuuuzzWgHHwHkKuzXMKXuzuuzuzzuzdkHHHHHkHWMHHbkWHMMMNXM#
// Wg#rvrvrrXmHNpfHHHMMRd-.._4kfyttttllOHWr``
// <udT"""7"""""TMHHMNHHMNgv4HMRXHXHwuzzzuWHHKXHkHzzXMSWzuzzuzuuzudbkHHHHkkHqHuWkWHHMMMNWM
// WHNrvrvvvXHmNppgg@MMMHr..` UkWOlllllldW$..?! ` `
// ?@MMHHMM#NMMmMkXXWkHuzuzuWNHSXHHHuuXNSWuzuuzuzuzuWkHNgMkkkMHSuWkqmqHHMNNK
// WHMkvvrvrXHHMppHHHMNMTN_``` 4kWOz====vXP` ` `
// ``.HggmgM@MH###NKkkuXWHzzuXHHMzdMHHuzWNXKzuuzuzuzuuHkHHNMkkHHBuzWkHHHHuHMMM
// WHHNzvvrvwHMMppHMMMM>.#L`````?kyy====?0S`` ` `
// ``...dmqqqmmHHHMMM#WRSzuzWHuzXHq#uWHHHzuWHXKzuzzuzuzuXHkHWMNkWM#uzuWHHHHSuuWM#
// WM@MkwvvrzXMMHpgHMMM[.MN.`````(HXy1???zd.`` ` ` `
// dHkkqkkqkHHHHHHMMWWXzzuzwWwXHHKXMkHHuXMRXSuuuzuuzuzXHkHdHHWHHXuuwWHqHHuXzXWM
// XHHMNyrvvwdW@HpHWMHML MM[` ` `.4kGz<<>Or``` `
// `dWpbbbbbHMMbbbHHMXXuzzuzuzXWHHSXMkHHuXMSXuzzuzzuzuzWkkHWMHMSwuzzXHkHHXuzuWd#
// dHHH@NyzwwwWHMHHWMMMR dW]`` ` ```(HZx<<<4.```` `` ``
// OZppfppppWfpWpK9NKXuuzuuzuXWHHudMqNHXWNuHuzzuzuzuzuHkHXMMBuuuzuuWkHHUuuuXSMS
// wWHMMMMkwwvdNpHHHM#MH-jWP``` `` ```7kI<:<h.``````` ``
// ,2OWVVyVVyWWWWIdMKWzuuuzzuXHHSwHHHHKXHHXSuuzuuzuzuXHHHXMXuuuuuuXHHHuzuuXSX#X
// wdWHMMMMmwXwHbpMNHMM@b.hb```````````
// 7x1_(>_```````````(x7UUUV0XwvCI1dMWKXuzzuzuWHHudMkgkWbMSXuzzzuzzuzuWkHSW#zXwXuXXWHHuuXXuWXWSX
// vvXWHMMHWNkvWHbbMWMMMN_JF.```` ``
// `````?1_(_.`.`........(<777=<<<><<+dMXUuzuuuuWWMRwMHWMkWHHXSuuzuzuzzuXqHHXMHUXuXXHHHSuuwuXWud8uH
// mzzXWH#zHbHkXNbbWMMMMD~(_```````````````
// .~_`.``.`.`.....___(<~(<<(<<dHkkuuuuuXkHHuWMkHkkkHSXXzuuzuuuuzXHHSd#uuXXWHHXuuuZuXSuqHudS
// UHzzXWSXXWbbHHHbWHMH#<~...```` ``````````````.```.`
// -_____<~~_<_<~~(jMWSuzuzuXWHMHXMHHHkkH#XSuzzuzuzuzuKkHXMQkWHHWUXuXXUuXUuXHuXBu
// .(Smd8wSvXbbbbHHHWHW3___.``````` ``
// ``````.```.```.`...._.._~~..~_~~(#WuzuuzXXkHMqMMHMkkkMUXuXzuuwuuzuXkHSWMWUUuuuXXUUuXHXXWSuXHXu
// .. JKwSvwzWkkkkHHHH5~~..```````````````````.```.````````.`
// .........dWSuuzzzdkHMW@MHMkkkHHXXuzuuXSuzuuWWHd#uuuXXkWSuXXWUXXHUXWHuuu
// .`(HXSzzzzwWbkWHNHr_...``````````````````.```````.```````.`.`..`.-.(HKuzzuuwHHMNMHHMkkkHHuZuuzuuXuuuuXkHWMHHHUUuXXXWHXXHHUuXW8uuuu
// .-MXWwzzzuzXkHHMHHN-.``````````
// ````````````.`.````.``.```.`.`....-dXUXuzuXHWHMMHHBWHMMMSZuzuuzXXzuuXHHMHMHkHHHHHHHWHHSuXkHWSuuuuX
// (#XKzzzzzuzuWHHkWHHp
// ``.````````````````````````.````````.....-((-(NSXuzzXHW@D:~`(/1-
// .kXuzuuzXSuuzXXkHWMHHHHHHHHMWuuuQXUXWuuuXuXH
// MXWzuzzzzzuXHHbHNMMMt`.```````````````````````````.`.` ..-J7"!``
// XKuzzuXHHM9;/<-.J-u!JXXuuzuXWuuuuXHHH#WMNHmkkkuXXkWUXXWXXuuuXqHH
// XWzzzzuzzwXHHHH#"````<.````````````````````.``.`...-c"7``` ` `
// `(BzuuuXmHH8<!(- ?_!`jWUuzuuuWuuuzXWHNH> ..7WHHqHmQkWWXXuuuuuXWqHH
// SwuzzzXuwXHNHY`` `` <,`.`````````````` `` ..J7=``` ` ` ``
// ````.#zuzXXHHH$~`` ```(_(HSuuuzuXSuzuuXHHWCi(` ._ ?WggHHHHWkkkkWHHHHMH
// zzzuzuzwWHMY!` ` ` `(&.```````````` ..J7^ `` ` ` ` ` `. .HXuuXWHW#!` `
// ```` (WUuzzuXXSzuuudHHXY$. : (..``.THHkqkHHHgHHMHkkk zzzzzzXHWK`` ` `` ` ` `
// TJ.``````..J7=```` ` ` ` ` `` ` `.8zuXXHHW=` ``
// ..(XSuuuuuXWuuuuXHWH5~~` .`_?_,-``.TMMMMMMHkkqqHHH zzuuzdHHkN ` ` ` `` `
// ``(Wm,.(J7!``` ` ``` `` `` ` ` ``` .SzuXWHHY ``
// .._~<~~(dSuuuzzXHuuuuXHWHD::?C._.( -`(!_1 ,WHqHHHmqHHHHN zuzXXHHkHM;` ` ` `
// `` ` .;jY= ` .``_`` ` ` ` ` `` ` `.dXuXWm@^
// .._~_.~~~~~(d0uuzuuXHUuuuXHWH5:::::::_.<&._4r?_.;WMMM@MMY"<!` zzXHHHHMHMb``
// `` ` `` `` .J! ` ..`_~ ` ` ` `` ` ` ``.JXXXHY!
// .__.....~.~~~-d0wuzuXXHSuuuXWWH$::::;:::;:+- ~`(.i +HqHHkkHL..`. XWHHHMMHMHM;
// ` ` ` ` ._`` ...(:.=_` ` ` ` ` ````
// .-dVT7^``````......~~~~~_jWuuuuuXHSuzuXHHH3<;:::::;;j<+z ``` -dHNkkMqkkN..``
// HHHMMHHHHNMN.`` ` ` `!`z(. ~..~ ! . ` `` ` ` `
// ..gHr``````````........~~~~_jWuuuuuXkSuuuXHWHC:;::;;:::+v>:((J<!(WHHMkkHNqkM;`..
// HMMkkHHHHM9?b `` ` ` `` .``. ` ` ` ` ``` 4HkkkH,
// ``````.`......~~~~_+KuuuzuXHSuuuXHHK<(::::::<;<J+g9>::;< .4NkkqMHqH]..`
// MHkHHHMM$<<:?L` `` ` ` ` ``.` ` !`` ` ` ` ` `
// ?HbkkHx``````.`..`...~~~~_jKuuuuuXHSuuuqMHD<:<;:<++ddNMB3:;::;:<`
// `,HkkqH@HH].`` kkHHkHY``` (;?h`` ` ` `` ```` ` ` ` ` ` ` ` `
// ```.4XWbHx```..`......~~~~_gKuuuuXWH0uuuXHH3:;++1z<jgMB3<::::::::~`
// `jMkqkHMHHF.`. kHHHH=` . ` _<?L ` ` ` ` ` ` ` ` ` ` ` ` ` ` ?kwWHp
// .`.......~_~~(dKuuuuXWHUuuXWH9++z1<;+jWB3::::;;;::;:;_`` MNkqkqMNMF..` HHk@!.
// ` ` ` ~?L ` ` `` ` `` `` ` ` ` ` ` ` ` `
// -WuXHh..`.....~~~~(dWuuuXXkHUuuXHH9>:<:++YY<:;::::;:::::;:::+.``?HHkHHHM>`.`
| #include "bits/stdc++.h"
using namespace std;
#define ll long long
#define endl '\n'
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, a, b) for (int i = int(a); i < int(b); i++)
#define pb emplace_back
#define all(x) (x).begin(), (x).end()
ll mod = 1e9 + 7;
ll mod2 = 998244353;
const int INF = 1e9;
signed main() {
ll n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
a--;
b--;
c--;
d--;
string s;
cin >> s;
rep2(i, min(a, b), max(c, d) - 1) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
if (a < b == c < d) {
cout << "Yes" << endl;
return 0;
}
bool f = false;
if (s[max(a, b) + 1] == '.' && s[max(a, b) - 1] == '.')
f = true;
if (s[min(c, d) + 1] == '.' && s[min(c, d) - 1] == '.')
f = true;
rep2(i, max(a, b), min(c, d) - 1) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.')
f = true;
}
if (f)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
// `.`..`(WNNNNNNMNWWWH9rttwgHM8OtttwwVtttrrtrttrw0rtrtwrrrtrZUAOOrrrXWppHMHyZHpWHMHMkWWVHMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
// `.`.`..`(WMNMHfWH9ZtrtAdNM8ttttOwVtrrtrrtrrrrrdrrttrZkOrrrrrrXWyrtrrZWWWWMmwXWppWHHMmWHkWMMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
// .`.```_..(HMfWH9OtttwXWHBrttrOw0rttrOvrrrtrZrrRrtrrrtZHwrrrrrwwZHyrrrrZWWpWMmwWppkWHHMkHNkVWMNNNNN#NN#NN#NN#NN#NN#NN#NN#NN#NN#NNNN
// .``..
// ..HNfWW9wtrrOdWHM0trttOdSrtrtwwrtrtrw0twSrtOrrrrZHwtrrrrrXwdWwrrrrXHppWNkXWpkvWH@MkHMHkWMMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
// `.`.
// -jMWWXXwtrttO0d@BrtrttwXVrtrrwVrrrtrtXrrd0rrXrrrrrZWyrrrrrrZXwWyZOrrvWWpWMkZHbkwrdHMMKMMNHkHMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
// `.`.
// v8Xdk9ttttrOwXM0tttrtwXwwrtrw0rrtrrtwKrrd0rrXrtrrrrZHkwrrrrrrXkVkrrrvrZHWpHHkWkwrwvVHHNWMMMMkWMNNNNNNN#NN#NN#NN#NN#NN#NN#NNNN
// ..
// JHZdbKOrrrtrtwWWOOttrOwSzVrOrw0rrttrrrdRrrdZrrdOrtrtrrZHkXwrrrrrZWXHwwrrrvWWWWNkWkvrrrwWM@RMMMNNmWMNNNNNNNNNNNNNNNNNNNNNNNNNNNN
// .
// .JGXHStttttrtwW9OrtrrrdSX0rtrdStrtrtrrwHVrrdkrrtSrrrrrrrdMyXrrrrrvXWXWmwvrrvdHWWNkWyvvvvvT@MNWM#N#MNWMMNNNNNNNNNNNNNNNNNNNNNNNNN
// (.zqHXZtrttrrOwU0trttrOdWX0OtOdRrrtrrrrrdNrrrdkrrrXOwrrrrrrdNySrrrrrwXXkUmvvwvrZHWfNkUkvwvvvdMMMRM#MMNNNkMMNNNNNN#NN#NN#NN#NN#NNNN
// (wdS0OttrtOOrwSrtttrrtwKukrrrwKrrrrrtrrwW@rrrXKrrrZkr0OrrrrrWNwkrvvrrvzXkXHwvvrvwWVVHkUyrvvvvZHMMNWMMNNNNNkWMNNNNNNNNNNNNNNNNNNNNN
// wWtrrttrrOwrwStrttrtrwWZXOrtwX0rrrttrrrXMSrrrXWrrrrXrwvrrrrvZHHXkrrrrvrzWkXNyvrvvvWWWHHWwvvvvvwHNMHRM#NNNNNMmWMMNNNNNNNNNNNNNNNNNN
// 8OtttrwZwwtwSrrttrrrwdyXwtrrdWrrtrrrrrdWH0rrrXWOrrrwRz0rrvrrrdMHWwvvrrvvXWkWHyrvvvrWWWHkHvvvvvvwWMMMNWMMNNNNNMHWMMNMNNNN#NN#NNNNNN
// wttrrdVrZrwWwtOrrrrwdWX0rrtdH0rrrtrrtwWHHrrrrXWRrrvrXXXrrvrrrvXHkSwvvrvrrXWkVHyvvvvwHVWHWRvvvvvvdHdMMMKMNNNNNNNMNkWMNNNNNNNNNNNNNM
// ttrrd0rwrOX0rrtrrtwXHXSrwrwHKrtrtrrtrdWH#rrrrdpkrrrrvHwkwvrrvrZWHXkzzvvvvwUWkpNwvrvvZHfVNHwvvvvvzXHWMNMNMNNNNNNNN#NkWMNNNNNNNNNM3>
// rrrdSrwwtXSrrtrrrwXWWKwrrrdHXrrrrrrrwWWH#vrrrvWpvrrvrdRXwvrvrvvXHWWwkvvrvvwWWKWHzwvvvXHVWWHvzzzzvzWRHMMMNHMNNNNNNNNMNkMMNNNNNN@<<>
// OOd9rw0rdKOtrtrrruXHW0rrrdH#rrrrrrrrdpWp#rrrrrXWkvrvvrWwkrvrrvwwWHpKdvvrrvvXHHfWmdwvzwWHVHWkzzzzzzwWXHMHHNWMNNNNNNNNNMNkMNNNN#z>>>
// OdSOwSwwW0rrrrtrwXNW8rrtrWWSrtrrrrrrXpHWHvrrrrXpHrrrvwZHdyvvvvvvXHpHwkvvvvvrXHHfNwXvzzwWWWKHzzzzzzzWSWHHHMMKMNNNNNNNNNNMNKMNN#>>;>
// wWwOXrwX8rtrrrrwWWpHrrrrdNNrrrrrrrrwppNWHrvrvrypWwvvrrvXKWvrvrvvZXHHkXzvvvvvwWWWWNdkvvzXHfHWkXzzzzzwWXHHHHNMHMNNNNNNNNNNNNNWMN+>>>
// R0rd0rdKrrtrtrrdWHWSrrrwWWDrrrrrrrrXpWHqWvrrrvdWbRvvrvvwWZkvvvrvvXHbHzRvvvvvvdHHpHkWwvzXWHWHHzuzzzzzXXWHHHMHMNHMNNNNNNNNNNNMNWh<>>
// wOwSrwXSrtrtrrwHWWMwrrrdNWSrrrrrrrvppWpHprrvrvddWHwvvrrvXHXwvvvrvzXWHkXzvvvvvzWWKWNdRvzzXWWHHXzzzzzzzudWHbH@HNNWMNNNNNNNNNNNNNkHe>
// rOXwwwKrrrrrrrXWHHDrrwrdHHXwrrrrrrwpWWbHWvvvrvwHHpHrvvvrXWHWwvvrwwXHkHdkvzvvvvZHHpHKWzzzwWHWHRzzzzuzzzzWHHkHHMMNWMNNNNNNNNNNNNNNKm
// rdX0OXSrrtrrrdHHWMXrrrwHWHrrrrrrrrXppqWHWkrrvvwWMHHXwwvvvZWKRvvvvrWHWHwWvzvzzzzXWKWNXRzzwXWWNHzzzzzzzzzXUHkHWMMHNWMNNNNNNNNNNNNNNN
// wSwww#rrrrrrwWWHM#vrrrd#WKvrrrrrvvXppmWMWkvvvvwXNNpNvSXzzvdHkkvvzvdWWWRXwzzzzzzdNNpMkHzzzWVHHpXzzzzzzzzdkHkHHHNMHNkMNNNNNNNNNNNNNN
// XwSwWwrrrrrrdHWWMKrvrvWHWSrvrvvvvwpppHW#HRwUUUWWMMMMMHHHHmmXHWwvvzwWHbNwRzzzzzzzWWWWHWkzzdXWWWRzzzzzzzuzWWbHHWMNMMNkMNNNNNNNNNNNNN
// 8drd#rrrrrrwWWkHMmXmywMfWXrvrrrvrwppWNWMNWvrvvwvW#MNHmdkrvvXHMMmmwzdWpM0WzzzzzzzdHHWNUHzzzWWmHHzzuzzuzuzWXbbNkHMqMHNkHNNNNNNNNNNNN
// dSwWSrrrrrrdHHHMHrrrwWMfWvvvrvrrrdppWNW#WWRvvrvvdM?WNHkXkzvvdWMHXHNmHHHkfwzzzzzzXHHpMWHkzuXWHNWXzzuzzuzzXXkkHbHMHMMMMkMNNNNNNNNNNN
// Xrd#wrrrrrrXpHWH#rrrvdMWWvrrvrvvrdppWHW#(NWwvvvvwMr~TNHmdkvzvXWMKzzzWMHKXXzzzzzzuWHbHkWKuzdWWHWkzzzuzzuuXXHkHkgHk@H@HHkMNNNNNNNNNN
// RvWDrrrrrrwHWkMW#rvvrMMfWwrvrrvvrdppWHW@~?HHuvvrvdb_~?NWkdkzzzUWMkzuuWWHWXuzwzzuzXHHHKWHuzzWW@WRuzuzzzzzduWbHHgMH@HHHMMHMNNNNNNNNN
// rdHwrrrrrrXHHWNW#vvvdMMHWkvrvrrvrdppWbWD~~?XKkrrrwMc~~~THHZHwzzWHNkvzwMRdHHzuzzzzXHHWHXNkuzdWHkWuzzuzuzzXzWkHHHMHHHkH@MMNWMNNNNNNN
// rdHvrrrrrrWkHHHW#rrrd#dNWKrvrvvrvwbpWWW$...vVkkOrtXb~~~~(WHkWkvwWWMkzzWRXkSWXzzzuwmNWHXHRuuwHMKWzzuzzzuzXzWHWHHMHHHkkMMMHHWNNNNNNN
// wW#rrvrrrwHWHMpWNrvrd@(NWWvrrrrrvvWpWXH$..._?dkkttOWl~~~~~?HHdHXXbWMkzUHXWkzzzzzzuHNk#XHHzzukHHXzuzzzuzuXuXqkMHMHMbbkHHH@HNWMNNNNN
// dH#rrrvrrdNWWNpHHwrrd@_WHWkrvvrrrrZpWXWr...__?WkWyOvN~~~~~__7HkWkbbkNkzXHZkzzzuzzzWHW#ugbXuzWWHXXuzzuzuuuzXkkHHH@MbkHMHMHMMNWMNNNN
// X@KrrvrvrXNHWHpHHHrrdb~(NWHrrrrrrrrXWXWr..`...-7HZkzvn~~~~~~~_TNyHHkHMyzXkXuzzzzuuWHW#uHkkzzWHHXuzzzzuzzuuXHkHHHMNbkHHHHHHMMNWMNNN
// WHKvvrvrvXHNMbpHmHkOwb..?HWRrwOrtrtrWKWr`.`.`..._?6dkJn~~~~~~-_~7NHMHbNkuUkzzuzzzuWHW#uHbRzuXHHXzzuuuuzuuzXHkHHMMbkkHkMkkkMMMNUMMN
// WHKrrvrrvXqHMpfHHHWkrb...vkHyOrtttttdNXr.`.J>~-((J+ggQkHXHHHmaJz7&JWHMMWkuHXzuuuzzWgHHwHkKuzXMKXuzuuzuzzuzdkHHHHHkHWMHHbkWHMMMNXM#
// Wg#rvrvrrXmHNpfHHHMMRd-.._4kfyttttllOHWr``
// <udT"""7"""""TMHHMNHHMNgv4HMRXHXHwuzzzuWHHKXHkHzzXMSWzuzzuzuuzudbkHHHHkkHqHuWkWHHMMMNWM
// WHNrvrvvvXHmNppgg@MMMHr..` UkWOlllllldW$..?! ` `
// ?@MMHHMM#NMMmMkXXWkHuzuzuWNHSXHHHuuXNSWuzuuzuzuzuWkHNgMkkkMHSuWkqmqHHMNNK
// WHMkvvrvrXHHMppHHHMNMTN_``` 4kWOz====vXP` ` `
// ``.HggmgM@MH###NKkkuXWHzzuXHHMzdMHHuzWNXKzuuzuzuzuuHkHHNMkkHHBuzWkHHHHuHMMM
// WHHNzvvrvwHMMppHMMMM>.#L`````?kyy====?0S`` ` `
// ``...dmqqqmmHHHMMM#WRSzuzWHuzXHq#uWHHHzuWHXKzuzzuzuzuXHkHWMNkWM#uzuWHHHHSuuWM#
// WM@MkwvvrzXMMHpgHMMM[.MN.`````(HXy1???zd.`` ` ` `
// dHkkqkkqkHHHHHHMMWWXzzuzwWwXHHKXMkHHuXMRXSuuuzuuzuzXHkHdHHWHHXuuwWHqHHuXzXWM
// XHHMNyrvvwdW@HpHWMHML MM[` ` `.4kGz<<>Or``` `
// `dWpbbbbbHMMbbbHHMXXuzzuzuzXWHHSXMkHHuXMSXuzzuzzuzuzWkkHWMHMSwuzzXHkHHXuzuWd#
// dHHH@NyzwwwWHMHHWMMMR dW]`` ` ```(HZx<<<4.```` `` ``
// OZppfppppWfpWpK9NKXuuzuuzuXWHHudMqNHXWNuHuzzuzuzuzuHkHXMMBuuuzuuWkHHUuuuXSMS
// wWHMMMMkwwvdNpHHHM#MH-jWP``` `` ```7kI<:<h.``````` ``
// ,2OWVVyVVyWWWWIdMKWzuuuzzuXHHSwHHHHKXHHXSuuzuuzuzuXHHHXMXuuuuuuXHHHuzuuXSX#X
// wdWHMMMMmwXwHbpMNHMM@b.hb```````````
// 7x1_(>_```````````(x7UUUV0XwvCI1dMWKXuzzuzuWHHudMkgkWbMSXuzzzuzzuzuWkHSW#zXwXuXXWHHuuXXuWXWSX
// vvXWHMMHWNkvWHbbMWMMMN_JF.```` ``
// `````?1_(_.`.`........(<777=<<<><<+dMXUuzuuuuWWMRwMHWMkWHHXSuuzuzuzzuXqHHXMHUXuXXHHHSuuwuXWud8uH
// mzzXWH#zHbHkXNbbWMMMMD~(_```````````````
// .~_`.``.`.`.....___(<~(<<(<<dHkkuuuuuXkHHuWMkHkkkHSXXzuuzuuuuzXHHSd#uuXXWHHXuuuZuXSuqHudS
// UHzzXWSXXWbbHHHbWHMH#<~...```` ``````````````.```.`
// -_____<~~_<_<~~(jMWSuzuzuXWHMHXMHHHkkH#XSuzzuzuzuzuKkHXMQkWHHWUXuXXUuXUuXHuXBu
// .(Smd8wSvXbbbbHHHWHW3___.``````` ``
// ``````.```.```.`...._.._~~..~_~~(#WuzuuzXXkHMqMMHMkkkMUXuXzuuwuuzuXkHSWMWUUuuuXXUUuXHXXWSuXHXu
// .. JKwSvwzWkkkkHHHH5~~..```````````````````.```.````````.`
// .........dWSuuzzzdkHMW@MHMkkkHHXXuzuuXSuzuuWWHd#uuuXXkWSuXXWUXXHUXWHuuu
// .`(HXSzzzzwWbkWHNHr_...``````````````````.```````.```````.`.`..`.-.(HKuzzuuwHHMNMHHMkkkHHuZuuzuuXuuuuXkHWMHHHUUuXXXWHXXHHUuXW8uuuu
// .-MXWwzzzuzXkHHMHHN-.``````````
// ````````````.`.````.``.```.`.`....-dXUXuzuXHWHMMHHBWHMMMSZuzuuzXXzuuXHHMHMHkHHHHHHHWHHSuXkHWSuuuuX
// (#XKzzzzzuzuWHHkWHHp
// ``.````````````````````````.````````.....-((-(NSXuzzXHW@D:~`(/1-
// .kXuzuuzXSuuzXXkHWMHHHHHHHHMWuuuQXUXWuuuXuXH
// MXWzuzzzzzuXHHbHNMMMt`.```````````````````````````.`.` ..-J7"!``
// XKuzzuXHHM9;/<-.J-u!JXXuuzuXWuuuuXHHH#WMNHmkkkuXXkWUXXWXXuuuXqHH
// XWzzzzuzzwXHHHH#"````<.````````````````````.``.`...-c"7``` ` `
// `(BzuuuXmHH8<!(- ?_!`jWUuzuuuWuuuzXWHNH> ..7WHHqHmQkWWXXuuuuuXWqHH
// SwuzzzXuwXHNHY`` `` <,`.`````````````` `` ..J7=``` ` ` ``
// ````.#zuzXXHHH$~`` ```(_(HSuuuzuXSuzuuXHHWCi(` ._ ?WggHHHHWkkkkWHHHHMH
// zzzuzuzwWHMY!` ` ` `(&.```````````` ..J7^ `` ` ` ` ` `. .HXuuXWHW#!` `
// ```` (WUuzzuXXSzuuudHHXY$. : (..``.THHkqkHHHgHHMHkkk zzzzzzXHWK`` ` `` ` ` `
// TJ.``````..J7=```` ` ` ` ` `` ` `.8zuXXHHW=` ``
// ..(XSuuuuuXWuuuuXHWH5~~` .`_?_,-``.TMMMMMMHkkqqHHH zzuuzdHHkN ` ` ` `` `
// ``(Wm,.(J7!``` ` ``` `` `` ` ` ``` .SzuXWHHY ``
// .._~<~~(dSuuuzzXHuuuuXHWHD::?C._.( -`(!_1 ,WHqHHHmqHHHHN zuzXXHHkHM;` ` ` `
// `` ` .;jY= ` .``_`` ` ` ` ` `` ` `.dXuXWm@^
// .._~_.~~~~~(d0uuzuuXHUuuuXHWH5:::::::_.<&._4r?_.;WMMM@MMY"<!` zzXHHHHMHMb``
// `` ` `` `` .J! ` ..`_~ ` ` ` `` ` ` ``.JXXXHY!
// .__.....~.~~~-d0wuzuXXHSuuuXWWH$::::;:::;:+- ~`(.i +HqHHkkHL..`. XWHHHMMHMHM;
// ` ` ` ` ._`` ...(:.=_` ` ` ` ` ````
// .-dVT7^``````......~~~~~_jWuuuuuXHSuzuXHHH3<;:::::;;j<+z ``` -dHNkkMqkkN..``
// HHHMMHHHHNMN.`` ` ` `!`z(. ~..~ ! . ` `` ` ` `
// ..gHr``````````........~~~~_jWuuuuuXkSuuuXHWHC:;::;;:::+v>:((J<!(WHHMkkHNqkM;`..
// HMMkkHHHHM9?b `` ` ` `` .``. ` ` ` ` ``` 4HkkkH,
// ``````.`......~~~~_+KuuuzuXHSuuuXHHK<(::::::<;<J+g9>::;< .4NkkqMHqH]..`
// MHkHHHMM$<<:?L` `` ` ` ` ``.` ` !`` ` ` ` ` `
// ?HbkkHx``````.`..`...~~~~_jKuuuuuXHSuuuqMHD<:<;:<++ddNMB3:;::;:<`
// `,HkkqH@HH].`` kkHHkHY``` (;?h`` ` ` `` ```` ` ` ` ` ` ` ` `
// ```.4XWbHx```..`......~~~~_gKuuuuXWH0uuuXHH3:;++1z<jgMB3<::::::::~`
// `jMkqkHMHHF.`. kHHHH=` . ` _<?L ` ` ` ` ` ` ` ` ` ` ` ` ` ` ?kwWHp
// .`.......~_~~(dKuuuuXWHUuuXWH9++z1<;+jWB3::::;;;::;:;_`` MNkqkqMNMF..` HHk@!.
// ` ` ` ~?L ` ` `` ` `` `` ` ` ` ` ` ` ` `
// -WuXHh..`.....~~~~(dWuuuXXkHUuuXHH9>:<:++YY<:;::::;:::::;:::+.``?HHkHHHM>`.`
| [
"literal.number.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 836,645 | 836,646 | u890465662 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = by; i <= fy + 1; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = by + 1; i <= fy + 1; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| [
"control_flow.loop.for.initializer.change"
] | 836,650 | 836,651 | u201455094 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = by - 1; i <= fy + 1; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = by + 1; i <= fy + 1; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| [
"misc.opposites",
"expression.operator.arithmetic.change",
"control_flow.loop.for.initializer.change",
"expression.operation.binary.change"
] | 836,652 | 836,651 | u201455094 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = by + 2; i <= fy + 2; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = by + 1; i <= fy + 1; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| [
"literal.number.change",
"control_flow.loop.for.initializer.change",
"expression.off_by_one",
"expression.operation.binary.change",
"control_flow.branch.if.condition.change"
] | 836,653 | 836,651 | u201455094 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = by + 2; i <= fy + 1; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = by + 1; i <= fy + 1; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| [
"literal.number.change",
"control_flow.loop.for.initializer.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 836,654 | 836,651 | u201455094 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = by + 3; i <= fy + 1; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = by + 1; i <= fy + 1; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| [
"literal.number.change",
"control_flow.loop.for.initializer.change",
"expression.operation.binary.change"
] | 836,655 | 836,651 | u201455094 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = bx; i <= fy + 1; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = by + 1; i <= fy + 1; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| [
"control_flow.loop.for.initializer.change"
] | 836,658 | 836,651 | u201455094 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = bx + 1; i <= fy + 1; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = by + 1; i <= fy + 1; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| [
"identifier.change",
"control_flow.loop.for.initializer.change",
"expression.operation.binary.change"
] | 836,659 | 836,651 | u201455094 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = bx + 1; i <= fy; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = by + 1; i <= fy + 1; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| [
"identifier.change",
"control_flow.loop.for.initializer.change",
"expression.operation.binary.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 836,660 | 836,651 | u201455094 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = bx; i <= fy; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = by + 1; i <= fy + 1; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| [
"control_flow.loop.for.initializer.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 836,661 | 836,651 | u201455094 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = bx; i <= fy + 2; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = by + 1; i <= fy + 1; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| [
"control_flow.loop.for.initializer.change",
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 836,662 | 836,651 | u201455094 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = bx - 2; i <= fy + 2; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = by + 1; i <= fy + 1; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| [
"control_flow.loop.for.initializer.change",
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 836,663 | 836,651 | u201455094 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = bx - 2; i <= fx; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = by + 1; i <= fy + 1; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| [
"control_flow.loop.for.initializer.change",
"identifier.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 836,664 | 836,651 | u201455094 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = bx - 2; i <= fy; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = by + 1; i <= fy + 1; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| [
"control_flow.loop.for.initializer.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 836,665 | 836,651 | u201455094 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = by; i <= fy; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = by + 1; i <= fy + 1; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| [
"control_flow.loop.for.initializer.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 836,666 | 836,651 | u201455094 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = by - 2; i <= fy; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = by + 1; i <= fy + 1; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| [
"control_flow.loop.for.initializer.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 836,667 | 836,651 | u201455094 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = bx + 2; i <= fy; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| #include <bits/stdc++.h>
using namespace std;
char a[200005];
int main() {
int n, bx, by, fx, fy;
cin >> n >> bx >> by >> fx >> fy;
for (int i = 1; i <= n; i++) {
cin >> a[i];
/*if(a[i]=='#' && a[i-1]=='#')
check1=1;*/
}
for (int i = bx + 1; i <= fx; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
for (int i = by + 1; i <= fy; i++) {
if (a[i] == '#' && a[i - 1] == '#') {
cout << "No";
return 0;
}
}
if (fx < fy)
cout << "Yes";
else {
for (int i = by + 1; i <= fy + 1; i++) {
if (a[i] == '.' && a[i - 1] == '.' && a[i - 2] == '.') {
cout << "Yes";
return 0;
}
}
cout << "No";
}
}
| [
"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",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 836,670 | 836,651 | u201455094 | cpp |
p03017 | #include <iostream>
#include <string>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
bool judge(int a, int b, string s) {
for (int i = a - 1; i < b - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
return false;
}
}
return true;
}
bool check(int a, int b, string s) {
for (int i = a - 1; i <= b - 1; i++) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.') {
return true;
}
}
return false;
}
int main() {
int n, a, b, c, d;
cin >> a >> b >> c >> d;
string s;
cin >> s;
if (judge(a, c, s) && judge(b, d, s)) {
if (c < d || check(b, d, s)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} else {
cout << "No" << endl;
}
} | #include <iostream>
#include <string>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
bool judge(int a, int b, string s) {
for (int i = a - 1; i < b - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
return false;
}
}
return true;
}
bool check(int a, int b, string s) {
for (int i = a - 1; i <= b - 1; i++) {
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 (judge(a, c, s) && judge(b, d, s)) {
if (c < d || check(b, d, s)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} else {
cout << "No" << endl;
}
} | [
"expression.operation.binary.add"
] | 836,676 | 836,677 | u467826805 | cpp |
p03017 | #include <algorithm>
#include <climits>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#ifdef _MSC_VER
using ll = __int64;
using ull = unsigned __int64;
#else
using ll = long long int;
using ull = unsigned long long int;
#endif
// Range็ณปใฎใฉใคใใฉใช
struct RangeIterator {
ll v;
const ll operator*() { return v; }
RangeIterator &operator++() {
++v;
return *this;
}
bool operator!=(const RangeIterator &rhs) { return v != rhs.v; }
};
template <bool INCLUSIVE> struct EndType {};
template <> struct EndType<false> {
ll end;
ll operator()() { return end; }
};
template <> struct EndType<true> {
ll end;
ll operator()() { return end + 1; }
};
template <bool INCLUSIVE> struct Range {
ll s;
EndType<INCLUSIVE> e;
Range(ll end) : s(0), e(EndType<INCLUSIVE>{end}) {}
Range(ll start, ll end) : s(start), e(EndType<INCLUSIVE>{end}) {}
RangeIterator begin() { return {s}; }
RangeIterator end() { return {e()}; }
};
inline Range<false> range(ll start) { return Range<false>(start); }
inline Range<false> range(ll start, ll end) { return Range<false>(start, end); }
inline Range<true> irange(ll start) { return Range<true>(start); }
inline Range<true> irange(ll start, ll end) { return Range<true>(start, end); }
// ไบไนใ่จ็ฎใใใ
ll sq(ll x) { return x * x; }
// ้ ๅๅ
ใซใใใใ
bool within(ll x, ll min, ll max) { return min <= x && x <= max; }
// container ใฎไธญใใ key ใใๅฐใใๅคใ่ฆใคใใใ
// ่ฆใคใใใชใๅ ดๅใฏ container.end() ใ่ฟใใ
template <typename T>
typename T::iterator less_than(T &container, typename T::key_type &key) {
typename T::iterator prev = container.lower_bound(key);
if (prev == container.begin())
prev = container.end();
else
prev--;
return prev;
}
// container ใฎไธญใใ key ใใๅคงใใๅคใ่ฆใคใใใ
// ่ฆใคใใใชใๅ ดๅใฏ container.end() ใ่ฟใใ
template <typename T>
typename T::iterator greater_than(T &container, typename T::key_type &key) {
return container.upper_bound(key);
}
// b^e (mod m) ใๆฑใใ
ll modpow(ll b, ll e, ll m) {
ll result = 1;
while (e > 0) {
if ((e & 1) == 1)
result = (result * b) % m;
e >>= 1;
b = (b * b) % m;
}
return result;
}
// ใใใใ่งฃๆณ
ll N, A, B, C, D;
string S;
int main(void) {
std::ios_base::sync_with_stdio(false);
cin >> N >> A >> B >> C >> D;
S.resize(N + 1);
for (ll i = 1; i <= N; ++i)
cin >> S[i];
bool snuke = true;
bool funuke = true;
for (ll i = A + 1; i <= C; ++i)
if (S[i] == '#' && S[i - 1] == '#')
snuke = false;
for (ll i = B + 1; i <= D; ++i)
if (S[i] == '#' && S[i - 1] == '#')
funuke = false;
if (C > D) {
bool swap = false;
for (ll i = B + 2; i <= D; ++i) {
if (S[i - 1] == '.' && S[i] == '.' && S[i + 1] == '.')
swap = true;
}
cout << ((snuke && funuke && swap) ? "Yes" : "No") << endl;
} else {
cout << ((snuke && funuke) ? "Yes" : "No") << endl;
}
return 0;
}
| #include <algorithm>
#include <climits>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#ifdef _MSC_VER
using ll = __int64;
using ull = unsigned __int64;
#else
using ll = long long int;
using ull = unsigned long long int;
#endif
// Range็ณปใฎใฉใคใใฉใช
struct RangeIterator {
ll v;
const ll operator*() { return v; }
RangeIterator &operator++() {
++v;
return *this;
}
bool operator!=(const RangeIterator &rhs) { return v != rhs.v; }
};
template <bool INCLUSIVE> struct EndType {};
template <> struct EndType<false> {
ll end;
ll operator()() { return end; }
};
template <> struct EndType<true> {
ll end;
ll operator()() { return end + 1; }
};
template <bool INCLUSIVE> struct Range {
ll s;
EndType<INCLUSIVE> e;
Range(ll end) : s(0), e(EndType<INCLUSIVE>{end}) {}
Range(ll start, ll end) : s(start), e(EndType<INCLUSIVE>{end}) {}
RangeIterator begin() { return {s}; }
RangeIterator end() { return {e()}; }
};
inline Range<false> range(ll start) { return Range<false>(start); }
inline Range<false> range(ll start, ll end) { return Range<false>(start, end); }
inline Range<true> irange(ll start) { return Range<true>(start); }
inline Range<true> irange(ll start, ll end) { return Range<true>(start, end); }
// ไบไนใ่จ็ฎใใใ
ll sq(ll x) { return x * x; }
// ้ ๅๅ
ใซใใใใ
bool within(ll x, ll min, ll max) { return min <= x && x <= max; }
// container ใฎไธญใใ key ใใๅฐใใๅคใ่ฆใคใใใ
// ่ฆใคใใใชใๅ ดๅใฏ container.end() ใ่ฟใใ
template <typename T>
typename T::iterator less_than(T &container, typename T::key_type &key) {
typename T::iterator prev = container.lower_bound(key);
if (prev == container.begin())
prev = container.end();
else
prev--;
return prev;
}
// container ใฎไธญใใ key ใใๅคงใใๅคใ่ฆใคใใใ
// ่ฆใคใใใชใๅ ดๅใฏ container.end() ใ่ฟใใ
template <typename T>
typename T::iterator greater_than(T &container, typename T::key_type &key) {
return container.upper_bound(key);
}
// b^e (mod m) ใๆฑใใ
ll modpow(ll b, ll e, ll m) {
ll result = 1;
while (e > 0) {
if ((e & 1) == 1)
result = (result * b) % m;
e >>= 1;
b = (b * b) % m;
}
return result;
}
// ใใใใ่งฃๆณ
ll N, A, B, C, D;
string S;
int main(void) {
std::ios_base::sync_with_stdio(false);
cin >> N >> A >> B >> C >> D;
S.resize(N + 1);
for (ll i = 1; i <= N; ++i)
cin >> S[i];
bool snuke = true;
bool funuke = true;
for (ll i = A + 1; i <= C; ++i)
if (S[i] == '#' && S[i - 1] == '#')
snuke = false;
for (ll i = B + 1; i <= D; ++i)
if (S[i] == '#' && S[i - 1] == '#')
funuke = false;
if (C > D) {
bool swap = false;
for (ll i = B; i <= D; ++i) {
if (S[i - 1] == '.' && S[i] == '.' && S[i + 1] == '.')
swap = true;
}
cout << ((snuke && funuke && swap) ? "Yes" : "No") << endl;
} else {
cout << ((snuke && funuke) ? "Yes" : "No") << endl;
}
return 0;
}
| [
"control_flow.loop.for.initializer.change",
"expression.operation.binary.remove"
] | 836,680 | 836,681 | u609688888 | cpp |
p03017 | #include <algorithm>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
constexpr ll MOD = 1000000007;
// struct UnionFind {
// vector<int> par;
// UnionFind(int N): par(N) {
// for (int i=0;i<N;i++) par[i] = i;
// }
// int root(int x) {
// if (par[x] == x) return x;
// else return par[x] = root(par[x]);
// }
// void unite(int x, int y) {
// int rx = root(x);
// int ry = root(y);
// if (rx == ry) return;
// par[rx] = ry;
// }
// bool same(int x, int y) {
// int rx = root(x);
// int ry = root(y);
// return rx == ry;
// }
// };
// ll gcd(ll a, ll b) {
// if (b == 0) return a;
// return gcd(b,a%b);
// }
int main(void) {
int N, A, B, C, D;
string S;
cin >> N >> A >> B >> C >> D >> S;
multiset<int> Sp;
multiset<int> Ro;
int cnt = 0, flag = 0, maxRo = 0;
for (int i = 0; i < N; i++) {
if (S[i] == '.') {
cnt++;
if (flag > 1)
Ro.insert(i - flag + 1);
flag = 0;
} else {
if (cnt >= 3)
Sp.insert(i - cnt + 1);
cnt = 0;
flag++;
}
}
if (cnt >= 3)
Sp.insert(N - cnt + 1);
if (flag > 1)
Ro.insert(N - flag + 1);
if (C < D) { // ABCD or ACBD
if (Ro.empty())
cout << "Yes" << endl;
else if (((Ro.lower_bound(A) != Ro.end() && *(Ro.lower_bound(A)) > C)) &&
((Ro.lower_bound(B) != Ro.end() && *(Ro.lower_bound(B)) > D)))
cout << "Yes" << endl;
else
cout << "No" << endl;
} else { // ABDC
if (Sp.empty() || Sp.lower_bound(B) == Sp.end())
cout << "No" << endl;
else if (*(Sp.lower_bound(B)) >= D)
cout << "No" << endl;
else
cout << "Yes" << endl;
}
return 0;
}
| #include <algorithm>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
constexpr ll MOD = 1000000007;
// struct UnionFind {
// vector<int> par;
// UnionFind(int N): par(N) {
// for (int i=0;i<N;i++) par[i] = i;
// }
// int root(int x) {
// if (par[x] == x) return x;
// else return par[x] = root(par[x]);
// }
// void unite(int x, int y) {
// int rx = root(x);
// int ry = root(y);
// if (rx == ry) return;
// par[rx] = ry;
// }
// bool same(int x, int y) {
// int rx = root(x);
// int ry = root(y);
// return rx == ry;
// }
// };
// ll gcd(ll a, ll b) {
// if (b == 0) return a;
// return gcd(b,a%b);
// }
int main(void) {
int N, A, B, C, D;
string S;
cin >> N >> A >> B >> C >> D >> S;
multiset<int> Sp;
multiset<int> Ro;
int cnt = 0, flag = 0, maxRo = 0;
for (int i = 0; i < N; i++) {
if (S[i] == '.') {
cnt++;
if (flag > 1)
Ro.insert(i - flag + 1);
flag = 0;
} else {
if (cnt >= 3)
Sp.insert(i - cnt + 1);
cnt = 0;
flag++;
}
}
if (cnt >= 3)
Sp.insert(N - cnt + 1);
if (flag > 1)
Ro.insert(N - flag + 1);
if (C < D) { // ABCD or ACBD
if (Ro.empty())
cout << "Yes" << endl;
else if (((Ro.lower_bound(A) != Ro.end() && *(Ro.lower_bound(A)) > C)) &&
((Ro.lower_bound(B) != Ro.end() && *(Ro.lower_bound(B)) > D)))
cout << "Yes" << endl;
else
cout << "No" << endl;
} else { // ABDC
if (Sp.empty() || Sp.lower_bound(B - 1) == Sp.end())
cout << "No" << endl;
else if (*(Sp.lower_bound(B - 1)) >= D)
cout << "No" << endl;
else
cout << "Yes" << endl;
}
return 0;
}
| [
"control_flow.branch.if.condition.change"
] | 836,694 | 836,695 | u677149117 | cpp |
p03017 | #include <iostream>
int main() {
int N, A, B, C, D;
std::cin >> N >> A >> B >> C >> D;
--A;
--B;
--C;
--D;
std::string S;
std::cin >> S;
int oikosi;
int owari;
if (C > D) {
// ๅฒฉใใงใใฏ
for (int i = A; i < C; ++i) {
if ((S[i] == '#') && (S[i + 1] == '#')) {
std::cout << "No" << std::endl;
return 0;
}
}
// ่ฟฝใ่ถใใใงใใฏ
for (int i = B; i < D; ++i) {
if (S.substr(i - 1, 3) == "...") {
std::cout << "Yes" << std::endl;
return 0;
}
}
// ็ก็ใชใ็ก็
std::cout << "No" << std::endl;
return 0;
} else {
// ๅฒฉใใงใใฏ
for (int i = A; i < D; ++i) {
if ((S[i] == '#') && (S[i + 1] == '#')) {
std::cout << "No" << std::endl;
return 0;
}
}
// ๅ้กใชใ
std::cout << "Yes" << std::endl;
return 0;
}
return 0;
} | #include <iostream>
int main() {
int N, A, B, C, D;
std::cin >> N >> A >> B >> C >> D;
--A;
--B;
--C;
--D;
std::string S;
std::cin >> S;
int oikosi;
int owari;
if (C > D) {
// ๅฒฉใใงใใฏ
for (int i = A; i < C; ++i) {
if ((S[i] == '#') && (S[i + 1] == '#')) {
std::cout << "No" << std::endl;
return 0;
}
}
// ่ฟฝใ่ถใใใงใใฏ
for (int i = B; i <= D; ++i) {
if (S.substr(i - 1, 3) == "...") {
std::cout << "Yes" << std::endl;
return 0;
}
}
// ็ก็ใชใ็ก็
std::cout << "No" << std::endl;
return 0;
} else {
// ๅฒฉใใงใใฏ
for (int i = A; i < D; ++i) {
if ((S[i] == '#') && (S[i + 1] == '#')) {
std::cout << "No" << std::endl;
return 0;
}
}
// ๅ้กใชใ
std::cout << "Yes" << std::endl;
return 0;
}
return 0;
} | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 836,706 | 836,707 | u477096296 | cpp |
p03017 | #include <iostream>
int main() {
int N, A, B, C, D;
std::cin >> N >> A >> B >> C >> D;
--A;
--B;
--C;
--D;
std::string S;
std::cin >> S;
int oikosi;
int owari;
if (C > D) {
// ๅฒฉใใงใใฏ
for (int i = A; i < C; ++i) {
if ((S[i] == '#') && (S[i + 1] == '#')) {
std::cout << "No" << std::endl;
return 0;
}
}
// ่ฟฝใ่ถใใใงใใฏ
for (int i = B; i < D; ++i) {
if (S.substr(i, 3) == "...") {
std::cout << "Yes" << std::endl;
return 0;
}
}
// ็ก็ใชใ็ก็
std::cout << "No" << std::endl;
return 0;
} else {
// ๅฒฉใใงใใฏ
for (int i = A; i < D; ++i) {
if ((S[i] == '#') && (S[i + 1] == '#')) {
std::cout << "No" << std::endl;
return 0;
}
}
// ๅ้กใชใ
std::cout << "Yes" << std::endl;
return 0;
}
return 0;
} | #include <iostream>
int main() {
int N, A, B, C, D;
std::cin >> N >> A >> B >> C >> D;
--A;
--B;
--C;
--D;
std::string S;
std::cin >> S;
int oikosi;
int owari;
if (C > D) {
// ๅฒฉใใงใใฏ
for (int i = A; i < C; ++i) {
if ((S[i] == '#') && (S[i + 1] == '#')) {
std::cout << "No" << std::endl;
return 0;
}
}
// ่ฟฝใ่ถใใใงใใฏ
for (int i = B; i <= D; ++i) {
if (S.substr(i - 1, 3) == "...") {
std::cout << "Yes" << std::endl;
return 0;
}
}
// ็ก็ใชใ็ก็
std::cout << "No" << std::endl;
return 0;
} else {
// ๅฒฉใใงใใฏ
for (int i = A; i < D; ++i) {
if ((S[i] == '#') && (S[i + 1] == '#')) {
std::cout << "No" << std::endl;
return 0;
}
}
// ๅ้กใชใ
std::cout << "Yes" << std::endl;
return 0;
}
return 0;
} | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 836,708 | 836,707 | u477096296 | cpp |
p03017 | #include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
// Compiler version g++ 6.3.0
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string y;
cin >> y;
y = '#' + y + '#';
bool rev = false;
bool ans = false;
bool revpos = true;
for (int i = a; i < c; i++) {
if (y[i] == '#' && y[i + 1] == '#') {
ans = true;
}
}
for (int i = b; i < d; i++) {
if (y[i] == '#' && y[i + 1] == '#') {
ans = true;
}
}
if (c > d) {
for (int i = b + 1; i < d + 1; i++) {
if (y[i] == '.' && y[i + 1] == '.' && y[i + 2] == '.') {
revpos = false;
}
}
}
if (ans) {
cout << "No" << endl;
} else if (c > d && revpos) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
} | #include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
// Compiler version g++ 6.3.0
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string y;
cin >> y;
y = '#' + y + '#';
bool rev = false;
bool ans = false;
bool revpos = true;
for (int i = a; i < c; i++) {
if (y[i] == '#' && y[i + 1] == '#') {
ans = true;
}
}
for (int i = b; i < d; i++) {
if (y[i] == '#' && y[i + 1] == '#') {
ans = true;
}
}
if (c > d) {
for (int i = b; i < d + 1; i++) {
if (y[i] == '.' && y[i + 1] == '.' && y[i - 1] == '.') {
revpos = false;
}
}
}
if (ans) {
cout << "No" << endl;
} else if (c > d && revpos) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
} | [
"control_flow.loop.for.initializer.change",
"expression.operation.binary.remove",
"control_flow.loop.for.condition.change"
] | 836,711 | 836,712 | u483156389 | cpp |
p03017 | #include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
// Compiler version g++ 6.3.0
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string y;
cin >> y;
y = '#' + y + '#';
bool rev = false;
bool ans = false;
bool revpos = true;
for (int i = a; i < c; i++) {
if (y[i] == '#' && y[i + 1] == '#') {
ans = true;
}
}
for (int i = b; i < d; i++) {
if (y[i] == '#' && y[i + 1] == '#') {
ans = true;
}
}
if (c > d) {
for (int i = b + 1; i < d + 2; i++) {
if (y[i] == '.' && y[i + 1] == '.' && y[i + 2] == '.') {
revpos = false;
}
}
}
if (ans) {
cout << "No" << endl;
} else if (c > d && revpos) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
} | #include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
// Compiler version g++ 6.3.0
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string y;
cin >> y;
y = '#' + y + '#';
bool rev = false;
bool ans = false;
bool revpos = true;
for (int i = a; i < c; i++) {
if (y[i] == '#' && y[i + 1] == '#') {
ans = true;
}
}
for (int i = b; i < d; i++) {
if (y[i] == '#' && y[i + 1] == '#') {
ans = true;
}
}
if (c > d) {
for (int i = b; i < d + 1; i++) {
if (y[i] == '.' && y[i + 1] == '.' && y[i - 1] == '.') {
revpos = false;
}
}
}
if (ans) {
cout << "No" << endl;
} else if (c > d && revpos) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
} | [
"control_flow.loop.for.initializer.change",
"expression.operation.binary.remove",
"literal.number.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 836,713 | 836,712 | u483156389 | cpp |
p03017 | #include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
// Compiler version g++ 6.3.0
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string y;
cin >> y;
y = '#' + y + '#';
bool rev = false;
bool ans = false;
bool revpos = true;
for (int i = a; i < c; i++) {
if (y[i] == '#' && y[i + 1] == '#') {
ans = true;
}
}
for (int i = b; i < d; i++) {
if (y[i] == '#' && y[i + 1] == '#') {
ans = true;
}
}
if (c > d) {
for (int i = b; i < d; i++) {
if (y[i] == '.' && y[i + 1] == '.' && y[i - 1] == '.') {
revpos = false;
}
}
}
if (ans) {
cout << "No" << endl;
} else if (c > d && revpos) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
} | #include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
// Compiler version g++ 6.3.0
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string y;
cin >> y;
y = '#' + y + '#';
bool rev = false;
bool ans = false;
bool revpos = true;
for (int i = a; i < c; i++) {
if (y[i] == '#' && y[i + 1] == '#') {
ans = true;
}
}
for (int i = b; i < d; i++) {
if (y[i] == '#' && y[i + 1] == '#') {
ans = true;
}
}
if (c > d) {
for (int i = b; i < d + 1; i++) {
if (y[i] == '.' && y[i + 1] == '.' && y[i - 1] == '.') {
revpos = false;
}
}
}
if (ans) {
cout << "No" << endl;
} else if (c > d && revpos) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
} | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 836,714 | 836,712 | u483156389 | cpp |
p03017 | #include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
// Compiler version g++ 6.3.0
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string y;
cin >> y;
y = '#' + y + '#';
bool rev = false;
bool ans = false;
bool revpos = true;
for (int i = a; i < c; i++) {
if (y[i] == '#' && y[i - 1] == '#') {
ans = true;
}
}
for (int i = b; i < d; i++) {
if (y[i] == '#' && y[i + 1] == '#') {
ans = true;
}
}
if (c > d) {
for (int i = b; i < d; i++) {
if (y[i] == '.' && y[i - 2] == '.' && y[i - 1] == '.') {
revpos = false;
}
}
}
if (ans) {
cout << "No" << endl;
} else if (c > d && revpos) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
} | #include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
// Compiler version g++ 6.3.0
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string y;
cin >> y;
y = '#' + y + '#';
bool rev = false;
bool ans = false;
bool revpos = true;
for (int i = a; i < c; i++) {
if (y[i] == '#' && y[i + 1] == '#') {
ans = true;
}
}
for (int i = b; i < d; i++) {
if (y[i] == '#' && y[i + 1] == '#') {
ans = true;
}
}
if (c > d) {
for (int i = b; i < d + 1; i++) {
if (y[i] == '.' && y[i + 1] == '.' && y[i - 1] == '.') {
revpos = false;
}
}
}
if (ans) {
cout << "No" << endl;
} else if (c > d && revpos) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
} | [
"misc.opposites",
"expression.operator.arithmetic.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 836,715 | 836,712 | u483156389 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define loop(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) loop(i, 0, n)
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define vi vector<int>
#define vl vector<ll>
#define pll pair<ll, ll>
#define vpll vector<pll>
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
int fa = 0;
int fb = 0;
if (c < d) {
for (int i = a - 1; i < c - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
fa = 1;
}
for (int i = b - 1; i < d - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
fb = 1;
}
if (fa == 0 && fb == 0)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
else if (c > d) {
int tmp = 0;
int tmp2 = 0;
for (int i = a - 1; i < c - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
fa = 1;
}
for (int i = b - 1; i < d - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
fb = 1;
}
for (int i = b - 2; i < c - 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.')
tmp = 1;
}
if (fa == 0 && fb == 0 && tmp == 1)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define loop(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) loop(i, 0, n)
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define vi vector<int>
#define vl vector<ll>
#define pll pair<ll, ll>
#define vpll vector<pll>
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
int fa = 0;
int fb = 0;
if (c < d) {
for (int i = a - 1; i < c - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
fa = 1;
}
for (int i = b - 1; i < d - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
fb = 1;
}
if (fa == 0 && fb == 0)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
else if (c > d) {
int tmp = 0;
int tmp2 = 0;
for (int i = a - 1; i < c - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
fa = 1;
}
for (int i = b - 1; i < d - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
fb = 1;
}
for (int i = b - 2; i < d - 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.')
tmp = 1;
}
if (fa == 0 && fb == 0 && tmp == 1)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
} | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 836,722 | 836,723 | u445922306 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define loop(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) loop(i, 0, n)
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define vi vector<int>
#define vl vector<ll>
#define pll pair<ll, ll>
#define vpll vector<pll>
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
int fa = 0;
int fb = 0;
if (c < d) {
for (int i = a - 1; i < c - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
fa = 1;
}
for (int i = b - 1; i < d - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
fb = 1;
}
if (fa == 0 && fb == 0)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
else if (c > d) {
int tmp = 0;
int tmp2 = 0;
for (int i = a - 1; i < c - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
fa = 1;
}
for (int i = b - 1; i < d - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
fb = 1;
}
for (int i = a - 1; i < c - 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.')
tmp = 1;
}
if (fa == 0 && fb == 0 && tmp == 1)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define loop(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) loop(i, 0, n)
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define vi vector<int>
#define vl vector<ll>
#define pll pair<ll, ll>
#define vpll vector<pll>
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
int fa = 0;
int fb = 0;
if (c < d) {
for (int i = a - 1; i < c - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
fa = 1;
}
for (int i = b - 1; i < d - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
fb = 1;
}
if (fa == 0 && fb == 0)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
else if (c > d) {
int tmp = 0;
int tmp2 = 0;
for (int i = a - 1; i < c - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
fa = 1;
}
for (int i = b - 1; i < d - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#')
fb = 1;
}
for (int i = b - 2; i < d - 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.')
tmp = 1;
}
if (fa == 0 && fb == 0 && tmp == 1)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
} | [
"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"
] | 836,724 | 836,723 | u445922306 | cpp |
p03017 | #include <algorithm>
#include <iostream>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;
#define ll long long
#define re register
inline int gi() {
int sum = 0, f = 1;
char ch = getchar();
while (ch > '9' || ch < '0') {
if (ch == '-')
f = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9') {
sum = (sum << 3) + (sum << 1) + ch - '0';
ch = getchar();
}
return sum * f;
}
inline ll gl() {
ll sum = 0, f = 1;
char ch = getchar();
while (ch > '9' || ch < '0') {
if (ch == '-')
f = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9') {
sum = (sum << 3) + (sum << 1) + ch - '0';
ch = getchar();
}
return sum * f;
}
const int N = 200010;
int n = gi(), a = gi(), b = gi(), c = gi(), d = gi();
char s[N];
void naive() {
puts("No");
exit(0);
}
int main() {
scanf("%s", s + 1);
if (c < d) {
for (int i = a; i < c; i++)
if (s[i] == '#' && s[i + 1] == '#')
naive();
for (int i = b; i < d; i++)
if (s[i] == '#' && s[i + 1] == '#')
naive();
} else {
for (int i = a; i < c; i++)
if (s[i] == '#' && s[i + 1] == '#')
naive();
for (int i = b; i < d; i++)
if (s[i] == '#' && s[i + 1] == '#')
naive();
int flag = 0;
for (int i = b; i < d; i++)
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.')
flag = 1;
if (!flag)
naive();
}
puts("Yes");
return 0;
}
| #include <algorithm>
#include <iostream>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;
#define ll long long
#define re register
inline int gi() {
int sum = 0, f = 1;
char ch = getchar();
while (ch > '9' || ch < '0') {
if (ch == '-')
f = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9') {
sum = (sum << 3) + (sum << 1) + ch - '0';
ch = getchar();
}
return sum * f;
}
inline ll gl() {
ll sum = 0, f = 1;
char ch = getchar();
while (ch > '9' || ch < '0') {
if (ch == '-')
f = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9') {
sum = (sum << 3) + (sum << 1) + ch - '0';
ch = getchar();
}
return sum * f;
}
const int N = 200010;
int n = gi(), a = gi(), b = gi(), c = gi(), d = gi();
char s[N];
void naive() {
puts("No");
exit(0);
}
int main() {
scanf("%s", s + 1);
if (c < d) {
for (int i = a; i < c; i++)
if (s[i] == '#' && s[i + 1] == '#')
naive();
for (int i = b; i < d; i++)
if (s[i] == '#' && s[i + 1] == '#')
naive();
} else {
for (int i = a; i < c; i++)
if (s[i] == '#' && s[i + 1] == '#')
naive();
for (int i = b; i < d; i++)
if (s[i] == '#' && s[i + 1] == '#')
naive();
int flag = 0;
for (int i = b; i <= d; i++)
if (s[i - 1] == '.' && s[i + 1] == '.' && s[i] == '.')
flag = 1;
if (!flag)
naive();
}
puts("Yes");
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one",
"expression.operation.binary.remove"
] | 836,737 | 836,738 | u131303230 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, A, B, C, D, E, G;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
G = 0;
if (C > D) {
for (int i = B - 1; i < D - 1; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
G = 1;
break;
}
}
}
for (int i = 0; i < N; i++) {
if (B < D - 2) {
if (S[B + 1] == '.') {
B += 2;
continue;
} else if (S[B] == '.') {
B++;
continue;
} else {
cout << "No" << endl;
return 0;
}
} else {
B = D;
break;
}
}
for (int i = 0; i < N; i++) {
if (A < C - 2) {
if (S[A + 1] == '.') {
A += 2;
continue;
} else if (S[A] == '.') {
A++;
continue;
} else {
cout << "No" << endl;
return 0;
}
} else {
A = C;
break;
}
}
if (D > C) {
cout << "Yes" << endl;
return 0;
} else {
if (G == 0) {
cout << "No" << endl;
return 0;
} else {
cout << "Yes" << endl;
return 0;
}
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int N, A, B, C, D, E, G;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
G = 0;
if (C > D) {
for (int i = B - 2; i < D - 1; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
G = 1;
break;
}
}
}
for (int i = 0; i < N; i++) {
if (B < D - 2) {
if (S[B + 1] == '.') {
B += 2;
continue;
} else if (S[B] == '.') {
B++;
continue;
} else {
cout << "No" << endl;
return 0;
}
} else {
B = D;
break;
}
}
for (int i = 0; i < N; i++) {
if (A < C - 2) {
if (S[A + 1] == '.') {
A += 2;
continue;
} else if (S[A] == '.') {
A++;
continue;
} else {
cout << "No" << endl;
return 0;
}
} else {
A = C;
break;
}
}
if (D > C) {
cout << "Yes" << endl;
return 0;
} else {
if (G == 0) {
cout << "No" << endl;
return 0;
} else {
cout << "Yes" << endl;
return 0;
}
}
} | [
"literal.number.change",
"control_flow.loop.for.initializer.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 836,780 | 836,781 | u902787159 | cpp |
p03017 | #include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
//#define cerr if(false) cerr
#ifdef DEBUG
#define show(...) cerr << #__VA_ARGS__ << " = ", debug(__VA_ARGS__);
#else
#define show(...) 42
#endif
using namespace std;
using ll = long long;
using pii = pair<int, int>;
template <typename T, typename S>
ostream &operator<<(ostream &os, pair<T, S> a) {
os << '(' << a.first << ',' << a.second << ')';
return os;
}
template <typename T> ostream &operator<<(ostream &os, vector<T> v) {
for (auto x : v)
os << x << ' ';
return os;
}
void debug() { cerr << '\n'; }
template <typename H, typename... T> void debug(H a, T... b) {
cerr << a;
if (sizeof...(b))
cerr << ", ";
debug(b...);
}
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
a--, b--, c--, d--;
string s;
cin >> s;
bool flag = true;
for (int i = b; i <= d - 1; i++) {
if (s[i] == '#' and s[i + 1] == '#') {
flag = false;
}
}
for (int i = a; i <= c - 1; i++) {
if (s[i] == '#' and s[i + 1] == '#') {
flag = false;
}
}
if (!flag) {
cout << "No" << endl;
return 0;
}
if (c < d) {
cout << "Yes" << endl;
return 0;
} else {
bool f = false;
for (int i = b - 1; i <= d - 3; i++) {
if (s[i] == '.' and s[i + 1] == '.' and s[i + 2] == '.')
f = true;
}
if (f) {
cout << "Yes" << endl;
return 0;
} else {
cout << "No" << endl;
return 0;
}
}
}
| #include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
//#define cerr if(false) cerr
#ifdef DEBUG
#define show(...) cerr << #__VA_ARGS__ << " = ", debug(__VA_ARGS__);
#else
#define show(...) 42
#endif
using namespace std;
using ll = long long;
using pii = pair<int, int>;
template <typename T, typename S>
ostream &operator<<(ostream &os, pair<T, S> a) {
os << '(' << a.first << ',' << a.second << ')';
return os;
}
template <typename T> ostream &operator<<(ostream &os, vector<T> v) {
for (auto x : v)
os << x << ' ';
return os;
}
void debug() { cerr << '\n'; }
template <typename H, typename... T> void debug(H a, T... b) {
cerr << a;
if (sizeof...(b))
cerr << ", ";
debug(b...);
}
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
a--, b--, c--, d--;
string s;
cin >> s;
bool flag = true;
for (int i = b; i <= d - 1; i++) {
if (s[i] == '#' and s[i + 1] == '#') {
flag = false;
}
}
for (int i = a; i <= c - 1; i++) {
if (s[i] == '#' and s[i + 1] == '#') {
flag = false;
}
}
if (!flag) {
cout << "No" << endl;
return 0;
}
if (c < d) {
cout << "Yes" << endl;
return 0;
} else {
bool f = false;
for (int i = b - 1; i <= d - 1; i++) {
if (s[i] == '.' and s[i + 1] == '.' and s[i + 2] == '.')
f = true;
}
if (f) {
cout << "Yes" << endl;
return 0;
} else {
cout << "No" << endl;
return 0;
}
}
}
| [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 836,793 | 836,794 | u628047647 | cpp |
p03017 | #include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
//#define cerr if(false) cerr
#ifdef DEBUG
#define show(...) cerr << #__VA_ARGS__ << " = ", debug(__VA_ARGS__);
#else
#define show(...) 42
#endif
using namespace std;
using ll = long long;
using pii = pair<int, int>;
template <typename T, typename S>
ostream &operator<<(ostream &os, pair<T, S> a) {
os << '(' << a.first << ',' << a.second << ')';
return os;
}
template <typename T> ostream &operator<<(ostream &os, vector<T> v) {
for (auto x : v)
os << x << ' ';
return os;
}
void debug() { cerr << '\n'; }
template <typename H, typename... T> void debug(H a, T... b) {
cerr << a;
if (sizeof...(b))
cerr << ", ";
debug(b...);
}
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
a--, b--, c--, d--;
string s;
cin >> s;
bool flag = true;
for (int i = b; i <= d - 1; i++) {
if (s[i] == '#' and s[i + 1] == '#') {
flag = false;
}
}
for (int i = a; i <= c - 1; i++) {
if (s[i] == '#' and s[i + 1] == '#') {
flag = false;
}
}
if (!flag) {
cout << "No" << endl;
return 0;
}
if (c < d) {
cout << "Yes" << endl;
return 0;
} else {
bool f = false;
for (int i = b - 1; i <= d - 2; i++) {
if (s[i] == '.' and s[i + 1] == '.' and s[i + 2] == '.')
f = true;
}
if (f) {
cout << "Yes" << endl;
return 0;
} else {
cout << "No" << endl;
return 0;
}
}
}
| #include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
//#define cerr if(false) cerr
#ifdef DEBUG
#define show(...) cerr << #__VA_ARGS__ << " = ", debug(__VA_ARGS__);
#else
#define show(...) 42
#endif
using namespace std;
using ll = long long;
using pii = pair<int, int>;
template <typename T, typename S>
ostream &operator<<(ostream &os, pair<T, S> a) {
os << '(' << a.first << ',' << a.second << ')';
return os;
}
template <typename T> ostream &operator<<(ostream &os, vector<T> v) {
for (auto x : v)
os << x << ' ';
return os;
}
void debug() { cerr << '\n'; }
template <typename H, typename... T> void debug(H a, T... b) {
cerr << a;
if (sizeof...(b))
cerr << ", ";
debug(b...);
}
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
a--, b--, c--, d--;
string s;
cin >> s;
bool flag = true;
for (int i = b; i <= d - 1; i++) {
if (s[i] == '#' and s[i + 1] == '#') {
flag = false;
}
}
for (int i = a; i <= c - 1; i++) {
if (s[i] == '#' and s[i + 1] == '#') {
flag = false;
}
}
if (!flag) {
cout << "No" << endl;
return 0;
}
if (c < d) {
cout << "Yes" << endl;
return 0;
} else {
bool f = false;
for (int i = b - 1; i <= d - 1; i++) {
if (s[i] == '.' and s[i + 1] == '.' and s[i + 2] == '.')
f = true;
}
if (f) {
cout << "Yes" << endl;
return 0;
} else {
cout << "No" << endl;
return 0;
}
}
}
| [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 836,795 | 836,794 | u628047647 | cpp |
p03017 | #include <algorithm>
#include <bits/stdc++.h>
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#define ll long long
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
string s;
int a, b, c, d;
cin >> a >> b >> c >> d;
cin >> s;
for (int i = b - 1; i < d; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (int i = a - 1; i < c; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
if (d > c) {
cout << "Yes" << endl;
return 0;
}
for (int i = b - 1; i < c; i++) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.') {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
}
| #include <algorithm>
#include <bits/stdc++.h>
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#define ll long long
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
string s;
int a, b, c, d;
cin >> a >> b >> c >> d;
cin >> s;
for (int i = b - 1; i < d; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (int i = a - 1; i < c; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
if (d > c) {
cout << "Yes" << endl;
return 0;
}
for (int i = b - 1; i < d; i++) {
if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.') {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
}
| [
"identifier.change",
"control_flow.loop.for.condition.change",
"expression.operation.binary.change"
] | 836,805 | 836,806 | u784120136 | cpp |
p03017 | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define FOR(i, a, b) for (ll i = (a), __last_##i = (b); i < __last_##i; i++)
#define RFOR(i, a, b) for (ll i = (b)-1, __last_##i = (a); i >= __last_##i; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, 0, n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template <typename T> istream &operator>>(istream &is, vector<T> &v) {
for (auto &x : v)
is >> x;
return is;
}
template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) {
REP(i, v.size()) {
if (i)
os << " ";
os << v[i];
}
return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<vector<T>> &v) {
REP(i, v.size()) {
if (i)
os << endl;
os << v[i];
}
return os;
}
#define vi vector<int>
#define vii vector<vector<int>>
#define mii map<int, int>
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define ALL(a) (a).begin(), (a).end()
#define pb push_back
#define mp make_pair
//#define int ll
const int md = 1000000007;
const int INF = 1 << 30;
void yesno(bool x) {
if (x)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
bool ans = true;
rep(i, a - 1, max(c - 2, d - 2)) {
if (s[i] == '#' and s[i + 1] == '#')
ans = false;
}
if (c < d) {
yesno(ans);
} else {
bool tmp = false;
rep(i, b - 2, d - 2) {
if (s[i] == '.' and s[i + 1] == '.' and s[i + 2] == '.')
tmp = true;
}
yesno(tmp and ans);
}
}
| #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define FOR(i, a, b) for (ll i = (a), __last_##i = (b); i < __last_##i; i++)
#define RFOR(i, a, b) for (ll i = (b)-1, __last_##i = (a); i >= __last_##i; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, 0, n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template <typename T> istream &operator>>(istream &is, vector<T> &v) {
for (auto &x : v)
is >> x;
return is;
}
template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) {
REP(i, v.size()) {
if (i)
os << " ";
os << v[i];
}
return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<vector<T>> &v) {
REP(i, v.size()) {
if (i)
os << endl;
os << v[i];
}
return os;
}
#define vi vector<int>
#define vii vector<vector<int>>
#define mii map<int, int>
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define ALL(a) (a).begin(), (a).end()
#define pb push_back
#define mp make_pair
//#define int ll
const int md = 1000000007;
const int INF = 1 << 30;
void yesno(bool x) {
if (x)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
bool ans = true;
rep(i, a - 1, max(c - 2, d - 2)) {
if (s[i] == '#' and s[i + 1] == '#')
ans = false;
}
if (c < d) {
yesno(ans);
} else {
bool tmp = false;
rep(i, b - 2, d - 1) {
if (s[i] == '.' and s[i + 1] == '.' and s[i + 2] == '.')
tmp = true;
}
yesno(tmp and ans);
}
}
| [
"literal.number.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 836,809 | 836,810 | u381585104 | cpp |
p03017 | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define FOR(i, a, b) for (ll i = (a), __last_##i = (b); i < __last_##i; i++)
#define RFOR(i, a, b) for (ll i = (b)-1, __last_##i = (a); i >= __last_##i; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, 0, n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template <typename T> istream &operator>>(istream &is, vector<T> &v) {
for (auto &x : v)
is >> x;
return is;
}
template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) {
REP(i, v.size()) {
if (i)
os << " ";
os << v[i];
}
return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<vector<T>> &v) {
REP(i, v.size()) {
if (i)
os << endl;
os << v[i];
}
return os;
}
#define vi vector<int>
#define vii vector<vector<int>>
#define mii map<int, int>
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define ALL(a) (a).begin(), (a).end()
#define pb push_back
#define mp make_pair
//#define int ll
const int md = 1000000007;
const int INF = 1 << 30;
void yesno(bool x) {
if (x)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
bool ans = true;
rep(i, a - 1, max(c - 2, d - 2)) {
if (s[i] == '#' and s[i + 1] == '#')
ans = false;
}
if (c < d) {
yesno(ans);
} else {
bool tmp = false;
rep(i, b - 1, d - 2) {
if (s[i] == '.' and s[i + 1] == '.' and s[i + 2] == '.')
tmp = true;
}
yesno(tmp and ans);
}
}
| #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define FOR(i, a, b) for (ll i = (a), __last_##i = (b); i < __last_##i; i++)
#define RFOR(i, a, b) for (ll i = (b)-1, __last_##i = (a); i >= __last_##i; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, 0, n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template <typename T> istream &operator>>(istream &is, vector<T> &v) {
for (auto &x : v)
is >> x;
return is;
}
template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) {
REP(i, v.size()) {
if (i)
os << " ";
os << v[i];
}
return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<vector<T>> &v) {
REP(i, v.size()) {
if (i)
os << endl;
os << v[i];
}
return os;
}
#define vi vector<int>
#define vii vector<vector<int>>
#define mii map<int, int>
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define ALL(a) (a).begin(), (a).end()
#define pb push_back
#define mp make_pair
//#define int ll
const int md = 1000000007;
const int INF = 1 << 30;
void yesno(bool x) {
if (x)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
bool ans = true;
rep(i, a - 1, max(c - 2, d - 2)) {
if (s[i] == '#' and s[i + 1] == '#')
ans = false;
}
if (c < d) {
yesno(ans);
} else {
bool tmp = false;
rep(i, b - 2, d - 1) {
if (s[i] == '.' and s[i + 1] == '.' and s[i + 2] == '.')
tmp = true;
}
yesno(tmp and ans);
}
}
| [
"literal.number.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 836,811 | 836,810 | u381585104 | cpp |
p03017 | #include <cstdio>
int n, a, b, c, d, t = -1;
char s[200000];
int main() {
scanf("%d%d%d%d%d%s", &n, &a, &b, &c, &d, s + 1);
for (int i = a; i < c; i++)
if (s[i] == s[i + 1] && s[i] == '#') {
puts("No");
return 0;
}
for (int i = b; i < d; i++)
if (s[i] == s[i + 1] && s[i] == '#') {
puts("No");
return 0;
}
if ((a >= b && c <= d) || (b >= a && c >= d)) {
t = 0;
for (int i = (a > b ? a : b) + 1; i < (c > d ? d : c); i++)
if (s[i] == s[i - 1] && s[i] == s[i + 1] && s[i] == '.')
t = 1;
}
if (!t) {
puts("No");
return 0;
}
puts("Yes");
return 0;
}
| #include <cstdio>
int n, a, b, c, d, t = -1;
char s[200000];
int main() {
scanf("%d%d%d%d%d%s", &n, &a, &b, &c, &d, s + 1);
for (int i = a; i < c; i++)
if (s[i] == s[i + 1] && s[i] == '#') {
puts("No");
return 0;
}
for (int i = b; i < d; i++)
if (s[i] == s[i + 1] && s[i] == '#') {
puts("No");
return 0;
}
if ((a >= b && c <= d) || (b >= a && c >= d)) {
t = 0;
for (int i = (a > b ? a : b); i <= (c > d ? d : c); i++)
if (s[i] == s[i - 1] && s[i] == s[i + 1] && s[i] == '.')
t = 1;
}
if (!t) {
puts("No");
return 0;
}
puts("Yes");
return 0;
}
| [
"control_flow.loop.for.initializer.change",
"expression.operation.binary.remove",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 836,812 | 836,813 | u823558173 | cpp |
p03017 | #include <cstdio>
int n, a, b, c, d, t = -1;
char s[200100];
int main() {
scanf("%d%d%d%d%d%s", &n, &a, &b, &c, &d, s + 1);
s[0] = s[n + 1] = '#';
for (int i = a; i < c; i++)
if (s[i + 1] == '#' && s[i] == '#') {
puts("No");
return 0;
}
for (int i = b; i < d; i++)
if (s[i + 1] == '#' && s[i] == '#') {
puts("No");
return 0;
}
if (c > d) {
for (int i = b + 1; i < d; i++)
if (s[i - 1] == '.' && s[i + 1] == '.' && s[i] == '.') {
puts("Yes");
return 0;
}
puts("No");
return 0;
}
puts("Yes");
return 0;
}
| #include <cstdio>
int n, a, b, c, d, t = -1;
char s[200100];
int main() {
scanf("%d%d%d%d%d%s", &n, &a, &b, &c, &d, s + 1);
s[0] = s[n + 1] = '#';
for (int i = a; i < c; i++)
if (s[i + 1] == '#' && s[i] == '#') {
puts("No");
return 0;
}
for (int i = b; i < d; i++)
if (s[i + 1] == '#' && s[i] == '#') {
puts("No");
return 0;
}
if (c > d) {
for (int i = b; i <= d; i++)
if (s[i - 1] == '.' && s[i + 1] == '.' && s[i] == '.') {
puts("Yes");
return 0;
}
puts("No");
return 0;
}
puts("Yes");
return 0;
}
| [
"control_flow.loop.for.initializer.change",
"expression.operation.binary.remove",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 836,814 | 836,815 | u823558173 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define INF 99999999
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
int N, A, B, C, D;
string s;
int main() {
cin >> N >> A >> B >> C >> D >> s;
A--;
B--;
C--;
D--;
bool flag = false;
if (D < C) {
for (int i = B; i < D - 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
flag = true;
}
}
if (!flag) {
cout << "No" << 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; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
}
| #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define INF 99999999
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
int N, A, B, C, D;
string s;
int main() {
cin >> N >> A >> B >> C >> D >> s;
A--;
B--;
C--;
D--;
bool flag = false;
if (D < C) {
for (int i = B; i <= D; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i - 1] == '.') {
flag = true;
}
}
if (!flag) {
cout << "No" << 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; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
}
| [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove"
] | 836,836 | 836,837 | u730271001 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define INF 99999999
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
int N, A, B, C, D;
string s;
int main() {
cin >> N >> A >> B >> C >> D >> s;
A--;
B--;
C--;
D--;
bool flag = false;
if (D < C) {
for (int i = B; i < D + 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
flag = true;
}
}
if (!flag) {
cout << "No" << 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; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
}
| #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define INF 99999999
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
int N, A, B, C, D;
string s;
int main() {
cin >> N >> A >> B >> C >> D >> s;
A--;
B--;
C--;
D--;
bool flag = false;
if (D < C) {
for (int i = B; i <= D; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i - 1] == '.') {
flag = true;
}
}
if (!flag) {
cout << "No" << 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; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
}
| [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove"
] | 836,838 | 836,837 | u730271001 | cpp |
p03017 | #include <inttypes.h>
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char const *argv[]) {
intmax_t N, A, B, C, D;
char S[200000 + 1];
intmax_t ans = 0;
scanf("%jd%jd%jd%jd%jd", &N, &A, &B, &C, &D);
scanf("%s", S);
A--;
B--;
C--;
D--;
// #ใไธฆใใงใใใจ้ฃใณ่ถใใใชใ
for (int i = A; i < (D - 1); i++) {
if (S[i] == '#' && S[i + 1] == '#') {
puts("No");
return 0;
}
}
// C < Dใ ใจใใตใฌใใใใๅ
ใซใดใผใซใใใจใใฐใใ
if (C < D) {
puts("Yes");
return 0;
}
// C > Dใ ใจใใใฌใใใใใตใฌใใใใ้ฃใณ่ถใใใใใฐใใ
for (int i = B; i <= D; i++) {
if (S[i] == '#')
continue;
if (S[i - 1] == '.' && S[i + 1] == '.') {
puts("Yes");
return 0;
}
}
puts("Yes");
return 0;
} | #include <inttypes.h>
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char const *argv[]) {
intmax_t N, A, B, C, D;
char S[200000 + 1];
intmax_t ans = 0;
scanf("%jd%jd%jd%jd%jd", &N, &A, &B, &C, &D);
scanf("%s", S);
A--;
B--;
C--;
D--;
// #ใไธฆใใงใใใจ้ฃใณ่ถใใใชใ
for (int i = A; i < (D - 1); i++) {
if (S[i] == '#' && S[i + 1] == '#') {
puts("No");
return 0;
}
}
// C < Dใ ใจใใตใฌใใใใๅ
ใซใดใผใซใใใจใใฐใใ
if (C < D) {
puts("Yes");
return 0;
}
// C > Dใ ใจใใใฌใใใใใตใฌใใใใ้ฃใณ่ถใใใใใฐใใ
for (int i = B; i <= D; i++) {
if (S[i] == '#')
continue;
if (S[i - 1] == '.' && S[i + 1] == '.') {
puts("Yes");
return 0;
}
}
puts("No");
return 0;
} | [
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 836,841 | 836,842 | u327687161 | cpp |
p03017 | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_map>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n - 1; i >= 0; i--)
#define repone(i, n) for (ll i = 1; i <= (ll)(n); i++)
#define each(i, mp) for (auto i : mp)
#define eb emplace_back
#define F first
#define S second
#define all(obj) (obj).begin(), (obj).end()
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll half_inf = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);
typedef unordered_map<ll, ll> mpll;
typedef unordered_map<char, ll> mpcl;
typedef unordered_map<string, ll> mpsl;
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;
ll inl() {
ll x;
cin >> x;
return (x);
}
string ins() {
string x;
cin >> x;
return (x);
}
int main() {
#ifdef MY_DEBUG
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmissing-noreturn"
while (true) {
#pragma clang diagnostic pop
#endif
ll n = inl(), a = inl(), b = inl(), c = inl(), d = inl();
a--, b--, c--, d--;
string s = ins();
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; i < c; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
if (a + 2 == b && s[a + 1] == '.')
a++;
for (int i = a; i <= d; i++) {
if ((i == d && s[i + 1] == '#') || (s[i] == '#' && i + 1 == d)) {
cout << "No" << endl;
return 0;
}
if (b <= i && i + 1 <= d) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
cout << "Yes" << endl;
return 0;
}
}
}
cout << "No" << endl;
return 0;
}
#ifdef MY_DEBUG
}
#endif
return 0;
} | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_map>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n - 1; i >= 0; i--)
#define repone(i, n) for (ll i = 1; i <= (ll)(n); i++)
#define each(i, mp) for (auto i : mp)
#define eb emplace_back
#define F first
#define S second
#define all(obj) (obj).begin(), (obj).end()
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll half_inf = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);
typedef unordered_map<ll, ll> mpll;
typedef unordered_map<char, ll> mpcl;
typedef unordered_map<string, ll> mpsl;
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;
ll inl() {
ll x;
cin >> x;
return (x);
}
string ins() {
string x;
cin >> x;
return (x);
}
int main() {
#ifdef MY_DEBUG
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmissing-noreturn"
while (true) {
#pragma clang diagnostic pop
#endif
ll n = inl(), a = inl(), b = inl(), c = inl(), d = inl();
a--, b--, c--, d--;
string s = ins();
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; i < c; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
if (a + 2 == b && s[a + 1] == '.')
a++;
for (int i = a; i <= d; i++) {
if ((i == d && s[i + 1] == '#') || (s[i] == '#' && i + 1 == d)) {
cout << "No" << endl;
return 0;
}
if (b - 1 <= i && i + 1 <= d) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
cout << "Yes" << endl;
return 0;
}
}
}
cout << "No" << endl;
return 0;
}
#ifdef MY_DEBUG
}
#endif
return 0;
} | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 836,843 | 836,844 | u136378781 | cpp |
p03017 | #include <iostream>
#include <string>
using namespace std;
int main() {
int n;
cin >> n;
int a, b, c, d;
cin >> a >> b >> c >> d;
string s;
cin >> s;
int ans = 1;
if (c < d) {
for (int i = a; i < d - 3; i++) {
if (s[i] == '#' && s[i + 1] == '#')
ans = 0;
}
}
if (c > d) {
for (int i = b - 2; i < d - 2; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.')
ans++;
}
if (ans == 1)
ans = 0;
for (int i = a; i < c - 3; i++) {
if (s[i] == '#' && s[i + 1] == '#')
ans = 0;
}
}
if (ans == 0)
cout << "No";
else
cout << "Yes";
return 0;
}
| #include <iostream>
#include <string>
using namespace std;
int main() {
int n;
cin >> n;
int a, b, c, d;
cin >> a >> b >> c >> d;
string s;
cin >> s;
int ans = 1;
if (c < d) {
for (int i = a; i < d - 3; i++) {
if (s[i] == '#' && s[i + 1] == '#')
ans = 0;
}
}
if (c > d) {
for (int i = b - 2; i < d - 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.')
ans++;
}
if (ans == 1)
ans = 0;
for (int i = a; i < c - 3; i++) {
if (s[i] == '#' && s[i + 1] == '#')
ans = 0;
}
}
if (ans == 0)
cout << "No";
else
cout << "Yes";
return 0;
}
| [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 836,851 | 836,852 | u057617112 | cpp |
p03017 | #include <iostream>
#include <string>
using namespace std;
int main() {
int n;
cin >> n;
int a, b, c, d;
cin >> a >> b >> c >> d;
string s;
cin >> s;
int ans = 1;
if (c < d) {
for (int i = a; i < d - 3; i++) {
if (s[i] == '#' && s[i + 1] == '#')
ans = 0;
}
}
if (c > d) {
for (int i = b - 2; i < d - 3; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.')
ans++;
}
if (ans == 1)
ans = 0;
for (int i = a; i < c - 3; i++) {
if (s[i] == '#' && s[i + 1] == '#')
ans = 0;
}
}
if (ans == 0)
cout << "No";
else
cout << "Yes";
return 0;
}
| #include <iostream>
#include <string>
using namespace std;
int main() {
int n;
cin >> n;
int a, b, c, d;
cin >> a >> b >> c >> d;
string s;
cin >> s;
int ans = 1;
if (c < d) {
for (int i = a; i < d - 3; i++) {
if (s[i] == '#' && s[i + 1] == '#')
ans = 0;
}
}
if (c > d) {
for (int i = b - 2; i < d - 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.')
ans++;
}
if (ans == 1)
ans = 0;
for (int i = a; i < c - 3; i++) {
if (s[i] == '#' && s[i + 1] == '#')
ans = 0;
}
}
if (ans == 0)
cout << "No";
else
cout << "Yes";
return 0;
}
| [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 836,853 | 836,852 | u057617112 | cpp |
p03017 | #include <iostream>
#include <string>
using namespace std;
int main() {
int n;
cin >> n;
int a, b, c, d;
cin >> a >> b >> c >> d;
string s;
cin >> s;
int ans = 1;
if (c < d) {
for (int i = a; i < d - a - 3; i++) {
if (s[i] == '#' && s[i + 1] == '#')
ans = 0;
}
}
if (c > d) {
for (int i = b - 2; i < d - b; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.')
ans++;
}
if (ans == 1)
ans = 0;
for (int i = a; i < c - a - 3; i++) {
if (s[i] == '#' && s[i + 1] == '#')
ans = 0;
}
}
if (ans == 0)
cout << "No";
else
cout << "Yes";
return 0;
}
| #include <iostream>
#include <string>
using namespace std;
int main() {
int n;
cin >> n;
int a, b, c, d;
cin >> a >> b >> c >> d;
string s;
cin >> s;
int ans = 1;
if (c < d) {
for (int i = a; i < d - 3; i++) {
if (s[i] == '#' && s[i + 1] == '#')
ans = 0;
}
}
if (c > d) {
for (int i = b - 2; i < d - 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.')
ans++;
}
if (ans == 1)
ans = 0;
for (int i = a; i < c - 3; i++) {
if (s[i] == '#' && s[i + 1] == '#')
ans = 0;
}
}
if (ans == 0)
cout << "No";
else
cout << "Yes";
return 0;
}
| [
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove",
"identifier.replace.remove",
"literal.replace.add",
"control_flow.branch.if.condition.change"
] | 836,856 | 836,852 | u057617112 | cpp |
p03017 | #include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define bit(x) (1L << (x))
using ll = long long;
using namespace std;
template <typename T> vector<T> make_v(size_t a, T b) {
return vector<T>(a, b);
}
template <typename... Ts> auto make_v(size_t a, Ts... ts) {
return vector<decltype(make_v(ts...))>(a, make_v(ts...));
}
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
--a;
--b;
--c;
--d;
string s;
cin >> s;
auto checkb = [&](int i, int j) {
FOR(x, i, j) {
if (s[x] == '#' && s[x + 1] == '#')
return false;
}
return true;
};
auto checkw = [&](int i, int j) {
FOR(x, max(1, i), min(n - 1, j)) {
if (s[x - 1] == '.' && s[x] == '.' && s[x + 1] == '.')
return true;
}
return false;
};
if (!checkb(a, c) || !checkb(b, d) || (c > d && !checkw(b, d)))
cout << "No" << endl;
else
cout << "Yes" << endl;
return 0;
}
| #include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define bit(x) (1L << (x))
using ll = long long;
using namespace std;
template <typename T> vector<T> make_v(size_t a, T b) {
return vector<T>(a, b);
}
template <typename... Ts> auto make_v(size_t a, Ts... ts) {
return vector<decltype(make_v(ts...))>(a, make_v(ts...));
}
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
--a;
--b;
--c;
--d;
string s;
cin >> s;
auto checkb = [&](int i, int j) {
FOR(x, i, j) {
if (s[x] == '#' && s[x + 1] == '#')
return false;
}
return true;
};
auto checkw = [&](int i, int j) {
FOR(x, max(1, i), min(n - 1, j + 1)) {
if (s[x - 1] == '.' && s[x] == '.' && s[x + 1] == '.')
return true;
}
return false;
};
if (!checkb(a, c) || !checkb(b, d) || (c > d && !checkw(b, d)))
cout << "No" << endl;
else
cout << "Yes" << endl;
return 0;
}
| [
"assignment.change"
] | 836,859 | 836,860 | u772304668 | cpp |
p03017 | #include <iostream>
using namespace std;
bool Check(string S, int A, int B, int C, int D) {
int fm = min(A, B);
int fM = max(A, B);
int lm = min(C, D);
int lM = max(C, D);
while (lM < S.size())
S.pop_back();
if (S.find("##", fm) != std::string::npos) {
return false;
}
if (((A < B) && (C < D)) || ((A > B) && (C > D))) {
return true;
} else {
string T = S.substr(fM - 2, lm - 1);
if (T.find("...") == std::string::npos) {
return false;
}
return true;
}
}
int main() {
int N, A, B, C, D;
string S;
cin >> N >> A >> B >> C >> D;
cin >> S;
bool result = Check(S, A, B, C, D);
if (result) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
} | #include <iostream>
using namespace std;
bool Check(string S, int A, int B, int C, int D) {
int fm = min(A, B);
int fM = max(A, B);
int lm = min(C, D);
int lM = max(C, D);
while (lM < S.size())
S.pop_back();
if (S.find("##", fm) != std::string::npos) {
return false;
}
if (((A < B) && (C < D)) || ((A > B) && (C > D))) {
return true;
} else {
string T2 = S.substr(fM - 2, lm - fM + 3);
if (T2.find("...") == std::string::npos) {
return false;
}
return true;
}
}
int main() {
int N, A, B, C, D;
string S;
cin >> N >> A >> B >> C >> D;
cin >> S;
bool result = Check(S, A, B, C, D);
if (result) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
} | [
"variable_declaration.name.change",
"identifier.change",
"identifier.replace.add",
"literal.replace.remove",
"call.arguments.change",
"expression.operation.binary.change",
"control_flow.branch.if.condition.change"
] | 836,861 | 836,862 | u878967567 | cpp |
p03017 | #include <iostream>
using namespace std;
int main(void) {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
n -= 1, a -= 1;
b -= 1;
c -= 1;
d -= 1;
char s[200000] = {};
for (int i = a; i < n; i++)
cin >> s[i];
if (c < d) {
if (c > a + 1) {
for (int i = a; i <= c - 1; i++) {
if (s[i] == '#') {
if (s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
}
}
if (d > b + 1) {
for (int i = b; i <= d - 1; i++) {
if (s[i] == '#') {
if (s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
}
}
cout << "Yes" << endl;
}
if (c > d) {
for (int i = a; i <= c - 1; i++) {
if (s[i] == '#') {
if (s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
}
bool flag1 = false, flag2 = false;
if (s[b - 1] == '.' && s[b + 1] == '.')
flag1 = true;
for (int i = b; i < d; i++) {
if (s[i] == '.') {
if (s[i + 1] == '.') {
if (s[i + 2] == '.') {
flag2 = true;
break;
}
}
}
}
if (flag1 || flag2)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
return 0;
} | #include <iostream>
using namespace std;
int main(void) {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
n -= 1, a -= 1;
b -= 1;
c -= 1;
d -= 1;
char s[200001];
for (int i = 0; i < n; i++)
cin >> s[i];
if (c < d) {
if (c > a + 1) {
for (int i = a; i <= c - 1; i++) {
if (s[i] == '#') {
if (s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
}
}
if (d > b + 1) {
for (int i = b; i <= d - 1; i++) {
if (s[i] == '#') {
if (s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
}
}
cout << "Yes" << endl;
}
if (c > d) {
for (int i = a; i <= c - 1; i++) {
if (s[i] == '#') {
if (s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
}
bool flag1 = false, flag2 = false;
if (s[b - 1] == '.' && s[b + 1] == '.')
flag1 = true;
for (int i = b; i < d; i++) {
if (s[i] == '.') {
if (s[i + 1] == '.') {
if (s[i + 2] == '.') {
flag2 = true;
break;
}
}
}
}
if (flag1 || flag2)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
return 0;
} | [
"literal.number.change",
"variable_declaration.array_dimensions.change",
"variable_declaration.value.change",
"identifier.replace.remove",
"literal.replace.add",
"control_flow.loop.for.initializer.change"
] | 836,890 | 836,891 | u957416438 | cpp |
p03017 | #include <iostream>
using namespace std;
int main(void) {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
n -= 1, a -= 1;
b -= 1;
c -= 1;
d -= 1;
char s[200000] = {};
for (int i = a; i < n; i++)
cin >> s[i];
if (c < d) {
if (c > a + 1) {
for (int i = a; i <= c - 1; i++) {
if (s[i] == '#') {
if (s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
}
}
if (d > b + 1) {
for (int i = b; i <= d - 1; i++) {
if (s[i] == '#') {
if (s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
}
}
cout << "Yes" << endl;
}
if (c > d) {
for (int i = a; i <= c - 1; i++) {
if (s[i] == '#') {
if (s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
}
bool flag1 = false, flag2 = false;
if (s[b - 1] == '.' && s[b + 1] == '.')
flag1 = true;
for (int i = b; i < d; i++) {
if (s[i] == '.') {
if (s[i + 1] == '.') {
if (s[i + 2] == '.') {
flag2 = true;
break;
}
}
}
}
if (flag1 || flag2)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
return 0;
} | #include <iostream>
using namespace std;
int main(void) {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
n -= 1, a -= 1;
b -= 1;
c -= 1;
d -= 1;
char s[200100];
for (int i = 0; i < n; i++)
cin >> s[i];
if (c < d) {
if (c > a + 1) {
for (int i = a; i <= c - 1; i++) {
if (s[i] == '#') {
if (s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
}
}
if (d > b + 1) {
for (int i = b; i <= d - 1; i++) {
if (s[i] == '#') {
if (s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
}
}
cout << "Yes" << endl;
}
if (c > d) {
for (int i = a; i <= c - 1; i++) {
if (s[i] == '#') {
if (s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
}
bool flag1 = false, flag2 = false;
if (s[b - 1] == '.' && s[b + 1] == '.')
flag1 = true;
for (int i = b; i < d; i++) {
if (s[i] == '.') {
if (s[i + 1] == '.') {
if (s[i + 2] == '.') {
flag2 = true;
break;
}
}
}
}
if (flag1 || flag2)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
return 0;
} | [
"literal.number.change",
"variable_declaration.array_dimensions.change",
"variable_declaration.value.change",
"identifier.replace.remove",
"literal.replace.add",
"control_flow.loop.for.initializer.change"
] | 836,890 | 836,892 | u957416438 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
const int H = 1000 + 7;
#define mp make_pair
#define pb push_back
#define st first
#define nd second
typedef long long ll;
typedef vector<ll> vl;
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
--a;
--b;
--c;
--d;
string s;
cin >> s;
int p = b;
bool dots = false;
while (p + 2 <= d) {
// cout << s[p] << s[p + 1] << s[p + 2] << endl;
if (s[p] == '.' && s[p + 1] == '.' && s[p + 2] == '.') {
dots = true;
}
++p;
}
bool stat = true;
while (b < d) {
// cout << b << " ";
if (b + 1 < n && s[b + 1] == '.')
++b;
else if (b + 2 < n && s[b + 2] == '.')
b += 2;
else {
stat = false;
break;
}
// cout << b << endl;
}
if (b == d)
s[b] = '#';
while (a < c) {
if (a + 1 < n && s[a + 1] == '.')
++a;
else if (a + 2 < n && s[a + 2] == '.')
a += 2;
else {
stat = false;
break;
}
}
if ((stat && a == c && b == d) || dots)
cout << "Yes\n";
else
cout << "No\n";
return 0;
}
/*
&& ((i > 0 && s[i - 1][j] == '#') || (i < h - 1 && s[i + 1][j] == '#') || (j >
0 && s[i][j - 1] == '#') || (j < w - 1 && s[i][j + 1] == '#'))
*/
| #include <bits/stdc++.h>
using namespace std;
const int H = 1000 + 7;
#define mp make_pair
#define pb push_back
#define st first
#define nd second
typedef long long ll;
typedef vector<ll> vl;
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
--a;
--b;
--c;
--d;
string s;
cin >> s;
int p = b - 1;
bool dots = false;
while (p + 2 <= d) {
// cout << s[p] << s[p + 1] << s[p + 2] << endl;
if (s[p] == '.' && s[p + 1] == '.' && s[p + 2] == '.') {
dots = true;
}
++p;
}
bool stat = true;
while (b < d) {
// cout << b << " ";
if (b + 1 < n && s[b + 1] == '.')
++b;
else if (b + 2 < n && s[b + 2] == '.')
b += 2;
else {
stat = false;
break;
}
// cout << b << endl;
}
if (b == d)
s[b] = '#';
while (a < c) {
if (a + 1 < n && s[a + 1] == '.')
++a;
else if (a + 2 < n && s[a + 2] == '.')
a += 2;
else {
stat = false;
break;
}
}
if ((stat && a == c && b == d) || dots)
cout << "Yes\n";
else
cout << "No\n";
return 0;
}
/*
&& ((i > 0 && s[i - 1][j] == '#') || (i < h - 1 && s[i + 1][j] == '#') || (j >
0 && s[i][j - 1] == '#') || (j < w - 1 && s[i][j + 1] == '#'))
*/
| [
"assignment.change"
] | 836,896 | 836,897 | u411195488 | cpp |
p03017 | #include <algorithm>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define MOD (long long int)(1e9 + 7)
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n) for (int i = 1; i <= (int)(n); i++)
#define REP(i, n) for (int i = n - 1; i >= 0; i--)
#define REPS(i, n) for (int i = n; i > 0; i--)
#define ALL(x) (x).begin(), (x).end()
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
bool check = true;
for (int i = A; i < max(C, D) - 2; i++) {
if ((S[i] == '#') && (S[i + 1] == '#')) {
check = false;
i = INF;
break;
}
}
if (D < C && check) {
check = false;
for (int i = B - 1; i < D - 1; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
check = true;
i = INF;
break;
}
}
}
if (check) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| #include <algorithm>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define MOD (long long int)(1e9 + 7)
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n) for (int i = 1; i <= (int)(n); i++)
#define REP(i, n) for (int i = n - 1; i >= 0; i--)
#define REPS(i, n) for (int i = n; i > 0; i--)
#define ALL(x) (x).begin(), (x).end()
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
bool check = true;
for (int i = A; i < max(C, D) - 2; i++) {
if ((S[i] == '#') && (S[i + 1] == '#')) {
check = false;
i = INF;
break;
}
}
if (D < C && check) {
check = false;
for (int i = B - 2; i < D - 1; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
check = true;
i = INF;
break;
}
}
}
if (check) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| [
"literal.number.change",
"control_flow.loop.for.initializer.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 836,908 | 836,909 | u050698451 | cpp |
p03017 | #include <algorithm>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define MOD (long long int)(1e9 + 7)
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n) for (int i = 1; i <= (int)(n); i++)
#define REP(i, n) for (int i = n - 1; i >= 0; i--)
#define REPS(i, n) for (int i = n; i > 0; i--)
#define ALL(x) (x).begin(), (x).end()
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
bool check = true;
for (int i = A; i < max(C, D) - 2; i++) {
if ((S[i] == '#') && (S[i + 1] == '#')) {
check = false;
i = INF;
break;
}
}
if (D < C && check) {
check = false;
for (int i = B; i < D - 2; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
check = true;
i = INF;
break;
}
}
}
if (check) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| #include <algorithm>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define MOD (long long int)(1e9 + 7)
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n) for (int i = 1; i <= (int)(n); i++)
#define REP(i, n) for (int i = n - 1; i >= 0; i--)
#define REPS(i, n) for (int i = n; i > 0; i--)
#define ALL(x) (x).begin(), (x).end()
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
bool check = true;
for (int i = A; i < max(C, D) - 2; i++) {
if ((S[i] == '#') && (S[i + 1] == '#')) {
check = false;
i = INF;
break;
}
}
if (D < C && check) {
check = false;
for (int i = B - 2; i < D - 1; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
check = true;
i = INF;
break;
}
}
}
if (check) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| [
"control_flow.loop.for.initializer.change",
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 836,910 | 836,909 | u050698451 | cpp |
p03017 | #include <algorithm>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define MOD (long long int)(1e9 + 7)
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n) for (int i = 1; i <= (int)(n); i++)
#define REP(i, n) for (int i = n - 1; i >= 0; i--)
#define REPS(i, n) for (int i = n; i > 0; i--)
#define ALL(x) (x).begin(), (x).end()
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
bool check = true;
for (int i = A; i < max(C, D) - 1; i++) {
if ((S[i] == '#') && (S[i + 1] == '#')) {
check = false;
i = INF;
break;
}
}
if (D < C && check) {
check = false;
for (int i = B; i < D - 1; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
check = true;
i = INF;
break;
}
}
}
if (check) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| #include <algorithm>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define MOD (long long int)(1e9 + 7)
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n) for (int i = 1; i <= (int)(n); i++)
#define REP(i, n) for (int i = n - 1; i >= 0; i--)
#define REPS(i, n) for (int i = n; i > 0; i--)
#define ALL(x) (x).begin(), (x).end()
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
bool check = true;
for (int i = A; i < max(C, D) - 2; i++) {
if ((S[i] == '#') && (S[i + 1] == '#')) {
check = false;
i = INF;
break;
}
}
if (D < C && check) {
check = false;
for (int i = B - 2; i < D - 1; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
check = true;
i = INF;
break;
}
}
}
if (check) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| [
"literal.number.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change",
"control_flow.loop.for.initializer.change"
] | 836,911 | 836,909 | u050698451 | cpp |
p03017 | #include <algorithm>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define MOD (long long int)(1e9 + 7)
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n) for (int i = 1; i <= (int)(n); i++)
#define REP(i, n) for (int i = n - 1; i >= 0; i--)
#define REPS(i, n) for (int i = n; i > 0; i--)
#define ALL(x) (x).begin(), (x).end()
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
bool check = true;
for (int i = A; i < max(C, D) - 2; i++) {
if ((S[i] == '#') && (S[i + 1] == '#')) {
check = false;
i = INF;
break;
}
}
if (D < C && check) {
check = false;
for (int i = B; i < D - 1; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
check = true;
i = INF;
break;
}
}
}
if (check) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| #include <algorithm>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define MOD (long long int)(1e9 + 7)
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n) for (int i = 1; i <= (int)(n); i++)
#define REP(i, n) for (int i = n - 1; i >= 0; i--)
#define REPS(i, n) for (int i = n; i > 0; i--)
#define ALL(x) (x).begin(), (x).end()
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
bool check = true;
for (int i = A; i < max(C, D) - 2; i++) {
if ((S[i] == '#') && (S[i + 1] == '#')) {
check = false;
i = INF;
break;
}
}
if (D < C && check) {
check = false;
for (int i = B - 2; i < D - 1; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
check = true;
i = INF;
break;
}
}
}
if (check) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| [
"control_flow.loop.for.initializer.change"
] | 836,912 | 836,909 | u050698451 | cpp |
p03017 | #include <algorithm>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define MOD (long long int)(1e9 + 7)
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n) for (int i = 1; i <= (int)(n); i++)
#define REP(i, n) for (int i = n - 1; i >= 0; i--)
#define REPS(i, n) for (int i = n; i > 0; i--)
#define ALL(x) (x).begin(), (x).end()
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
bool check = true;
for (int i = A; i < max(C, D) - 2; i++) {
if ((S[i] == '#') && (S[i + 1] == '#')) {
check = false;
i = INF;
break;
}
}
if (D < C && check) {
check = false;
for (int i = B; i < C - 2; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
check = true;
i = INF;
break;
}
}
}
if (check) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| #include <algorithm>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define MOD (long long int)(1e9 + 7)
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n) for (int i = 1; i <= (int)(n); i++)
#define REP(i, n) for (int i = n - 1; i >= 0; i--)
#define REPS(i, n) for (int i = n; i > 0; i--)
#define ALL(x) (x).begin(), (x).end()
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
int main() {
int N, A, B, C, D;
cin >> N >> A >> B >> C >> D;
string S;
cin >> S;
bool check = true;
for (int i = A; i < max(C, D) - 2; i++) {
if ((S[i] == '#') && (S[i + 1] == '#')) {
check = false;
i = INF;
break;
}
}
if (D < C && check) {
check = false;
for (int i = B - 2; i < D - 1; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
check = true;
i = INF;
break;
}
}
}
if (check) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| [
"control_flow.loop.for.initializer.change",
"identifier.change",
"control_flow.branch.if.condition.change",
"literal.number.change"
] | 836,914 | 836,909 | u050698451 | cpp |
p03017 | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
//#define MODE 1
#ifdef MODE
#define DEB(X) cout << #X << ": " << X << " ";
#define END cout << endl;
#else
#define DEB(X) \
{}
#define END \
{}
#endif
typedef long long ll;
#define int ll
#define uset unordered_set
#define umap unordered_map
typedef std::pair<int, int> P;
struct edge {
int to, cost;
};
const int INF = 100000000000000000;
const int INF2 = 9223372036854775807;
const int MOD = 1000000007;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define min(X, Y) (((int)(X) < (int)(Y)) ? (X) : (Y))
#define max(X, Y) (((int)(X) > (int)(Y)) ? (X) : (Y))
#define MAX(X, Y) (*max_element(X, Y))
#define MIN(X, Y) (*min_element(X, Y))
#define NP(X, Y) next_permutation(X, Y)
int N, A, B, C, D;
string S;
signed main() {
cin >> N >> A >> B >> C >> D >> S;
int pos = INF, pos2 = INF;
for (int i = A - 1; i < S.size() - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
pos = i;
break;
}
}
for (int i = B - 1; i < S.size() - 2; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
pos2 = i;
break;
}
}
if (C < D) {
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;
}
}
cout << "Yes" << endl;
} else {
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;
}
}
for (int i = B - 2; 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 <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
//#define MODE 1
#ifdef MODE
#define DEB(X) cout << #X << ": " << X << " ";
#define END cout << endl;
#else
#define DEB(X) \
{}
#define END \
{}
#endif
typedef long long ll;
#define int ll
#define uset unordered_set
#define umap unordered_map
typedef std::pair<int, int> P;
struct edge {
int to, cost;
};
const int INF = 100000000000000000;
const int INF2 = 9223372036854775807;
const int MOD = 1000000007;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define min(X, Y) (((int)(X) < (int)(Y)) ? (X) : (Y))
#define max(X, Y) (((int)(X) > (int)(Y)) ? (X) : (Y))
#define MAX(X, Y) (*max_element(X, Y))
#define MIN(X, Y) (*min_element(X, Y))
#define NP(X, Y) next_permutation(X, Y)
int N, A, B, C, D;
string S;
signed main() {
cin >> N >> A >> B >> C >> D >> S;
int pos = INF, pos2 = INF;
for (int i = A - 1; i < S.size() - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
pos = i;
break;
}
}
for (int i = B - 1; i < S.size() - 2; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
pos2 = i;
break;
}
}
if (C < D) {
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;
}
}
cout << "Yes" << endl;
} else {
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;
}
}
for (int i = B - 2; i < D - 1; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
}
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 836,945 | 836,946 | u848736574 | cpp |
p03017 | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
//#define MODE 1
#ifdef MODE
#define DEB(X) cout << #X << ": " << X << " ";
#define END cout << endl;
#else
#define DEB(X) \
{}
#define END \
{}
#endif
typedef long long ll;
#define int ll
#define uset unordered_set
#define umap unordered_map
typedef std::pair<int, int> P;
struct edge {
int to, cost;
};
const int INF = 100000000000000000;
const int INF2 = 9223372036854775807;
const int MOD = 1000000007;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define min(X, Y) (((int)(X) < (int)(Y)) ? (X) : (Y))
#define max(X, Y) (((int)(X) > (int)(Y)) ? (X) : (Y))
#define MAX(X, Y) (*max_element(X, Y))
#define MIN(X, Y) (*min_element(X, Y))
#define NP(X, Y) next_permutation(X, Y)
int N, A, B, C, D;
string S;
signed main() {
cin >> N >> A >> B >> C >> D >> S;
int pos = INF, pos2 = INF;
for (int i = A - 1; i < S.size() - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
pos = i;
break;
}
}
for (int i = B - 1; i < S.size() - 2; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
pos2 = i;
break;
}
}
if (C < D) {
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;
}
}
cout << "Yes" << endl;
} else {
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;
}
}
for (int i = B - 2; i < D - 2; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
}
return 0;
}
| #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
//#define MODE 1
#ifdef MODE
#define DEB(X) cout << #X << ": " << X << " ";
#define END cout << endl;
#else
#define DEB(X) \
{}
#define END \
{}
#endif
typedef long long ll;
#define int ll
#define uset unordered_set
#define umap unordered_map
typedef std::pair<int, int> P;
struct edge {
int to, cost;
};
const int INF = 100000000000000000;
const int INF2 = 9223372036854775807;
const int MOD = 1000000007;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define min(X, Y) (((int)(X) < (int)(Y)) ? (X) : (Y))
#define max(X, Y) (((int)(X) > (int)(Y)) ? (X) : (Y))
#define MAX(X, Y) (*max_element(X, Y))
#define MIN(X, Y) (*min_element(X, Y))
#define NP(X, Y) next_permutation(X, Y)
int N, A, B, C, D;
string S;
signed main() {
cin >> N >> A >> B >> C >> D >> S;
int pos = INF, pos2 = INF;
for (int i = A - 1; i < S.size() - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
pos = i;
break;
}
}
for (int i = B - 1; i < S.size() - 2; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
pos2 = i;
break;
}
}
if (C < D) {
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;
}
}
cout << "Yes" << endl;
} else {
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;
}
}
for (int i = B - 2; i < D - 1; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
}
return 0;
}
| [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 836,947 | 836,946 | u848736574 | cpp |
p03017 | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
//#define MODE 1
#ifdef MODE
#define DEB(X) cout << #X << ": " << X << " ";
#define END cout << endl;
#else
#define DEB(X) \
{}
#define END \
{}
#endif
typedef long long ll;
#define int ll
#define uset unordered_set
#define umap unordered_map
typedef std::pair<int, int> P;
struct edge {
int to, cost;
};
const int INF = 100000000000000000;
const int INF2 = 9223372036854775807;
const int MOD = 1000000007;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define min(X, Y) (((int)(X) < (int)(Y)) ? (X) : (Y))
#define max(X, Y) (((int)(X) > (int)(Y)) ? (X) : (Y))
#define MAX(X, Y) (*max_element(X, Y))
#define MIN(X, Y) (*min_element(X, Y))
#define NP(X, Y) next_permutation(X, Y)
int N, A, B, C, D;
string S;
signed main() {
cin >> N >> A >> B >> C >> D >> S;
int pos = INF, pos2 = INF;
for (int i = A - 1; i < S.size() - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
pos = i;
break;
}
}
for (int i = B - 1; i < S.size() - 2; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
pos2 = i;
break;
}
}
if (C < D) {
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;
}
}
cout << "Yes" << endl;
} else {
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;
}
}
for (int i = B - 1; i < D - 2; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
}
return 0;
}
| #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
//#define MODE 1
#ifdef MODE
#define DEB(X) cout << #X << ": " << X << " ";
#define END cout << endl;
#else
#define DEB(X) \
{}
#define END \
{}
#endif
typedef long long ll;
#define int ll
#define uset unordered_set
#define umap unordered_map
typedef std::pair<int, int> P;
struct edge {
int to, cost;
};
const int INF = 100000000000000000;
const int INF2 = 9223372036854775807;
const int MOD = 1000000007;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define min(X, Y) (((int)(X) < (int)(Y)) ? (X) : (Y))
#define max(X, Y) (((int)(X) > (int)(Y)) ? (X) : (Y))
#define MAX(X, Y) (*max_element(X, Y))
#define MIN(X, Y) (*min_element(X, Y))
#define NP(X, Y) next_permutation(X, Y)
int N, A, B, C, D;
string S;
signed main() {
cin >> N >> A >> B >> C >> D >> S;
int pos = INF, pos2 = INF;
for (int i = A - 1; i < S.size() - 1; i++) {
if (S[i] == '#' && S[i + 1] == '#') {
pos = i;
break;
}
}
for (int i = B - 1; i < S.size() - 2; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
pos2 = i;
break;
}
}
if (C < D) {
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;
}
}
cout << "Yes" << endl;
} else {
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;
}
}
for (int i = B - 2; i < D - 1; i++) {
if (S[i] == '.' && S[i + 1] == '.' && S[i + 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",
"control_flow.branch.if.condition.change"
] | 836,948 | 836,946 | u848736574 | cpp |
p03017 | //#include <bits/stdc++.h>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vector<int>> vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long>> vvll, vvLL;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define mod (ll)(1e9 + 7)
#define FIX(a) ((a) % mod + mod) % mod
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define INF 1000000000 // 1e9
#define LLINF 2000000000000000000LL // 2e18
#define fi first
#define se second
#define pb push_back
int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
string s;
ll n, a, b, c, d;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
cin >> n;
cin >> a >> b >> c >> d;
a -= 1;
b -= 1;
c -= 1;
d -= 1;
cin >> s;
bool niiwa = false;
bool san = false;
if (c < d) {
for (ll i = a; i < c; i++) {
if ((s[i] == '#') && (s[i + 1] == '#')) {
niiwa = true;
}
}
for (ll i = b; i < d; i++) {
if ((s[i] == '#') && (s[i + 1] == '#')) {
niiwa = true;
}
}
if (niiwa == true) {
cout << "No\n";
} else {
cout << "Yes\n";
}
} else {
niiwa = false;
san = false;
for (ll i = a; i < c; i++) {
if ((s[i] == '#') && (s[i + 1] == '#')) {
niiwa = true;
}
}
for (ll i = b; i < d; i++) {
if ((s[i] == '#') && (s[i + 1] == '#')) {
niiwa = true;
}
}
for (ll i = a; i <= c - 2; i++) {
if ((s[i] == '.') && (s[i + 1] == '.') && (s[i + 2] == '.') &&
(i + 1 <= d) && (i + 2 <= c)) {
san = true;
}
}
if ((niiwa == true) || (san == false)) {
cout << "No\n";
} else {
cout << "Yes\n";
}
}
return 0;
} | //#include <bits/stdc++.h>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vector<int>> vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long>> vvll, vvLL;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define mod (ll)(1e9 + 7)
#define FIX(a) ((a) % mod + mod) % mod
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define INF 1000000000 // 1e9
#define LLINF 2000000000000000000LL // 2e18
#define fi first
#define se second
#define pb push_back
int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
string s;
ll n, a, b, c, d;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
cin >> n;
cin >> a >> b >> c >> d;
a -= 1;
b -= 1;
c -= 1;
d -= 1;
cin >> s;
bool niiwa = false;
bool san = false;
if (c < d) {
for (ll i = a; i < c; i++) {
if ((s[i] == '#') && (s[i + 1] == '#')) {
niiwa = true;
}
}
for (ll i = b; i < d; i++) {
if ((s[i] == '#') && (s[i + 1] == '#')) {
niiwa = true;
}
}
if (niiwa == true) {
cout << "No\n";
} else {
cout << "Yes\n";
}
} else {
niiwa = false;
san = false;
for (ll i = a; i < c; i++) {
if ((s[i] == '#') && (s[i + 1] == '#')) {
niiwa = true;
}
}
for (ll i = b; i < d; i++) {
if ((s[i] == '#') && (s[i + 1] == '#')) {
niiwa = true;
}
}
for (ll i = b - 1; i <= c - 2; i++) {
if ((s[i] == '.') && (s[i + 1] == '.') && (s[i + 2] == '.') &&
(i + 1 <= d) && (i + 2 <= c)) {
san = true;
}
}
if ((niiwa == true) || (san == false)) {
cout << "No\n";
} else {
cout << "Yes\n";
}
}
return 0;
} | [
"control_flow.loop.for.initializer.change"
] | 836,955 | 836,956 | u652420316 | cpp |
p03017 | #include <algorithm>
#include <iostream>
char s[200001];
using namespace std;
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
cin >> s;
if (d < c) {
bool flg = false;
for (int i = a - 1; i < b - 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] == '.' && s[i + 2] == '.') {
flg = true;
}
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (int i = d - 2; i < c - 2; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
if (flg) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
} else {
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;
}
}
cout << "Yes" << endl;
return 0;
}
}
| #include <algorithm>
#include <iostream>
char s[200001];
using namespace std;
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
cin >> s;
if (d < c) {
bool flg = false;
for (int i = a - 1; i < b - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (int i = b - 2; i < d - 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
flg = true;
}
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (int i = d - 2; i < c - 2; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
if (flg) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
} else {
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;
}
}
cout << "Yes" << endl;
return 0;
}
}
| [
"literal.number.change",
"control_flow.loop.for.initializer.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 836,971 | 836,972 | u809889010 | cpp |
p03017 | #include <algorithm>
#include <iostream>
char s[200001];
using namespace std;
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
cin >> s;
if (d < c) {
bool flg = false;
for (int i = a - 1; i < b - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (int i = b - 1; i < d - 2; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
flg = true;
}
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (int i = d - 2; i < c - 2; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
if (flg) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
} else {
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;
}
}
cout << "Yes" << endl;
return 0;
}
}
| #include <algorithm>
#include <iostream>
char s[200001];
using namespace std;
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
cin >> s;
if (d < c) {
bool flg = false;
for (int i = a - 1; i < b - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (int i = b - 2; i < d - 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
flg = true;
}
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (int i = d - 2; i < c - 2; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
if (flg) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
} else {
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;
}
}
cout << "Yes" << 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"
] | 836,973 | 836,972 | u809889010 | cpp |
p03017 | #include <algorithm>
#include <iostream>
char s[200001];
using namespace std;
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
cin >> s;
if (d < c) {
bool flg = false;
for (int i = a - 1; i < b - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (int i = b - 1; i < d - 2; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
flg = true;
}
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (int i = d - 2; i < c - 2; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
if (flg) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
} else {
for (int i = a - 1; 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 + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
}
}
| #include <algorithm>
#include <iostream>
char s[200001];
using namespace std;
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
cin >> s;
if (d < c) {
bool flg = false;
for (int i = a - 1; i < b - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (int i = b - 2; i < d - 1; i++) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
flg = true;
}
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
for (int i = d - 2; i < c - 2; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
cout << "No" << endl;
return 0;
}
}
if (flg) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
} else {
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;
}
}
cout << "Yes" << 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"
] | 836,974 | 836,972 | u809889010 | cpp |
p03017 | #include "bits/stdc++.h"
using namespace std;
#define Rep(i, n) for (int i = 0; i < (int)(n); i++)
#define For(i, n1, n2) for (int i = (int)(n1); i < (int)(n2); i++)
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define RREP(i, n) for (ll i = ((ll)(n)-1); i >= 0; i--)
#define FOR(i, n1, n2) for (ll i = (ll)(n1); i < (ll)(n2); i++)
#define RFOR(i, n1, n2) for (ll i = ((ll)(n1)-1); i >= (ll)(n2); i--)
#define put(a) cout << a << "\n"
#define all(a) (a).begin(), (a).end()
#define SORT(a) sort((a).begin(), (a).end())
#define oorret 0
#define oor(x) \
[&]() { \
try { \
x; \
} catch (const out_of_range &oor) { \
return oorret; \
} \
return x; \
}()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
a--;
b--;
c--;
d--;
string s;
cin >> s;
if (c < b) {
bool flag = true;
FOR(i, a, c) {
if (s[i] == '#' && s[i + 1] == '#') {
flag = false;
}
}
FOR(i, b, d) {
if (s[i] == '#' && s[i + 1] == '#') {
flag = false;
}
}
if (flag) {
put("Yes");
} else {
put("No");
}
} else if (c < d) {
bool flag = true;
FOR(i, a, d) {
if (s[i] == '#' && s[i + 1] == '#') {
flag = false;
}
}
if (flag) {
put("Yes");
} else {
put("No");
}
} else {
bool flag = true;
FOR(i, a, c) {
if (s[i] == '#' && s[i + 1] == '#') {
flag = false;
}
}
if (!flag) {
put("No");
return 0;
}
bool flag2 = false;
FOR(i, b - 1, d - 1) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
flag2 = true;
break;
}
}
if (flag2) {
put("Yes");
} else {
put("No");
}
}
return 0;
}
| #include "bits/stdc++.h"
using namespace std;
#define Rep(i, n) for (int i = 0; i < (int)(n); i++)
#define For(i, n1, n2) for (int i = (int)(n1); i < (int)(n2); i++)
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define RREP(i, n) for (ll i = ((ll)(n)-1); i >= 0; i--)
#define FOR(i, n1, n2) for (ll i = (ll)(n1); i < (ll)(n2); i++)
#define RFOR(i, n1, n2) for (ll i = ((ll)(n1)-1); i >= (ll)(n2); i--)
#define put(a) cout << a << "\n"
#define all(a) (a).begin(), (a).end()
#define SORT(a) sort((a).begin(), (a).end())
#define oorret 0
#define oor(x) \
[&]() { \
try { \
x; \
} catch (const out_of_range &oor) { \
return oorret; \
} \
return x; \
}()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
a--;
b--;
c--;
d--;
string s;
cin >> s;
if (c < b) {
bool flag = true;
FOR(i, a, c) {
if (s[i] == '#' && s[i + 1] == '#') {
flag = false;
}
}
FOR(i, b, d) {
if (s[i] == '#' && s[i + 1] == '#') {
flag = false;
}
}
if (flag) {
put("Yes");
} else {
put("No");
}
} else if (c < d) {
bool flag = true;
FOR(i, a, d) {
if (s[i] == '#' && s[i + 1] == '#') {
flag = false;
}
}
if (flag) {
put("Yes");
} else {
put("No");
}
} else {
bool flag = true;
FOR(i, a, c) {
if (s[i] == '#' && s[i + 1] == '#') {
flag = false;
}
}
if (!flag) {
put("No");
return 0;
}
bool flag2 = false;
FOR(i, b - 1, d) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
flag2 = true;
break;
}
}
if (flag2) {
put("Yes");
} else {
put("No");
}
}
return 0;
}
| [
"expression.operation.binary.remove"
] | 836,981 | 836,982 | u030685402 | cpp |
p03017 | #include "bits/stdc++.h"
using namespace std;
#define Rep(i, n) for (int i = 0; i < (int)(n); i++)
#define For(i, n1, n2) for (int i = (int)(n1); i < (int)(n2); i++)
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define RREP(i, n) for (ll i = ((ll)(n)-1); i >= 0; i--)
#define FOR(i, n1, n2) for (ll i = (ll)(n1); i < (ll)(n2); i++)
#define RFOR(i, n1, n2) for (ll i = ((ll)(n1)-1); i >= (ll)(n2); i--)
#define put(a) cout << a << "\n"
#define all(a) (a).begin(), (a).end()
#define SORT(a) sort((a).begin(), (a).end())
#define oorret 0
#define oor(x) \
[&]() { \
try { \
x; \
} catch (const out_of_range &oor) { \
return oorret; \
} \
return x; \
}()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
a--;
b--;
c--;
d--;
string s;
cin >> s;
if (c < b) {
bool flag = true;
FOR(i, a, c) {
if (s[i] == '#' && s[i + 1] == '#') {
flag = false;
}
}
FOR(i, b, d) {
if (s[i] == '#' && s[i + 1] == '#') {
flag = false;
}
}
if (flag) {
put("Yes");
} else {
put("No");
}
} else if (c < d) {
bool flag = true;
FOR(i, a, d) {
if (s[i] == '#' && s[i + 1] == '#') {
flag = false;
}
}
if (flag) {
put("Yes");
} else {
put("No");
}
} else {
bool flag = true;
FOR(i, a, c) {
if (s[i] == '#' && s[i + 1] == '#') {
flag = false;
}
}
if (!flag) {
put("No");
return 0;
}
bool flag2 = false;
FOR(i, b, d - 1) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
flag2 = true;
break;
}
}
if (flag2) {
put("Yes");
} else {
put("No");
}
}
return 0;
}
| #include "bits/stdc++.h"
using namespace std;
#define Rep(i, n) for (int i = 0; i < (int)(n); i++)
#define For(i, n1, n2) for (int i = (int)(n1); i < (int)(n2); i++)
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define RREP(i, n) for (ll i = ((ll)(n)-1); i >= 0; i--)
#define FOR(i, n1, n2) for (ll i = (ll)(n1); i < (ll)(n2); i++)
#define RFOR(i, n1, n2) for (ll i = ((ll)(n1)-1); i >= (ll)(n2); i--)
#define put(a) cout << a << "\n"
#define all(a) (a).begin(), (a).end()
#define SORT(a) sort((a).begin(), (a).end())
#define oorret 0
#define oor(x) \
[&]() { \
try { \
x; \
} catch (const out_of_range &oor) { \
return oorret; \
} \
return x; \
}()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
a--;
b--;
c--;
d--;
string s;
cin >> s;
if (c < b) {
bool flag = true;
FOR(i, a, c) {
if (s[i] == '#' && s[i + 1] == '#') {
flag = false;
}
}
FOR(i, b, d) {
if (s[i] == '#' && s[i + 1] == '#') {
flag = false;
}
}
if (flag) {
put("Yes");
} else {
put("No");
}
} else if (c < d) {
bool flag = true;
FOR(i, a, d) {
if (s[i] == '#' && s[i + 1] == '#') {
flag = false;
}
}
if (flag) {
put("Yes");
} else {
put("No");
}
} else {
bool flag = true;
FOR(i, a, c) {
if (s[i] == '#' && s[i + 1] == '#') {
flag = false;
}
}
if (!flag) {
put("No");
return 0;
}
bool flag2 = false;
FOR(i, b - 1, d) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
flag2 = true;
break;
}
}
if (flag2) {
put("Yes");
} else {
put("No");
}
}
return 0;
}
| [
"call.arguments.change",
"call.arguments.add"
] | 836,983 | 836,982 | u030685402 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
#define mem(arr, i) fill(arr, arr + sizeof(arr), i)
#define MEM(arr, i) memset(arr, i, sizeof(arr))
#define Push push_back
#define Pair make_pair
typedef unsigned long long ull;
typedef long long lli;
typedef pair<int, int> pii;
typedef pair<lli, lli> pll;
typedef vector<int> vcI;
typedef vector<lli> vcL;
typedef vector<pii> vPI;
typedef vector<pll> vPL;
// typedef priority_queue<T> prior_S<T>;
// typedef priority_queue< T, vector<T>, greater<T> > prior_B<T>;
const double PI = 3.141592653589793;
const lli I_MAX = 1LL << 60;
const lli mod = 1000000007;
void precal() { return; }
bool solve() {
lli n, a, b, c, d;
string s;
if (cin >> n >> a >> b >> c >> d >> s)
;
else
return false;
bool flag = true;
if (c < d) {
for (int i = b; i < d; ++i) {
if (s[i] == '#' and s[i - 1] == '#') {
flag = false;
}
}
for (int i = a; i < c; ++i) {
if (s[i] == '#' and s[i - 1] == '#') {
flag = false;
}
}
} else if (c > d) {
bool flag2 = false;
for (int i = a; i < c; ++i) {
if (s[i] == '#' and s[i - 1] == '#') {
flag = false;
}
}
for (int i = b; i < d; ++i) {
if (s[i] == '.' and s[i - 1] == '.' and s[i - 2] == '.') {
flag2 = true;
}
}
flag &= flag2;
}
if (flag & 0)
cout << "Yes\n";
else
cout << "No\n";
return true;
}
int main() {
precal();
int t = INT_MAX;
// cin >> t;
for (int i = 1; i <= t; ++i) {
// printf("Case #%d: ", i );
if (!solve())
break;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define mem(arr, i) fill(arr, arr + sizeof(arr), i)
#define MEM(arr, i) memset(arr, i, sizeof(arr))
#define Push push_back
#define Pair make_pair
typedef unsigned long long ull;
typedef long long lli;
typedef pair<int, int> pii;
typedef pair<lli, lli> pll;
typedef vector<int> vcI;
typedef vector<lli> vcL;
typedef vector<pii> vPI;
typedef vector<pll> vPL;
// typedef priority_queue<T> prior_S<T>;
// typedef priority_queue< T, vector<T>, greater<T> > prior_B<T>;
const double PI = 3.141592653589793;
const lli I_MAX = 1LL << 60;
const lli mod = 1000000007;
void precal() { return; }
bool solve() {
lli n, a, b, c, d;
string s;
if (cin >> n >> a >> b >> c >> d >> s)
;
else
return false;
bool flag = true;
if (c < d) {
for (int i = b; i < d; ++i) {
if (s[i] == '#' and s[i - 1] == '#') {
flag = false;
}
}
for (int i = a; i < c; ++i) {
if (s[i] == '#' and s[i - 1] == '#') {
flag = false;
}
}
} else if (c > d) {
bool flag2 = false;
for (int i = a; i < c; ++i) {
if (s[i] == '#' and s[i - 1] == '#') {
flag = false;
}
}
for (int i = b; i <= d; ++i) {
if (s[i] == '.' and s[i - 1] == '.' and s[i - 2] == '.') {
flag2 = true;
}
}
flag &= flag2;
}
if (flag)
cout << "Yes\n";
else
cout << "No\n";
return true;
}
int main() {
precal();
int t = INT_MAX;
// cin >> t;
for (int i = 1; i <= t; ++i) {
// printf("Case #%d: ", i );
if (!solve())
break;
}
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 836,984 | 836,985 | u516708338 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
#define mem(arr, i) fill(arr, arr + sizeof(arr), i)
#define MEM(arr, i) memset(arr, i, sizeof(arr))
#define Push push_back
#define Pair make_pair
typedef unsigned long long ull;
typedef long long lli;
typedef pair<int, int> pii;
typedef pair<lli, lli> pll;
typedef vector<int> vcI;
typedef vector<lli> vcL;
typedef vector<pii> vPI;
typedef vector<pll> vPL;
// typedef priority_queue<T> prior_S<T>;
// typedef priority_queue< T, vector<T>, greater<T> > prior_B<T>;
const double PI = 3.141592653589793;
const lli I_MAX = 1LL << 60;
const lli mod = 1000000007;
void precal() { return; }
bool solve() {
lli n, a, b, c, d;
string s;
if (cin >> n >> a >> b >> c >> d >> s)
;
else
return false;
bool flag = true;
if (c < d) {
for (int i = b; i < d; ++i) {
if (s[i] == '#' and s[i - 1] == '#') {
flag = false;
}
}
for (int i = a; i < c; ++i) {
if (s[i] == '#' and s[i - 1] == '#') {
flag = false;
}
}
} else if (c > d) {
bool flag2 = false;
for (int i = a; i < c; ++i) {
if (s[i] == '#' and s[i - 1] == '#') {
flag = false;
}
}
for (int i = b; i < d; ++i) {
if (s[i] == '.' and s[i - 1] == '.' and s[i - 2] == '.') {
flag2 = true;
}
}
flag &= flag2;
}
if (flag | 1)
cout << "Yes\n";
else
cout << "No\n";
return true;
}
int main() {
precal();
int t = INT_MAX;
// cin >> t;
for (int i = 1; i <= t; ++i) {
// printf("Case #%d: ", i );
if (!solve())
break;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define mem(arr, i) fill(arr, arr + sizeof(arr), i)
#define MEM(arr, i) memset(arr, i, sizeof(arr))
#define Push push_back
#define Pair make_pair
typedef unsigned long long ull;
typedef long long lli;
typedef pair<int, int> pii;
typedef pair<lli, lli> pll;
typedef vector<int> vcI;
typedef vector<lli> vcL;
typedef vector<pii> vPI;
typedef vector<pll> vPL;
// typedef priority_queue<T> prior_S<T>;
// typedef priority_queue< T, vector<T>, greater<T> > prior_B<T>;
const double PI = 3.141592653589793;
const lli I_MAX = 1LL << 60;
const lli mod = 1000000007;
void precal() { return; }
bool solve() {
lli n, a, b, c, d;
string s;
if (cin >> n >> a >> b >> c >> d >> s)
;
else
return false;
bool flag = true;
if (c < d) {
for (int i = b; i < d; ++i) {
if (s[i] == '#' and s[i - 1] == '#') {
flag = false;
}
}
for (int i = a; i < c; ++i) {
if (s[i] == '#' and s[i - 1] == '#') {
flag = false;
}
}
} else if (c > d) {
bool flag2 = false;
for (int i = a; i < c; ++i) {
if (s[i] == '#' and s[i - 1] == '#') {
flag = false;
}
}
for (int i = b; i <= d; ++i) {
if (s[i] == '.' and s[i - 1] == '.' and s[i - 2] == '.') {
flag2 = true;
}
}
flag &= flag2;
}
if (flag)
cout << "Yes\n";
else
cout << "No\n";
return true;
}
int main() {
precal();
int t = INT_MAX;
// cin >> t;
for (int i = 1; i <= t; ++i) {
// printf("Case #%d: ", i );
if (!solve())
break;
}
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 836,986 | 836,985 | u516708338 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
#define mem(arr, i) fill(arr, arr + sizeof(arr), i)
#define MEM(arr, i) memset(arr, i, sizeof(arr))
#define Push push_back
#define Pair make_pair
typedef unsigned long long ull;
typedef long long lli;
typedef pair<int, int> pii;
typedef pair<lli, lli> pll;
typedef vector<int> vcI;
typedef vector<lli> vcL;
typedef vector<pii> vPI;
typedef vector<pll> vPL;
// typedef priority_queue<T> prior_S<T>;
// typedef priority_queue< T, vector<T>, greater<T> > prior_B<T>;
const double PI = 3.141592653589793;
const lli I_MAX = 1LL << 60;
const lli mod = 1000000007;
void precal() { return; }
bool solve() {
lli n, a, b, c, d;
string s;
if (cin >> n >> a >> b >> c >> d >> s)
;
else
return false;
bool flag = true;
if (c < d) {
for (int i = b; i < d; ++i) {
if (s[i] == '#' and s[i - 1] == '#') {
flag = false;
}
}
for (int i = a; i < c; ++i) {
if (s[i] == '#' and s[i - 1] == '#') {
flag = false;
}
}
} else if (c > d) {
bool flag2 = false;
for (int i = a; i < c; ++i) {
if (s[i] == '#' and s[i - 1] == '#') {
flag = false;
}
}
for (int i = b; i < d; ++i) {
if (s[i] == '.' and s[i - 1] == '.' and s[i - 2] == '.') {
flag2 = true;
}
}
flag &= flag2;
}
if (flag)
cout << "Yes\n";
else
cout << "No\n";
return true;
}
int main() {
precal();
int t = INT_MAX;
// cin >> t;
for (int i = 1; i <= t; ++i) {
// printf("Case #%d: ", i );
if (!solve())
break;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define mem(arr, i) fill(arr, arr + sizeof(arr), i)
#define MEM(arr, i) memset(arr, i, sizeof(arr))
#define Push push_back
#define Pair make_pair
typedef unsigned long long ull;
typedef long long lli;
typedef pair<int, int> pii;
typedef pair<lli, lli> pll;
typedef vector<int> vcI;
typedef vector<lli> vcL;
typedef vector<pii> vPI;
typedef vector<pll> vPL;
// typedef priority_queue<T> prior_S<T>;
// typedef priority_queue< T, vector<T>, greater<T> > prior_B<T>;
const double PI = 3.141592653589793;
const lli I_MAX = 1LL << 60;
const lli mod = 1000000007;
void precal() { return; }
bool solve() {
lli n, a, b, c, d;
string s;
if (cin >> n >> a >> b >> c >> d >> s)
;
else
return false;
bool flag = true;
if (c < d) {
for (int i = b; i < d; ++i) {
if (s[i] == '#' and s[i - 1] == '#') {
flag = false;
}
}
for (int i = a; i < c; ++i) {
if (s[i] == '#' and s[i - 1] == '#') {
flag = false;
}
}
} else if (c > d) {
bool flag2 = false;
for (int i = a; i < c; ++i) {
if (s[i] == '#' and s[i - 1] == '#') {
flag = false;
}
}
for (int i = b; i <= d; ++i) {
if (s[i] == '.' and s[i - 1] == '.' and s[i - 2] == '.') {
flag2 = true;
}
}
flag &= flag2;
}
if (flag)
cout << "Yes\n";
else
cout << "No\n";
return true;
}
int main() {
precal();
int t = INT_MAX;
// cin >> t;
for (int i = 1; i <= t; ++i) {
// printf("Case #%d: ", i );
if (!solve())
break;
}
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 836,987 | 836,985 | u516708338 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
#define mem(arr, i) fill(arr, arr + sizeof(arr), i)
#define MEM(arr, i) memset(arr, i, sizeof(arr))
#define Push push_back
#define Pair make_pair
typedef unsigned long long ull;
typedef long long lli;
typedef pair<int, int> pii;
typedef pair<lli, lli> pll;
typedef vector<int> vcI;
typedef vector<lli> vcL;
typedef vector<pii> vPI;
typedef vector<pll> vPL;
// typedef priority_queue<T> prior_S<T>;
// typedef priority_queue< T, vector<T>, greater<T> > prior_B<T>;
const double PI = 3.141592653589793;
const lli I_MAX = 1LL << 60;
const lli mod = 1000000007;
void precal() { return; }
bool solve() {
lli n, a, b, c, d;
string s;
if (cin >> n >> a >> b >> c >> d >> s)
;
else
return false;
bool flag = true;
if (c < d) {
for (int i = b; i < d; ++i) {
if (s[i] == '#' and s[i - 1] == '#') {
flag = false;
}
}
for (int i = a; i < c; ++i) {
if (s[i] == '#' and s[i - 1] == '#') {
flag = false;
}
}
} else if (c > d) {
bool flag2 = false;
for (int i = a; i < c; ++i) {
if (s[i] == '#' and s[i - 1] == '#') {
flag = false;
}
}
for (int i = b + 1; i < d; ++i) {
if (s[i] == '.' and s[i - 1] == '.' and s[i - 2] == '.') {
flag2 = true;
}
}
flag &= flag2;
}
if (flag)
cout << "Yes\n";
else
cout << "No\n";
return true;
}
int main() {
precal();
int t = INT_MAX;
// cin >> t;
for (int i = 1; i <= t; ++i) {
// printf("Case #%d: ", i );
if (!solve())
break;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define mem(arr, i) fill(arr, arr + sizeof(arr), i)
#define MEM(arr, i) memset(arr, i, sizeof(arr))
#define Push push_back
#define Pair make_pair
typedef unsigned long long ull;
typedef long long lli;
typedef pair<int, int> pii;
typedef pair<lli, lli> pll;
typedef vector<int> vcI;
typedef vector<lli> vcL;
typedef vector<pii> vPI;
typedef vector<pll> vPL;
// typedef priority_queue<T> prior_S<T>;
// typedef priority_queue< T, vector<T>, greater<T> > prior_B<T>;
const double PI = 3.141592653589793;
const lli I_MAX = 1LL << 60;
const lli mod = 1000000007;
void precal() { return; }
bool solve() {
lli n, a, b, c, d;
string s;
if (cin >> n >> a >> b >> c >> d >> s)
;
else
return false;
bool flag = true;
if (c < d) {
for (int i = b; i < d; ++i) {
if (s[i] == '#' and s[i - 1] == '#') {
flag = false;
}
}
for (int i = a; i < c; ++i) {
if (s[i] == '#' and s[i - 1] == '#') {
flag = false;
}
}
} else if (c > d) {
bool flag2 = false;
for (int i = a; i < c; ++i) {
if (s[i] == '#' and s[i - 1] == '#') {
flag = false;
}
}
for (int i = b; i <= d; ++i) {
if (s[i] == '.' and s[i - 1] == '.' and s[i - 2] == '.') {
flag2 = true;
}
}
flag &= flag2;
}
if (flag)
cout << "Yes\n";
else
cout << "No\n";
return true;
}
int main() {
precal();
int t = INT_MAX;
// cin >> t;
for (int i = 1; i <= t; ++i) {
// printf("Case #%d: ", i );
if (!solve())
break;
}
return 0;
}
| [
"control_flow.loop.for.initializer.change",
"expression.operation.binary.remove",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 836,988 | 836,985 | u516708338 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (a); i > (b); i--)
#define sq(x) ((x) * (x))
#define bit(x) bitset<32>(x)
#define vsort(v) sort(v.begin(), v.end())
#define rvsort(v) sort(v.begin(), v.end(), greater<llint>())
#define debug(x) cout << #x << " " << (x) << endl
#define ci cin
#define co cout
#define en endl
#define ln cout << '\n'
#define pb push_back
#define fi first
#define se second
#define MOD 1000000007
typedef long long int llint;
typedef pair<int, int> pii;
typedef pair<llint, llint> pll;
typedef vector<int> vi;
typedef vector<llint> vl;
typedef vector<pii> vii;
typedef vector<pll> vll;
int n, a, b, c, d;
string s;
int main() {
ci >> n >> a >> b >> c >> d;
ci >> s;
a--;
b--;
c--;
d--;
s += "###";
bool flg = true;
if (c < d) {
rep(i, b + 1, d) if (s[i] == '#' && s[i + 1] == '#') flg = false;
rep(i, a + 1, c) if (s[i] == '#' && s[i + 1] == '#') flg = false;
} else {
rep(i, a + 1, c) if (s[i] == '#' && s[i + 1] == '#') flg = false;
bool ch = false;
rep(i, b, d + 1) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.')
ch = true;
}
flg = (flg & ch);
}
co << (flg ? "Yes" : "No") << en;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (a); i > (b); i--)
#define sq(x) ((x) * (x))
#define bit(x) bitset<32>(x)
#define vsort(v) sort(v.begin(), v.end())
#define rvsort(v) sort(v.begin(), v.end(), greater<llint>())
#define debug(x) cout << #x << " " << (x) << endl
#define ci cin
#define co cout
#define en endl
#define ln cout << '\n'
#define pb push_back
#define fi first
#define se second
#define MOD 1000000007
typedef long long int llint;
typedef pair<int, int> pii;
typedef pair<llint, llint> pll;
typedef vector<int> vi;
typedef vector<llint> vl;
typedef vector<pii> vii;
typedef vector<pll> vll;
int n, a, b, c, d;
string s;
int main() {
ci >> n >> a >> b >> c >> d;
ci >> s;
a--;
b--;
c--;
d--;
s += "###";
bool flg = true;
if (c < d) {
rep(i, b + 1, d) if (s[i] == '#' && s[i + 1] == '#') flg = false;
rep(i, a + 1, c) if (s[i] == '#' && s[i + 1] == '#') flg = false;
} else {
rep(i, a + 1, c) if (s[i] == '#' && s[i + 1] == '#') flg = false;
bool ch = false;
rep(i, b - 1, d) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.')
ch = true;
}
flg = (flg & ch);
}
co << (flg ? "Yes" : "No") << en;
return 0;
}
| [
"expression.operation.binary.remove"
] | 836,992 | 836,993 | u966921248 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (a); i > (b); i--)
#define sq(x) ((x) * (x))
#define bit(x) bitset<32>(x)
#define vsort(v) sort(v.begin(), v.end())
#define rvsort(v) sort(v.begin(), v.end(), greater<llint>())
#define debug(x) cout << #x << " " << (x) << endl
#define ci cin
#define co cout
#define en endl
#define ln cout << '\n'
#define pb push_back
#define fi first
#define se second
#define MOD 1000000007
typedef long long int llint;
typedef pair<int, int> pii;
typedef pair<llint, llint> pll;
typedef vector<int> vi;
typedef vector<llint> vl;
typedef vector<pii> vii;
typedef vector<pll> vll;
int n, a, b, c, d;
string s;
int main() {
ci >> n >> a >> b >> c >> d;
ci >> s;
a--;
b--;
c--;
d--;
s += "###";
bool flg = true;
if (c < d) {
rep(i, b + 1, d) if (s[i] == '#' && s[i + 1] == '#') flg = false;
rep(i, a + 1, c) if (s[i] == '#' && s[i + 1] == '#') flg = false;
} else {
rep(i, a + 1, c) if (s[i] == '#' && s[i + 1] == '#') flg = false;
bool ch = false;
rep(i, b, d - 1) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.')
ch = true;
}
flg = (flg & ch);
}
co << (flg ? "Yes" : "No") << en;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (a); i > (b); i--)
#define sq(x) ((x) * (x))
#define bit(x) bitset<32>(x)
#define vsort(v) sort(v.begin(), v.end())
#define rvsort(v) sort(v.begin(), v.end(), greater<llint>())
#define debug(x) cout << #x << " " << (x) << endl
#define ci cin
#define co cout
#define en endl
#define ln cout << '\n'
#define pb push_back
#define fi first
#define se second
#define MOD 1000000007
typedef long long int llint;
typedef pair<int, int> pii;
typedef pair<llint, llint> pll;
typedef vector<int> vi;
typedef vector<llint> vl;
typedef vector<pii> vii;
typedef vector<pll> vll;
int n, a, b, c, d;
string s;
int main() {
ci >> n >> a >> b >> c >> d;
ci >> s;
a--;
b--;
c--;
d--;
s += "###";
bool flg = true;
if (c < d) {
rep(i, b + 1, d) if (s[i] == '#' && s[i + 1] == '#') flg = false;
rep(i, a + 1, c) if (s[i] == '#' && s[i + 1] == '#') flg = false;
} else {
rep(i, a + 1, c) if (s[i] == '#' && s[i + 1] == '#') flg = false;
bool ch = false;
rep(i, b - 1, d) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.')
ch = true;
}
flg = (flg & ch);
}
co << (flg ? "Yes" : "No") << en;
return 0;
}
| [
"call.arguments.change",
"call.arguments.add"
] | 836,994 | 836,993 | u966921248 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (a); i > (b); i--)
#define sq(x) ((x) * (x))
#define bit(x) bitset<32>(x)
#define vsort(v) sort(v.begin(), v.end())
#define rvsort(v) sort(v.begin(), v.end(), greater<llint>())
#define debug(x) cout << #x << " " << (x) << endl
#define ci cin
#define co cout
#define en endl
#define ln cout << '\n'
#define pb push_back
#define fi first
#define se second
#define MOD 1000000007
typedef long long int llint;
typedef pair<int, int> pii;
typedef pair<llint, llint> pll;
typedef vector<int> vi;
typedef vector<llint> vl;
typedef vector<pii> vii;
typedef vector<pll> vll;
int n, a, b, c, d;
string s;
int main() {
ci >> n >> a >> b >> c >> d;
ci >> s;
a--;
b--;
c--;
d--;
s += "###";
bool flg = true;
if (c < d) {
rep(i, b + 1, d) if (s[i] == '#' && s[i + 1] == '#') flg = false;
rep(i, a + 1, c) if (s[i] == '#' && s[i + 1] == '#') flg = false;
} else {
rep(i, a + 1, c) if (s[i] == '#' && s[i + 1] == '#') flg = false;
bool ch = false;
rep(i, b, d) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.')
ch = true;
}
flg = (flg & ch);
}
co << (flg ? "Yes" : "No") << en;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (a); i > (b); i--)
#define sq(x) ((x) * (x))
#define bit(x) bitset<32>(x)
#define vsort(v) sort(v.begin(), v.end())
#define rvsort(v) sort(v.begin(), v.end(), greater<llint>())
#define debug(x) cout << #x << " " << (x) << endl
#define ci cin
#define co cout
#define en endl
#define ln cout << '\n'
#define pb push_back
#define fi first
#define se second
#define MOD 1000000007
typedef long long int llint;
typedef pair<int, int> pii;
typedef pair<llint, llint> pll;
typedef vector<int> vi;
typedef vector<llint> vl;
typedef vector<pii> vii;
typedef vector<pll> vll;
int n, a, b, c, d;
string s;
int main() {
ci >> n >> a >> b >> c >> d;
ci >> s;
a--;
b--;
c--;
d--;
s += "###";
bool flg = true;
if (c < d) {
rep(i, b + 1, d) if (s[i] == '#' && s[i + 1] == '#') flg = false;
rep(i, a + 1, c) if (s[i] == '#' && s[i + 1] == '#') flg = false;
} else {
rep(i, a + 1, c) if (s[i] == '#' && s[i + 1] == '#') flg = false;
bool ch = false;
rep(i, b - 1, d) {
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.')
ch = true;
}
flg = (flg & ch);
}
co << (flg ? "Yes" : "No") << en;
return 0;
}
| [
"expression.operation.binary.add"
] | 836,995 | 836,993 | u966921248 | cpp |
p03017 | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <limits.h>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
typedef long long LL;
const int N = 2e5 + 10;
int n, a, b, c, d;
char s[N];
bool check(int a, int b) {
for (int i = a + 2; i < b; i++) {
if (s[i] == '#' && s[i - 1] == '#') {
return 0;
}
}
return 1;
}
bool solve() {
if (check(a, c) && check(b, d)) {
if (a < b && b < d && d < c) {
// printf("gougou\n");
for (int i = b; i <= d; i++) {
if (s[i] == '.' && s[i - 1] == '.' && s[i + 1] == '.')
return 1;
}
return 0;
}
return 1;
}
return 0;
}
int main() {
scanf("%d %d %d %d %d %s", &n, &a, &b, &c, &d, s);
printf("%s\n", solve() ? "Yes" : "No");
} | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <limits.h>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
typedef long long LL;
const int N = 2e5 + 10;
int n, a, b, c, d;
char s[N];
bool check(int a, int b) {
for (int i = a + 2; i < b; i++) {
if (s[i] == '#' && s[i - 1] == '#') {
return 0;
}
}
return 1;
}
bool solve() {
if (check(a, c) && check(b, d)) {
if (a < b && b < d && d < c) {
// printf("gougou\n");
for (int i = b; i <= d; i++) {
if (s[i] == '.' && s[i - 1] == '.' && s[i + 1] == '.')
return 1;
}
return 0;
}
return 1;
}
return 0;
}
int main() {
scanf("%d %d %d %d %d %s", &n, &a, &b, &c, &d, s + 1);
printf("%s\n", solve() ? "Yes" : "No");
} | [
"expression.operation.binary.add"
] | 836,996 | 836,997 | u209921913 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, nn) for (int i = 0; i < nn; i++)
#define MOD 1000000007
typedef long long ll;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
} else {
return 0;
}
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
} else {
return 0;
}
}
template <class T> inline T GCD(T a, T b) {
T c;
while (b != 0) {
c = a % b;
a = b;
b = c;
}
return a;
}
template <class T> inline T LCM(T a, T b) { return a * b / GCD(a, b); }
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
bool ans = 1;
for (int i = a - 1; i < max(c, d) - 2; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
ans = 0;
}
}
bool z = 0;
if (c < d) {
} else {
for (int i = max(a, b) - 2; i < d - 3; i++) {
if (i < 0) {
continue;
}
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
z = 1;
}
}
if (!z) {
ans = 0;
}
}
if (ans) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, nn) for (int i = 0; i < nn; i++)
#define MOD 1000000007
typedef long long ll;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
} else {
return 0;
}
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
} else {
return 0;
}
}
template <class T> inline T GCD(T a, T b) {
T c;
while (b != 0) {
c = a % b;
a = b;
b = c;
}
return a;
}
template <class T> inline T LCM(T a, T b) { return a * b / GCD(a, b); }
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
bool ans = 1;
for (int i = a - 1; i < max(c, d) - 2; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
ans = 0;
}
}
bool z = 0;
if (c < d) {
} else {
for (int i = max(a, b) - 2; i < d - 1; i++) {
if (i < 0) {
continue;
}
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
z = 1;
}
}
if (!z) {
ans = 0;
}
}
if (ans) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 836,998 | 836,999 | u962104148 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, nn) for (int i = 0; i < nn; i++)
#define MOD 1000000007
typedef long long ll;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
} else {
return 0;
}
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
} else {
return 0;
}
}
template <class T> inline T GCD(T a, T b) {
T c;
while (b != 0) {
c = a % b;
a = b;
b = c;
}
return a;
}
template <class T> inline T LCM(T a, T b) { return a * b / GCD(a, b); }
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
bool ans = 1;
for (int i = a - 1; i < max(c, d) - 2; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
ans = 0;
}
}
bool z = 0;
if (c < d) {
} else {
for (int i = max(a, b) - 2; i < d - 2; i++) {
if (i < 0) {
continue;
}
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
z = 1;
}
}
if (!z) {
ans = 0;
}
}
if (ans) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, nn) for (int i = 0; i < nn; i++)
#define MOD 1000000007
typedef long long ll;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
} else {
return 0;
}
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
} else {
return 0;
}
}
template <class T> inline T GCD(T a, T b) {
T c;
while (b != 0) {
c = a % b;
a = b;
b = c;
}
return a;
}
template <class T> inline T LCM(T a, T b) { return a * b / GCD(a, b); }
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
bool ans = 1;
for (int i = a - 1; i < max(c, d) - 2; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
ans = 0;
}
}
bool z = 0;
if (c < d) {
} else {
for (int i = max(a, b) - 2; i < d - 1; i++) {
if (i < 0) {
continue;
}
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
z = 1;
}
}
if (!z) {
ans = 0;
}
}
if (ans) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 837,000 | 836,999 | u962104148 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, nn) for (int i = 0; i < nn; i++)
#define MOD 1000000007
typedef long long ll;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
} else {
return 0;
}
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
} else {
return 0;
}
}
template <class T> inline T GCD(T a, T b) {
T c;
while (b != 0) {
c = a % b;
a = b;
b = c;
}
return a;
}
template <class T> inline T LCM(T a, T b) { return a * b / GCD(a, b); }
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
bool ans = 1;
for (int i = a - 1; i < max(c, d) - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
ans = 0;
}
}
bool z = 0;
if (c < d) {
} else {
for (int i = max(a, b) - 2; i < d - 2; i++) {
if (i < 0) {
continue;
}
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
z = 1;
}
}
if (!z) {
ans = 0;
}
}
if (ans) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, nn) for (int i = 0; i < nn; i++)
#define MOD 1000000007
typedef long long ll;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
} else {
return 0;
}
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
} else {
return 0;
}
}
template <class T> inline T GCD(T a, T b) {
T c;
while (b != 0) {
c = a % b;
a = b;
b = c;
}
return a;
}
template <class T> inline T LCM(T a, T b) { return a * b / GCD(a, b); }
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
bool ans = 1;
for (int i = a - 1; i < max(c, d) - 2; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
ans = 0;
}
}
bool z = 0;
if (c < d) {
} else {
for (int i = max(a, b) - 2; i < d - 1; i++) {
if (i < 0) {
continue;
}
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
z = 1;
}
}
if (!z) {
ans = 0;
}
}
if (ans) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | [
"literal.number.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change",
"control_flow.branch.if.condition.change"
] | 837,001 | 836,999 | u962104148 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, nn) for (int i = 0; i < nn; i++)
#define MOD 1000000007
typedef long long ll;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
} else {
return 0;
}
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
} else {
return 0;
}
}
template <class T> inline T GCD(T a, T b) {
T c;
while (b != 0) {
c = a % b;
a = b;
b = c;
}
return a;
}
template <class T> inline T LCM(T a, T b) { return a * b / GCD(a, b); }
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
bool ans = 1;
for (int i = a - 1; i < max(c, d) - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
ans = 0;
}
}
bool z = 0;
if (c < d) {
} else {
for (int i = min(a, b) - 2; i < c - 2; i++) {
if (i < 0) {
continue;
}
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
z = 1;
}
}
if (!z) {
ans = 0;
}
}
if (ans) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, nn) for (int i = 0; i < nn; i++)
#define MOD 1000000007
typedef long long ll;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
} else {
return 0;
}
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
} else {
return 0;
}
}
template <class T> inline T GCD(T a, T b) {
T c;
while (b != 0) {
c = a % b;
a = b;
b = c;
}
return a;
}
template <class T> inline T LCM(T a, T b) { return a * b / GCD(a, b); }
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
bool ans = 1;
for (int i = a - 1; i < max(c, d) - 2; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
ans = 0;
}
}
bool z = 0;
if (c < d) {
} else {
for (int i = max(a, b) - 2; i < d - 1; i++) {
if (i < 0) {
continue;
}
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
z = 1;
}
}
if (!z) {
ans = 0;
}
}
if (ans) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | [
"literal.number.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change",
"misc.opposites",
"identifier.change",
"call.function.change",
"control_flow.loop.for.initializer.change",
"control_flow.branch.if.condition.change"
] | 837,002 | 836,999 | u962104148 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, nn) for (int i = 0; i < nn; i++)
#define MOD 1000000007
typedef long long ll;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
} else {
return 0;
}
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
} else {
return 0;
}
}
template <class T> inline T GCD(T a, T b) {
T c;
while (b != 0) {
c = a % b;
a = b;
b = c;
}
return a;
}
template <class T> inline T LCM(T a, T b) { return a * b / GCD(a, b); }
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
bool ans = 1;
for (int i = a - 1; i < min(c, d) - 1; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
ans = 0;
}
}
bool z = 0;
if (c < d) {
} else {
for (int i = max(a, b) - 2; i < c - 2; i++) {
if (i < 0) {
continue;
}
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
z = 1;
}
}
if (!z) {
ans = 0;
}
}
if (ans) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, nn) for (int i = 0; i < nn; i++)
#define MOD 1000000007
typedef long long ll;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
} else {
return 0;
}
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
} else {
return 0;
}
}
template <class T> inline T GCD(T a, T b) {
T c;
while (b != 0) {
c = a % b;
a = b;
b = c;
}
return a;
}
template <class T> inline T LCM(T a, T b) { return a * b / GCD(a, b); }
int main() {
int n, a, b, c, d;
cin >> n >> a >> b >> c >> d;
string s;
cin >> s;
bool ans = 1;
for (int i = a - 1; i < max(c, d) - 2; i++) {
if (s[i] == '#' && s[i + 1] == '#') {
ans = 0;
}
}
bool z = 0;
if (c < d) {
} else {
for (int i = max(a, b) - 2; i < d - 1; i++) {
if (i < 0) {
continue;
}
if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
z = 1;
}
}
if (!z) {
ans = 0;
}
}
if (ans) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | [
"misc.opposites",
"identifier.change",
"call.function.change",
"control_flow.loop.for.condition.change",
"expression.operation.binary.change",
"literal.number.change",
"expression.off_by_one",
"control_flow.branch.if.condition.change"
] | 837,003 | 836,999 | u962104148 | cpp |
p03017 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i, x, n) for (int i = x; i < (int)(n); ++i)
int const N = 200000;
char s[N + 2];
void no() {
printf("No\n");
exit(0);
}
int main() {
int n, a, b, c, d;
scanf("%d%d%d%d%d%s", &n, &a, &b, &c, &d, s + 1);
f(i, a, c) if (s[i] == '#' && s[i - 1] == '#') no();
f(i, b, d) if (s[i] == '#' && s[i - 1] == '#') no();
if (c > d) {
bool ok = false;
f(i, b + 1, d + 2) if (s[i] == '.' && s[i - 1] == '.' && s[i - 2] == '.') {
ok = true;
break;
}
if (!ok)
no();
}
printf("YES\n");
} | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i, x, n) for (int i = x; i < (int)(n); ++i)
int const N = 200000;
char s[N + 2];
void no() {
printf("No\n");
exit(0);
}
int main() {
int n, a, b, c, d;
scanf("%d%d%d%d%d%s", &n, &a, &b, &c, &d, s + 1);
f(i, a, c) if (s[i] == '#' && s[i - 1] == '#') no();
f(i, b, d) if (s[i] == '#' && s[i - 1] == '#') no();
if (c > d) {
bool ok = false;
f(i, b + 1, d + 2) if (s[i] == '.' && s[i - 1] == '.' && s[i - 2] == '.') {
ok = true;
break;
}
if (!ok)
no();
}
printf("Yes\n");
} | [
"literal.string.change",
"literal.string.case.change",
"call.arguments.change",
"io.output.change"
] | 837,010 | 837,011 | u647100698 | cpp |
p03027 | #include <bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(), x.end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#define debug(v) \
cout << #v << ":"; \
for (auto x : v) { \
cout << x << ' '; \
} \
cout << endl;
#define mod 1000003
using ll = long long;
const int INF = 1000000000;
const ll LINF = 1001002003004005006ll;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
// ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return true;
}
return false;
}
struct IOSetup {
IOSetup() {
cin.tie(0);
ios::sync_with_stdio(0);
cout << fixed << setprecision(12);
}
} iosetup;
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
os << p.first << " " << p.second;
return os;
}
template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) {
for (int i = 0; i < (int)v.size(); i++)
os << v[i] << (i + 1 == v.size() ? "" : " ");
return os;
}
template <ll Mod> struct ModInt {
long long x;
ModInt() : x(0) {}
ModInt(long long y) : x(y >= 0 ? y % Mod : (Mod - (-y) % Mod) % Mod) {}
ModInt &operator+=(const ModInt &p) {
if ((x += p.x) >= Mod)
x -= Mod;
return *this;
}
ModInt &operator-=(const ModInt &p) {
if ((x += Mod - p.x) >= Mod)
x -= Mod;
return *this;
}
ModInt &operator*=(const ModInt &p) {
x = (int)(1ll * x * p.x % Mod);
return *this;
}
ModInt &operator/=(const ModInt &p) {
(*this) *= p.inverse();
return *this;
}
ModInt operator-() const { return ModInt(x); }
ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }
ModInt operator==(const ModInt &p) const { return x == p.x; }
ModInt operator!=(const ModInt &p) const { return x != p.x; }
ModInt inverse() const {
int a = x, b = Mod, u = 1, v = 0, t;
while (b > 0) {
t = a / b;
swap(a -= t * b, b);
swap(u -= t * v, v);
}
return ModInt(u);
}
ModInt pow(long long n) const {
ModInt ret(1), mul(x);
while (n > 0) {
if (n & 1)
ret *= mul;
mul *= mul;
n >>= 1;
}
return ret;
}
friend ostream &operator<<(ostream &os, const ModInt &p) { return os << p.x; }
friend istream &operator>>(istream &is, ModInt &a) {
long long t;
is >> t;
a = ModInt<Mod>(t);
return (is);
}
static int get_mod() { return Mod; }
};
using mint = ModInt<mod>;
template <int MAX> struct comcalc {
vector<mint> fact, finv, inv;
comcalc() : fact(MAX), finv(MAX), inv(MAX) {
fact[0] = mint(1), fact[1] = mint(1), finv[0] = mint(1), finv[1] = mint(1),
inv[1] = mint(1);
for (int i = 2; i < MAX; i++) {
fact[i] = fact[i - 1] * mint(i);
inv[i] = mint(0) - inv[mod % i] * (mint(mod / i));
finv[i] = finv[i - 1] * inv[i];
}
}
mint com(int n, int k) {
if (n < k)
return mint(0);
if (n < 0 or k < 0)
return mint(0);
return fact[n] * (finv[k] * finv[n - k]);
}
mint fac(int n) { return fact[n]; }
// ้่ค็ตใฟๅใใ:n็จฎ้กใฎ็ฉใใ้่คใ่จฑใ๏ผkๅ้ธใถ
mint nHk(int n, int k) { return com(n + k - 1, k); }
// ็nๅบๅฅ๏ผ็ฎฑkๅบๅฅ๏ผๅ็ฎฑ1ๅไปฅไธO(k)
mint F12_dis_dis_one(int n, int k) {
mint ret = 1;
for (int i = 0; i <= k; i++) {
mint add = com(k, i) * (mint(i).pow(n));
if ((k - i) % 2)
ret -= add;
else
ret += add;
}
return ret;
}
};
mint pow_mod(mint x, ll n) { return x.pow(n); }
mint inv_mod(mint x) { return x.inverse(); }
// O(n)
mint fact_mod(ll n) {
mint ret = 1;
for (int i = 2; i <= n; i++)
ret *= mint(i);
return ret;
}
// O(r)
mint comb_mod(ll n, ll r) {
if (r > n - r)
r = n - r;
if (r == 0)
return 1;
mint a = 1, b = mint(fact_mod(r)).inverse();
for (int i = 0; i < r; i++)
a *= mint(n - i);
return a * b;
}
const int MAX = 20000000;
using cominit = comcalc<MAX>;
signed main() {
cominit F;
int q;
cin >> q;
for (; q--;) {
int x, d, n;
cin >> x >> d >> n;
if (d % mod == 0) {
cout << mint(x).pow(n);
continue;
}
if (n >= mod) {
cout << 0 << endl;
continue;
}
mint t = mint(x) * mint(d).inverse();
mint ans = mint(d).pow(n) * F.fac(t.x + n - 1) * F.fac(t.x - 1).inverse();
cout << ans << endl;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(), x.end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#define debug(v) \
cout << #v << ":"; \
for (auto x : v) { \
cout << x << ' '; \
} \
cout << endl;
#define mod 1000003
using ll = long long;
const int INF = 1000000000;
const ll LINF = 1001002003004005006ll;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
// ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return true;
}
return false;
}
struct IOSetup {
IOSetup() {
cin.tie(0);
ios::sync_with_stdio(0);
cout << fixed << setprecision(12);
}
} iosetup;
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
os << p.first << " " << p.second;
return os;
}
template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) {
for (int i = 0; i < (int)v.size(); i++)
os << v[i] << (i + 1 == v.size() ? "" : " ");
return os;
}
template <ll Mod> struct ModInt {
long long x;
ModInt() : x(0) {}
ModInt(long long y) : x(y >= 0 ? y % Mod : (Mod - (-y) % Mod) % Mod) {}
ModInt &operator+=(const ModInt &p) {
if ((x += p.x) >= Mod)
x -= Mod;
return *this;
}
ModInt &operator-=(const ModInt &p) {
if ((x += Mod - p.x) >= Mod)
x -= Mod;
return *this;
}
ModInt &operator*=(const ModInt &p) {
x = (int)(1ll * x * p.x % Mod);
return *this;
}
ModInt &operator/=(const ModInt &p) {
(*this) *= p.inverse();
return *this;
}
ModInt operator-() const { return ModInt(x); }
ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }
ModInt operator==(const ModInt &p) const { return x == p.x; }
ModInt operator!=(const ModInt &p) const { return x != p.x; }
ModInt inverse() const {
int a = x, b = Mod, u = 1, v = 0, t;
while (b > 0) {
t = a / b;
swap(a -= t * b, b);
swap(u -= t * v, v);
}
return ModInt(u);
}
ModInt pow(long long n) const {
ModInt ret(1), mul(x);
while (n > 0) {
if (n & 1)
ret *= mul;
mul *= mul;
n >>= 1;
}
return ret;
}
friend ostream &operator<<(ostream &os, const ModInt &p) { return os << p.x; }
friend istream &operator>>(istream &is, ModInt &a) {
long long t;
is >> t;
a = ModInt<Mod>(t);
return (is);
}
static int get_mod() { return Mod; }
};
using mint = ModInt<mod>;
template <int MAX> struct comcalc {
vector<mint> fact, finv, inv;
comcalc() : fact(MAX), finv(MAX), inv(MAX) {
fact[0] = mint(1), fact[1] = mint(1), finv[0] = mint(1), finv[1] = mint(1),
inv[1] = mint(1);
for (int i = 2; i < MAX; i++) {
fact[i] = fact[i - 1] * mint(i);
inv[i] = mint(0) - inv[mod % i] * (mint(mod / i));
finv[i] = finv[i - 1] * inv[i];
}
}
mint com(int n, int k) {
if (n < k)
return mint(0);
if (n < 0 or k < 0)
return mint(0);
return fact[n] * (finv[k] * finv[n - k]);
}
mint fac(int n) { return fact[n]; }
// ้่ค็ตใฟๅใใ:n็จฎ้กใฎ็ฉใใ้่คใ่จฑใ๏ผkๅ้ธใถ
mint nHk(int n, int k) { return com(n + k - 1, k); }
// ็nๅบๅฅ๏ผ็ฎฑkๅบๅฅ๏ผๅ็ฎฑ1ๅไปฅไธO(k)
mint F12_dis_dis_one(int n, int k) {
mint ret = 1;
for (int i = 0; i <= k; i++) {
mint add = com(k, i) * (mint(i).pow(n));
if ((k - i) % 2)
ret -= add;
else
ret += add;
}
return ret;
}
};
mint pow_mod(mint x, ll n) { return x.pow(n); }
mint inv_mod(mint x) { return x.inverse(); }
// O(n)
mint fact_mod(ll n) {
mint ret = 1;
for (int i = 2; i <= n; i++)
ret *= mint(i);
return ret;
}
// O(r)
mint comb_mod(ll n, ll r) {
if (r > n - r)
r = n - r;
if (r == 0)
return 1;
mint a = 1, b = mint(fact_mod(r)).inverse();
for (int i = 0; i < r; i++)
a *= mint(n - i);
return a * b;
}
const int MAX = 20000000;
using cominit = comcalc<MAX>;
signed main() {
cominit F;
int q;
cin >> q;
for (; q--;) {
int x, d, n;
cin >> x >> d >> n;
if (d % mod == 0) {
cout << mint(x).pow(n) << endl;
continue;
}
if (n >= mod) {
cout << 0 << endl;
continue;
}
mint t = mint(x) * mint(d).inverse();
mint ans = mint(d).pow(n) * F.fac(t.x + n - 1) * F.fac(t.x - 1).inverse();
cout << ans << endl;
}
return 0;
}
/*
t=x/d
x*(x+d)*(x+2d)*...*(x+(n-1)d)
=d^n*(t*(t+1)*(t+2)...(t+n-1)) ...(1)
=d^n*((t+n-1)!/(t-1)!)
ใใฎๅผๅคๅฝขใใใฃใฆใใใฎใ็ด่ฆณ็ใซๅใใใชใใชใใงใใ๏ผ
(1)ๅผ=d^n*(...(t-1)*t*(t+1)*(t+2)...(t+n-1))/(...*(t-1))
ใจๅผๅคๅฝขใใๅพใซ๏ผๅฅใซ...ใฎๅใซใใใใงใๅๆฏๅๆใซๆฐใใใใฆใใใใฎใง๏ผใใใt=x/d
mod 1000003ใฎ modใจใฃใ่กจ็พใฎๅๆฐๅ็ฝฎใใฆใๆงใใใใใญ๏ผใจใใๆฐๆใกใงใใใญ๏ผ
่งฃ่ชฌใจใใงใใพใใซๅฝใใๅใซไฝฟใฃใฆใใฆใณใฃใใใใฆใใพใฃใ๏ผใใใช็ด่ฆณ็ใใใชใใจๆใฃใ
*/
| [
"io.output.newline.add"
] | 837,248 | 837,249 | u022832318 | cpp |
p03027 | #include <bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(), x.end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#define debug(v) \
cout << #v << ":"; \
for (auto x : v) { \
cout << x << ' '; \
} \
cout << endl;
#define mod 1000003
using ll = long long;
const int INF = 1000000000;
const ll LINF = 1001002003004005006ll;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
// ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return true;
}
return false;
}
struct IOSetup {
IOSetup() {
cin.tie(0);
ios::sync_with_stdio(0);
cout << fixed << setprecision(12);
}
} iosetup;
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
os << p.first << " " << p.second;
return os;
}
template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) {
for (int i = 0; i < (int)v.size(); i++)
os << v[i] << (i + 1 == v.size() ? "" : " ");
return os;
}
template <ll Mod> struct ModInt {
long long x;
ModInt() : x(0) {}
ModInt(long long y) : x(y >= 0 ? y % Mod : (Mod - (-y) % Mod) % Mod) {}
ModInt &operator+=(const ModInt &p) {
if ((x += p.x) >= Mod)
x -= Mod;
return *this;
}
ModInt &operator-=(const ModInt &p) {
if ((x += Mod - p.x) >= Mod)
x -= Mod;
return *this;
}
ModInt &operator*=(const ModInt &p) {
x = (int)(1ll * x * p.x % Mod);
return *this;
}
ModInt &operator/=(const ModInt &p) {
(*this) *= p.inverse();
return *this;
}
ModInt operator-() const { return ModInt(x); }
ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }
ModInt operator==(const ModInt &p) const { return x == p.x; }
ModInt operator!=(const ModInt &p) const { return x != p.x; }
ModInt inverse() const {
int a = x, b = Mod, u = 1, v = 0, t;
while (b > 0) {
t = a / b;
swap(a -= t * b, b);
swap(u -= t * v, v);
}
return ModInt(u);
}
ModInt pow(long long n) const {
ModInt ret(1), mul(x);
while (n > 0) {
if (n & 1)
ret *= mul;
mul *= mul;
n >>= 1;
}
return ret;
}
friend ostream &operator<<(ostream &os, const ModInt &p) { return os << p.x; }
friend istream &operator>>(istream &is, ModInt &a) {
long long t;
is >> t;
a = ModInt<Mod>(t);
return (is);
}
static int get_mod() { return Mod; }
};
using mint = ModInt<mod>;
template <int MAX> struct comcalc {
vector<mint> fact, finv, inv;
comcalc() : fact(MAX), finv(MAX), inv(MAX) {
fact[0] = mint(1), fact[1] = mint(1), finv[0] = mint(1), finv[1] = mint(1),
inv[1] = mint(1);
for (int i = 2; i < MAX; i++) {
fact[i] = fact[i - 1] * mint(i);
inv[i] = mint(0) - inv[mod % i] * (mint(mod / i));
finv[i] = finv[i - 1] * inv[i];
}
}
mint com(int n, int k) {
if (n < k)
return mint(0);
if (n < 0 or k < 0)
return mint(0);
return fact[n] * (finv[k] * finv[n - k]);
}
mint fac(int n) { return fact[n]; }
// ้่ค็ตใฟๅใใ:n็จฎ้กใฎ็ฉใใ้่คใ่จฑใ๏ผkๅ้ธใถ
mint nHk(int n, int k) { return com(n + k - 1, k); }
// ็nๅบๅฅ๏ผ็ฎฑkๅบๅฅ๏ผๅ็ฎฑ1ๅไปฅไธO(k)
mint F12_dis_dis_one(int n, int k) {
mint ret = 1;
for (int i = 0; i <= k; i++) {
mint add = com(k, i) * (mint(i).pow(n));
if ((k - i) % 2)
ret -= add;
else
ret += add;
}
return ret;
}
};
mint pow_mod(mint x, ll n) { return x.pow(n); }
mint inv_mod(mint x) { return x.inverse(); }
// O(n)
mint fact_mod(ll n) {
mint ret = 1;
for (int i = 2; i <= n; i++)
ret *= mint(i);
return ret;
}
// O(r)
mint comb_mod(ll n, ll r) {
if (r > n - r)
r = n - r;
if (r == 0)
return 1;
mint a = 1, b = mint(fact_mod(r)).inverse();
for (int i = 0; i < r; i++)
a *= mint(n - i);
return a * b;
}
const int MAX = 20000000;
using cominit = comcalc<MAX>;
signed main() {
cominit F;
int q;
cin >> q;
for (; q--;) {
int x, d, n;
cin >> x >> d >> n;
if (d % mod == 0) {
cout << mint(x).pow(n);
continue;
}
if (n >= mod) {
cout << 0 << endl;
continue;
}
mint t = mint(x) * mint(d).inverse();
mint ans = mint(d).pow(n) * F.fac(t.x + n - 1) * F.fac(t.x - 1).inverse();
cout << ans << endl;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(), x.end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#define debug(v) \
cout << #v << ":"; \
for (auto x : v) { \
cout << x << ' '; \
} \
cout << endl;
#define mod 1000003
using ll = long long;
const int INF = 1000000000;
const ll LINF = 1001002003004005006ll;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
// ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return true;
}
return false;
}
struct IOSetup {
IOSetup() {
cin.tie(0);
ios::sync_with_stdio(0);
cout << fixed << setprecision(12);
}
} iosetup;
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
os << p.first << " " << p.second;
return os;
}
template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) {
for (int i = 0; i < (int)v.size(); i++)
os << v[i] << (i + 1 == v.size() ? "" : " ");
return os;
}
template <ll Mod> struct ModInt {
long long x;
ModInt() : x(0) {}
ModInt(long long y) : x(y >= 0 ? y % Mod : (Mod - (-y) % Mod) % Mod) {}
ModInt &operator+=(const ModInt &p) {
if ((x += p.x) >= Mod)
x -= Mod;
return *this;
}
ModInt &operator-=(const ModInt &p) {
if ((x += Mod - p.x) >= Mod)
x -= Mod;
return *this;
}
ModInt &operator*=(const ModInt &p) {
x = (int)(1ll * x * p.x % Mod);
return *this;
}
ModInt &operator/=(const ModInt &p) {
(*this) *= p.inverse();
return *this;
}
ModInt operator-() const { return ModInt(x); }
ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }
ModInt operator==(const ModInt &p) const { return x == p.x; }
ModInt operator!=(const ModInt &p) const { return x != p.x; }
ModInt inverse() const {
int a = x, b = Mod, u = 1, v = 0, t;
while (b > 0) {
t = a / b;
swap(a -= t * b, b);
swap(u -= t * v, v);
}
return ModInt(u);
}
ModInt pow(long long n) const {
ModInt ret(1), mul(x);
while (n > 0) {
if (n & 1)
ret *= mul;
mul *= mul;
n >>= 1;
}
return ret;
}
friend ostream &operator<<(ostream &os, const ModInt &p) { return os << p.x; }
friend istream &operator>>(istream &is, ModInt &a) {
long long t;
is >> t;
a = ModInt<Mod>(t);
return (is);
}
static int get_mod() { return Mod; }
};
using mint = ModInt<mod>;
template <int MAX> struct comcalc {
vector<mint> fact, finv, inv;
comcalc() : fact(MAX), finv(MAX), inv(MAX) {
fact[0] = mint(1), fact[1] = mint(1), finv[0] = mint(1), finv[1] = mint(1),
inv[1] = mint(1);
for (int i = 2; i < MAX; i++) {
fact[i] = fact[i - 1] * mint(i);
inv[i] = mint(0) - inv[mod % i] * (mint(mod / i));
finv[i] = finv[i - 1] * inv[i];
}
}
mint com(int n, int k) {
if (n < k)
return mint(0);
if (n < 0 or k < 0)
return mint(0);
return fact[n] * (finv[k] * finv[n - k]);
}
mint fac(int n) { return fact[n]; }
// ้่ค็ตใฟๅใใ:n็จฎ้กใฎ็ฉใใ้่คใ่จฑใ๏ผkๅ้ธใถ
mint nHk(int n, int k) { return com(n + k - 1, k); }
// ็nๅบๅฅ๏ผ็ฎฑkๅบๅฅ๏ผๅ็ฎฑ1ๅไปฅไธO(k)
mint F12_dis_dis_one(int n, int k) {
mint ret = 1;
for (int i = 0; i <= k; i++) {
mint add = com(k, i) * (mint(i).pow(n));
if ((k - i) % 2)
ret -= add;
else
ret += add;
}
return ret;
}
};
mint pow_mod(mint x, ll n) { return x.pow(n); }
mint inv_mod(mint x) { return x.inverse(); }
// O(n)
mint fact_mod(ll n) {
mint ret = 1;
for (int i = 2; i <= n; i++)
ret *= mint(i);
return ret;
}
// O(r)
mint comb_mod(ll n, ll r) {
if (r > n - r)
r = n - r;
if (r == 0)
return 1;
mint a = 1, b = mint(fact_mod(r)).inverse();
for (int i = 0; i < r; i++)
a *= mint(n - i);
return a * b;
}
const int MAX = 20000000;
using cominit = comcalc<MAX>;
signed main() {
cominit F;
int q;
cin >> q;
for (; q--;) {
int x, d, n;
cin >> x >> d >> n;
if (d % mod == 0) {
cout << mint(x).pow(n) << endl;
continue;
}
if (n >= mod) {
cout << 0 << endl;
continue;
}
mint t = mint(x) * mint(d).inverse();
mint ans = mint(d).pow(n) * F.fac(t.x + n - 1) * F.fac(t.x - 1).inverse();
cout << ans << endl;
}
return 0;
}
| [
"io.output.newline.add"
] | 837,248 | 837,250 | u022832318 | cpp |
p03027 | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define boost \
ios::sync_with_stdio(false); \
cin.tie(nullptr)
#define pi pair<int, int>
#define ff first
#define ss second
#include "string"
const int N = 2000006;
const int M = 1000003;
int mod(int m, int mod = M) {
m %= mod;
return (m + mod) % mod;
}
int power(int x, int y) {
int res = 1;
x = mod(x);
while (y > 0) {
if (y & 1)
res = mod(res * x);
y = y / 2;
x = mod(x * x);
}
return mod(res);
}
int f[N], invf[N];
void fact() {
f[0] = f[1] = 1;
for (int i = 2; i < N; i++)
f[i] = mod(f[i - 1] * i);
invf[N - 1] = power(f[N - 1], M - 2);
for (int i = N - 1; i > 0; i--)
invf[i - 1] = mod(invf[i] * i);
}
int nCr(int n, int r) {
if (r > n)
return 0;
int ans = f[n];
ans = mod(ans * invf[n - r]);
ans = mod(ans * invf[r]);
return ans;
}
int nPr(int n, int r) {
if (r > n)
return 0;
int ans = f[n];
ans = mod(ans * invf[n - r]);
return ans;
}
int32_t main() {
boost;
fact();
int t;
cin >> t;
while (t--) {
int x, d, n;
cin >> x >> d >> n;
if (x == 0) {
cout << 0 << endl;
continue;
} else if (d == 0) {
cout << power(x, n) << endl;
continue;
}
int l = mod(x * power(d, M - 2));
int r = l + n - 1;
int tt = (r / M) * M;
if (tt >= l && tt <= r)
cout << 0 << endl;
else {
int ans = mod(f[r] * invf[l - 1]);
ans = mod(ans * power(d, n));
cout << ans << endl;
}
}
}
| #include <bits/stdc++.h>
using namespace std;
#define int long long
#define boost \
ios::sync_with_stdio(false); \
cin.tie(nullptr)
#define pi pair<int, int>
#define ff first
#define ss second
#include "string"
const int N = 1000003;
const int M = 1000003;
int mod(int m, int mod = M) {
m %= mod;
return (m + mod) % mod;
}
int power(int x, int y) {
int res = 1;
x = mod(x);
while (y > 0) {
if (y & 1)
res = mod(res * x);
y = y / 2;
x = mod(x * x);
}
return mod(res);
}
int f[N], invf[N];
void fact() {
f[0] = f[1] = 1;
for (int i = 2; i < N; i++)
f[i] = mod(f[i - 1] * i);
invf[N - 1] = power(f[N - 1], M - 2);
for (int i = N - 1; i > 0; i--)
invf[i - 1] = mod(invf[i] * i);
}
int nCr(int n, int r) {
if (r > n)
return 0;
int ans = f[n];
ans = mod(ans * invf[n - r]);
ans = mod(ans * invf[r]);
return ans;
}
int nPr(int n, int r) {
if (r > n)
return 0;
int ans = f[n];
ans = mod(ans * invf[n - r]);
return ans;
}
int32_t main() {
boost;
fact();
int t;
cin >> t;
while (t--) {
int x, d, n;
cin >> x >> d >> n;
if (x == 0) {
cout << 0 << endl;
continue;
} else if (d == 0) {
cout << power(x, n) << endl;
continue;
}
int l = mod(x * power(d, M - 2));
int r = l + n - 1;
int tt = (r / M) * M;
if (tt >= l && tt <= r)
cout << 0 << endl;
else {
int ans = mod(f[r] * invf[l - 1]);
ans = mod(ans * power(d, n));
cout << ans << endl;
}
}
}
| [
"literal.number.change",
"variable_declaration.value.change"
] | 837,251 | 837,252 | u371555975 | cpp |
p03027 | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <ctime>
#include <deque>
#include <float.h>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;
unsigned euclidean_gcd(unsigned a, unsigned b) {
if (a < b)
return euclidean_gcd(b, a);
unsigned r;
while ((r = a % b)) {
a = b;
b = r;
}
return b;
}
ll ll_gcd(ll a, ll b) {
if (a < b)
return ll_gcd(b, a);
ll r;
while ((r = a % b)) {
a = b;
b = r;
}
return b;
}
struct UnionFind {
vector<ll> par;
vector<ll> siz;
UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL) {
for (ll i = 0; i < sz_; ++i)
par[i] = i;
}
void init(ll sz_) {
par.resize(sz_);
siz.assign(sz_, 1LL);
for (ll i = 0; i < sz_; ++i)
par[i] = i;
}
ll root(ll x) {
while (par[x] != x) {
x = par[x] = par[par[x]];
}
return x;
}
bool merge(ll x, ll y) {
x = root(x);
y = root(y);
if (x == y)
return false;
if (siz[x] < siz[y])
swap(x, y);
siz[x] += siz[y];
par[y] = x;
return true;
}
bool issame(ll x, ll y) { return root(x) == root(y); }
ll size(ll x) { return siz[root(x)]; }
};
long long modpow(long long a, long long n, long long mod) {
long long res = 1;
while (n > 0) {
if (n & 1)
res = res * a % mod;
a = a * a % mod;
n >>= 1;
}
return res;
}
long long modinv(long long a, long long mod) { return modpow(a, mod - 2, mod); }
vector<int> tpsort(vector<vector<int>> &G) {
int V = G.size();
vector<int> sorted_vertices;
queue<int> que;
vector<int> indegree(V);
for (int i = 0; i < V; i++) {
for (int j = 0; j < G[i].size(); j++) {
indegree[G[i][j]]++;
}
}
for (int i = 0; i < V; i++) {
if (indegree[i] == 0) {
que.push(i);
}
}
while (que.empty() == false) {
int v = que.front();
que.pop();
for (int i = 0; i < G[v].size(); i++) {
int u = G[v][i];
indegree[u] -= 1;
if (indegree[u] == 0)
que.push(u);
}
sorted_vertices.push_back(v);
}
return sorted_vertices;
}
struct Point {
double x;
double y;
};
struct LineSegment {
Point start;
Point end;
};
double tenkyori(const LineSegment &line, const Point &point) {
double x0 = point.x, y0 = point.y;
double x1 = line.start.x, y1 = line.start.y;
double x2 = line.end.x, y2 = line.end.y;
double a = x2 - x1;
double b = y2 - y1;
double a2 = a * a;
double b2 = b * b;
double r2 = a2 + b2;
double tt = -(a * (x1 - x0) + b * (y1 - y0));
if (tt < 0)
return sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0));
else if (tt > r2)
return sqrt((x2 - x0) * (x2 - x0) + (y2 - y0) * (y2 - y0));
double f1 = a * (y1 - y0) - b * (x1 - x0);
return sqrt((f1 * f1) / r2);
}
template <typename X> struct SegTree {
using FX = function<X(X, X)>; // XโขX -> X ใจใชใ้ขๆฐใฎๅ
int n;
FX fx;
const X ex;
vector<X> dat;
SegTree(int n_, FX fx_, X ex_) : n(), fx(fx_), ex(ex_), dat(n_ * 4, ex_) {
int x = 1;
while (n_ > x) {
x *= 2;
}
n = x;
}
void set(int i, X x) { dat[i + n - 1] = x; }
void build() {
for (int k = n - 2; k >= 0; k--)
dat[k] = fx(dat[2 * k + 1], dat[2 * k + 2]);
}
void update(int i, X x) {
i += n - 1;
dat[i] = x;
while (i > 0) {
i = (i - 1) / 2; // parent
dat[i] = fx(dat[i * 2 + 1], dat[i * 2 + 2]);
}
}
X query(int a, int b) { return query_sub(a, b, 0, 0, n); }
X query_sub(int a, int b, int k, int l, int r) {
if (r <= a || b <= l) {
return ex;
} else if (a <= l && r <= b) {
return dat[k];
} else {
X vl = query_sub(a, b, k * 2 + 1, l, (l + r) / 2);
X vr = query_sub(a, b, k * 2 + 2, (l + r) / 2, r);
return fx(vl, vr);
}
}
};
template <typename X, typename M> struct SegTreeLazy {
using FX = function<X(X, X)>;
using FA = function<X(X, M)>;
using FM = function<M(M, M)>;
int n;
FX fx;
FA fa;
FM fm;
const X ex;
const M em;
vector<X> dat;
vector<M> lazy;
SegTreeLazy(int n_, FX fx_, FA fa_, FM fm_, X ex_, M em_)
: n(), fx(fx_), fa(fa_), fm(fm_), ex(ex_), em(em_), dat(n_ * 4, ex),
lazy(n_ * 4, em) {
int x = 1;
while (n_ > x)
x *= 2;
n = x;
}
void set(int i, X x) { dat[i + n - 1] = x; }
void build() {
for (int k = n - 2; k >= 0; k--)
dat[k] = fx(dat[2 * k + 1], dat[2 * k + 2]);
}
void eval(int k) {
if (lazy[k] == em)
return;
if (k < n - 1) {
lazy[k * 2 + 1] = fm(lazy[k * 2 + 1], lazy[k]);
lazy[k * 2 + 2] = fm(lazy[k * 2 + 2], lazy[k]);
}
dat[k] = fa(dat[k], lazy[k]);
lazy[k] = em;
}
void update(int a, int b, M x, int k, int l, int r) {
eval(k);
if (a <= l && r <= b) {
lazy[k] = fm(lazy[k], x);
eval(k);
} else if (a < r && l < b) {
update(a, b, x, k * 2 + 1, l, (l + r) / 2);
update(a, b, x, k * 2 + 2, (l + r) / 2, r);
dat[k] = fx(dat[k * 2 + 1], dat[k * 2 + 2]);
}
}
void update(int a, int b, M x) { update(a, b, x, 0, 0, n); }
X query_sub(int a, int b, int k, int l, int r) {
eval(k);
if (r <= a || b <= l) {
return ex;
} else if (a <= l && r <= b) {
return dat[k];
} else {
X vl = query_sub(a, b, k * 2 + 1, l, (l + r) / 2);
X vr = query_sub(a, b, k * 2 + 2, (l + r) / 2, r);
return fx(vl, vr);
}
}
X query(int a, int b) { return query_sub(a, b, 0, 0, n); }
};
int main() {
ll q;
cin >> q;
vector<ll> bik(2002008);
bik[0] = 1;
for (int i = 0; i < 2000104; i++) {
bik[i + 1] = (i + 1) * bik[i] % 1000003;
}
for (int i = 0; i < q; i++) {
ll a, b, c;
cin >> a >> b >> c;
if (b == 0) {
cout << modpow(a, c, 1000003);
continue;
}
if (c > 1000003) {
cout << 0 << endl;
continue;
}
ll d = modinv(b, 1000003) * a % 1000003;
ll ans = bik[d + c - 1] * modinv(bik[d - 1], 1000003) % 1000003 *
modpow(b, c, 1000003) % 1000003;
cout << ans << endl;
}
} | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <ctime>
#include <deque>
#include <float.h>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;
unsigned euclidean_gcd(unsigned a, unsigned b) {
if (a < b)
return euclidean_gcd(b, a);
unsigned r;
while ((r = a % b)) {
a = b;
b = r;
}
return b;
}
ll ll_gcd(ll a, ll b) {
if (a < b)
return ll_gcd(b, a);
ll r;
while ((r = a % b)) {
a = b;
b = r;
}
return b;
}
struct UnionFind {
vector<ll> par;
vector<ll> siz;
UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL) {
for (ll i = 0; i < sz_; ++i)
par[i] = i;
}
void init(ll sz_) {
par.resize(sz_);
siz.assign(sz_, 1LL);
for (ll i = 0; i < sz_; ++i)
par[i] = i;
}
ll root(ll x) {
while (par[x] != x) {
x = par[x] = par[par[x]];
}
return x;
}
bool merge(ll x, ll y) {
x = root(x);
y = root(y);
if (x == y)
return false;
if (siz[x] < siz[y])
swap(x, y);
siz[x] += siz[y];
par[y] = x;
return true;
}
bool issame(ll x, ll y) { return root(x) == root(y); }
ll size(ll x) { return siz[root(x)]; }
};
long long modpow(long long a, long long n, long long mod) {
long long res = 1;
while (n > 0) {
if (n & 1)
res = res * a % mod;
a = a * a % mod;
n >>= 1;
}
return res;
}
long long modinv(long long a, long long mod) { return modpow(a, mod - 2, mod); }
vector<int> tpsort(vector<vector<int>> &G) {
int V = G.size();
vector<int> sorted_vertices;
queue<int> que;
vector<int> indegree(V);
for (int i = 0; i < V; i++) {
for (int j = 0; j < G[i].size(); j++) {
indegree[G[i][j]]++;
}
}
for (int i = 0; i < V; i++) {
if (indegree[i] == 0) {
que.push(i);
}
}
while (que.empty() == false) {
int v = que.front();
que.pop();
for (int i = 0; i < G[v].size(); i++) {
int u = G[v][i];
indegree[u] -= 1;
if (indegree[u] == 0)
que.push(u);
}
sorted_vertices.push_back(v);
}
return sorted_vertices;
}
struct Point {
double x;
double y;
};
struct LineSegment {
Point start;
Point end;
};
double tenkyori(const LineSegment &line, const Point &point) {
double x0 = point.x, y0 = point.y;
double x1 = line.start.x, y1 = line.start.y;
double x2 = line.end.x, y2 = line.end.y;
double a = x2 - x1;
double b = y2 - y1;
double a2 = a * a;
double b2 = b * b;
double r2 = a2 + b2;
double tt = -(a * (x1 - x0) + b * (y1 - y0));
if (tt < 0)
return sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0));
else if (tt > r2)
return sqrt((x2 - x0) * (x2 - x0) + (y2 - y0) * (y2 - y0));
double f1 = a * (y1 - y0) - b * (x1 - x0);
return sqrt((f1 * f1) / r2);
}
template <typename X> struct SegTree {
using FX = function<X(X, X)>; // XโขX -> X ใจใชใ้ขๆฐใฎๅ
int n;
FX fx;
const X ex;
vector<X> dat;
SegTree(int n_, FX fx_, X ex_) : n(), fx(fx_), ex(ex_), dat(n_ * 4, ex_) {
int x = 1;
while (n_ > x) {
x *= 2;
}
n = x;
}
void set(int i, X x) { dat[i + n - 1] = x; }
void build() {
for (int k = n - 2; k >= 0; k--)
dat[k] = fx(dat[2 * k + 1], dat[2 * k + 2]);
}
void update(int i, X x) {
i += n - 1;
dat[i] = x;
while (i > 0) {
i = (i - 1) / 2; // parent
dat[i] = fx(dat[i * 2 + 1], dat[i * 2 + 2]);
}
}
X query(int a, int b) { return query_sub(a, b, 0, 0, n); }
X query_sub(int a, int b, int k, int l, int r) {
if (r <= a || b <= l) {
return ex;
} else if (a <= l && r <= b) {
return dat[k];
} else {
X vl = query_sub(a, b, k * 2 + 1, l, (l + r) / 2);
X vr = query_sub(a, b, k * 2 + 2, (l + r) / 2, r);
return fx(vl, vr);
}
}
};
template <typename X, typename M> struct SegTreeLazy {
using FX = function<X(X, X)>;
using FA = function<X(X, M)>;
using FM = function<M(M, M)>;
int n;
FX fx;
FA fa;
FM fm;
const X ex;
const M em;
vector<X> dat;
vector<M> lazy;
SegTreeLazy(int n_, FX fx_, FA fa_, FM fm_, X ex_, M em_)
: n(), fx(fx_), fa(fa_), fm(fm_), ex(ex_), em(em_), dat(n_ * 4, ex),
lazy(n_ * 4, em) {
int x = 1;
while (n_ > x)
x *= 2;
n = x;
}
void set(int i, X x) { dat[i + n - 1] = x; }
void build() {
for (int k = n - 2; k >= 0; k--)
dat[k] = fx(dat[2 * k + 1], dat[2 * k + 2]);
}
void eval(int k) {
if (lazy[k] == em)
return;
if (k < n - 1) {
lazy[k * 2 + 1] = fm(lazy[k * 2 + 1], lazy[k]);
lazy[k * 2 + 2] = fm(lazy[k * 2 + 2], lazy[k]);
}
dat[k] = fa(dat[k], lazy[k]);
lazy[k] = em;
}
void update(int a, int b, M x, int k, int l, int r) {
eval(k);
if (a <= l && r <= b) {
lazy[k] = fm(lazy[k], x);
eval(k);
} else if (a < r && l < b) {
update(a, b, x, k * 2 + 1, l, (l + r) / 2);
update(a, b, x, k * 2 + 2, (l + r) / 2, r);
dat[k] = fx(dat[k * 2 + 1], dat[k * 2 + 2]);
}
}
void update(int a, int b, M x) { update(a, b, x, 0, 0, n); }
X query_sub(int a, int b, int k, int l, int r) {
eval(k);
if (r <= a || b <= l) {
return ex;
} else if (a <= l && r <= b) {
return dat[k];
} else {
X vl = query_sub(a, b, k * 2 + 1, l, (l + r) / 2);
X vr = query_sub(a, b, k * 2 + 2, (l + r) / 2, r);
return fx(vl, vr);
}
}
X query(int a, int b) { return query_sub(a, b, 0, 0, n); }
};
int main() {
ll q;
cin >> q;
vector<ll> bik(2002008);
bik[0] = 1;
for (int i = 0; i < 2000104; i++) {
bik[i + 1] = (i + 1) * bik[i] % 1000003;
}
for (int i = 0; i < q; i++) {
ll a, b, c;
cin >> a >> b >> c;
if (b == 0) {
cout << modpow(a, c, 1000003) << endl;
continue;
}
if (c >= 1000003) {
cout << 0 << endl;
continue;
}
ll d = modinv(b, 1000003) * a % 1000003;
ll ans = bik[d + c - 1] * modinv(bik[d - 1], 1000003) % 1000003 *
modpow(b, c, 1000003) % 1000003;
cout << ans << endl;
}
} | [
"io.output.newline.add",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 837,255 | 837,256 | u577774192 | cpp |
p03027 | #include <bits/stdc++.h>
#define int long long
#define ll long long
using ull = unsigned long long;
using namespace std;
const int INF = 1ll << 50;
const int MOD = 1000003;
#define dump(x) \
if (dbg) { \
cerr << #x << " = " << (x) << endl; \
}
#define overload4(_1, _2, _3, _4, name, ...) name
#define FOR1(n) for (ll i = 0; i < (n); ++i)
#define FOR2(i, n) for (ll i = 0; i < (n); ++i)
#define FOR3(i, a, b) for (ll i = (a); i < (b); ++i)
#define FOR4(i, a, b, c) for (ll i = (a); i < (b); i += (c))
#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define FORR(i, a, b) for (int i = (a); i <= (b); ++i)
#define bit(n, k) ((n >> k) & 1) /*nใฎk bit็ฎ*/
template <class T> bool chmin(T &a, const T &b) {
if (a > b) {
a = b;
return 1;
} else
return 0;
}
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
} else
return 0;
}
void Yes(bool flag = true) {
if (flag)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
void No(bool flag = true) { Yes(!flag); }
void YES(bool flag = true) {
if (flag)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
void NO(bool flag = true) { YES(!flag); }
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(), (v).end()
#define SZ(x) ((int)(x).size())
#define vi vector<int>
//#define P pair<int, int>
//#define V vector<int>
//#define S set<int>
#define itn int
bool dbg = false;
template <uint MD> struct ModInt {
using M = ModInt;
const static M G;
uint v;
ModInt(ll _v = 0) { set_v(_v % MD + MD); }
M &set_v(uint _v) {
v = (_v < MD) ? _v : _v - MD;
return *this;
}
explicit operator bool() const { return v != 0; }
M operator-() const { return M() - *this; }
M operator+(const M &r) const { return M().set_v(v + r.v); }
M operator-(const M &r) const { return M().set_v(v + MD - r.v); }
M operator*(const M &r) const { return M().set_v(ull(v) * r.v % MD); }
M operator/(const M &r) const { return *this * r.inv(); }
M &operator+=(const M &r) { return *this = *this + r; }
M &operator-=(const M &r) { return *this = *this - r; }
M &operator*=(const M &r) { return *this = *this * r; }
M &operator/=(const M &r) { return *this = *this / r; }
bool operator==(const M &r) const { return v == r.v; }
M pow(ll n) const {
M x = *this, r = 1;
while (n) {
if (n & 1)
r *= x;
x *= x;
n >>= 1;
}
return r;
}
M inv() const { return pow(MD - 2); }
friend ostream &operator<<(ostream &os, const M &r) { return os << r.v; }
friend istream &operator>>(istream &is, M &r) { return is >> r.v; }
};
using Mint = ModInt<MOD>;
int Q;
Mint kai[2010101];
void solve() {
kai[0] = 1;
FOR(i, 1, 2010001) { kai[i] = kai[i - 1] * i; }
while (Q--) {
Mint x, d;
int n;
cin >> x >> d >> n;
if (d == Mint{0} || x == Mint{0}) {
cout << x.pow(n) << endl;
}
x /= d;
if (x.v + n - 1 >= 1000003) {
cout << 0 << endl;
} else {
cout << kai[x.v + n - 1] / kai[x.v - 1] * d.pow(n) << endl;
}
}
}
signed main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
cin >> Q;
solve();
return 0;
}
| #include <bits/stdc++.h>
#define int long long
#define ll long long
using ull = unsigned long long;
using namespace std;
const int INF = 1ll << 50;
const int MOD = 1000003;
#define dump(x) \
if (dbg) { \
cerr << #x << " = " << (x) << endl; \
}
#define overload4(_1, _2, _3, _4, name, ...) name
#define FOR1(n) for (ll i = 0; i < (n); ++i)
#define FOR2(i, n) for (ll i = 0; i < (n); ++i)
#define FOR3(i, a, b) for (ll i = (a); i < (b); ++i)
#define FOR4(i, a, b, c) for (ll i = (a); i < (b); i += (c))
#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define FORR(i, a, b) for (int i = (a); i <= (b); ++i)
#define bit(n, k) ((n >> k) & 1) /*nใฎk bit็ฎ*/
template <class T> bool chmin(T &a, const T &b) {
if (a > b) {
a = b;
return 1;
} else
return 0;
}
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
} else
return 0;
}
void Yes(bool flag = true) {
if (flag)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
void No(bool flag = true) { Yes(!flag); }
void YES(bool flag = true) {
if (flag)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
void NO(bool flag = true) { YES(!flag); }
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(), (v).end()
#define SZ(x) ((int)(x).size())
#define vi vector<int>
//#define P pair<int, int>
//#define V vector<int>
//#define S set<int>
#define itn int
bool dbg = false;
template <uint MD> struct ModInt {
using M = ModInt;
const static M G;
uint v;
ModInt(ll _v = 0) { set_v(_v % MD + MD); }
M &set_v(uint _v) {
v = (_v < MD) ? _v : _v - MD;
return *this;
}
explicit operator bool() const { return v != 0; }
M operator-() const { return M() - *this; }
M operator+(const M &r) const { return M().set_v(v + r.v); }
M operator-(const M &r) const { return M().set_v(v + MD - r.v); }
M operator*(const M &r) const { return M().set_v(ull(v) * r.v % MD); }
M operator/(const M &r) const { return *this * r.inv(); }
M &operator+=(const M &r) { return *this = *this + r; }
M &operator-=(const M &r) { return *this = *this - r; }
M &operator*=(const M &r) { return *this = *this * r; }
M &operator/=(const M &r) { return *this = *this / r; }
bool operator==(const M &r) const { return v == r.v; }
M pow(ll n) const {
M x = *this, r = 1;
while (n) {
if (n & 1)
r *= x;
x *= x;
n >>= 1;
}
return r;
}
M inv() const { return pow(MD - 2); }
friend ostream &operator<<(ostream &os, const M &r) { return os << r.v; }
friend istream &operator>>(istream &is, M &r) { return is >> r.v; }
};
using Mint = ModInt<MOD>;
int Q;
Mint kai[2010101];
void solve() {
kai[0] = 1;
FOR(i, 1, 2010001) { kai[i] = kai[i - 1] * i; }
while (Q--) {
Mint x, d;
int n;
cin >> x >> d >> n;
if (d == Mint{0} || x == Mint{0}) {
cout << x.pow(n) << endl;
continue;
}
x /= d;
if (x.v + n - 1 >= 1000003) {
cout << 0 << endl;
} else {
cout << kai[x.v + n - 1] / kai[x.v - 1] * d.pow(n) << endl;
}
}
}
signed main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
cin >> Q;
solve();
return 0;
}
| [] | 837,265 | 837,266 | u070600790 | cpp |
p03027 | //#include <bits/stdc++.h>
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
//#include "boost/multiprecision/cpp_int.hpp"
// typedef boost::multiprecision::cpp_int ll;
typedef long double dd;
//#define i_7 (ll)(1E9+7)
//#define i_7 998244353
//#define i_5 i_7-2
ll i_7 = 1E6 + 3;
ll i_5 = i_7 - 2;
ll mod(ll a) {
ll c = a % i_7;
if (c >= 0)
return c;
return c + i_7;
}
typedef pair<ll, ll> l_l;
typedef pair<dd, dd> d_d;
ll inf = (ll)1E16;
#define rep(i, l, r) for (ll i = l; i <= r; i++)
#define pb push_back
ll max(ll a, ll b) {
if (a < b)
return b;
else
return a;
}
ll min(ll a, ll b) {
if (a > b)
return b;
else
return a;
}
void Max(ll &pos, ll val) { pos = max(pos, val); } // Max(dp[n],dp[n-1]);
void Min(ll &pos, ll val) { pos = min(pos, val); }
void Add(ll &pos, ll val) { pos = mod(pos + val); }
dd EPS = 1E-9;
#define fastio \
ios::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
#define fi first
#define se second
#define endl "\n"
///////////////////////////
ll po(ll i, ll p) {
if (p == 0)
return 1;
else {
i = mod(i);
if (p == 1)
return i;
if (p % 2 == 0)
return po(mod(i * i), p / 2);
return mod(i * po(i, p - 1));
}
}
ll bunbo(ll n) { return po(n, i_5); }
#define N 1000003
ll kai[N];
ll kai2[N];
ll bun[N];
void calc() {
kai[0] = 1;
kai2[0] = 1;
rep(i, 1, N - 1) { bun[i] = bunbo(i); }
rep(i, 1, N - 1) {
kai[i] = mod(kai[i - 1] * i);
kai2[i] = mod(kai2[i - 1] * bun[i]);
}
}
bool ansp() {
ll x, d, n;
cin >> x >> d >> n;
if (x == 0) {
cout << 0 << endl;
return 0;
}
if (d == 0) {
cout << mod(x * n) << endl;
return 0;
}
ll y = mod(x * bun[d]);
ll z = y + n - 1;
if (z >= i_7) {
cout << 0 << endl;
return 0;
}
ll ans = kai[z];
if (y - 1 >= 0)
ans = mod(ans * kai2[y - 1]);
ans = mod(ans * po(d, n));
cout << mod(ans) << endl;
return 0;
}
int main() {
fastio calc();
ll que;
cin >> que;
while (que--) {
ansp();
}
return 0;
}
| //#include <bits/stdc++.h>
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
//#include "boost/multiprecision/cpp_int.hpp"
// typedef boost::multiprecision::cpp_int ll;
typedef long double dd;
//#define i_7 (ll)(1E9+7)
//#define i_7 998244353
//#define i_5 i_7-2
ll i_7 = 1E6 + 3;
ll i_5 = i_7 - 2;
ll mod(ll a) {
ll c = a % i_7;
if (c >= 0)
return c;
return c + i_7;
}
typedef pair<ll, ll> l_l;
typedef pair<dd, dd> d_d;
ll inf = (ll)1E16;
#define rep(i, l, r) for (ll i = l; i <= r; i++)
#define pb push_back
ll max(ll a, ll b) {
if (a < b)
return b;
else
return a;
}
ll min(ll a, ll b) {
if (a > b)
return b;
else
return a;
}
void Max(ll &pos, ll val) { pos = max(pos, val); } // Max(dp[n],dp[n-1]);
void Min(ll &pos, ll val) { pos = min(pos, val); }
void Add(ll &pos, ll val) { pos = mod(pos + val); }
dd EPS = 1E-9;
#define fastio \
ios::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
#define fi first
#define se second
#define endl "\n"
///////////////////////////
ll po(ll i, ll p) {
if (p == 0)
return 1;
else {
i = mod(i);
if (p == 1)
return i;
if (p % 2 == 0)
return po(mod(i * i), p / 2);
return mod(i * po(i, p - 1));
}
}
ll bunbo(ll n) { return po(n, i_5); }
#define N 1000003
ll kai[N];
ll kai2[N];
ll bun[N];
void calc() {
kai[0] = 1;
kai2[0] = 1;
rep(i, 1, N - 1) { bun[i] = bunbo(i); }
rep(i, 1, N - 1) {
kai[i] = mod(kai[i - 1] * i);
kai2[i] = mod(kai2[i - 1] * bun[i]);
}
}
bool ansp() {
ll x, d, n;
cin >> x >> d >> n;
if (x == 0) {
cout << 0 << endl;
return 0;
}
if (d == 0) {
cout << mod(po(x, n)) << endl;
return 0;
}
ll y = mod(x * bun[d]);
ll z = y + n - 1;
if (z >= i_7) {
cout << 0 << endl;
return 0;
}
ll ans = kai[z];
if (y - 1 >= 1)
ans = mod(ans * kai2[y - 1]);
ans = mod(ans * po(d, n));
cout << mod(ans) << endl;
return 0;
}
int main() {
fastio calc();
ll que;
cin >> que;
while (que--) {
ansp();
}
return 0;
}
| [
"call.add",
"io.output.change",
"call.arguments.change",
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 837,267 | 837,268 | u763881112 | cpp |
p03027 | #include "bits/stdc++.h"
using namespace std;
#define Rep(i, n) for (int i = 0; i < (int)(n); i++)
#define For(i, n1, n2) for (int i = (int)(n1); i < (int)(n2); i++)
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define RREP(i, n) for (ll i = ((ll)(n)-1); i >= 0; i--)
#define FOR(i, n1, n2) for (ll i = (ll)(n1); i < (ll)(n2); i++)
#define RFOR(i, n1, n2) for (ll i = ((ll)(n1)-1); i >= (ll)(n2); i--)
#define all(a) (a).begin(), (a).end()
#define SORT(a) sort((a).begin(), (a).end())
#define oorret 0
#define oor(x) \
[&]() { \
try { \
x; \
} catch (const out_of_range &oor) { \
return oorret; \
} \
return x; \
}()
#define IOS cin.tie(0), ios::sync_with_stdio(false)
typedef long long ll;
typedef unsigned long long ull;
typedef std::pair<ll, ll> P;
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class Type> struct is_vector : std::false_type {};
template <class ValueType, class Alloc>
struct is_vector<std::vector<ValueType, Alloc>> : std::true_type {};
template <typename T>
inline std::ostream &operator<<(std::ostream &out, const std::vector<T> &v) {
if (v.empty())
return out;
constexpr bool is_vector_v = is_vector<T>::value;
if (is_vector_v)
for (auto itr = v.begin(); itr != v.end();)
out << (*itr), out << ((++itr != v.end()) ? "\n" : "");
else
for (auto itr = v.begin(); itr != v.end();)
out << (*itr), out << ((++itr != v.end()) ? " " : "");
return out;
}
inline void put() {}
template <class T> inline void put(const T &first) {
std::cout << first << "\n";
}
template <class T, class... N>
inline void put(const T &first, const N &...rest) {
std::cout << first << " ";
put(rest...);
}
inline void putn() {}
template <class T, class... N>
inline void putn(const T &first, const N &...rest) {
std::cout << first << "\n";
putn(rest...);
}
template <typename T, typename U> inline T pow(T x, U exp) {
if (exp <= 0) {
return 1;
}
if (exp % 2 == 0) {
T d = pow(x, exp / 2);
return d * d;
} else {
return (x * pow(x, exp - 1));
}
}
template <typename T> inline T fact(int_fast32_t n) {
static vector<T> table(1, 1);
if (n >= (int)table.size()) {
uint_fast32_t s = table.size();
T t = s;
for (int_fast32_t i = s; i < n + 1; ++i) {
table.push_back(table.back() * t++);
}
}
if (n < 0)
return 1;
else
return table[n];
}
template <typename T> inline T invfact(int_fast32_t n) {
static vector<T> invtable(1, 1);
if (n >= (int)invtable.size()) {
uint_fast32_t s = invtable.size();
for (T i = s; i < n + 1; ++i) {
invtable.push_back(invtable.back() / i);
}
}
if (n < 0)
return 1;
else
return invtable[n];
}
template <typename T>
inline T comb(uint_fast32_t n, uint_fast32_t m, bool closed = true) { // nCm
if (n < m)
return 0;
else if (closed)
return fact<T>(n) * invfact<T>(m) * invfact<T>(n - m);
else
return fact<T>(n) / fact<T>(m) / fact<T>(n - m);
}
template <int_fast64_t Mod> class ModInt {
using lint = int_fast64_t;
public:
lint a;
ModInt(lint val = 0) {
if (val >= Mod) {
val %= Mod;
} else if (val < 0) {
val %= Mod;
val += Mod;
}
a = val;
}
ModInt operator-() {
return ModInt(Mod - a);
} //ๅ้
-ๆผ็ฎๅญ(-a)ใฎใชใผใใผใญใผใ
ModInt operator=(const ModInt n) {
a = n.a;
return a;
}
ModInt operator+(const ModInt n) {
if ((a + n.a) >= Mod) {
return a + n.a - Mod;
} else {
return a + n.a;
}
}
ModInt operator-(const ModInt n) { return a + (Mod - n.a); }
ModInt operator*(const ModInt n) { return a * n.a; }
ModInt operator/(const ModInt n) { return (*this) * pow(n, Mod - 2); }
ModInt &operator+=(const ModInt n) {
(*this) = (*this) + n;
return *this;
}
ModInt &operator-=(const ModInt n) {
(*this) = (*this) + (Mod - n.a);
return *this;
}
ModInt &operator*=(const ModInt n) {
(*this) = (*this) * n;
return *this;
}
ModInt &operator/=(const ModInt n) {
(*this) = (*this) / n;
return *this;
}
ModInt &operator++(int) {
ModInt &a = *this;
(*this) += 1;
return a;
} //ๅพ็ฝฎใคใณใฏใชใกใณใs(++a)ใฎใชใผใใผใญใผใ
ModInt &operator++() {
(*this) += 1;
return *this;
} //ๅ็ฝฎใคใณใฏใชใกใณใ(a++)ใฎใชใผใใผใญใผใ
ModInt &operator--(int) {
ModInt &a = *this;
(*this) -= 1;
return a;
} //ๅพ็ฝฎใใฏใชใกใณใ(--a)ใฎใชใผใใผใญใผใ
ModInt &operator--() {
(*this) -= 1;
return *this;
} //ๅ็ฝฎใใฏใชใกใณใ(a--)ใฎใชใผใใผใญใผใ
ModInt inv() { return (ModInt)1 / (*this); } //้ๆฐใ่ฟใ้ขๆฐ
bool operator<(const ModInt n) { return a < n.a; }
bool operator<=(const ModInt n) { return a <= n.a; }
bool operator>(const ModInt n) { return a > n.a; }
bool operator>=(const ModInt n) { return a >= n.a; }
bool operator==(const ModInt n) { return a == n.a; }
bool operator!=(const ModInt n) { return a != n.a; }
//ไธใฎ้ขไฟๆผ็ฎๅญใฏpow้ขๆฐใง่ฆ่ซใใใ
bool operator<(const int n) { return a < n; }
bool operator<=(const int n) { return a <= n; }
bool operator>(const int n) { return a > n; }
bool operator>=(const int n) { return a >= n; }
bool operator==(const int n) { return a == n; }
ModInt operator%(const int n) { return a % n; }
};
template <int_fast64_t Mod>
inline ostream &operator<<(ostream &o, const ModInt<Mod> &t) {
o << t.a;
return o;
}
template <int_fast64_t Mod>
inline istream &operator>>(istream &i, ModInt<Mod> &t) {
i >> t.a;
return i;
}
// constexpr int_fast64_t mod = 1e9 + 7;
// constexpr int_fast64_t mod = 998244353;
constexpr int_fast64_t mod = 1e6 + 3;
using mi = ModInt<mod>;
int main() {
int q;
cin >> q;
mi res;
REP(i, q) {
int x, d, n;
cin >> x >> d >> n;
if (d == 0) {
put(pow<mi>(x, n));
continue;
}
if (x == 0 || n >= mod) {
put(0);
continue;
}
res = pow<mi>(d, n);
mi tmp = x;
tmp /= d;
if (tmp + n - 1 < tmp - 1 || tmp.a + n - 1 >= mod) {
put(0);
continue;
}
res *= fact<mi>(tmp.a + n - 1);
res /= fact<mi>(tmp.a - 1);
put(res);
}
return 0;
}
| #include "bits/stdc++.h"
using namespace std;
#define Rep(i, n) for (int i = 0; i < (int)(n); i++)
#define For(i, n1, n2) for (int i = (int)(n1); i < (int)(n2); i++)
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define RREP(i, n) for (ll i = ((ll)(n)-1); i >= 0; i--)
#define FOR(i, n1, n2) for (ll i = (ll)(n1); i < (ll)(n2); i++)
#define RFOR(i, n1, n2) for (ll i = ((ll)(n1)-1); i >= (ll)(n2); i--)
#define all(a) (a).begin(), (a).end()
#define SORT(a) sort((a).begin(), (a).end())
#define oorret 0
#define oor(x) \
[&]() { \
try { \
x; \
} catch (const out_of_range &oor) { \
return oorret; \
} \
return x; \
}()
#define IOS cin.tie(0), ios::sync_with_stdio(false)
typedef long long ll;
typedef unsigned long long ull;
typedef std::pair<ll, ll> P;
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class Type> struct is_vector : std::false_type {};
template <class ValueType, class Alloc>
struct is_vector<std::vector<ValueType, Alloc>> : std::true_type {};
template <typename T>
inline std::ostream &operator<<(std::ostream &out, const std::vector<T> &v) {
if (v.empty())
return out;
constexpr bool is_vector_v = is_vector<T>::value;
if (is_vector_v)
for (auto itr = v.begin(); itr != v.end();)
out << (*itr), out << ((++itr != v.end()) ? "\n" : "");
else
for (auto itr = v.begin(); itr != v.end();)
out << (*itr), out << ((++itr != v.end()) ? " " : "");
return out;
}
inline void put() {}
template <class T> inline void put(const T &first) {
std::cout << first << "\n";
}
template <class T, class... N>
inline void put(const T &first, const N &...rest) {
std::cout << first << " ";
put(rest...);
}
inline void putn() {}
template <class T, class... N>
inline void putn(const T &first, const N &...rest) {
std::cout << first << "\n";
putn(rest...);
}
template <typename T, typename U> inline T pow(T x, U exp) {
if (exp <= 0) {
return 1;
}
if (exp % 2 == 0) {
T d = pow(x, exp / 2);
return d * d;
} else {
return (x * pow(x, exp - 1));
}
}
template <typename T> inline T fact(int_fast32_t n) {
static vector<T> table(1, 1);
if (n >= (int)table.size()) {
uint_fast32_t s = table.size();
T t = s;
for (int_fast32_t i = s; i < n + 1; ++i) {
table.push_back(table.back() * t++);
}
}
if (n < 0)
return 1;
else
return table[n];
}
template <typename T> inline T invfact(int_fast32_t n) {
static vector<T> invtable(1, 1);
if (n >= (int)invtable.size()) {
uint_fast32_t s = invtable.size();
for (T i = s; i < n + 1; ++i) {
invtable.push_back(invtable.back() / i);
}
}
if (n < 0)
return 1;
else
return invtable[n];
}
template <typename T>
inline T comb(uint_fast32_t n, uint_fast32_t m, bool closed = true) { // nCm
if (n < m)
return 0;
else if (closed)
return fact<T>(n) * invfact<T>(m) * invfact<T>(n - m);
else
return fact<T>(n) / fact<T>(m) / fact<T>(n - m);
}
template <int_fast64_t Mod> class ModInt {
using lint = int_fast64_t;
public:
lint a;
ModInt(lint val = 0) {
if (val >= Mod) {
val %= Mod;
} else if (val < 0) {
val %= Mod;
val += Mod;
}
a = val;
}
ModInt operator-() {
return ModInt(Mod - a);
} //ๅ้
-ๆผ็ฎๅญ(-a)ใฎใชใผใใผใญใผใ
ModInt operator=(const ModInt n) {
a = n.a;
return a;
}
ModInt operator+(const ModInt n) {
if ((a + n.a) >= Mod) {
return a + n.a - Mod;
} else {
return a + n.a;
}
}
ModInt operator-(const ModInt n) { return a + (Mod - n.a); }
ModInt operator*(const ModInt n) { return a * n.a; }
ModInt operator/(const ModInt n) { return (*this) * pow(n, Mod - 2); }
ModInt &operator+=(const ModInt n) {
(*this) = (*this) + n;
return *this;
}
ModInt &operator-=(const ModInt n) {
(*this) = (*this) + (Mod - n.a);
return *this;
}
ModInt &operator*=(const ModInt n) {
(*this) = (*this) * n;
return *this;
}
ModInt &operator/=(const ModInt n) {
(*this) = (*this) / n;
return *this;
}
ModInt operator++(int) {
ModInt a = *this;
(*this) += 1;
return a;
} //ๅพ็ฝฎใคใณใฏใชใกใณใs(++a)ใฎใชใผใใผใญใผใ
ModInt &operator++() {
(*this) += 1;
return *this;
} //ๅ็ฝฎใคใณใฏใชใกใณใ(a++)ใฎใชใผใใผใญใผใ
ModInt operator--(int) {
ModInt a = *this;
(*this) -= 1;
return a;
} //ๅพ็ฝฎใใฏใชใกใณใ(--a)ใฎใชใผใใผใญใผใ
ModInt &operator--() {
(*this) -= 1;
return *this;
} //ๅ็ฝฎใใฏใชใกใณใ(a--)ใฎใชใผใใผใญใผใ
ModInt inv() { return (ModInt)1 / (*this); } //้ๆฐใ่ฟใ้ขๆฐ
bool operator<(const ModInt n) { return a < n.a; }
bool operator<=(const ModInt n) { return a <= n.a; }
bool operator>(const ModInt n) { return a > n.a; }
bool operator>=(const ModInt n) { return a >= n.a; }
bool operator==(const ModInt n) { return a == n.a; }
bool operator!=(const ModInt n) { return a != n.a; }
//ไธใฎ้ขไฟๆผ็ฎๅญใฏpow้ขๆฐใง่ฆ่ซใใใ
bool operator<(const int n) { return a < n; }
bool operator<=(const int n) { return a <= n; }
bool operator>(const int n) { return a > n; }
bool operator>=(const int n) { return a >= n; }
bool operator==(const int n) { return a == n; }
ModInt operator%(const int n) { return a % n; }
};
template <int_fast64_t Mod>
inline ostream &operator<<(ostream &o, const ModInt<Mod> &t) {
o << t.a;
return o;
}
template <int_fast64_t Mod>
inline istream &operator>>(istream &i, ModInt<Mod> &t) {
i >> t.a;
return i;
}
// constexpr int_fast64_t mod = 1e9 + 7;
// constexpr int_fast64_t mod = 998244353;
constexpr int_fast64_t mod = 1e6 + 3;
using mi = ModInt<mod>;
int main() {
int q;
cin >> q;
mi res;
REP(i, q) {
int x, d, n;
cin >> x >> d >> n;
if (d == 0) {
put(pow<mi>(x, n));
continue;
}
if (x == 0 || n >= mod) {
put(0);
continue;
}
res = pow<mi>(d, n);
mi tmp = x;
tmp /= d;
if (tmp + n - 1 < tmp - 1 || tmp.a + n - 1 >= mod) {
put(0);
continue;
}
res *= fact<mi>(tmp.a + n - 1);
res /= fact<mi>(tmp.a - 1);
put(res);
}
return 0;
}
| [] | 837,279 | 837,280 | u030685402 | cpp |
p03027 | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define F first
#define S second
#define int long long
//#define ll long long
//#define int unsigned long long
#define pb push_back
#define double long double
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
const int N = 3000000;
int mod = 1000003;
int f[N], invf[N], lg[N];
int binpow(int x, int y) {
if (y == 0)
return 1;
if (y % 2)
return x * binpow(x, y - 1) % mod;
int z = binpow(x, y / 2);
return z * z % mod;
}
int cnk(int n, int k) { return f[n] * invf[n - k] % mod * invf[k] % mod; }
main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
// freopen("input.txt", "r", stdin);
int q;
cin >> q;
int b = 2;
int p = 1;
for (int i = 0; i < mod - 1; i++) {
lg[p] = i;
p = p * b % mod;
}
f[0] = 1;
for (int i = 1; i < mod; i++)
f[i] = f[i - 1] * i % mod;
while (q--) {
int x, d, n;
cin >> x >> d >> n;
int y = (mod - x) * binpow(d, mod - 2) % mod;
if (d == 0) {
cout << binpow(x, n) % mod;
continue;
}
if (y <= n - 1 || x == 0) {
cout << 0 << endl;
continue;
}
int z = binpow(d, mod - 2) * x % mod;
int t;
if (z == 1)
t = lg[f[n] * binpow(d, n) % mod];
else
t = (lg[f[n + z - 1] * binpow(d, n + z - 1) % mod] -
lg[f[z - 1] * binpow(d, z - 1) % mod] + mod - 1) %
(mod - 1);
cout << binpow(2, t) << endl;
}
}
| #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define F first
#define S second
#define int long long
//#define ll long long
//#define int unsigned long long
#define pb push_back
#define double long double
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
const int N = 3000000;
int mod = 1000003;
int f[N], invf[N], lg[N];
int binpow(int x, int y) {
if (y == 0)
return 1;
if (y % 2)
return x * binpow(x, y - 1) % mod;
int z = binpow(x, y / 2);
return z * z % mod;
}
int cnk(int n, int k) { return f[n] * invf[n - k] % mod * invf[k] % mod; }
main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
// freopen("input.txt", "r", stdin);
int q;
cin >> q;
int b = 2;
int p = 1;
for (int i = 0; i < mod - 1; i++) {
lg[p] = i;
p = p * b % mod;
}
f[0] = 1;
for (int i = 1; i < mod; i++)
f[i] = f[i - 1] * i % mod;
while (q--) {
int x, d, n;
cin >> x >> d >> n;
int y = (mod - x) * binpow(d, mod - 2) % mod;
if (d == 0) {
cout << binpow(x, n) % mod << endl;
continue;
}
if (y <= n - 1 || x == 0) {
cout << 0 << endl;
continue;
}
int z = binpow(d, mod - 2) * x % mod;
int t;
if (z == 1)
t = lg[f[n] * binpow(d, n) % mod];
else
t = (lg[f[n + z - 1] * binpow(d, n + z - 1) % mod] -
lg[f[z - 1] * binpow(d, z - 1) % mod] + mod - 1) %
(mod - 1);
cout << binpow(2, t) << endl;
}
}
| [
"io.output.newline.add"
] | 837,283 | 837,284 | u373008269 | cpp |
p03027 | #include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define ll int64_t
#define Rep(i, n) for (ll i = 0; i < n; i++)
using namespace std;
typedef vector<ll> vec;
typedef vector<vec> mat;
template <class T> inline void chmin(T &a, T b) {
if (a > b) {
a = b;
}
}
template <class T> inline void chmax(T &a, T b) {
if (a < b) {
a = b;
}
}
const int MAX = 2000010;
const int MOD = 1000003;
ll fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++) {
fac[i] = fac[i - 1] * i % MOD;
inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
finv[i] = finv[i - 1] * inv[i] % MOD;
}
}
ll COM(int n, int k) {
if (n < k)
return 0;
if (n < 0 || k < 0)
return 0;
return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
ll modpow(ll a, ll n) {
ll res = 1;
while (n > 0) {
if (n & 1)
res = res * a % MOD;
a = a * a % MOD;
n >>= 1;
}
return res;
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
COMinit();
ll Q;
cin >> Q;
while (Q--) {
ll x, d, n;
cin >> x >> d >> n;
ll ans;
if (d == 0)
ans = x * n % MOD;
else {
ll first = (MOD - 1 + x * inv[d]) % MOD;
if (first / MOD != (first + n) / MOD)
ans = 0;
else {
ans = fac[first + n] * finv[first] % MOD;
ans *= modpow(d, n);
ans %= MOD;
}
}
cout << ans << "\n";
}
} | #include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define ll int64_t
#define Rep(i, n) for (ll i = 0; i < n; i++)
using namespace std;
typedef vector<ll> vec;
typedef vector<vec> mat;
template <class T> inline void chmin(T &a, T b) {
if (a > b) {
a = b;
}
}
template <class T> inline void chmax(T &a, T b) {
if (a < b) {
a = b;
}
}
const int MAX = 2000010;
const int MOD = 1000003;
ll fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++) {
fac[i] = fac[i - 1] * i % MOD;
inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
finv[i] = finv[i - 1] * inv[i] % MOD;
}
}
ll COM(int n, int k) {
if (n < k)
return 0;
if (n < 0 || k < 0)
return 0;
return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
ll modpow(ll a, ll n) {
ll res = 1;
while (n > 0) {
if (n & 1)
res = res * a % MOD;
a = a * a % MOD;
n >>= 1;
}
return res;
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
COMinit();
ll Q;
cin >> Q;
while (Q--) {
ll x, d, n;
cin >> x >> d >> n;
ll ans;
if (d == 0)
ans = modpow(x, n);
else {
ll first = (MOD - 1 + x * inv[d]) % MOD;
if (first / MOD != (first + n) / MOD)
ans = 0;
else {
ans = fac[first + n] * finv[first] % MOD;
ans *= modpow(d, n);
ans %= MOD;
}
}
cout << ans << "\n";
}
} | [
"call.add",
"assignment.value.change",
"expression.operation.binary.change"
] | 837,285 | 837,286 | u017271745 | cpp |
p03027 | #include <bits/stdc++.h>
using namespace std;
const int64_t MOD = 1e6 + 3;
void add(int64_t &a, int64_t b) { a = (a + b) % MOD; }
void mul(int64_t &a, int64_t b) { a = a * b % MOD; }
vector<int64_t> fact, seq_inv, fact_inv;
void create_fact_mod(int num) {
fact[0] = fact[1] = 1;
for (int i = 2; i <= num; i++)
fact[i] = fact[i - 1] * i % MOD;
}
void create_seq_inv_mod(int num) {
seq_inv[0] = seq_inv[1] = 1;
for (int i = 2; i <= num; i++)
seq_inv[i] = (MOD - MOD / i) * seq_inv[MOD % i] % MOD;
}
void create_fact_inv_mod(int num) {
fact_inv[0] = fact_inv[1] = 1;
for (int i = 2; i <= num; i++)
fact_inv[i] = fact_inv[i - 1] * seq_inv[i] % MOD;
}
void create_mod_tables(int num) {
fact.resize(num + 1);
seq_inv.resize(num + 1);
fact_inv.resize(num + 1);
create_fact_mod(num);
create_seq_inv_mod(num);
create_fact_inv_mod(num);
}
int64_t comb_mod(int n, int k) {
return fact[n] * fact_inv[n - k] % MOD * fact_inv[k] % MOD;
}
int64_t perm_mod(int n, int k) { return fact[n] * fact_inv[n - k] % MOD; }
int64_t power_mod(int64_t num, int64_t power) {
int64_t prod = 1;
num %= MOD;
while (power > 0) {
if (power & 1)
prod = prod * num % MOD;
num = num * num % MOD;
power >>= 1;
}
return prod;
}
int64_t extgcd(int64_t a, int64_t b, int64_t &x, int64_t &y) {
int64_t d = a;
if (b != 0) {
d = extgcd(b, a % b, y, x);
y -= (a / b) * x;
} else {
x = 1;
y = 0;
}
return d;
}
int64_t inv_mod(int64_t a) {
int64_t x, y;
extgcd(a, MOD, x, y);
return (MOD + x % MOD) % MOD;
}
int main() {
int Q;
cin >> Q;
create_mod_tables(MOD - 1);
while (Q--) {
int64_t X, D, N, ans;
cin >> X >> D >> N;
if (D == 0) {
ans = X * N % MOD;
} else {
int64_t st = X * inv_mod(D) % MOD;
int64_t term = st + N - 1;
if (st == 0 || st / MOD != term / MOD) {
ans = 0;
} else {
ans = fact[term] * inv_mod(fact[st - 1]) % MOD;
}
mul(ans, power_mod(D, N));
}
cout << ans << endl;
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
const int64_t MOD = 1e6 + 3;
void add(int64_t &a, int64_t b) { a = (a + b) % MOD; }
void mul(int64_t &a, int64_t b) { a = a * b % MOD; }
vector<int64_t> fact, seq_inv, fact_inv;
void create_fact_mod(int num) {
fact[0] = fact[1] = 1;
for (int i = 2; i <= num; i++)
fact[i] = fact[i - 1] * i % MOD;
}
void create_seq_inv_mod(int num) {
seq_inv[0] = seq_inv[1] = 1;
for (int i = 2; i <= num; i++)
seq_inv[i] = (MOD - MOD / i) * seq_inv[MOD % i] % MOD;
}
void create_fact_inv_mod(int num) {
fact_inv[0] = fact_inv[1] = 1;
for (int i = 2; i <= num; i++)
fact_inv[i] = fact_inv[i - 1] * seq_inv[i] % MOD;
}
void create_mod_tables(int num) {
fact.resize(num + 1);
seq_inv.resize(num + 1);
fact_inv.resize(num + 1);
create_fact_mod(num);
create_seq_inv_mod(num);
create_fact_inv_mod(num);
}
int64_t comb_mod(int n, int k) {
return fact[n] * fact_inv[n - k] % MOD * fact_inv[k] % MOD;
}
int64_t perm_mod(int n, int k) { return fact[n] * fact_inv[n - k] % MOD; }
int64_t power_mod(int64_t num, int64_t power) {
int64_t prod = 1;
num %= MOD;
while (power > 0) {
if (power & 1)
prod = prod * num % MOD;
num = num * num % MOD;
power >>= 1;
}
return prod;
}
int64_t extgcd(int64_t a, int64_t b, int64_t &x, int64_t &y) {
int64_t d = a;
if (b != 0) {
d = extgcd(b, a % b, y, x);
y -= (a / b) * x;
} else {
x = 1;
y = 0;
}
return d;
}
int64_t inv_mod(int64_t a) {
int64_t x, y;
extgcd(a, MOD, x, y);
return (MOD + x % MOD) % MOD;
}
int main() {
int Q;
cin >> Q;
create_mod_tables(MOD - 1);
while (Q--) {
int64_t X, D, N, ans;
cin >> X >> D >> N;
if (D == 0) {
ans = power_mod(X, N) % MOD;
} else {
int64_t st = X * inv_mod(D) % MOD;
int64_t term = st + N - 1;
if (st == 0 || st / MOD != term / MOD) {
ans = 0;
} else {
ans = fact[term] * inv_mod(fact[st - 1]) % MOD;
}
mul(ans, power_mod(D, N));
}
cout << ans << endl;
}
return 0;
} | [
"call.add",
"assignment.value.change",
"expression.operation.binary.change",
"call.arguments.change"
] | 837,291 | 837,292 | u314396879 | cpp |
p03027 | #include <bits/stdc++.h>
using namespace std;
template <class T> inline T updmax(T &a, T b) { return a = max(a, b); }
template <class T> inline T updmin(T &a, T b) { return a = min(a, b); }
template <unsigned long long mod> class modint {
public:
unsigned long long v;
modint(const long long x = 0) : v(x % mod) {}
modint operator+(const modint rhs) { return modint(*this) += rhs; }
modint operator-(const modint rhs) { return modint(*this) -= rhs; }
modint operator*(const modint rhs) { return modint(*this) *= rhs; }
modint operator/(const modint rhs) { return modint(*this) /= rhs; }
modint operator-() { return modint(mod - this->v); }
modint &operator+=(const modint rhs) {
v += rhs.v;
if (v >= mod)
v -= mod;
return *this;
}
modint &operator-=(const modint rhs) {
if (v < rhs.v)
v += mod;
v -= rhs.v;
return *this;
}
modint &operator*=(const modint rhs) {
v = v * rhs.v % mod;
return *this;
}
modint inverse(modint a) {
unsigned long long exp = mod - 2;
modint ret(1ULL);
while (exp) {
if (exp % 2) {
ret *= a;
}
a *= a;
exp >>= 1;
}
return ret;
}
modint &operator/=(modint rhs) {
(*this) *= inverse(rhs);
return *this;
}
friend ostream &operator<<(ostream &os, modint &u) {
os << u.v;
return (os);
}
friend istream &operator>>(istream &is, modint &u) {
is >> u.v;
return (is);
}
};
const int MOD = 1000003;
using mint = modint<MOD>;
const int MAX = MOD;
mint fact[MAX], invfact[MAX], inv[MAX];
void facinit() {
fact[0] = fact[1] = 1;
invfact[0] = invfact[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++) {
fact[i] = fact[i - 1] * i;
inv[i] = -inv[MOD % i] * (MOD / i);
invfact[i] = invfact[i - 1] * inv[i];
}
}
template <class T> T fastpow(T a, long long p) {
T tmp = a;
T ret = 1;
while (p) {
if (p & 1)
ret *= tmp;
p >>= 1;
tmp = tmp * tmp;
}
return ret;
}
int main() {
int q;
scanf("%d", &q);
facinit();
for (int i = 0; i < q; i++) {
mint x, d, n;
cin >> x >> d >> n;
if (x.v == 0) {
cout << 0 << "\n";
return 0;
}
if (d.v == 0) {
cout << fastpow(x, n.v).v << "\n";
}
mint s = x / d;
if (s.v + n.v - 1 >= MOD) {
cout << 0 << "\n";
continue;
}
cout << (fastpow(d, n.v) * fact[s.v + n.v - 1] * invfact[s.v - 1]).v
<< "\n";
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
template <class T> inline T updmax(T &a, T b) { return a = max(a, b); }
template <class T> inline T updmin(T &a, T b) { return a = min(a, b); }
template <unsigned long long mod> class modint {
public:
unsigned long long v;
modint(const long long x = 0) : v(x % mod) {}
modint operator+(const modint rhs) { return modint(*this) += rhs; }
modint operator-(const modint rhs) { return modint(*this) -= rhs; }
modint operator*(const modint rhs) { return modint(*this) *= rhs; }
modint operator/(const modint rhs) { return modint(*this) /= rhs; }
modint operator-() { return modint(mod - this->v); }
modint &operator+=(const modint rhs) {
v += rhs.v;
if (v >= mod)
v -= mod;
return *this;
}
modint &operator-=(const modint rhs) {
if (v < rhs.v)
v += mod;
v -= rhs.v;
return *this;
}
modint &operator*=(const modint rhs) {
v = v * rhs.v % mod;
return *this;
}
modint inverse(modint a) {
unsigned long long exp = mod - 2;
modint ret(1ULL);
while (exp) {
if (exp % 2) {
ret *= a;
}
a *= a;
exp >>= 1;
}
return ret;
}
modint &operator/=(modint rhs) {
(*this) *= inverse(rhs);
return *this;
}
friend ostream &operator<<(ostream &os, modint &u) {
os << u.v;
return (os);
}
friend istream &operator>>(istream &is, modint &u) {
is >> u.v;
return (is);
}
};
const int MOD = 1000003;
using mint = modint<MOD>;
const int MAX = MOD;
mint fact[MAX], invfact[MAX], inv[MAX];
void facinit() {
fact[0] = fact[1] = 1;
invfact[0] = invfact[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++) {
fact[i] = fact[i - 1] * i;
inv[i] = -inv[MOD % i] * (MOD / i);
invfact[i] = invfact[i - 1] * inv[i];
}
}
template <class T> T fastpow(T a, long long p) {
T tmp = a;
T ret = 1;
while (p) {
if (p & 1)
ret *= tmp;
p >>= 1;
tmp = tmp * tmp;
}
return ret;
}
int main() {
int q;
scanf("%d", &q);
facinit();
for (int i = 0; i < q; i++) {
mint x, d, n;
cin >> x >> d >> n;
if (x.v == 0) {
cout << 0 << "\n";
continue;
}
if (d.v == 0) {
cout << fastpow(x, n.v).v << "\n";
continue;
}
mint s = x / d;
if (s.v + n.v - 1 >= MOD) {
cout << 0 << "\n";
continue;
}
cout << (fastpow(d, n.v) * fact[s.v + n.v - 1] * invfact[s.v - 1]).v
<< "\n";
}
return 0;
} | [
"control_flow.return.remove",
"control_flow.continue.add"
] | 837,295 | 837,296 | u614497125 | cpp |
p03027 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// a^n (mod m)
const long long mod = 1000003;
long long modpow(long long a, long long n) {
long long res = 1;
while (n > 0) {
if (n & 1)
res = res * a % mod;
a = a * a % mod;
n >>= 1;
}
return res;
}
// mod mใงใฎ a ใฎ้ๅ
ใๆฑใใ
long long modinv(long long a) {
long long b = mod, u = 1, v = 0;
while (b) {
long long t = a / b;
a -= t * b;
swap(a, b);
u -= t * v;
swap(u, v);
}
u %= mod;
if (u < 0)
u += mod;
return u;
}
ll f[2000200];
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout << fixed << setprecision(20);
int q;
cin >> q;
f[0] = 1;
for (int i = 1; i < 2000200; i++) {
f[i] = f[i - 1] * i;
f[i] %= mod;
}
while (q--) {
ll x, d, n;
cin >> x >> d >> n;
if (d == 0) {
ll t = modpow(x, n);
cout << t << "\n";
}
if (n >= mod) {
cout << 0 << "\n";
continue;
}
ll ans = modpow(d, n);
ll xd = x * modinv(d) + mod - 1;
xd %= mod;
ans *= (f[xd + n] * modinv(f[xd])) % mod;
ans %= mod;
cout << ans << "\n";
}
}
| #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// a^n (mod m)
const long long mod = 1000003;
long long modpow(long long a, long long n) {
long long res = 1;
while (n > 0) {
if (n & 1)
res = res * a % mod;
a = a * a % mod;
n >>= 1;
}
return res;
}
// mod mใงใฎ a ใฎ้ๅ
ใๆฑใใ
long long modinv(long long a) {
long long b = mod, u = 1, v = 0;
while (b) {
long long t = a / b;
a -= t * b;
swap(a, b);
u -= t * v;
swap(u, v);
}
u %= mod;
if (u < 0)
u += mod;
return u;
}
ll f[2000200];
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout << fixed << setprecision(20);
int q;
cin >> q;
f[0] = 1;
for (int i = 1; i < 2000200; i++) {
f[i] = f[i - 1] * i;
f[i] %= mod;
}
while (q--) {
ll x, d, n;
cin >> x >> d >> n;
if (d == 0) {
ll t = modpow(x, n);
cout << t << "\n";
continue;
}
if (n >= mod) {
cout << 0 << "\n";
continue;
}
ll ans = modpow(d, n);
ll xd = x * modinv(d) + mod - 1;
xd %= mod;
ans *= (f[xd + n] * modinv(f[xd])) % mod;
ans %= mod;
cout << ans << "\n";
}
}
| [] | 837,299 | 837,300 | u676029460 | cpp |
p03027 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
#define REP(i, n) for (int i = 0; i < n; ++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#define DBG(fmt, ...)
#endif
const ll LLINF = (1LL << 60);
const int INF = (1LL << 30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000003;
#define MAX_X 1000010
struct mint {
ll x;
mint(ll x = 0) : x(x % MOD) {}
mint &operator+=(const mint a) {
if ((x += a.x) >= MOD) {
x -= MOD;
}
return *this;
}
mint &operator-=(const mint a) {
if ((x += MOD - a.x) >= MOD) {
x -= MOD;
}
return *this;
}
mint &operator*=(const mint a) {
(x *= a.x) %= MOD;
return *this;
}
mint operator+(const mint a) const {
mint res(*this);
return res += a;
}
mint operator-(const mint a) const {
mint res(*this);
return res -= a;
}
mint operator*(const mint a) const {
mint res(*this);
return res *= a;
}
};
// x ใฎ y ไนใๆฑใใ O(log MOD)
ll modpow(ll x, ll y) {
if (y == 0)
return 1;
ll res = modpow(x, y / 2);
return res * res % MOD * (y & 1 ? x : 1) % MOD;
}
// x ใฎ้ๅ
ใๆฑใใ O(logMOD)
ll modinv(ll x) { return modpow(x, MOD - 2); }
mint modinv(mint x) { return modpow(x.x, MOD - 2); }
ll Q;
vector<mint> fact; // ้ไน i!
ll solve(ll x, ll d, ll n) {
// ็ญๅทฎๆฐๅใฎ็ฉใฏ d^n * ( (x/d + n - 1)! / (x/d - 1)! ) ใงใใ
mint x_d = mint(x) * mint(modinv(d));
// d ใ 0 ใฎใจใใฏไพๅค -> x^n ใซใชใ
if (d == 0) {
return modpow(x, n);
}
// ๅฐไฝใฎ้ขไฟไธ MAX_X! ไปฅไธใฎ้ไนใฏ 0 ใซใชใ
if ((x_d + n - 1).x >= MOD) {
return 0;
}
mint ret = modpow(d, n);
ret *= fact[(x_d + n - 1).x];
ret *= modinv(fact[(x_d - 1).x]);
return ret.x;
}
signed main() {
cin >> Q;
// fact ใฎไฝๆ
fact.resize(MAX_X);
fact[0] = 1;
fact[1] = 1;
for (int i = 2; i < MAX_X; ++i) {
fact[i] = fact[i - 1] * i;
}
REP(i, Q) {
ll x, d, n;
cin >> x >> d >> n;
ll ans = solve(x, d, n);
printf("%lld\n", ans);
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
#define REP(i, n) for (int i = 0; i < n; ++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#define DBG(fmt, ...)
#endif
const ll LLINF = (1LL << 60);
const int INF = (1LL << 30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000003;
#define MAX_X 1000010
struct mint {
ll x;
mint(ll x = 0) : x(x % MOD) {}
mint &operator+=(const mint a) {
if ((x += a.x) >= MOD) {
x -= MOD;
}
return *this;
}
mint &operator-=(const mint a) {
if ((x += MOD - a.x) >= MOD) {
x -= MOD;
}
return *this;
}
mint &operator*=(const mint a) {
(x *= a.x) %= MOD;
return *this;
}
mint operator+(const mint a) const {
mint res(*this);
return res += a;
}
mint operator-(const mint a) const {
mint res(*this);
return res -= a;
}
mint operator*(const mint a) const {
mint res(*this);
return res *= a;
}
};
// x ใฎ y ไนใๆฑใใ O(log MOD)
ll modpow(ll x, ll y) {
if (y == 0)
return 1;
ll res = modpow(x, y / 2);
return res * res % MOD * (y & 1 ? x : 1) % MOD;
}
// x ใฎ้ๅ
ใๆฑใใ O(logMOD)
ll modinv(ll x) { return modpow(x, MOD - 2); }
mint modinv(mint x) { return modpow(x.x, MOD - 2); }
ll Q;
vector<mint> fact; // ้ไน i!
ll solve(ll x, ll d, ll n) {
// ็ญๅทฎๆฐๅใฎ็ฉใฏ d^n * ( (x/d + n - 1)! / (x/d - 1)! ) ใงใใ
mint x_d = mint(x) * mint(modinv(d));
// d ใ 0 ใฎใจใใฏไพๅค -> x^n ใซใชใ
if (d == 0) {
return modpow(x, n);
}
// ๅฐไฝใฎ้ขไฟไธ MOD! ไปฅไธใฎ้ไนใฏ 0 ใซใชใ
if (x_d.x + n - 1 >= MOD) {
return 0;
}
mint ret = modpow(d, n);
ret *= fact[(x_d + n - 1).x];
ret *= modinv(fact[(x_d - 1).x]);
return ret.x;
}
signed main() {
cin >> Q;
// fact ใฎไฝๆ
fact.resize(MAX_X);
fact[0] = 1;
fact[1] = 1;
for (int i = 2; i < MAX_X; ++i) {
fact[i] = fact[i - 1] * i;
}
REP(i, Q) {
ll x, d, n;
cin >> x >> d >> n;
ll ans = solve(x, d, n);
printf("%lld\n", ans);
}
return 0;
}
| [
"control_flow.branch.if.condition.change"
] | 837,310 | 837,311 | u633020228 | cpp |
p03027 | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define pb push_back
#define pf push_front
typedef long long lint;
typedef complex<double> P;
#define mp make_pair
#define fi first
#define se second
typedef pair<int, int> pint;
#define All(s) s.begin(), s.end()
#define rAll(s) s.rbegin(), s.rend()
#define REP(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
//ๅ้กๆใใใณๅถ็ดใฏใกใใใจ็ขบ่ชใใใ๏ผ
//ใตใคใบใฏ10^5ใใใชใใฆ2ร10^5ใจใใใใใใชใใใ้่ฆใชๅถ็ดใปๆกไปถใ่ฆ่ฝใจใใฆใใใใ
//ใจใใใใใตใณใใซใ่ชญใใงใใ่งฃๆณใ่ใใใ๏ผ
lint extgcd(lint a, lint b, lint &x, lint &y) {
lint g = a;
x = 1;
y = 0;
if (b != 0)
g = extgcd(b, a % b, y, x), y -= (a / b) * x;
return g;
}
lint invMod(lint a, lint m) {
lint x, y;
if (extgcd(a, m, x, y) == 1)
return (x + m) % m;
return 0;
}
lint mo = 1000003, zy = 1;
lint zyo(lint x, lint y) {
lint ret = 1, a = x;
while (y > 0) {
if (y % 2 == 1)
ret = (ret * a) % mo;
a = (a * a) % mo;
y /= 2;
}
return ret;
}
vector<lint> ka;
//[x,y]
lint p(int x, int y) {
assert(y < mo && x > 0);
return ka[y] * invMod(ka[x - 1], mo) % mo;
}
lint cal(lint x, lint d, lint n) {
if (x == 0)
return 0;
if (d == 0)
return zyo(x, n);
lint ix = x * invMod(d, mo) % mo;
assert(x == (ix * d) % mo);
// cout<<(ix*d)%mo<<' '<<(ix+n)*d%mo<<endl;
if (ix + n >= mo)
return 0;
// return
// ((ka[mo-1]*ka[ix-1]%mo)*p(ix+n+1,mo-1)%mo)*invMod(zyo(d,mo-2-n),mo)%mo;
return p(ix, ix + n) * zyo(d, n + 1) % mo;
}
int main() {
ka.pb(1);
rep(i, 1141919) ka.pb((ka[i] * (i + 1)) % mo);
int t, x, d, n;
cin >> t;
rep(i, t) {
cin >> x >> d >> n;
cout << cal(x, d, n - 1) << endl;
}
}
| #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define pb push_back
#define pf push_front
typedef long long lint;
typedef complex<double> P;
#define mp make_pair
#define fi first
#define se second
typedef pair<int, int> pint;
#define All(s) s.begin(), s.end()
#define rAll(s) s.rbegin(), s.rend()
#define REP(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
//ๅ้กๆใใใณๅถ็ดใฏใกใใใจ็ขบ่ชใใใ๏ผ
//ใตใคใบใฏ10^5ใใใชใใฆ2ร10^5ใจใใใใใใชใใใ้่ฆใชๅถ็ดใปๆกไปถใ่ฆ่ฝใจใใฆใใใใ
//ใจใใใใใตใณใใซใ่ชญใใงใใ่งฃๆณใ่ใใใ๏ผ
lint extgcd(lint a, lint b, lint &x, lint &y) {
lint g = a;
x = 1;
y = 0;
if (b != 0)
g = extgcd(b, a % b, y, x), y -= (a / b) * x;
return g;
}
lint invMod(lint a, lint m) {
lint x, y;
if (extgcd(a, m, x, y) == 1)
return (x + m) % m;
return 0;
}
lint mo = 1000003, zy = 1;
lint zyo(lint x, lint y) {
lint ret = 1, a = x;
while (y > 0) {
if (y % 2 == 1)
ret = (ret * a) % mo;
a = (a * a) % mo;
y /= 2;
}
return ret;
}
vector<lint> ka;
//[x,y]
lint p(int x, int y) {
assert(y < mo && x > 0);
return ka[y] * invMod(ka[x - 1], mo) % mo;
}
lint cal(lint x, lint d, lint n) {
if (x == 0)
return 0;
if (d == 0)
return zyo(x, n + 1);
lint ix = x * invMod(d, mo) % mo;
assert(x == (ix * d) % mo);
// cout<<(ix*d)%mo<<' '<<(ix+n)*d%mo<<endl;
if (ix + n >= mo)
return 0;
// return
// ((ka[mo-1]*ka[ix-1]%mo)*p(ix+n+1,mo-1)%mo)*invMod(zyo(d,mo-2-n),mo)%mo;
return p(ix, ix + n) * zyo(d, n + 1) % mo;
}
int main() {
ka.pb(1);
rep(i, 1141919) ka.pb((ka[i] * (i + 1)) % mo);
int t, x, d, n;
cin >> t;
rep(i, t) {
cin >> x >> d >> n;
cout << cal(x, d, n - 1) << endl;
}
}
| [
"expression.operation.binary.add"
] | 837,318 | 837,319 | u162364634 | cpp |
p03027 | #include <bits/stdc++.h>
#define int long long
#define M 1000003
using namespace std;
typedef long long ll;
const int mod = M;
ll mod_pow(ll a, ll x) {
ll res = 1;
while (x) {
if (x % 2)
res = res * a % mod;
a = a * a % mod;
x /= 2;
}
return res;
}
ll inv(ll x) { return mod_pow(x, mod - 2); }
int X[M], invX[M];
void init() {
int num = 1;
for (int i = 1; i < M; i++) {
num *= i;
num %= mod;
X[i] = num;
}
for (int i = 0; i < M; i++)
invX[i] = inv(X[i]);
}
int cal(int x, int d, int n) {
if (d == 0)
return mod_pow(x, n);
int R = (x * inv(d) + (n - 1)) % mod;
int L = (x * inv(d) - 1 + mod) % mod;
// int l = ( R - ( n - 1 ) - 1 );
int l = (x * inv(d) - 1);
if (l <= 0)
return 0;
return ((X[R] * invX[L]) % mod * mod_pow(d, n)) % mod;
}
signed main() {
init();
int q;
cin >> q;
while (q--) {
int x, d, n;
cin >> x >> d >> n;
cout << cal(x, d, n) << endl;
}
return 0;
}
| #include <bits/stdc++.h>
#define int long long
#define M 1000003
using namespace std;
typedef long long ll;
const int mod = M;
ll mod_pow(ll a, ll x) {
ll res = 1;
while (x) {
if (x % 2)
res = res * a % mod;
a = a * a % mod;
x /= 2;
}
return res;
}
ll inv(ll x) { return mod_pow(x, mod - 2); }
int X[M], invX[M];
void init() {
int num = 1;
for (int i = 1; i < M; i++) {
num *= i;
num %= mod;
X[i] = num;
}
for (int i = 0; i < M; i++)
invX[i] = inv(X[i]);
}
int cal(int x, int d, int n) {
if (d == 0)
return mod_pow(x, n);
int R = (x * inv(d) + (n - 1)) % mod;
int L = (x * inv(d) - 1 + mod) % mod;
// if( L + ( n - 1 ) >= mod ) return 0;
int l = (R - (n - 1) - 1);
if (l <= 0)
return 0;
return ((X[R] * invX[L]) % mod * mod_pow(d, n)) % mod;
}
signed main() {
init();
int q;
cin >> q;
while (q--) {
int x, d, n;
cin >> x >> d >> n;
cout << cal(x, d, n) << endl;
}
return 0;
}
| [
"call.arguments.change",
"expression.operation.binary.change"
] | 837,323 | 837,324 | u192912097 | cpp |
p03027 | #include <bits/stdc++.h>
#define int long long
#define M 1000003
using namespace std;
typedef long long ll;
const int mod = M;
ll mod_pow(ll a, ll x) {
ll res = 1;
while (x) {
if (x % 2)
res = res * a % mod;
a = a * a % mod;
x /= 2;
}
return res;
}
ll inv(ll x) { return mod_pow(x, mod - 2); }
int X[M], invX[M];
void init() {
int num = 1;
for (int i = 1; i < M; i++) {
num *= i;
num %= mod;
X[i] = num;
}
for (int i = 0; i < M; i++)
invX[i] = inv(X[i]);
}
int cal(int x, int d, int n) {
if (d == 0)
return mod_pow(x, n);
int R = (x * inv(d) + (n - 1)) % mod;
int L = (x * inv(d) - 1 + mod) % mod;
// int l = ( R - ( n - 1 ) - 1 );
int l = (x * inv(d) - 1);
if (l <= 0)
return 0;
return ((X[R] * invX[L]) % mod * mod_pow(d, n)) % mod;
}
signed main() {
init();
int q;
cin >> q;
while (q--) {
int x, d, n;
cin >> x >> d >> n;
cout << cal(x, d, n) << endl;
}
return 0;
}
| #include <bits/stdc++.h>
#define int long long
#define M 1000003
using namespace std;
typedef long long ll;
const int mod = M;
ll mod_pow(ll a, ll x) {
ll res = 1;
while (x) {
if (x % 2)
res = res * a % mod;
a = a * a % mod;
x /= 2;
}
return res;
}
ll inv(ll x) { return mod_pow(x, mod - 2); }
int X[M], invX[M];
void init() {
int num = 1;
for (int i = 1; i < M; i++) {
num *= i;
num %= mod;
X[i] = num;
}
for (int i = 0; i < M; i++)
invX[i] = inv(X[i]);
}
int cal(int x, int d, int n) {
if (d == 0)
return mod_pow(x, n);
int R = (x * inv(d) + (n - 1)) % mod;
int L = (x * inv(d) - 1 + mod) % mod;
int l = (R - (n - 1) - 1);
if (l <= 0)
return 0;
return ((X[R] * invX[L]) % mod * mod_pow(d, n)) % mod;
}
signed main() {
init();
int q;
cin >> q;
while (q--) {
int x, d, n;
cin >> x >> d >> n;
cout << cal(x, d, n) << endl;
}
return 0;
}
| [
"call.arguments.change",
"expression.operation.binary.change"
] | 837,323 | 837,325 | u192912097 | cpp |
p03027 | #include <bits/stdc++.h>
#define ll long long
using namespace std;
vector<ll> fct, invfct;
ll mod_pow(ll n, ll p, ll mod) {
// ็นฐใ่ฟใไบไนๆณใง (n^p) % mod ใๆฑใใ
if (p == 0)
return 1;
ll res = mod_pow(n * n % mod, p / 2, mod);
if (p % 2 == 1)
res = res * n % mod;
return res;
}
ll calc(ll x, ll n, ll mod) {
if (x == 0 || x + n - 1 >= mod) {
// (2-a) ใฎๅ ดๅ
return 0;
} else {
// (2-b) ใฎๅ ดๅ
return fct[x + n - 1] * invfct[x - 1] % mod;
}
}
int main() {
int Q;
cin >> Q;
ll mod = 1000003;
// mod-1 ใพใงใฎ้ไนใๆฑใใใ
fct = vector<ll>(mod, 1);
for (int i = 1; i < 2 * mod; i++) {
fct[i] = fct[i - 1] * i % mod;
}
// mod-1 ใพใงใฎ้ไนใฎ้ๆฐใๆฑใใใ
invfct = vector<ll>(mod, 1);
invfct[mod - 1] = mod_pow(mod - 1, mod - 2, mod);
for (int i = mod - 2; i >= 1; i--) {
invfct[i] = invfct[i + 1] * (i + 1) % mod;
}
while (Q--) {
ll x, d, n;
cin >> x >> d >> n;
if (d == 0) {
// (1) ใฎๅ ดๅใ x^n ใ่จ็ฎใใใ
cout << mod_pow(x, n, mod) << endl;
} else if (d == 1) {
// (2) ใฎๅ ดๅใ
cout << calc(x, n, mod) << endl;
} else {
// (3) ใฎๅ ดๅใ
// x ใ x/d ใฎ mod ใง็ฝฎใๆใใฆ(2)ใฎ่จ็ฎใใใๆๅพใซ d^n ใๆใใใ
x = x * mod_pow(d, mod - 2, mod) % mod;
cout << mod_pow(d, n, mod) * calc(x, n, mod) % mod << endl;
}
}
} | #include <bits/stdc++.h>
#define ll long long
using namespace std;
vector<ll> fct, invfct;
ll mod_pow(ll n, ll p, ll mod) {
// ็นฐใ่ฟใไบไนๆณใง (n^p) % mod ใๆฑใใ
if (p == 0)
return 1;
ll res = mod_pow(n * n % mod, p / 2, mod);
if (p % 2 == 1)
res = res * n % mod;
return res;
}
ll calc(ll x, ll n, ll mod) {
if (x == 0 || x + n - 1 >= mod) {
// (2-a) ใฎๅ ดๅ
return 0;
} else {
// (2-b) ใฎๅ ดๅ
return fct[x + n - 1] * invfct[x - 1] % mod;
}
}
int main() {
int Q;
cin >> Q;
ll mod = 1000003;
// mod-1 ใพใงใฎ้ไนใๆฑใใใ
fct = vector<ll>(mod, 1);
for (int i = 1; i < mod; i++) {
fct[i] = fct[i - 1] * i % mod;
}
// mod-1 ใพใงใฎ้ไนใฎ้ๆฐใๆฑใใใ
invfct = vector<ll>(mod, 1);
invfct[mod - 1] = mod_pow(mod - 1, mod - 2, mod);
for (int i = mod - 2; i >= 1; i--) {
invfct[i] = invfct[i + 1] * (i + 1) % mod;
}
while (Q--) {
ll x, d, n;
cin >> x >> d >> n;
if (d == 0) {
// (1) ใฎๅ ดๅใ x^n ใ่จ็ฎใใใ
cout << mod_pow(x, n, mod) << endl;
} else if (d == 1) {
// (2) ใฎๅ ดๅใ
cout << calc(x, n, mod) << endl;
} else {
// (3) ใฎๅ ดๅใ
// x ใ x/d ใฎ mod ใง็ฝฎใๆใใฆ(2)ใฎ่จ็ฎใใใๆๅพใซ d^n ใๆใใใ
x = x * mod_pow(d, mod - 2, mod) % mod;
cout << mod_pow(d, n, mod) * calc(x, n, mod) % mod << endl;
}
}
}
| [
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove"
] | 837,326 | 837,327 | u119098168 | cpp |
p03027 | /*
_ooOoo_
o8888888o
88" . "88
(| -_- |)
O\ = /O
____/`---'\____
.' \\| |// `.
/ \\||| : |||// \
/ _||||| -:- |||||- \
| | \\\ - /// | |
| \_| ''\---/'' | |
\ .-\__ `-` ___/-. /
___`. .' /--.--\ `. . __
."" '< `.___\_<|>_/___.' >'"".
| | : `- \`.;`\ _ /`;.`/ - ` : | |
\ \ `-. \_ __\ /__ _/ .-` / /
======`-.____`-.___\_____/___.-`____.-'======
`=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
prayer
*/
// g++ -std=c++11 a.cpp
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <typeinfo>
#include <unordered_map>
#include <utility>
#include <vector>
#define loop(i, a, b) for (long long i = a; i < b; i++)
#define rep(i, a) loop(i, 0, a)
#define FOR(i, a) for (auto i : a)
#define pb push_back
#define all(in) in.begin(), in.end()
#define shosu(x) fixed << setprecision(x)
#define show1d(v) \
{ \
rep(_, v.size()) cout << " " << v[_]; \
cout << endl; \
}
#define show2d(v) \
{ rep(__, v.size()) show1d(v[__]); }
using namespace std;
// kaewasuretyuui
typedef long long ll;
#define int ll
typedef int Def;
typedef pair<Def, Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def, pii> pip;
typedef vector<pip> vip;
#define mt make_tuple
typedef tuple<int, int, int, int> tp;
typedef vector<tp> vt;
template <typename A, typename B> bool cmin(A &a, const B &b) {
return a > b ? (a = b, true) : false;
}
template <typename A, typename B> bool cmax(A &a, const B &b) {
return a < b ? (a = b, true) : false;
}
const double PI = acos(-1);
const double EPS = 1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9 + 10;
#define yes cout << "Yes\n"
#define no cout << "No\n"
// nCr mod m
#define MOD 1000003
#define M 2000200
vector<ll> fact;
bool h = false;
void init() {
h = true;
fact = vector<ll>(M);
fact[0] = fact[1] = 1;
loop(i, 2, M) fact[i] = fact[i - 1] * i % MOD;
}
// a^b mod MOD
ll powmod(ll a, ll b, ll m = MOD) {
ll out = 1;
ll p = a % m;
while (b) {
if (b & 1)
out = out * p % m;
p = p * p % m;
b >>= 1;
}
return out;
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
int q;
cin >> q;
init();
while (q--) {
int x, d, n;
cin >> x >> d >> n;
if (d == 0) {
cout << powmod(x, n, MOD) << endl;
return 0;
}
if (n > 1000003) {
cout << 0 << endl;
continue;
}
(x *= powmod(d, MOD - 2, MOD)) %= MOD;
cout << fact[x + n - 1] * powmod(fact[x - 1], MOD - 2, MOD) % MOD *
powmod(d, n, MOD) % MOD
<< endl;
}
}
| /*
_ooOoo_
o8888888o
88" . "88
(| -_- |)
O\ = /O
____/`---'\____
.' \\| |// `.
/ \\||| : |||// \
/ _||||| -:- |||||- \
| | \\\ - /// | |
| \_| ''\---/'' | |
\ .-\__ `-` ___/-. /
___`. .' /--.--\ `. . __
."" '< `.___\_<|>_/___.' >'"".
| | : `- \`.;`\ _ /`;.`/ - ` : | |
\ \ `-. \_ __\ /__ _/ .-` / /
======`-.____`-.___\_____/___.-`____.-'======
`=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
prayer
*/
// g++ -std=c++11 a.cpp
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <typeinfo>
#include <unordered_map>
#include <utility>
#include <vector>
#define loop(i, a, b) for (long long i = a; i < b; i++)
#define rep(i, a) loop(i, 0, a)
#define FOR(i, a) for (auto i : a)
#define pb push_back
#define all(in) in.begin(), in.end()
#define shosu(x) fixed << setprecision(x)
#define show1d(v) \
{ \
rep(_, v.size()) cout << " " << v[_]; \
cout << endl; \
}
#define show2d(v) \
{ rep(__, v.size()) show1d(v[__]); }
using namespace std;
// kaewasuretyuui
typedef long long ll;
#define int ll
typedef int Def;
typedef pair<Def, Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def, pii> pip;
typedef vector<pip> vip;
#define mt make_tuple
typedef tuple<int, int, int, int> tp;
typedef vector<tp> vt;
template <typename A, typename B> bool cmin(A &a, const B &b) {
return a > b ? (a = b, true) : false;
}
template <typename A, typename B> bool cmax(A &a, const B &b) {
return a < b ? (a = b, true) : false;
}
const double PI = acos(-1);
const double EPS = 1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9 + 10;
#define yes cout << "Yes\n"
#define no cout << "No\n"
// nCr mod m
#define MOD 1000003
#define M 2000200
vector<ll> fact;
bool h = false;
void init() {
h = true;
fact = vector<ll>(M);
fact[0] = fact[1] = 1;
loop(i, 2, M) fact[i] = fact[i - 1] * i % MOD;
}
// a^b mod MOD
ll powmod(ll a, ll b, ll m = MOD) {
ll out = 1;
ll p = a % m;
while (b) {
if (b & 1)
out = out * p % m;
p = p * p % m;
b >>= 1;
}
return out;
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
int q;
cin >> q;
init();
while (q--) {
int x, d, n;
cin >> x >> d >> n;
if (d == 0) {
cout << powmod(x, n, MOD) << endl;
continue;
}
if (n > 1000003) {
cout << 0 << endl;
continue;
}
(x *= powmod(d, MOD - 2, MOD)) %= MOD;
cout << fact[x + n - 1] * powmod(fact[x - 1], MOD - 2, MOD) % MOD *
powmod(d, n, MOD) % MOD
<< endl;
}
}
| [
"control_flow.return.remove",
"control_flow.continue.add"
] | 837,328 | 837,329 | u010004797 | cpp |
p03027 | #include <iostream>
#define MOD 1000003
using namespace std;
long long fac_dic[1000010], fac_inv_dic[1000010], inv_d[1000010];
long long modpow(long long a, long long n, long long mod) {
long long res = 1;
while (n > 0) {
if (n & 1)
res = res * a % mod;
a = a * a % mod;
n >>= 1;
}
return res;
}
// a^{-1} mod ใ่จ็ฎใใ
long long modinv(long long a, long long mod) { return modpow(a, mod - 2, mod); }
void yield_fac() {
fac_dic[0] = 1;
fac_dic[1] = 1;
fac_inv_dic[0] = 0;
fac_inv_dic[1] = 1;
inv_d[0] = 1;
inv_d[1] = 1;
for (int i = 2; i < 1000010; i++) {
fac_dic[i] = (fac_dic[i - 1] * i) % MOD;
fac_inv_dic[i] = modinv(fac_dic[i], MOD);
inv_d[i] = modinv(i, MOD);
}
}
void solve(long long tmpx, long long tmpd, long long tmpn) {
long long ans = 0;
long long xd = (tmpx * inv_d[tmpd]) % MOD;
if (tmpd == 0) {
ans = modpow(tmpx, tmpn, MOD);
} else {
if (xd <= 1000003 && xd <= xd + tmpn - 1) {
ans = 0;
} else {
ans = (((modpow(tmpd, tmpn, MOD) * fac_dic[(xd + tmpn - 1)]) % MOD) *
fac_inv_dic[xd - 1]) %
MOD;
}
}
cout << ans << endl;
}
int main() {
int q;
cin >> q;
yield_fac();
for (int i = 0; i < q; i++) {
long long tmpx, tmpd, tmpn;
cin >> tmpx >> tmpd >> tmpn;
solve(tmpx, tmpd, tmpn);
}
} | #include <iostream>
#define MOD 1000003
using namespace std;
long long fac_dic[1000010], fac_inv_dic[1000010], inv_d[1000010];
long long modpow(long long a, long long n, long long mod) {
long long res = 1;
while (n > 0) {
if (n & 1)
res = res * a % mod;
a = a * a % mod;
n >>= 1;
}
return res;
}
// a^{-1} mod ใ่จ็ฎใใ
long long modinv(long long a, long long mod) { return modpow(a, mod - 2, mod); }
void yield_fac() {
fac_dic[0] = 1;
fac_dic[1] = 1;
fac_inv_dic[0] = 0;
fac_inv_dic[1] = 1;
inv_d[0] = 1;
inv_d[1] = 1;
for (int i = 2; i < 1000010; i++) {
fac_dic[i] = (fac_dic[i - 1] * i) % MOD;
fac_inv_dic[i] = modinv(fac_dic[i], MOD);
inv_d[i] = modinv(i, MOD);
}
}
void solve(long long tmpx, long long tmpd, long long tmpn) {
long long ans = 0;
long long xd = (tmpx * inv_d[tmpd]) % MOD;
if (tmpd == 0) {
ans = modpow(tmpx, tmpn, MOD);
} else {
if (xd <= 1000003 && 1000003 <= xd + tmpn - 1) {
ans = 0;
} else {
ans = (((modpow(tmpd, tmpn, MOD) * fac_dic[(xd + tmpn - 1)]) % MOD) *
fac_inv_dic[xd - 1]) %
MOD;
}
}
cout << ans << endl;
}
int main() {
int q;
cin >> q;
yield_fac();
for (int i = 0; i < q; i++) {
long long tmpx, tmpd, tmpn;
cin >> tmpx >> tmpd >> tmpn;
solve(tmpx, tmpd, tmpn);
}
} | [
"identifier.replace.remove",
"literal.replace.add",
"control_flow.branch.if.condition.change"
] | 837,330 | 837,331 | u112318601 | cpp |
p03027 | #include <bits/stdc++.h>
using namespace std;
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, n1, n2) for (int i = n1; i < n2; i++)
#define speed_up \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
typedef long long int ll;
typedef pair<ll, ll> Pi;
const int INF = (ll)(1LL << 31) - 1;
const ll INFl = (ll)9223372036854775807;
const int MAX = 10000;
const ll MOD = (ll)1e9 + 7;
const ll MODI = (ll)1e6 + 3;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
// int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
std::fill((T *)array, (T *)(array + N), val);
}
ll mod_pow(ll x, ll n, ll mod) {
ll res = 1;
while (n > 0) {
if (n & 1)
res = res * x % mod;
x = x * x % mod;
n >>= 1;
}
return res;
}
int q;
int x[100100], d[100100], n[100100];
ll xnd[1000100LL], xd[1000100LL];
int main() {
cin >> q;
REP(i, q) { cin >> x[i] >> d[i] >> n[i]; }
xnd[0] = 1;
for (ll i = 1; i <= 1000050; i++) {
xnd[i] = (xnd[i - 1] * i) % MODI;
}
xd[1000002] = mod_pow(xnd[1000002], MODI - 2, MODI);
for (ll i = 1000002; i > 0; i--) {
xd[i - 1] = (xd[i] * i % MODI);
}
// cout<<"2"<<endl;
for (int i = 0; i < q; i++) {
if (d[i] == 0) {
cout << mod_pow(x[i], n[i], MODI) << endl;
/*}else
if(((x[i]*mod_pow(d[i],MODI-2,MODI)-1))/MODI!=(((x[i]*mod_pow(d[i],MODI-2,MODI))+n[i-1]))/MODI){
cout<<0<<endl;*/
} else {
auto ii = x[i] * mod_pow(d[i], MODI - 2, MODI) % MODI;
if (ii + n[i] - 1 >= MODI || ii == 0)
cout << 0 << endl;
// cout<<xd[ii-1]<<endl;
cout << (xnd[ii + n[i] - 1] * xd[ii - 1] % MODI) *
mod_pow(d[i], n[i], MODI) % MODI
<< endl;
}
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, n1, n2) for (int i = n1; i < n2; i++)
#define speed_up \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
typedef long long int ll;
typedef pair<ll, ll> Pi;
const int INF = (ll)(1LL << 31) - 1;
const ll INFl = (ll)9223372036854775807;
const int MAX = 10000;
const ll MOD = (ll)1e9 + 7;
const ll MODI = (ll)1e6 + 3;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
// int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
std::fill((T *)array, (T *)(array + N), val);
}
ll mod_pow(ll x, ll n, ll mod) {
ll res = 1;
while (n > 0) {
if (n & 1)
res = res * x % mod;
x = x * x % mod;
n >>= 1;
}
return res;
}
int q;
int x[100100], d[100100], n[100100];
ll xnd[1000100LL], xd[1000100LL];
int main() {
cin >> q;
REP(i, q) { cin >> x[i] >> d[i] >> n[i]; }
xnd[0] = 1;
for (ll i = 1; i <= 1000050; i++) {
xnd[i] = (xnd[i - 1] * i) % MODI;
}
xd[1000002] = mod_pow(xnd[1000002], MODI - 2, MODI);
for (ll i = 1000002; i > 0; i--) {
xd[i - 1] = (xd[i] * i % MODI);
}
// cout<<"2"<<endl;
for (int i = 0; i < q; i++) {
if (d[i] == 0) {
cout << mod_pow(x[i], n[i], MODI) << endl;
/*}else
if(((x[i]*mod_pow(d[i],MODI-2,MODI)-1))/MODI!=(((x[i]*mod_pow(d[i],MODI-2,MODI))+n[i-1]))/MODI){
cout<<0<<endl;*/
} else {
auto ii = x[i] * mod_pow(d[i], MODI - 2, MODI) % MODI;
if (ii + n[i] - 1 >= MODI || ii == 0)
cout << 0 << endl;
// cout<<xd[ii-1]<<endl;
else
cout << (xnd[ii + n[i] - 1] * xd[ii - 1] % MODI) *
mod_pow(d[i], n[i], MODI) % MODI
<< endl;
}
}
return 0;
} | [
"control_flow.branch.else_if.replace.remove",
"control_flow.branch.if.replace.add"
] | 837,332 | 837,333 | u055303078 | cpp |
p03027 | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repf(i, j, n) for (int i = (j); i < (n); i++)
#define repr(i, n) for (int i = (n)-1; i >= 0; i--)
struct modCalc {
int mod;
int n;
vector<int> fact, invfact;
modCalc(){};
modCalc(int _mod, int _n) {
mod = _mod, n = _n;
fact.resize(n + 1, 1);
invfact.resize(n + 1, 1);
for (int i = 0; i < n; i++)
fact[i + 1] = fact[i] * (i + 1) % mod;
invfact[n] = modinv(fact[n]);
for (int i = n; i > 1; i--)
invfact[i - 1] = invfact[i] * i % mod;
};
int modpow(int x, int n) {
int ret = 1;
while (n > 0) {
if (n & 1)
(ret *= x) %= mod;
(x *= x) %= mod;
n >>= 1;
}
return ret;
}
int modinv(int x) { return modpow(x, mod - 2); }
int nCm(int x, int y) {
if (y == 0)
return 1;
else
return fact[x] * invfact[y] % mod * invfact[x - y] % mod;
}
int nPm(int x, int y = -1) {
if (y == -1)
y = x;
return fact[x] * invfact[x - y] % mod;
}
};
signed main() {
int q;
cin >> q;
vector<int> x(q), d(q), n(q);
rep(i, q) cin >> x[i] >> d[i] >> n[i];
int mod = 1e6 + 3;
modCalc mc(mod, mod - 1);
rep(i, q) {
int x0 = x[i], d0 = d[i], n0 = n[i];
if (x0 == 0) {
cout << 0 << endl;
continue;
}
if (d0 == 0) {
cout << mc.modpow(x0, n0) << endl;
continue;
}
if (n0 == 1) {
cout << x0 << endl, exit(0);
continue;
}
int dn = mc.modpow(d0, n0);
int xd = mc.modinv(d0) * x0 % mod;
if (xd + n0 - 1 >= mod) {
cout << 0 << endl;
continue;
}
int ret = mc.nPm(xd + n0 - 1, n0) * dn % mod;
cout << ret << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repf(i, j, n) for (int i = (j); i < (n); i++)
#define repr(i, n) for (int i = (n)-1; i >= 0; i--)
struct modCalc {
int mod;
int n;
vector<int> fact, invfact;
modCalc(){};
modCalc(int _mod, int _n) {
mod = _mod, n = _n;
fact.resize(n + 1, 1);
invfact.resize(n + 1, 1);
for (int i = 0; i < n; i++)
fact[i + 1] = fact[i] * (i + 1) % mod;
invfact[n] = modinv(fact[n]);
for (int i = n; i > 1; i--)
invfact[i - 1] = invfact[i] * i % mod;
};
int modpow(int x, int n) {
int ret = 1;
while (n > 0) {
if (n & 1)
(ret *= x) %= mod;
(x *= x) %= mod;
n >>= 1;
}
return ret;
}
int modinv(int x) { return modpow(x, mod - 2); }
int nCm(int x, int y) {
if (y == 0)
return 1;
else
return fact[x] * invfact[y] % mod * invfact[x - y] % mod;
}
int nPm(int x, int y = -1) {
if (y == -1)
y = x;
return fact[x] * invfact[x - y] % mod;
}
};
signed main() {
int q;
cin >> q;
vector<int> x(q), d(q), n(q);
rep(i, q) cin >> x[i] >> d[i] >> n[i];
int mod = 1e6 + 3;
modCalc mc(mod, mod - 1);
rep(i, q) {
int x0 = x[i], d0 = d[i], n0 = n[i];
if (x0 == 0) {
cout << 0 << endl;
continue;
}
if (d0 == 0) {
cout << mc.modpow(x0, n0) << endl;
continue;
}
if (n0 == 1) {
cout << x0 << endl;
continue;
}
int dn = mc.modpow(d0, n0);
int xd = mc.modinv(d0) * x0 % mod;
if (xd + n0 - 1 >= mod) {
cout << 0 << endl;
continue;
}
int ret = mc.nPm(xd + n0 - 1, n0) * dn % mod;
cout << ret << endl;
}
}
| [] | 837,339 | 837,340 | u731175398 | cpp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.