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 8
values |
|---|---|---|---|---|---|---|---|
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long X, K, D;
cin >> X >> K >> D;
X = abs(X);
if (X - K * D >= 0) {
cout << X - K * D << endl;
} else {
K -= X / D;
X -= (X / D) * D;
cout << abs(X - D * (K % 2)) << endl;
// cout << min(X + (K%2)*D,abs(X - D) + ((1 + K)%2)*... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long X, K, D;
cin >> X >> K >> D;
X = abs(X);
if (X / D - K >= 0) {
cout << X - K * D << endl;
} else {
K -= X / D;
X -= (X / D) * D;
cout << abs(X - D * (K % 2)) << endl;
// cout << min(X + (K%2)*D,abs(X - D) + ((1 + K)%2)*... | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,616 | 284,617 | u005072763 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long X, K, D;
cin >> X >> K >> D;
X = abs(X);
if (X - K * D >= 0) {
cout << X - K * D << endl;
} else {
K -= X / D;
X -= (X / D) * D;
cout << abs(X - D * (abs(K) % 2)) << endl;
// cout << min(X + (K%2)*D,abs(X - D) + ((1 + K... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long X, K, D;
cin >> X >> K >> D;
X = abs(X);
if (X / D - K >= 0) {
cout << X - K * D << endl;
} else {
K -= X / D;
X -= (X / D) * D;
cout << abs(X - D * (abs(K) % 2)) << endl;
// cout << min(X + (K%2)*D,abs(X - D) + ((1 + K... | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,618 | 284,619 | u005072763 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long X, K, D;
cin >> X >> K >> D;
if (X < 0) {
X *= -1;
}
if (X - K * D >= 0) {
cout << X - K * D << endl;
} else {
K -= X / D;
X -= (X / D) * D;
if (K % 2) {
cout << D - X << endl;
} else {
cout << X << en... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long X, K, D;
cin >> X >> K >> D;
if (X < 0) {
X *= -1;
}
if (X / D - K >= 0) {
cout << X - K * D << endl;
// cout << 1 << endl;
} else {
K -= X / D;
X -= (X / D) * D;
if (K % 2) {
cout << D - X << endl;
} el... | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,620 | 284,621 | u005072763 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
template <class T> ostream &operator<<(ostream &os, vector<T> V) {
os << "[ ";
for (auto v : V)
os << v << " ";
return os << "]";
}
template <class T> ostream &operator<<(ostream &os, set<T> S) {
os << "{ ";
for (auto s : S)
os << s << " ";
return os << ... | #include <bits/stdc++.h>
using namespace std;
template <class T> ostream &operator<<(ostream &os, vector<T> V) {
os << "[ ";
for (auto v : V)
os << v << " ";
return os << "]";
}
template <class T> ostream &operator<<(ostream &os, set<T> S) {
os << "{ ";
for (auto s : S)
os << s << " ";
return os << ... | [
"call.add",
"call.arguments.change"
] | 284,631 | 284,632 | u293764826 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
template <class T> ostream &operator<<(ostream &os, vector<T> V) {
os << "[ ";
for (auto v : V)
os << v << " ";
return os << "]";
}
template <class T> ostream &operator<<(ostream &os, set<T> S) {
os << "{ ";
for (auto s : S)
os << s << " ";
return os << ... | #include <bits/stdc++.h>
using namespace std;
template <class T> ostream &operator<<(ostream &os, vector<T> V) {
os << "[ ";
for (auto v : V)
os << v << " ";
return os << "]";
}
template <class T> ostream &operator<<(ostream &os, set<T> S) {
os << "{ ";
for (auto s : S)
os << s << " ";
return os << ... | [
"assignment.value.change",
"call.arguments.change",
"call.arguments.add"
] | 284,633 | 284,632 | u293764826 | cpp |
p02584 |
#include <bits/stdc++.h>
#include <string.h>
#include <vector>
// s#define rep(i, n) for (int i = 0; i < (n); i++)
#define MAX 10000
using namespace std;
#define inf 0x3f3f3f3f
#define ll long long
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(), (a).end()
#define rep(i, a, n) for (int i = a; i... |
#include <bits/stdc++.h>
#include <string.h>
#include <vector>
// s#define rep(i, n) for (int i = 0; i < (n); i++)
#define MAX 10000
using namespace std;
#define inf 0x3f3f3f3f
#define ll long long
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(), (a).end()
#define rep(i, a, n) for (int i = a; i... | [
"assignment.change"
] | 284,634 | 284,635 | u278032600 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef set<int> si;
typedef set<ll> sll;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define pvec(v) \
for (auto e : v) ... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef set<int> si;
typedef set<ll> sll;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define pvec(v) \
for (auto e : v) ... | [
"identifier.change",
"expression.operation.binary.change"
] | 284,641 | 284,642 | u914460803 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll X, K, D;
cin >> X >> K >> D;
ll now = abs(X);
ll num = min(K, X / D);
K -= num;
X -= num * D;
if (K % 2 == 0) {
cout << X << endl;
} else {
cout << D - X << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll X, K, D;
cin >> X >> K >> D;
ll now = abs(X);
ll num = min(K, now / D);
K -= num;
now -= num * D;
if (K % 2 == 0) {
cout << now << endl;
} else {
cout << D - now << endl;
}
} | [
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"assignment.variable.change",
"io.output.change"
] | 284,656 | 284,657 | u188588273 | cpp |
p02584 | // 2020/08/23
// Walking Takahashi
#include <fstream>
#include <iostream>
#include <math.h>
#include <string>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
long long quo; // quotient
quo = x / d;
// cout << "quo=" << quo << endl;
long long ans, tmp1, tmp2;
if (k <= quo) {
... | // 2020/08/23
// Walking Takahashi
#include <fstream>
#include <iostream>
#include <math.h>
#include <string>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
long long quo; // quotient
quo = abs(x) / d;
// cout << "quo=" << quo << endl;
long long ans, tmp1, tmp2;
if (k <= qu... | [
"call.add",
"call.arguments.change"
] | 284,660 | 284,661 | u491827431 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int ctoi(char c) {
switch (c) {
case '0':
return 0;
case '1':
return 1;
case '2':
return 2;
case '3':
return 3;
case '4':
return 4;
case '5':
return 5;
case '6':
return 6;
case '7':
return 7;
case '8':
return 8;
case... | #include <bits/stdc++.h>
using namespace std;
int ctoi(char c) {
switch (c) {
case '0':
return 0;
case '1':
return 1;
case '2':
return 2;
case '3':
return 3;
case '4':
return 4;
case '5':
return 5;
case '6':
return 6;
case '7':
return 7;
case '8':
return 8;
case... | [
"variable_declaration.type.primitive.change",
"variable_declaration.type.widen.change",
"assignment.value.change",
"identifier.change",
"expression.operation.binary.change"
] | 284,667 | 284,666 | u062680260 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll X, K, D;
cin >> X >> K >> D;
X = abs(X);
ll t = X / D;
ll p = K - t;
if (K * D > X) {
if (p % 2 == 0)
cout << X - t * D;
else
cout << (t + 1) * D - X;
} else {
cout << X - K * D;
}
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll X, K, D;
cin >> X >> K >> D;
X = abs(X);
ll t = X / D;
ll p = K - t;
if (K >= t) {
if (p % 2 == 0)
cout << X - t * D;
else
cout << (t + 1) * D - X;
} else {
cout << X - K * D;
}
} | [
"expression.operation.binary.remove"
] | 284,670 | 284,671 | u302240043 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
LL x, k, d;
int main() {
cin >> x >> k >> d;
x = max(x, -x);
LL divv = x / d;
if (divv >= k)
cout << x - k * d;
else {
LL rem = x % d;
if (divv % 2 == k % 2)
cout << rem;
else
cout << (d - rem) % d;
}
return ... | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
LL x, k, d;
int main() {
cin >> x >> k >> d;
x = max(x, -x);
LL divv = x / d;
if (divv >= k)
cout << x - k * d;
else {
LL rem = x % d;
if (divv % 2 == k % 2)
cout << rem;
else
cout << d - rem;
}
return 0;
} | [
"expression.operation.binary.remove"
] | 284,672 | 284,673 | u229051304 | cpp |
p02584 | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ll x, k, d;
cin >> x >> k >> d;
if (x < 0)
x = -x;
if (x >= k * d)
cout << x - k * d;
else {
cout << (((k - x / d) % 2 == 0) ? x % d : d - x % d);
}
} | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ll x, k, d;
cin >> x >> k >> d;
if (x < 0)
x = -x;
if (x / d >= k)
cout << x - k * d;
else {
cout << (((k - x / d) % 2 == 0) ? x % d : d - x % d);
}
} | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,674 | 284,675 | u443403172 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
#define ar array
#define endl '\n'
#define ll long long
#define in insert
#define pb push_back
#define vt vector
#define P_Q(x) priority_queue<x>
#define p_q(x) priority_queue<x, vector<x>, greater<x>>
#define Rep(i, a, b) for (int i = a; i <= b; i++)
#define Rev(i, a, b) f... | #include <bits/stdc++.h>
using namespace std;
#define ar array
#define endl '\n'
#define ll long long
#define in insert
#define pb push_back
#define vt vector
#define P_Q(x) priority_queue<x>
#define p_q(x) priority_queue<x, vector<x>, greater<x>>
#define Rep(i, a, b) for (int i = a; i <= b; i++)
#define Rev(i, a, b) f... | [
"variable_declaration.type.change"
] | 284,676 | 284,677 | u735052662 | cpp |
p02584 | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
int main() {
ll x, k, d;
cin >> x >> k >> d;
if (x < 0) {
x *= -1;
}
if (x >= k * d) {
cout << x - k * d;
}
else {
ll m;
while (x >= 0) {
m = x;
x -= d;
k--;
}
if (k % 2 == 0) {
cout << a... | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
int main() {
ll x, k, d;
cin >> x >> k >> d;
if (x < 0) {
x *= -1;
}
if (x / d > k) {
cout << x - k * d;
}
else {
ll m;
while (x >= 0) {
m = x;
x -= d;
k--;
}
if (k % 2 == 0) {
cout << ab... | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,680 | 284,681 | u686581527 | cpp |
p02584 | #include <algorithm>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define INF 1001001001001001001
#define MAX 2001001
#define rep(i, n, m) for (int i = n; i < m; i++)
u... | #include <algorithm>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define INF 1001001001001001001
#define MAX 2001001
#define rep(i, n, m) for (int i = n; i < m; i++)
u... | [
"control_flow.branch.if.condition.change",
"call.add",
"call.arguments.change"
] | 284,682 | 284,683 | u621120516 | cpp |
p02584 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll x, k, d;
cin >> x >> k >> d;
ll l = -x / d;
ll ans;
if (l < -k) {
ans = abs(x - k * d);
} else if (l > k) {
ans = abs(x + k * d);
} else {... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll x, k, d;
cin >> x >> k >> d;
ll l = -x / d;
ll ans;
if (l < -k) {
ans = abs(x - k * d);
} else if (l > k) {
ans = abs(x + k * d);
} else {... | [
"control_flow.branch.if.condition.change",
"call.add"
] | 284,688 | 284,689 | u849445992 | cpp |
p02584 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll x, k, d;
cin >> x >> k >> d;
ll l = -x / d;
ll ans;
if (l <= -k) {
ans = abs(x - k * d);
} else if (l >= k) {
ans = abs(x + k * d);
} else... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll x, k, d;
cin >> x >> k >> d;
ll l = -x / d;
ll ans;
if (l < -k) {
ans = abs(x - k * d);
} else if (l > k) {
ans = abs(x + k * d);
} else {... | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"call.add"
] | 284,690 | 284,689 | u849445992 | cpp |
p02584 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll x, k, d;
cin >> x >> k >> d;
ll l = -x / d;
ll ans;
if (l < -k) {
ans = min(abs(x - k * d), abs(x - (k - 2) * d));
} else if (l > k) {
ans =... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
// #include <boost/multiprecision/cpp_int.hpp>
// namespace mp = boost::multiprecision;
int main() {
ll x, k, d;
cin >> x >> k >> d;
ll l = -x / d;
ll ans;
if (l < -... | [
"control_flow.branch.if.condition.change",
"call.add"
] | 284,691 | 284,692 | u849445992 | cpp |
p02584 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
int main(void) {
ll x;
ll k;
ll d;
ll c;
cin >> x >> k >> d;
x = abs(x);
c = x / d;
if (c == k) {
cout << 0 << endl;
} else if (c > k) {
cout << x - d * k << endl;
} else ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
int main(void) {
ll x;
ll k;
ll d;
ll c;
cin >> x >> k >> d;
x = abs(x);
c = x / d;
if (c == k) {
cout << x - d * k << endl;
} else if (c > k) {
cout << x - d * k << endl;
... | [
"identifier.replace.add",
"literal.replace.remove",
"io.output.change"
] | 284,693 | 284,694 | u783299609 | cpp |
p02584 | #include <bitset>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define printfloat(x) cout << fixed << setprecision(7) << (x) << endl;
#define printbit(x)... | #include <bitset>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define printfloat(x) cout << fixed << setprecision(7) << (x) << endl;
#define printbit(x)... | [
"expression.operator.arithmetic.change",
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove",
"identifier.replace.add",
"literal.replace.remove"
] | 284,695 | 284,696 | u482454662 | cpp |
p02584 | #include "algorithm"
#include "bitset"
#include "cassert"
#include "climits"
#include "cmath"
#include "cstdio"
#include "ctime"
#include "functional"
#include "iomanip"
#include "iostream"
#include "list"
#include "map"
#include "numeric"
#include "queue"
#include "random"
#include "set"
#include "stack"
#include "str... | #include "algorithm"
#include "bitset"
#include "cassert"
#include "climits"
#include "cmath"
#include "cstdio"
#include "ctime"
#include "functional"
#include "iomanip"
#include "iostream"
#include "list"
#include "map"
#include "numeric"
#include "queue"
#include "random"
#include "set"
#include "stack"
#include "str... | [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 284,699 | 284,700 | u124659583 | cpp |
p02584 | #include <bits/stdc++.h>
#define ll long long
using namespace std;
void print(ll x, ll k, ll d) {
if (k & 1) {
cout << min(abs(x - d), abs(x + d));
} else
cout << abs(x);
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
ll x, k, d;
cin >> x >> k >> d;
if (abs(x) <= d) {
... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
void print(ll x, ll k, ll d) {
if (k & 1) {
cout << min(abs(x - d), abs(x + d));
} else
cout << abs(x);
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
ll x, k, d;
cin >> x >> k >> d;
if (abs(x) <= d) {
... | [
"call.add",
"call.arguments.change"
] | 284,706 | 284,707 | u413352434 | cpp |
p02584 | #include <bits/stdc++.h>
#define ll long long
using namespace std;
void print(ll x, ll k, ll d) {
if (k & 1) {
cout << min(abs(x - d), abs(x + d));
} else
cout << abs(x);
}
main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
ll x, k, d;
cin >> x >> k >> d;
if (abs(x) <= d) {
... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
void print(ll x, ll k, ll d) {
if (k & 1) {
cout << min(abs(x - d), abs(x + d));
} else
cout << abs(x);
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
ll x, k, d;
cin >> x >> k >> d;
if (abs(x) <= d) {
... | [
"call.add",
"call.arguments.change"
] | 284,708 | 284,707 | u413352434 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n) for (int i = 1; i <= n; i++)
typedef long long ll;
int main() {
ll x, k, d;
cin >> x >> k >> d;
if (x < 0)
x = -x;
if (x >= k * d) {
cout << x - k * d << endl;
} else {
ll t = x / d;
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n) for (int i = 1; i <= n; i++)
typedef long long ll;
int main() {
ll x, k, d;
cin >> x >> k >> d;
if (x < 0)
x = -x;
if (x / d >= k) {
cout << x - k * d << endl;
} else {
ll t = x / d;
... | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,709 | 284,710 | u024191315 | cpp |
p02584 | #include <algorithm>
#include <deque>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <vector>
long long int mod = 1000000007;
long long modpow(long long a, long long n, long long mod);
long long modinv(long long a, long long mod);
using namespace std;
int main() {
// C
long long in... | #include <algorithm>
#include <deque>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <vector>
long long int mod = 1000000007;
long long modpow(long long a, long long n, long long mod);
long long modinv(long long a, long long mod);
using namespace std;
int main() {
// C
long long in... | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 284,718 | 284,719 | u073015397 | cpp |
p02584 | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0, i##_len = int(n); i < i##_len; ++i)
#define rep(i, a, b) for (int i = int(a); i < int(b); ++i)
#define All(x) (x).begin(), (x).end()
#define rAll(x) (x).rbegin(), (x).rend()
using namespace std;
using ll = long long;
int main() {
ll X, K, D;
cin >> X >> K ... | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0, i##_len = int(n); i < i##_len; ++i)
#define rep(i, a, b) for (int i = int(a); i < int(b); ++i)
#define All(x) (x).begin(), (x).end()
#define rAll(x) (x).rbegin(), (x).rend()
using namespace std;
using ll = long long;
int main() {
ll X, K, D;
cin >> X >> K ... | [
"call.add",
"call.arguments.change"
] | 284,725 | 284,726 | u203033720 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int X, K, D;
cin >> X;
cin >> K;
cin >> D;
if (X < 0) {
X = -X;
}
if (X / D < K) {
cout << X - K * D << endl;
} else if ((K - X / D) % 2 == 0) {
cout << X % D << endl;
} else {
cout << D - X % D << endl;
}
return... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int X, K, D;
cin >> X;
cin >> K;
cin >> D;
if (X < 0) {
X = -X;
}
if (X / D > K) {
cout << X - K * D << endl;
} else if ((K - X / D) % 2 == 0) {
cout << X % D << endl;
} else {
cout << D - X % D << endl;
}
return... | [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 284,727 | 284,728 | u678480555 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
#define rep(i, cc, n) for (int i = cc; i < n; ++i)
#defi... | #include <bits/stdc++.h>
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
#define rep(i, cc, n) for (int i = cc; i < n; ++i)
#defi... | [
"expression.operation.binary.remove",
"control_flow.branch.if.condition.change"
] | 284,729 | 284,730 | u330518333 | cpp |
p02584 | #include <algorithm>
#include <cmath>
#include <complex>
#include <functional>
#include <iostream>
#include <limits>
#include <numeric>
#include <sstream>
#include <string>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
long long X, K, D;
cin >> X >> K >... | #include <algorithm>
#include <cmath>
#include <complex>
#include <functional>
#include <iostream>
#include <limits>
#include <numeric>
#include <sstream>
#include <string>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
long long X, K, D;
cin >> X >> K >... | [
"assignment.change",
"call.arguments.add"
] | 284,731 | 284,732 | u557207741 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
#define int long long
template <typename T> void fin(T a) {
cout << a << endl;
exit(0);
}
signed main() {
int x, k, d;
cin >> x >> k >> d;
x = abs(x);
if (x / d > k)
fin(x - d * k);
if ((x / d + k) & 1)
fin((x - x % d) % d);
fin(x % d);
}
| #include <bits/stdc++.h>
using namespace std;
#define int long long
template <typename T> void fin(T a) {
cout << a << endl;
exit(0);
}
signed main() {
int x, k, d;
cin >> x >> k >> d;
x = abs(x);
if (x / d > k)
fin(x - d * k);
if ((x / d + k) & 1)
fin(d - x % d);
fin(x % d);
}
| [
"call.arguments.change",
"expression.operation.binary.change"
] | 284,739 | 284,740 | u942774736 | cpp |
p02584 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
int main() {
ll x, k, d;
cin >> x >> k >> d;
x = abs(x);
if (x >= k * d) {
cout << x - k * d << endl;
return... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
int main() {
ll x, k, d;
cin >> x >> k >> d;
x = abs(x);
if (x / d >= k) {
cout << x - k * d << endl;
return... | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove",
"identifier.change"
] | 284,741 | 284,742 | u268822556 | cpp |
p02584 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
int main() {
ll x, k, d;
cin >> x >> k >> d;
x = abs(x);
if (x >= k * d) {
cout << x - k * d << endl;
return... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
int main() {
ll x, k, d;
cin >> x >> k >> d;
x = abs(x);
if (x / d >= k) {
cout << x - k * d << endl;
return... | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,743 | 284,742 | u268822556 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
#ifndef aa
#define trace(...)
#define endl '\n'
#endif
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define fi first
#define se second
#define int long long
typedef long long ll;
typedef long double ld;
#define double long double
#define pii pair<int... | #include <bits/stdc++.h>
using namespace std;
#ifndef aa
#define trace(...)
#define endl '\n'
#endif
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define fi first
#define se second
#define int long long
typedef long long ll;
typedef long double ld;
#define double long double
#define pii pair<int... | [
"assignment.value.change",
"identifier.change",
"expression.operation.binary.change",
"assignment.change"
] | 284,744 | 284,745 | u919814960 | cpp |
p02584 | #include <bits/stdc++.h>
/*...
...
author
@
Aman Kothari
.....
.....*/
using namespace std;
#define ll long long
#define dl double
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
ll x, k, d;
cin >> x >> k >> d;
x = abs(x);
if (x / d >= k) {
ll ans = x - (k * ... | #include <bits/stdc++.h>
/*...
...
author
@
Aman Kothari
.....
.....*/
using namespace std;
#define ll long long
#define dl double
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
ll x, k, d;
cin >> x >> k >> d;
x = abs(x);
if (x / d >= k) {
ll ans = x - (k * ... | [
"expression.operation.binary.add"
] | 284,746 | 284,747 | u905654805 | cpp |
p02584 | #include <algorithm>
#include <array>
#include <iostream>
#include <numeric>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
using ll = long long;
#define rep(i, n) for (decltype(n) i = 0; i < n; ++i)
inline constexpr ll Inf = (1ULL << 62) - 1;
template <class T> void updatemax(T &a, T b) {
... | #include <algorithm>
#include <array>
#include <iostream>
#include <numeric>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
using ll = long long;
#define rep(i, n) for (decltype(n) i = 0; i < n; ++i)
inline constexpr ll Inf = (1ULL << 62) - 1;
template <class T> void updatemax(T &a, T b) {
... | [
"call.add",
"call.arguments.change"
] | 284,748 | 284,749 | u185413585 | cpp |
p02584 | #include <bits/stdc++.h>
#define ALL(A) (A).begin(), (A).end()
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a ... | #include <bits/stdc++.h>
#define ALL(A) (A).begin(), (A).end()
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a ... | [
"call.arguments.change"
] | 284,750 | 284,751 | u168774513 | cpp |
p02584 | //
// main.cpp
// ervb
//
// Created by Kanak Gautam on 21/04/20.
// Copyright © 2020 Kanak Gautam. All rights reserved.
//
#include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#includ... | //
// main.cpp
// ervb
//
// Created by Kanak Gautam on 21/04/20.
// Copyright © 2020 Kanak Gautam. All rights reserved.
//
#include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#includ... | [
"control_flow.branch.else_if.replace.add",
"control_flow.branch.if.replace.remove"
] | 284,752 | 284,753 | u068535586 | cpp |
p02584 | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
//#include <boost/multiprecision/cpp_int.hpp>
//
// using namespace boost::multiprecision;
using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag,
tree_... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
//#include <boost/multiprecision/cpp_int.hpp>
//
// using namespace boost::multiprecision;
using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag,
tree_... | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,772 | 284,773 | u403290660 | cpp |
p02584 | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
//#include <boost/multiprecision/cpp_int.hpp>
//
// using namespace boost::multiprecision;
using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag,
tree_... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
//#include <boost/multiprecision/cpp_int.hpp>
//
// using namespace boost::multiprecision;
using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag,
tree_... | [
"expression.operation.binary.remove",
"control_flow.branch.if.condition.change"
] | 284,774 | 284,773 | u403290660 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
#define COUT(x) cout << #x << " = " << (x) << " (L" << __... | #include <bits/stdc++.h>
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
#define COUT(x) cout << #x << " = " << (x) << " (L" << __... | [
"identifier.replace.remove",
"literal.replace.add"
] | 284,788 | 284,789 | u692336506 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main(void) {
long long X, K, D;
long long ans = 0;
cin >> X >> K >> D;
if (K * D < abs(X)) {
ans = abs(X) - K * D;
} else {
if ((abs(X) / D) % 2 == 0) {
if (K % 2 == 0) {
ans = abs(X) % D;
} else {
ans = abs(abs(X) % D - D... | #include <bits/stdc++.h>
using namespace std;
int main(void) {
long long X, K, D;
long long ans = 0;
cin >> X >> K >> D;
if (K < abs(X) / D) {
ans = abs(X) - K * D;
} else {
if ((abs(X) / D) % 2 == 0) {
if (K % 2 == 0) {
ans = abs(X) % D;
} else {
ans = abs(abs(X) % D - D... | [
"expression.operation.binary.remove",
"control_flow.branch.if.condition.change"
] | 284,790 | 284,791 | u864090097 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
ll n, m, t, a[100005];
vector<ll> adj[100005];
#define ari \
for (int i = 0; i < n; i++) \
cin >> a[i];
#d... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
ll n, m, t, a[100005];
vector<ll> adj[100005];
#define ari \
for (int i = 0; i < n; i++) \
cin >> a[i];
#d... | [
"call.add",
"call.arguments.change"
] | 284,793 | 284,794 | u681396939 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
long long x, k, d;
cin >> x >> k >> d;
long long cur = abs(x);
int rem = k;
long long cnt = min(cur / d, k);
cur -= d * cnt;
rem -= cnt;
if (rem > 0) {
if (rem % 2 == 1) {
cur =... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
long long x, k, d;
cin >> x >> k >> d;
long long cur = abs(x);
long long rem = k;
long long cnt = min(cur / d, k);
cur -= d * cnt;
rem -= cnt;
if (rem > 0) {
if (rem % 2 == 1) {
... | [
"variable_declaration.type.primitive.change",
"variable_declaration.type.widen.change"
] | 284,795 | 284,796 | u231961655 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
x = abs(x);
int ans;
if (x / d > k) {
ans = x - d * k;
} else {
int a = k - x / d;
if (a % 2)
ans = x - d * (x / d + 1);
else
ans = x - d * (x / d);
}
cout << abs(ans) << endl;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
x = abs(x);
long long ans;
if (x / d > k) {
ans = x - d * k;
} else {
long long a = k - x / d;
if (a % 2)
ans = x - d * (x / d + 1);
else
ans = x - d * (x / d);
}
cout << abs(an... | [
"variable_declaration.type.primitive.change",
"variable_declaration.type.widen.change"
] | 284,798 | 284,799 | u055884688 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
long long a = x / d;
if (0 > a) {
a = 0 - a;
}
if (x < 0) {
x += min(a, k);
} else {
x -= min(a, k) * d;
}
k -= min(a, k);
if (x > 0) {
x -= (k % 2) * d;
} else {
x += (k % 2) * d;... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
long long a = x / d;
if (0 > a) {
a = 0 - a;
}
if (x < 0) {
x += min(a, k) * d;
} else {
x -= min(a, k) * d;
}
k -= min(a, k);
if (x > 0) {
x -= (k % 2) * d;
} else {
x += (k % 2) ... | [
"assignment.change"
] | 284,800 | 284,801 | u006783139 | cpp |
p02584 | // Create by JJL
#define IOS \
ios_base::sync_with_stdio(0); \
cin.tie(0);
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <set>
... | // Create by JJL
#define IOS \
ios_base::sync_with_stdio(0); \
cin.tie(0);
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <set>
... | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,810 | 284,811 | u496396808 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
// rep…「0からn-1まで」の繰り返し
#define rep2(i, s, n) for (long long i = s; i <= (long long)(n); i++)
// rep2…「sからnまで」の繰り返し
#define repr(i, s, n) for (long long i = s; i >= (long long)(n); i--)
// repr…「sからnまで」の降順の繰り返... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
// rep…「0からn-1まで」の繰り返し
#define rep2(i, s, n) for (long long i = s; i <= (long long)(n); i++)
// rep2…「sからnまで」の繰り返し
#define repr(i, s, n) for (long long i = s; i >= (long long)(n); i--)
// repr…「sからnまで」の降順の繰り返... | [
"expression.operation.binary.remove",
"control_flow.branch.if.condition.change"
] | 284,814 | 284,815 | u931071094 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
// rep…「0からn-1まで」の繰り返し
#define rep2(i, s, n) for (long long i = s; i <= (long long)(n); i++)
// rep2…「sからnまで」の繰り返し
#define repr(i, s, n) for (long long i = s; i >= (long long)(n); i--)
// repr…「sからnまで」の降順の繰り返... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
// rep…「0からn-1まで」の繰り返し
#define rep2(i, s, n) for (long long i = s; i <= (long long)(n); i++)
// rep2…「sからnまで」の繰り返し
#define repr(i, s, n) for (long long i = s; i >= (long long)(n); i--)
// repr…「sからnまで」の降順の繰り返... | [
"expression.operation.binary.remove",
"control_flow.branch.if.condition.change"
] | 284,816 | 284,817 | u931071094 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
if (x < 0)
abs(x);
if (x / d >= k)
cout << x - k * d;
else if (x / d % 2 != k % 2)
cout << d - x % d;
else
cout << x % d;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
if (x < 0)
x = -x;
if (x / d >= k)
cout << x - k * d;
else if (x / d % 2 != k % 2)
cout << d - x % d;
else
cout << x % d;
return 0;
} | [
"call.remove",
"call.arguments.change"
] | 284,818 | 284,819 | u714254211 | cpp |
p02584 | #include <algorithm>
#include <iostream>
using namespace std;
long long longabs(long long x) {
if (x < 0)
x *= -1;
return x;
}
int main() {
long long pos;
long long n, d;
cin >> pos >> n >> d;
pos = longabs(pos);
if (pos >= n * d) {
cout << pos - n * d << endl;
return 0;
}
else {
... | #include <algorithm>
#include <iostream>
using namespace std;
long long longabs(long long x) {
if (x < 0)
x *= -1;
return x;
}
int main() {
long long pos;
long long n, d;
cin >> pos >> n >> d;
pos = longabs(pos);
if (pos / d >= n) {
cout << pos - n * d << endl;
return 0;
}
else {
... | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,824 | 284,825 | u066739287 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
if (x > 0) {
long long t = x / d;
if (t >= k) {
cout << x - k * d;
} else {
x = x - t * d;
k = k - t;
if (k % 2 == 0) {
cout << x;
} else
cout << d - x;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
if (x > 0) {
long long t = x / d;
if (t >= k) {
cout << x - k * d;
} else {
x = x - t * d;
k = k - t;
if (k % 2 == 0) {
cout << x;
} else
cout << d - x;
... | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 284,828 | 284,829 | u985615809 | cpp |
p02584 | #include <iostream>
using namespace std;
int main() {
long x, k, d;
cin >> x >> k >> d;
x = abs(x);
if (x >= k * d) {
cout << x - k * d << endl;
} else {
// x / d < k
// k - x / d > 0
long t = k - x / d;
if (t % 2 == 0) {
cout << x % d << endl;
} else {
cout << abs(x % d - ... | #include <iostream>
using namespace std;
int main() {
long x, k, d;
cin >> x >> k >> d;
x = abs(x);
if (x / d >= k) {
// K * d の最大は10e30//
cout << x - k * d << endl;
} else {
// x / d < k
// k - x / d > 0
long t = k - x / d;
if (t % 2 == 0) {
cout << x % d << endl;
} else {
... | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,837 | 284,838 | u359856428 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
void solve() {
ll X, K, D, res = 0;
cin >> X >> K >> D;
X = abs(X);
if (X / D >= K)
res = X - D * K;
else {
ll temp = X / D;
K = K - temp;
X = X - temp * K;
if (K % 2)
X = abs(X - D);
res... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
void solve() {
ll X, K, D, res = 0;
cin >> X >> K >> D;
X = abs(X);
if (X / D >= K)
res = X - D * K;
else {
ll temp = X / D;
K = K - temp;
X = X - temp * D;
if (K % 2)
X = abs(X - D);
res... | [
"assignment.value.change",
"identifier.change",
"expression.operation.binary.change"
] | 284,839 | 284,840 | u412960991 | cpp |
p02584 | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
long solve(long x, long k, long d) {
if (x < 0)
d = -d;
auto a = std::abs(x / d);
if (x % d)
++a;
if (a > k)
return x - d * k;
const auto b = x - d * a;
return std::abs((k - a) % 2... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
long solve(long x, long k, long d) {
if (x < 0)
d = -d;
auto a = std::abs(x / d);
if (x % d)
++a;
if (a > k)
return std::abs(x - d * k);
const auto b = x - d * a;
return std::abs((... | [
"call.add",
"call.arguments.change",
"function.return_value.change"
] | 284,841 | 284,842 | u405612058 | cpp |
p02584 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = long long;
using namespace std;
int main() {
ll x, k, d;
cin >> x >> k >> d;
x = abs(x);
ll ans;
if (x / d > k)
ans = x - d * k;
else {
ll e = x / d;
k -= e;
x -= e * d;
if (k % 2 == 1)
x = abs(x ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = long long;
using namespace std;
int main() {
ll x, k, d;
cin >> x >> k >> d;
x = abs(x);
ll ans;
if (x / d > k)
ans = x - d * k;
else {
ll e = x / d;
k -= e;
x -= e * d;
if (k % 2 == 1)
x = abs(x ... | [
"misc.opposites",
"expression.operator.arithmetic.change",
"assignment.value.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 284,843 | 284,844 | u020933954 | cpp |
p02584 | #include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sz(a) (a).size()
#define all(c) (c).begin(), (c).end()
#define rep(i, n) for (int i = 0; i < n; i++)
#define forn(i, n) for (int i = 1; i <= n; i++)
#define ford(i, n) for (int i = n; i >= 0; i--)
#define REP(i... | #include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sz(a) (a).size()
#define all(c) (c).begin(), (c).end()
#define rep(i, n) for (int i = 0; i < n; i++)
#define forn(i, n) for (int i = 1; i <= n; i++)
#define ford(i, n) for (int i = n; i >= 0; i--)
#define REP(i... | [
"expression.operator.arithmetic.change",
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,845 | 284,846 | u811897616 | cpp |
p02584 | #include <bits/stdc++.h>
#define INF 2000000000
#define MOD 1000000007
#define EPS (1e-10)
using namespace std;
int main(int argc, char *argv[]) {
long long X, K, D;
cin >> X >> K >> D;
X = abs(X);
long long ans = 0;
if (X >= K * D) {
ans = X - (K * D);
} else {
long long temae_made = (X / D);
... | #include <bits/stdc++.h>
#define INF 2000000000
#define MOD 1000000007
#define EPS (1e-10)
using namespace std;
int main(int argc, char *argv[]) {
long long X, K, D;
cin >> X >> K >> D;
X = abs(X);
long long ans = 0;
if (X / D >= K) {
ans = X - (K * D);
} else {
long long temae_made = (X / D);
... | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,847 | 284,848 | u365077014 | cpp |
p02584 | #include <bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define BITLE(n) (1LL << ((ll)n))
#define SUBS(s, f, t) ((s).substr((f), (t) - (f)))
#define ALL... | #include <bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define BITLE(n) (1LL << ((ll)n))
#define SUBS(s, f, t) ((s).substr((f), (t) - (f)))
#define ALL... | [
"identifier.change",
"io.output.change"
] | 284,853 | 284,854 | u905715926 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll x, k, d;
cin >> x >> k >> d;
x = abs(x);
if (x >= k * d) {
cout << x - k * d << endl;
return 0;
} else {
k -= x / d;
if (k % 2 == 0) {
cout << x - d * (x / d) << endl;
} else {
cout << abs(x -... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll x, k, d;
cin >> x >> k >> d;
x = abs(x);
if (x / d >= k) {
cout << x - k * d << endl;
return 0;
} else {
k -= x / d;
if (k % 2 == 0) {
cout << x - d * (x / d) << endl;
} else {
cout << abs(x -... | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,858 | 284,859 | u675125216 | cpp |
p02584 | #include <bits/stdc++.h>
#define fint register int
#define h 5001
#define p 4859345
#define int long long
using namespace std;
signed main() {
int x, k, d;
cin >> x >> k >> d;
int steps = abs(x) / d;
int now = x;
now -= (steps * d);
if (steps == k)
cout << now;
else if (steps > k) {
cout << abs(x)... | #include <bits/stdc++.h>
#define fint register int
#define h 5001
#define p 4859345
#define int long long
using namespace std;
signed main() {
int x, k, d;
cin >> x >> k >> d;
int steps = abs(x) / d;
int now = abs(x);
now -= (steps * d);
if (steps == k)
cout << now;
else if (steps > k) {
cout << a... | [
"call.add",
"call.arguments.change"
] | 284,866 | 284,865 | u033009443 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using uint = unsigned;
using pcc = pair<char, char>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
using tuplis = array<ll, 3>;
template <class T> using p... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using uint = unsigned;
using pcc = pair<char, char>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
using tuplis = array<ll, 3>;
template <class T> using p... | [
"expression.operator.arithmetic.change",
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove",
"identifier.replace.add",
"literal.replace.remove"
] | 284,869 | 284,870 | u902786897 | cpp |
p02584 | #define CPP17
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <complex>
#include <cstddef>
#include <deque>
#include <functional>
#include <initializer_list>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numeric>... | #define CPP17
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <complex>
#include <cstddef>
#include <deque>
#include <functional>
#include <initializer_list>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numeric>... | [
"identifier.change",
"function.return_value.change",
"expression.operation.binary.change"
] | 284,876 | 284,877 | u216962796 | cpp |
p02584 | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define r... | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define r... | [
"expression.operator.arithmetic.change",
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove",
"identifier.replace.add",
"literal.replace.remove"
] | 284,882 | 284,883 | u860546679 | cpp |
p02584 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define rrep1(i, n) for (int i = (n); i > 0; i--)
#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>
#define MOD 10000000... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define rrep1(i, n) for (int i = (n); i > 0; i--)
#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>
#define MOD 10000000... | [
"assignment.value.change",
"expression.operation.unary.add"
] | 284,886 | 284,887 | u021358975 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
if (x < 0) {
x = -x;
}
if (x >= d * k) {
cout << x - d * k << endl;
} else {
k -= x / d;
x %= d;
if (k % 2 == 0) {
cout << x << endl;
} else {
cout << d - x << endl;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
if (x < 0) {
x = -x;
}
if (x / d >= k) {
cout << x - d * k << endl;
} else {
k -= x / d;
x %= d;
if (k % 2 == 0) {
cout << x << endl;
} else {
cout << d - x << endl;
... | [
"control_flow.branch.if.condition.change"
] | 284,892 | 284,893 | u923172145 | cpp |
p02584 | //
// Created by 27420 on 2020/8/16.
//
#include <iostream>
#include <stdio.h>
typedef long long ll;
using namespace std;
void solve(ll x, ll k, ll d) {
if (x < 0)
x = abs(x); // x可以取负数
else {
if ((x / d) > k) {
printf("%lld", x - k * d);
} else if ((k - x / d) % 2 == 1) {
printf("%lld", ab... | //
// Created by 27420 on 2020/8/16.
//
#include <iostream>
#include <stdio.h>
typedef long long ll;
using namespace std;
void solve(ll x, ll k, ll d) {
if (x < 0)
x = abs(x); // x可以取负数
if ((x / d) > k) {
printf("%lld", x - k * d);
} else {
if ((k - x / d) % 2 == 1) {
printf("%lld", abs(x % d -... | [] | 284,900 | 284,901 | u236468356 | cpp |
p02584 | //
// Created by 27420 on 2020/8/16.
//
#include <iostream>
#include <stdio.h>
typedef long long ll;
using namespace std;
void solve(ll x, ll k, ll d) {
if (x < 0)
x = abs(x); // x可以取负数
else {
if ((x / d) > k) {
printf("%d", x - k * d);
} else if ((k - x / d) % 2 == 1) {
printf("%d", abs(x ... | //
// Created by 27420 on 2020/8/16.
//
#include <iostream>
#include <stdio.h>
typedef long long ll;
using namespace std;
void solve(ll x, ll k, ll d) {
if (x < 0)
x = abs(x); // x可以取负数
if ((x / d) > k) {
printf("%lld", x - k * d);
} else {
if ((k - x / d) % 2 == 1) {
printf("%lld", abs(x % d -... | [
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 284,902 | 284,901 | u236468356 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long x, k, d;
scanf("%lld %lld %lld", &x, &k, &d);
x = abs(x);
if (x / d > k) {
printf("%lld\n", x % d + d * (x / d - k));
} else {
printf("%lld\n", k % 2 == 0 ? x % d : abs(x % d - d));
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
long long x, k, d;
scanf("%lld %lld %lld", &x, &k, &d);
x = abs(x);
if (x / d > k) {
printf("%lld\n", x % d + d * (x / d - k));
} else {
printf("%lld\n", (k - x / d) % 2 == 0 ? x % d : abs(x % d - d));
}
return 0;
}
| [
"control_flow.branch.if.condition.change"
] | 284,908 | 284,909 | u123756661 | cpp |
p02584 | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define FOR(i, m, n) for (ll i = m; i < (n); i++)
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
using vi = vector<int>;
using vii = vector<vi>;
using pii = pair<int, int>;
using vl = vector<... | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define FOR(i, m, n) for (ll i = m; i < (n); i++)
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
using vi = vector<int>;
using vii = vector<vi>;
using pii = pair<int, int>;
using vl = vector<... | [
"assignment.value.change",
"identifier.change",
"expression.operation.binary.change"
] | 284,913 | 284,914 | u563914702 | cpp |
p02584 | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define FOR(i, m, n) for (ll i = m; i < (n); i++)
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
using vi = vector<int>;
using vii = vector<vi>;
using pii = pair<int, int>;
using vl = vector<... | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define FOR(i, m, n) for (ll i = m; i < (n); i++)
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
using vi = vector<int>;
using vii = vector<vi>;
using pii = pair<int, int>;
using vl = vector<... | [
"identifier.change",
"expression.operation.binary.change",
"control_flow.branch.if.condition.change"
] | 284,915 | 284,916 | u563914702 | cpp |
p02584 | #include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++) // rep(i,回数){処理}
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll x, k, d;
cin >> x >> k >> d;
int ans;
x = abs(x); //原点からーや+であっても同じ
//往復せずに終わる場合
if (x / d > k) {
ans = x - d * k;
... | #include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++) // rep(i,回数){処理}
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll x, k, d;
cin >> x >> k >> d;
ll ans;
x = abs(x); //原点からーや+であっても同じ
//往復せずに終わる場合
if (x / d > k) {
ans = x - d * k;
... | [
"variable_declaration.type.change"
] | 284,917 | 284,918 | u799428010 | cpp |
p02584 | #include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++) // rep(i,回数){処理}
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
int x, k, d;
cin >> x >> k >> d;
ll ans;
x = abs(x); //原点からーや+であっても同じ
//往復せずに終わる場合
if (x / d < k) {
ans = x - d * k;
... | #include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++) // rep(i,回数){処理}
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll x, k, d;
cin >> x >> k >> d;
ll ans;
x = abs(x); //原点からーや+であっても同じ
//往復せずに終わる場合
if (x / d > k) {
ans = x - d * k;
... | [
"variable_declaration.type.change",
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"assignment.variable.change",
"identifier.change"
] | 284,919 | 284,918 | u799428010 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll x, k, d;
cin >> x >> k >> d;
x = abs(x);
if (x / d <= k)
cout << x - d * k << endl;
else {
long r1 = x % d;
if ((k - (x - r1) / d) % 2 == 0) {
cout << r1 << endl;
} else {
cout << (d - r1) << end... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll x, k, d;
cin >> x >> k >> d;
x = abs(x);
if (x / d >= k) {
cout << x - d * k << endl;
} else {
long r1 = x % d;
if ((k - (x - r1) / d) % 2 == 0) {
cout << r1 << endl;
} else {
cout << (d - r1) <<... | [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 284,929 | 284,930 | u932291797 | cpp |
p02584 | #include <iostream>
#include <stdio.h>
#include <string>
// #include <cstdlib>
#include <stdlib.h>
using namespace std;
long long X;
long long K;
long long D;
int main() {
cin >> X >> K >> D;
if (D > labs(X)) {
if (K % 2 == 0) {
cout << labs(X) << endl;
} else {
if (X >= 0) {
cout << ... | #include <iostream>
#include <stdio.h>
#include <string>
// #include <cstdlib>
#include <stdlib.h>
using namespace std;
long X;
unsigned long K;
unsigned long D;
int main() {
cin >> X >> K >> D;
if (D > labs(X)) {
if (K % 2 == 0) {
cout << labs(X) << endl;
} else {
if (X >= 0) {
cout ... | [
"variable_declaration.type.narrow.change",
"variable_declaration.type.primitive.change"
] | 284,944 | 284,945 | u646880214 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
#ifdef LOCAL
freopen("in", "r", stdin);
#endif // LOCAL
ios::sync_with_stdio(0);
cin.tie(0);
int64_t x, k, d;
cin >> x >> k >> d;
int64_t step = abs(x) / d;
if (step > k)
cout << abs(x) - k * d;
else {
if (step % 2 == 0)
cout << ... | #include <bits/stdc++.h>
using namespace std;
int main() {
#ifdef LOCAL
freopen("in", "r", stdin);
#endif // LOCAL
ios::sync_with_stdio(0);
cin.tie(0);
int64_t x, k, d;
cin >> x >> k >> d;
int64_t step = abs(x) / d;
if (step > k)
cout << abs(x) - k * d;
else {
if ((k - step) % 2 == 0)
co... | [
"control_flow.branch.if.condition.change"
] | 284,950 | 284,951 | u209067041 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int factorial(int n);
int factorial(int n) {
if (n == 1) {
return 1;
} else {
return n * factorial(n - 1);
}
}
bool is_prime(ll n) {
// Assumes that n is a positive natural number
// We know 1 is not a prime number
if (n == 1) {
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int factorial(int n);
int factorial(int n) {
if (n == 1) {
return 1;
} else {
return n * factorial(n - 1);
}
}
bool is_prime(ll n) {
// Assumes that n is a positive natural number
// We know 1 is not a prime number
if (n == 1) {
... | [
"expression.operation.compare.replace.remove",
"assignment.replace.add",
"misc.typo"
] | 284,952 | 284,953 | u372321911 | cpp |
p02584 | #include <iostream>
using namespace std;
int main(void) {
long X, K, D;
cin >> X >> K >> D;
long now_place = X;
long times = now_place / D + 1;
if (times < 0) {
times *= -1;
}
if (times > K) {
times = K;
}
if (now_place > 0) {
now_place -= D * times;
K -= times;
} else {
now... | #include <iostream>
using namespace std;
int main(void) {
long X, K, D;
cin >> X >> K >> D;
long now_place = X;
long times = now_place / D;
if (times < 0) {
times *= -1;
}
if (times > K) {
times = K;
}
if (now_place > 0) {
now_place -= D * times;
K -= times;
} else {
now_pla... | [
"expression.operation.binary.remove"
] | 284,962 | 284,963 | u696048490 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long X;
long long K;
long long D;
cin >> X >> K >> D;
long long ans = 0;
if (abs(abs(X) / D) >= K) {
if (X > 0) {
ans = X - K * D;
cout << abs(ans) << endl;
return 0;
}
if (X < 0) {
ans = X + K * D;
c... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long X;
long long K;
long long D;
cin >> X >> K >> D;
long long ans = 0;
if (abs(abs(X) / D) >= K) {
if (X > 0) {
ans = X - K * D;
cout << abs(ans) << endl;
return 0;
}
if (X < 0) {
ans = X + K * D;
c... | [
"control_flow.branch.if.condition.change",
"assignment.value.change",
"identifier.change"
] | 284,968 | 284,969 | u469315559 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t x, d, k;
cin >> x >> k >> d;
x = abs(x);
if (x <= d) {
if (k % 2 == 0) {
cout << x << endl;
return 0;
} else {
cout << d - x << endl;
return 0;
}
}
if (x > d * k && k > 100000000000000) {
cout << x ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t x, d, k;
cin >> x >> k >> d;
x = abs(x);
if (x <= d) {
if (k % 2 == 0) {
cout << x << endl;
return 0;
} else {
cout << d - x << endl;
return 0;
}
}
if (x > d * k && k > 100000000000000 && d < 100) {
... | [
"control_flow.branch.if.condition.change"
] | 284,976 | 284,977 | u490253317 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t x, d, k;
cin >> x >> k >> d;
x = abs(x);
if (x <= d) {
if (k % 2 == 0) {
cout << x << endl;
return 0;
} else {
cout << d - x << endl;
return 0;
}
}
if (x > d * k && k > 10000000000) {
cout << x - d ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t x, d, k;
cin >> x >> k >> d;
x = abs(x);
if (x <= d) {
if (k % 2 == 0) {
cout << x << endl;
return 0;
} else {
cout << d - x << endl;
return 0;
}
}
if (x > d * k && k > 100000000000000 && d < 100) {
... | [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 284,978 | 284,977 | u490253317 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t x, d, k;
cin >> x >> k >> d;
x = abs(x);
if (x <= d) {
if (k % 2 == 0) {
cout << x << endl;
return 0;
} else {
cout << d - x << endl;
return 0;
}
}
if (x > d * k && k > 100000) {
cout << x - d * k <... | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t x, d, k;
cin >> x >> k >> d;
x = abs(x);
if (x <= d) {
if (k % 2 == 0) {
cout << x << endl;
return 0;
} else {
cout << d - x << endl;
return 0;
}
}
if (x > d * k && k > 100000000000000 && d < 100) {
... | [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 284,979 | 284,977 | u490253317 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using pll = pair<long, long>;
using vpi = vector<pii>;
#define pb push_back
#define mp make_pair
#define all(v) (v).begin(), (v).end()
#define rall(v... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using pll = pair<long, long>;
using vpi = vector<pii>;
#define pb push_back
#define mp make_pair
#define all(v) (v).begin(), (v).end()
#define rall(v... | [
"call.add",
"call.arguments.change"
] | 284,985 | 284,986 | u827865658 | cpp |
p02584 | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdio.h>
#include <string>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
typedef long long ll;
using namespace std;
int main() {
ll x, k, d;
cin >> x >> k >> d;... | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdio.h>
#include <string>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
typedef long long ll;
using namespace std;
int main() {
ll x, k, d;
cin >> x >> k >> d;... | [
"call.add",
"call.arguments.change"
] | 284,996 | 284,997 | u745134826 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
//#define f(i,a,n) for(ll i=a;i<n;i++)
#define fast \
ios_base::sync_with_stdio(0); \
cin.tie(0); ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
//#define f(i,a,n) for(ll i=a;i<n;i++)
#define fast \
ios_base::sync_with_stdio(0); \
cin.tie(0); ... | [
"control_flow.branch.if.condition.change"
] | 285,000 | 285,001 | u049892106 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll x, k, d;
cin >> x >> k >> d;
ll t = -x / d, f = k % 2, ans = 1e18;
ll mi, ma;
mi = -k, ma = k;
if (abs(t) <= k) {
if (mi > ma)
swap(mi, ma);
ll l = max(mi, t - 10), r = min(ma, t + 10);
for (ll i = l; i ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll x, k, d;
cin >> x >> k >> d;
ll t = -x / d, f = k % 2, ans = 1e18;
ll mi, ma;
mi = -k, ma = k;
if (abs(t) <= k) {
if (mi > ma)
swap(mi, ma);
ll l = max(mi, t - 10), r = min(ma, t + 10);
for (ll i = l; i ... | [
"call.arguments.add",
"call.arguments.change",
"call.add"
] | 285,002 | 285,003 | u457777106 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll X, K, D, N;
cin >> X >> K >> D;
if (X > 0) {
N = X / D;
if (N > K) {
X = X - K * D;
} else {
X = X - N * D;
N = (K - N) % 2;
if (N != 0) {
X = X - D;
}
}
} else {
N = (-1... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll X, K, D, N;
cin >> X >> K >> D;
if (X > 0) {
N = X / D;
if (N > K) {
X = X - K * D;
} else {
X = X - N * D;
N = (K - N) % 2;
if (N != 0) {
X = X - D;
}
}
} else {
N = (-1... | [
"call.add",
"call.arguments.change"
] | 285,009 | 285,010 | u697149593 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t X, K, D;
cin >> X >> K >> D;
int64_t chk = (X / D);
int64_t ans;
if (abs(chk) >= K) {
if (X > 0) {
ans = X - D * K;
}
if (X < 0) {
ans = X + D * K;
}
cout << abs(ans) << endl;
return 0;
}
if ((K - chk) ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t X, K, D;
cin >> X >> K >> D;
int64_t chk = abs(X / D);
int64_t ans;
if (abs(chk) >= K) {
if (X > 0) {
ans = X - D * K;
}
if (X < 0) {
ans = X + D * K;
}
cout << abs(ans) << endl;
return 0;
}
if ((K - ch... | [
"call.add"
] | 285,025 | 285,026 | u977547071 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t X, K, D;
cin >> X >> K >> D;
int64_t chk = (X / D);
int64_t ans;
if (abs(chk) >= K) {
if (X >= 0) {
ans = X - D * K;
}
if (X < 0) {
ans = X + D * K;
}
cout << abs(ans) << endl;
return 0;
}
if ((K - chk)... | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t X, K, D;
cin >> X >> K >> D;
int64_t chk = abs(X / D);
int64_t ans;
if (abs(chk) >= K) {
if (X > 0) {
ans = X - D * K;
}
if (X < 0) {
ans = X + D * K;
}
cout << abs(ans) << endl;
return 0;
}
if ((K - ch... | [
"call.add",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 285,027 | 285,026 | u977547071 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
using V_2 = vector<vector<int>>;
using ll = long long;
ll k;
float x, d, ans;
int main() {
cin >> x >> k >> d;
if (x < 0)
x = -1 * x;
ll syou = x / d;
ll sa = k - syou;
if (syou < k && sa % 2 == 0)
ans = x - syou * d;
else if (syou < k && sa % 2 != 0)
... | #include <bits/stdc++.h>
using namespace std;
using V_2 = vector<vector<int>>;
using ll = long long;
ll k, x, d, ans;
int main() {
cin >> x >> k >> d;
if (x < 0)
x = -1 * x;
ll syou = x / d;
ll sa = k - syou;
if (syou <= k && sa % 2 == 0)
ans = x - syou * d;
else if (syou <= k && sa % 2 != 0)
... | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 285,028 | 285,029 | u127025777 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
using V_2 = vector<vector<int>>;
using ll = long long;
ll x, k, d, ans;
int main() {
cin >> x >> k >> d;
if (x < 0)
x = -1 * x;
ll syou = x / d;
ll sa = k - syou;
if (syou < k && sa % 2 == 0)
ans = x - syou * d;
else if (syou < k && sa % 2 != 0)
an... | #include <bits/stdc++.h>
using namespace std;
using V_2 = vector<vector<int>>;
using ll = long long;
ll k, x, d, ans;
int main() {
cin >> x >> k >> d;
if (x < 0)
x = -1 * x;
ll syou = x / d;
ll sa = k - syou;
if (syou <= k && sa % 2 == 0)
ans = x - syou * d;
else if (syou <= k && sa % 2 != 0)
... | [
"variable_declaration.remove",
"variable_declaration.add",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 285,030 | 285,029 | u127025777 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using Graph = vector<vector<int>>;
int main(void) {
ll x, k, d;
ll kaisu;
cin >> x >> k >> d;
if (abs(x) >= abs(k * d)) {
cout << abs(x) - abs(k * d) << endl;
} else {
kaisu = x / d;
if ((k - kaisu) % 2 =... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using Graph = vector<vector<int>>;
int main(void) {
ll x, k, d;
ll kaisu;
cin >> x >> k >> d;
if (abs(x) >= abs(k * d)) {
cout << abs(x) - abs(k * d) << endl;
} else {
kaisu = abs(x) / d;
if ((k - kaisu) ... | [
"call.add",
"call.arguments.change"
] | 285,031 | 285,032 | u006949180 | cpp |
p02584 | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
using Int = int64_t;
using P = pair<Int, Int>;
const Int INF... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
using Int = int64_t;
using P = pair<Int, Int>;
const Int INF... | [
"variable_declaration.value.change",
"identifier.replace.remove",
"literal.replace.add",
"call.arguments.change"
] | 285,043 | 285,044 | u952094438 | cpp |
p02584 | //----------BHAVIK DIWANI(PICT_COMP)---------------
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define test \
ll t; \
c... | //----------BHAVIK DIWANI(PICT_COMP)---------------
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define test \
ll t; \
c... | [
"identifier.replace.remove",
"literal.replace.add",
"control_flow.branch.if.condition.change"
] | 285,052 | 285,053 | u785748162 | cpp |
p02584 | #include <bits/stdc++.h>
#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 all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
retu... | #include <bits/stdc++.h>
#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 all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
retu... | [
"identifier.change",
"expression.operation.binary.change"
] | 285,056 | 285,057 | u748577909 | cpp |
p02584 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long int;
int main() {
ll X, K, D;
cin >> X >> K >> D;
ll ans = 0;
if (X < 0) {
X = abs(X);
}
if (K * D >= X) {
K -= X / D;
X -= (X / D) * D;
if (K % 2 == 0) {
ans = X;
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long int;
int main() {
ll X, K, D;
cin >> X >> K >> D;
ll ans = 0;
if (X < 0) {
X = abs(X);
}
if (K >= X / D) {
K -= X / D;
X -= (X / D) * D;
if (K % 2 == 0) {
ans = X;
... | [
"expression.operation.binary.remove",
"control_flow.branch.if.condition.change"
] | 285,058 | 285,059 | u428138851 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll x, k, d, a, b, y;
cin >> x >> k >> d;
a = x % d;
b = x / d;
if (b > k) {
if (x >= 0)
cout << abs(x - (d * k));
else
cout << abs(x + (d * k));
} else i... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll x, k, d, a, b, y;
cin >> x >> k >> d;
a = x % d;
b = x / d;
if (abs(b) > k) {
if (x >= 0)
cout << abs(x - (d * k));
else
cout << abs(x + (d * k));
} e... | [
"control_flow.branch.if.condition.change",
"call.add"
] | 285,060 | 285,061 | u729905231 | cpp |
p02584 | #include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
long long m;
if (llabs(x) / d < k) {
m = llabs(x) % d;
if ((k - (x / d)) % 2 != 0) {
m = llabs(m - d);
}
} else {
m =... | #include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
long long m;
if (llabs(x) / d < k) {
m = llabs(x) % d;
if ((k - (x / d)) % 2 != 0) {
m = llabs(m - d);
}
} else {
m =... | [
"call.arguments.change"
] | 285,071 | 285,072 | u381491108 | cpp |
p02584 | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
const int MAX_N = 1e5 + 5;
const int MAX_... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
const int MAX_N = 1e5 + 5;
const int MAX_... | [
"call.add",
"call.arguments.change"
] | 285,082 | 285,083 | u247911113 | cpp |
p02579 | #include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const double eps = 1e-8;
const int NINF = 0xc0c0c0c0;
const int INF = 0x3f3f3f3f;
const ll mod = 1e9 + 7;
const ll N = 1e3 + 5;
int n, m, sx, sy, ex, ey;
int vis[N][N... | #include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const double eps = 1e-8;
const int NINF = 0xc0c0c0c0;
const int INF = 0x3f3f3f3f;
const ll mod = 1e9 + 7;
const ll N = 1e3 + 5;
int n, m, sx, sy, ex, ey;
int vis[N][N... | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 285,094 | 285,095 | u375212600 | cpp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.