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;
typedef long long ll;
int main() {
ll x, k, d;
cin >> x >> k >> d;
x = x > 0 ? x : -x;
ll temp = min(k, x / d);
k -= temp;
x -= temp * d;
if (k > 0 && k % 2 == 0) {
x -= d;
}
cout << abs(x);
return 0;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll x, k, d;
cin >> x >> k >> d;
x = x > 0 ? x : -x;
ll temp = min(k, x / d);
k -= temp;
x -= temp * d;
if (k > 0 && k % 2 == 1) {
x -= d;
}
cout << abs(x);
return 0;
} | [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 284,132 | 284,133 | u612631199 | cpp |
p02584 | #include <iostream>
using namespace std;
int main() {
long long X, K, D;
cin >> X >> K >> D;
long long S = abs(X) / D;
if (S >= K) {
cout << X + ((X > 0) ? -1 : 1) * D * K << endl;
} else {
if (X > 0) {
X -= D * S;
K -= S;
cout << abs(X - ((K % 2) ? D : 0)) << endl;
} else {
... | #include <iostream>
using namespace std;
int main() {
long long X, K, D;
cin >> X >> K >> D;
long long S = abs(X) / D;
if (S >= K) {
cout << abs(X + ((X > 0) ? -1 : 1) * D * K) << endl;
} else {
if (X > 0) {
X -= D * S;
K -= S;
cout << abs(X - ((K % 2) ? D : 0)) << endl;
} else ... | [
"call.add",
"call.arguments.change"
] | 284,134 | 284,135 | u961358555 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
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;
}
#define all(x) (x).beg... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
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;
}
#define all(x) (x).beg... | [
"call.add",
"call.arguments.change"
] | 284,136 | 284,137 | u133391510 | cpp |
p02584 | #include <iostream>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
x = abs(x);
if (k * d <= x) {
cout << x - k * d << endl;
return 0;
}
k = (k - x / d) % 2;
x %= d;
for (int i = 0; i < k; ++i)
x = abs(x - d);
cout << x << endl;
}
| #include <iostream>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
x = abs(x);
if (k <= x / d) {
cout << x - k * d << endl;
return 0;
}
k = (k - x / d) % 2;
x %= d;
for (int i = 0; i < k; ++i)
x = abs(x - d);
cout << x << endl;
}
| [
"expression.operation.binary.remove",
"control_flow.branch.if.condition.change"
] | 284,138 | 284,139 | u590427200 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long X, K, D;
cin >> X >> K >> D;
bool a = false;
if (X > 0) {
long long A = X / D;
if (K < A) {
X -= K * D;
cout << abs(X) << endl;
a = true;
}
X -= A * D;
K -= A;
if (abs(X - D) < abs(X) && K > 0) {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long X, K, D;
cin >> X >> K >> D;
bool a = false;
if (X > 0) {
long long A = X / D;
if (K < A) {
X -= K * D;
cout << abs(X) << endl;
a = true;
}
X -= A * D;
K -= A;
if (abs(X - D) < abs(X) && K > 0) {
... | [
"call.add",
"call.arguments.change"
] | 284,140 | 284,141 | u280966279 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const int M = 1000000007;
ll mod(ll x) { return ((x % M + M) % M); }
ll add(ll a, ll b) { return mod(mod(a) + mod(b)); }
ll mul(ll a, ll b) { return mod(mod(a) * mod(b)); }
ll minu(ll a, ll b) { return mod(mod(a) - mod(b)); }
ll power(ll a, ll b) {
ll... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const int M = 1000000007;
ll mod(ll x) { return ((x % M + M) % M); }
ll add(ll a, ll b) { return mod(mod(a) + mod(b)); }
ll mul(ll a, ll b) { return mod(mod(a) * mod(b)); }
ll minu(ll a, ll b) { return mod(mod(a) - mod(b)); }
ll power(ll a, ll b) {
ll... | [
"call.add",
"call.arguments.change"
] | 284,144 | 284,145 | u185463307 | cpp |
p02584 | #include <bits/stdc++.h>
#define ABS(x) ((x) > 0 ? (x) : -(x))
using namespace std;
const int ARR_SIZE = 1e2 + 5;
// int arr[ARR_SIZE];
int main() {
long long x, k, d;
scanf("%lld%lld%lld", &x, &k, &d);
long long maxMove = ABS(x) / d;
if (maxMove >= k) {
if (x > 0)
printf("%lld\n", x - k * d);
... | #include <bits/stdc++.h>
#define ABS(x) ((x) > 0 ? (x) : -(x))
using namespace std;
const int ARR_SIZE = 1e2 + 5;
// int arr[ARR_SIZE];
int main() {
long long x, k, d;
scanf("%lld%lld%lld", &x, &k, &d);
long long maxMove = ABS(x) / d;
if (maxMove >= k) {
if (x > 0)
printf("%lld\n", x - k * d);
... | [
"expression.operation.unary.add",
"call.arguments.change",
"misc.opposites",
"expression.operator.arithmetic.change",
"expression.operation.binary.change",
"io.output.change"
] | 284,146 | 284,147 | u349870478 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vint;
typedef vector<vector<ll>> vvint;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define repf(i, f, n) for (ll i = f; i < n; i++)
#define repr(i, n) for (ll i = n - 1; i >= 0; i--)
#define mp make_pair
#define mt make_tuple
#de... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vint;
typedef vector<vector<ll>> vvint;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define repf(i, f, n) for (ll i = f; i < n; i++)
#define repr(i, n) for (ll i = n - 1; i >= 0; i--)
#define mp make_pair
#define mt make_tuple
#de... | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 284,159 | 284,160 | u644070128 | cpp |
p02584 | #include <algorithm>
#include <iostream>
using namespace std;
using ll = long long;
int main() {
ll X, K, D;
cin >> X >> K >> D;
X = abs(X);
ll straight = min(K, X / D);
K -= straight;
X -= straight * D;
if ((K - min(K, X / D)) % 2 == 0) {
cout << X - X / D * D << endl;
} else {
cout << D - (... | #include <algorithm>
#include <iostream>
using namespace std;
using ll = long long;
int main() {
ll X, K, D;
cin >> X >> K >> D;
X = abs(X);
ll straight = min(K, X / D);
K -= straight;
X -= straight * D;
if ((K - min(K, X / D)) % 2 == 0) {
cout << X - min(X / D, K) * D << endl;
} else {
cout ... | [
"call.add",
"call.arguments.add"
] | 284,161 | 284,162 | u389055093 | 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, tmp = 0;
cin >> X >> K >> D;
X = abs(X);
D = abs(D);
tmp = X / D;
if (K <= tmp) {
X = X - D * K;
} else {
X = X - D * tmp;
K = K - tmp;
}
if (K % 2 == 0) {
... | #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, tmp = 0;
cin >> X >> K >> D;
X = abs(X);
D = abs(D);
tmp = X / D;
if (K <= tmp) {
X = X - D * K;
K = 0;
} else {
X = X - D * tmp;
K = K - tmp;
}
if (K % 2... | [
"assignment.add"
] | 284,165 | 284,166 | u359767101 | cpp |
p02584 | #include <iostream>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
x = abs(x);
if (k * d <= x) {
cout << x - k * d << endl;
return 0;
}
k -= x / d;
x %= d;
if (k % 2) {
cout << abs(x - d) << endl;
} else {
cout << x << endl;
}
} | #include <iostream>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
x = abs(x);
if (k <= x / d) {
cout << x - k * d << endl;
return 0;
}
k -= x / d;
x %= d;
if (k % 2) {
cout << abs(x - d) << endl;
} else {
cout << x << endl;
}
} | [
"expression.operation.binary.remove",
"control_flow.branch.if.condition.change"
] | 284,169 | 284,170 | u132159708 | cpp |
p02584 | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <string.h>
#include <vector>
const long long INF = 1e6 + 7;
const long long MOD = 1e9 + 7;
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
long lon... | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <string.h>
#include <vector>
const long long INF = 1e6 + 7;
const long long MOD = 1e9 + 7;
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
long lon... | [
"assignment.value.change",
"identifier.change",
"expression.operation.binary.change"
] | 284,173 | 284,174 | u198469037 | cpp |
p02584 | #include <algorithm> // sort
#include <cstring>
#include <fstream>
#include <iostream>
#include <math.h>
#include <queue>
#include <vector>
#define DEBUG 0
#define REP(i, n) for (long long i = 0; i < (n); i++)
typedef long long ll;
static const ll MOD = 1000000007;
static const ll INF = 1000000000000000000LL;
// 9999... | #include <algorithm> // sort
#include <cstring>
#include <fstream>
#include <iostream>
#include <math.h>
#include <queue>
#include <vector>
#define DEBUG 0
#define REP(i, n) for (long long i = 0; i < (n); i++)
typedef long long ll;
static const ll MOD = 1000000007;
static const ll INF = 1000000000000000000LL;
// 9999... | [
"expression.operator.arithmetic.change",
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove",
"identifier.replace.add",
"literal.replace.remove"
] | 284,185 | 284,186 | u485731913 | cpp |
p02584 | /* Welcome to my Code */
#include <bits/stdc++.h>
#define ll long long int
#define i(a, n) int a = n;
#define l(a, n) ll a = n;
#define d(a, n) double a = n;
#define s(a) string a;
#define c(a) \
ll a; ... | /* Welcome to my Code */
#include <bits/stdc++.h>
#define ll long long int
#define i(a, n) int a = n;
#define l(a, n) ll a = n;
#define d(a, n) double a = n;
#define s(a) string a;
#define c(a) \
ll a; ... | [
"expression.operation.binary.remove"
] | 284,187 | 284,188 | u576357372 | cpp |
p02584 | /* Welcome to my Code */
#include <bits/stdc++.h>
#define ll long long int
#define i(a, n) int a = n;
#define l(a, n) ll a = n;
#define d(a, n) double a = n;
#define s(a) string a;
#define c(a) \
ll a; ... | /* Welcome to my Code */
#include <bits/stdc++.h>
#define ll long long int
#define i(a, n) int a = n;
#define l(a, n) ll a = n;
#define d(a, n) double a = n;
#define s(a) string a;
#define c(a) \
ll a; ... | [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 284,187 | 284,189 | u576357372 | cpp |
p02584 | /* Welcome to my Code */
#include <bits/stdc++.h>
#define ll long long int
#define i(a, n) int a = n;
#define l(a, n) ll a = n;
#define d(a, n) double a = n;
#define s(a) string a;
#define c(a) \
ll a; ... | /* Welcome to my Code */
#include <bits/stdc++.h>
#define ll long long int
#define i(a, n) int a = n;
#define l(a, n) ll a = n;
#define d(a, n) double a = n;
#define s(a) string a;
#define c(a) \
ll a; ... | [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 284,187 | 284,190 | u576357372 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i < n + 1; i++)
#define all(A) A.begin(), A.end()
typedef long long ll;
int main() {
ll x;
cin >> x;
x = abs(x);
ll k, d;
cin >> k >> d;
if (k <= (x + d - 1) / d) { //原点にたどり着けない場合
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i < n + 1; i++)
#define all(A) A.begin(), A.end()
typedef long long ll;
int main() {
ll x;
cin >> x;
x = abs(x);
ll k, d;
cin >> k >> d;
if (k < (x + d - 1) / d) { //原点にたどり着けない場合
... | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 284,191 | 284,192 | u132364782 | 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;
long long a = x / d;
if (k < a) {
cout << x - k * d << '\n';
} else {
long long r = k - a;
long long m = x % d;
if (r % 2 == 0)
cout << x - a * d << '\n';
else... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
if (x < 0)
x = -x;
long long a = x / d;
if (k < a) {
cout << x - k * d << '\n';
} else {
long long r = k - a;
long long m = x % d;
if (r % 2 == 0)
cout << x - a * d << '\n';
else... | [
"misc.opposites",
"expression.operator.arithmetic.change",
"io.output.change"
] | 284,201 | 284,202 | u263392794 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
x = abs(x);
long long a, b;
if (x % d == 0)
a = x / d - 1;
else
a = x / d;
b = a + 1;
// cout<<a<<" "<<b<<"\n";
if (k < a) {
cout << x - k * d << "\n";
return 0;
}
long long x1 = x - ... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
x = abs(x);
long long a, b;
if (x % d == 0)
a = x / d - 1;
else
a = x / d;
b = a + 1;
// cout<<a<<" "<<b<<"\n";
if (k < a) {
cout << x - k * d << "\n";
return 0;
}
long long x1 = x - ... | [
"identifier.replace.remove",
"literal.replace.add",
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,203 | 284,204 | u023030760 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll ce(ll a, ll b) { return (a + b - 1) / b; }
int main() {
ll x, k, d, l;
scanf("%lld%lld%lld", &x, &k, &d);
l = ce(abs(x), d);
if (k >= l)
printf("%I64d\n",
llabs((k - l) % 2 ? llabs(x) - (l - 1) * d : llabs(x) - l * d));
e... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll ce(ll a, ll b) { return (a + b - 1) / b; }
int main() {
ll x, k, d, l;
scanf("%lld%lld%lld", &x, &k, &d);
l = ce(abs(x), d);
if (k >= l)
printf("%lld\n",
llabs((k - l) % 2 ? llabs(x) - (l - 1) * d : llabs(x) - l * d));
el... | [
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 284,205 | 284,206 | u984175692 | cpp |
p02584 | #include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits.h>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <random>
#... | #include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits.h>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <random>
#... | [
"control_flow.branch.if.condition.change"
] | 284,207 | 284,208 | u685066025 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, n) for (int i = 0; i < n; i++)
#define UNIQUE(v) \
v.erase(unique(v.begin(), v.end()), v.end()) // sortしてから使う
#define INF 2147483647
#define LLINF... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, n) for (int i = 0; i < n; i++)
#define UNIQUE(v) \
v.erase(unique(v.begin(), v.end()), v.end()) // sortしてから使う
#define INF 2147483647
#define LLINF... | [
"control_flow.branch.if.condition.change",
"call.add"
] | 284,210 | 284,211 | u166553470 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, n) for (int i = 0; i < n; i++)
#define UNIQUE(v) \
v.erase(unique(v.begin(), v.end()), v.end()) // sortしてから使う
#define INF 2147483647
#define LLINF... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, n) for (int i = 0; i < n; i++)
#define UNIQUE(v) \
v.erase(unique(v.begin(), v.end()), v.end()) // sortしてから使う
#define INF 2147483647
#define LLINF... | [
"control_flow.branch.if.condition.change",
"call.add",
"expression.operator.compare.change"
] | 284,212 | 284,211 | u166553470 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, n) for (int i = 0; i < n; i++)
#define UNIQUE(v) \
v.erase(unique(v.begin(), v.end()), v.end()) // sortしてから使う
#define INF 2147483647
#define LLINF... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, n) for (int i = 0; i < n; i++)
#define UNIQUE(v) \
v.erase(unique(v.begin(), v.end()), v.end()) // sortしてから使う
#define INF 2147483647
#define LLINF... | [
"control_flow.branch.if.condition.change",
"call.add",
"expression.operator.compare.change"
] | 284,213 | 284,211 | u166553470 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, n) for (int i = 0; i < n; i++)
#define UNIQUE(v) \
v.erase(unique(v.begin(), v.end()), v.end()) // sortしてから使う
#define INF 2147483647
#define LLINF... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, n) for (int i = 0; i < n; i++)
#define UNIQUE(v) \
v.erase(unique(v.begin(), v.end()), v.end()) // sortしてから使う
#define INF 2147483647
#define LLINF... | [
"expression.operation.binary.add"
] | 284,214 | 284,215 | u166553470 | cpp |
p02584 | #include <bits/stdc++.h>
#include <stdlib.h>
#include <sys/time.h>
#include <unistd.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<P, ll> T;
typedef pair<long double, ll> Ps;
typedef pair<ll, bool> Pb;
const ll INF = 1e18;
const ll fact_table = 3200008;
long double Pi = 3.14159265... | #include <bits/stdc++.h>
#include <stdlib.h>
#include <sys/time.h>
#include <unistd.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<P, ll> T;
typedef pair<long double, ll> Ps;
typedef pair<ll, bool> Pb;
const ll INF = 1e18;
const ll fact_table = 3200008;
long double Pi = 3.14159265... | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,216 | 284,217 | u399527088 | cpp |
p02584 | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
// FILE *fi = freopen("1.txt", "r", stdin);
// FILE *fo = freopen("1", "w", stdout);
long long a, b, c;
long long ans;
long long calc(long long t) { return abs(a + c * t); }
int main() {
cin >> a >> b >> c;
a = abs(a);
// ans = a;
// long long l ... | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
// FILE *fi = freopen("1.txt", "r", stdin);
// FILE *fo = freopen("1", "w", stdout);
long long a, b, c;
long long ans = 1e18;
long long calc(long long t) { return abs(a + c * t); }
int main() {
cin >> a >> b >> c;
a = abs(a);
// ans = a;
// long ... | [
"variable_declaration.value.change"
] | 284,231 | 284,232 | u549042846 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define fs first
#define se second
#define M 1000000007
#define pii pair<long long, long long>
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
unordered_map<char, pii> dir;
ll D = 1e9;
bool check(ll x, ll y, ll z, ll X, ll Y... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define fs first
#define se second
#define M 1000000007
#define pii pair<long long, long long>
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
unordered_map<char, pii> dir;
ll D = 1e9;
bool check(ll x, ll y, ll z, ll X, ll Y... | [
"identifier.change",
"expression.operation.binary.change"
] | 284,233 | 284,234 | u833144598 | cpp |
p02584 | #include <cmath>
#include <cstdint>
#include <iostream>
using int64 = std::int64_t;
int main() {
int64 X, K, D, x; // initial position, time of act, distance per move
std::cin >> X >> K >> D;
if (X > 0)
x = X;
else
x = -X;
int64 min_step = x / D;
if (min_step > K)
min_step = K;
else if (0 ... | #include <cmath>
#include <cstdint>
#include <iostream>
using int64 = std::int64_t;
int main() {
int64 X, K, D, x; // initial position, time of act, distance per move
std::cin >> X >> K >> D;
if (X > 0)
x = X;
else
x = -X;
int64 min_step = x / D;
if (min_step >= K)
min_step = K;
else if (0... | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 284,250 | 284,251 | u082497013 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define int long long
using P = pair<int, int>;
#define LOG(variable) cerr << #variable ":\t" << (variable) << endl
#define LOGCON(i, container) \
for (int(i) = 0; (i) < (container).size(); ++(i)) ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define int long long
using P = pair<int, int>;
#define LOG(variable) cerr << #variable ":\t" << (variable) << endl
#define LOGCON(i, container) \
for (int(i) = 0; (i) < (container).size(); ++(i)) ... | [
"identifier.change",
"io.output.change"
] | 284,252 | 284,253 | u323748756 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define int long long
using P = pair<int, int>;
#define LOG(variable) cerr << #variable ":\t" << (variable) << endl
#define LOGCON(i, container) \
for (int(i) = 0; (i) < (container).size(); ++(i)) ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define int long long
using P = pair<int, int>;
#define LOG(variable) cerr << #variable ":\t" << (variable) << endl
#define LOGCON(i, container) \
for (int(i) = 0; (i) < (container).size(); ++(i)) ... | [
"identifier.change",
"io.output.change"
] | 284,252 | 284,254 | u323748756 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll x, k, d;
cin >> x >> k >> d;
x = abs(x);
ll tempAns = x / 2 * d;
tempAns += k / 2;
tempAns = min(tempAns, k);
ll ans = 1e18;
ll mi = 0;
ll low = max(tempAns - 4, mi);
for (ll i = low; i <= k && i <= low + 10; i++) ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll x, k, d;
cin >> x >> k >> d;
x = abs(x);
ll tempAns = x / (2 * d);
tempAns += k / 2;
tempAns = min(tempAns, k);
ll ans = 1e18;
ll mi = 0;
ll low = max(tempAns - 4, mi);
for (ll i = low; i <= k && i <= low + 10; i++... | [] | 284,257 | 284,258 | u224168474 | cpp |
p02584 | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
//#include<unordered_map>
using namespace std;
#define ll long long
#define dd cout << endl
const long long int inf = 1e18 + 7;... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
//#include<unordered_map>
using namespace std;
#define ll long long
#define dd cout << endl
const long long int inf = 1e18 + 7;... | [
"variable_declaration.value.change",
"identifier.change"
] | 284,259 | 284,260 | u111563567 | cpp |
p02584 | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
//#include<unordered_map>
using namespace std;
#define ll long long
#define dd cout << endl
const long long int inf = 1e18 + 7;... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
//#include<unordered_map>
using namespace std;
#define ll long long
#define dd cout << endl
const long long int inf = 1e18 + 7;... | [
"variable_declaration.value.change",
"identifier.change"
] | 284,261 | 284,262 | u111563567 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
ll x, k, d;
cin >> x >> k >> d;
x = abs(x);
ll fa = x / d;
ll rm = x % d;
if (fa == k) {
cout << rm << "\n";
}
if (fa > k) {
cout << x - (d * k) << "\n";
} else {
k -= fa;
if (k & 1)
cout << a... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
ll x, k, d;
cin >> x >> k >> d;
x = abs(x);
ll fa = x / d;
ll rm = x % d;
if (fa == k) {
cout << rm << "\n";
} else if (fa > k) {
cout << x - (d * k) << "\n";
} else {
k -= fa;
if (k & 1ll)
cout... | [
"control_flow.branch.else_if.replace.add",
"control_flow.branch.if.replace.remove",
"control_flow.branch.if.condition.change",
"call.remove",
"call.arguments.change"
] | 284,265 | 284,266 | u621389035 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
using ll = long long int;
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cou... | #include <bits/stdc++.h>
using namespace std;
using ll = long long int;
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cou... | [] | 284,267 | 284,268 | u625602578 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define M 1000000007
#define INF ((1LL << 62LL) - 1)
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int x, k, d;
cin >> x >> k >> d;
x = abs(x);
int times = x / d;
if (times >= k) {
cout << x - d * k << "\n";
... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define M 1000000007
#define INF ((1LL << 62LL) - 1)
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int x, k, d;
cin >> x >> k >> d;
x = abs(x);
int times = x / d;
if (times >= k) {
cout << x - d * k << "\n";
... | [
"call.remove",
"call.arguments.change"
] | 284,271 | 284,272 | u328025904 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
int main() {
int t;
t = 1;
;
while (t--) {
ll a, b, c;
cin >> a >> b >> c;
// 800 -800
// kuch bhi least or say close to give gnerate it
ll k = a / c;
if (k > b) {
k = b;
}
b = b - k;
l... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
int main() {
int t;
t = 1;
;
while (t--) {
ll a, b, c;
cin >> a >> b >> c;
// 800 -800
// kuch bhi least or say close to give gnerate it
ll k = a / c;
if (abs(k) > b) {
k = b;
}
b = b - k;
... | [
"control_flow.branch.if.condition.change",
"call.add"
] | 284,275 | 284,276 | u025131804 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(void) {
ll X, K, D;
cin >> X >> K >> D;
X = abs(X);
ll a = X / D;
ll b = X - a * D;
ll c = K - a;
if (c <= 0) {
X -= D * K;
cout << X << endl;
return 0;
} else if (X % D == 0) {
if (K % 2 == 0) {
cout ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(void) {
ll X, K, D;
cin >> X >> K >> D;
X = abs(X);
ll a = X / D;
ll b = X - a * D;
ll c = K - a;
if (c <= 0) {
X -= D * K;
cout << X << endl;
return 0;
} else if (X % D == 0) {
if (K % 2 == 0) {
cout ... | [
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 284,277 | 284,278 | u883680855 | cpp |
p02584 | #include <algorithm>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep2(i, j, k) for (int i = j; i < k; i++)
#define ll long long
using namespace std;
int main() {
ll X, K, D;
cin >> X >> K >> D;
X = abs(X);
... | #include <algorithm>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep2(i, j, k) for (int i = j; i < k; i++)
#define ll long long
using namespace std;
int main() {
ll X, K, D;
cin >> X >> K >> D;
X = abs(X);
... | [
"control_flow.branch.else_if.replace.remove",
"control_flow.branch.if.replace.add",
"assignment.add"
] | 284,287 | 284,286 | u944033453 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int N = 1e9 + 5, mod = 1e9 + 7;
void solve() {
ll x, k, d;
cin >> x >> k >> d;
x = abs(x);
ll mn = x % d;
if (x < d) {
if (k & 1) {
cout << abs(d - x) << endl;
} else {
cout << d << en... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int N = 1e9 + 5, mod = 1e9 + 7;
void solve() {
ll x, k, d;
cin >> x >> k >> d;
x = abs(x);
ll mn = x % d;
if (x < d) {
if (k & 1) {
cout << abs(d - x) << endl;
} else {
cout << x << en... | [
"identifier.change",
"io.output.change"
] | 284,288 | 284,289 | u919209605 | cpp |
p02584 | #include <algorithm>
#include <cstdlib>
#include <iostream>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
if ((k - min(k, abs(x) / d)) % 2 == 0) {
cout << x - min(k, abs(x) / d) * d << endl;
} else {
cout << d - x + min(k, abs(x) / d) * d << endl;
}
}
| #include <algorithm>
#include <cstdlib>
#include <iostream>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
if ((k - min(k, abs(x) / d)) % 2 == 0) {
cout << abs(x) - min(k, abs(x) / d) * d << endl;
} else {
cout << d - abs(x) + min(k, abs(x) / d) * d << endl;
}
}
| [
"call.add",
"call.arguments.change"
] | 284,292 | 284,293 | u185690073 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main(void) {
long long x, k, d, o, p;
cin >> x >> k >> d;
x = abs(x);
o = x / d;
p = x % d;
if (o <= k) {
if ((k - o) % 2 == 0)
cout << p << endl;
else
cout << abs(d - k - o) << endl;
} else {
cout << x - d * k << endl;
}
return... | #include <bits/stdc++.h>
using namespace std;
int main(void) {
long long x, k, d, o, p;
cin >> x >> k >> d;
x = abs(x);
o = x / d;
p = x % d;
if (o <= k) {
if ((k - o) % 2 == 0)
cout << p << endl;
else
cout << abs(p - d) << endl;
} else {
cout << x - d * k << endl;
}
return 0;
... | [
"identifier.change",
"io.output.change",
"expression.operation.binary.remove"
] | 284,294 | 284,295 | u787972656 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main(void) {
long long x, k, d, o, p;
cin >> x >> k >> d;
x = abs(x);
o = x / d;
p = x % d;
if (o <= k) {
if ((k - o) % 2 == 0)
cout << p << endl;
else
cout << d - k - o << endl;
} else {
cout << x - d * k << endl;
}
return 0;
}... | #include <bits/stdc++.h>
using namespace std;
int main(void) {
long long x, k, d, o, p;
cin >> x >> k >> d;
x = abs(x);
o = x / d;
p = x % d;
if (o <= k) {
if ((k - o) % 2 == 0)
cout << p << endl;
else
cout << abs(p - d) << endl;
} else {
cout << x - d * k << endl;
}
return 0;
... | [
"identifier.change",
"io.output.change",
"call.arguments.change"
] | 284,296 | 284,295 | u787972656 | cpp |
p02584 | #pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
#include <bits/stdc++.h>
#define fastAF \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); ... | #pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
#include <bits/stdc++.h>
#define fastAF \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); ... | [
"identifier.change",
"io.output.change"
] | 284,306 | 284,307 | u365955948 | cpp |
p02584 | #include <algorithm>
#include <bits/stdc++.h>
#include <cstdlib>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
int main() {
ll X, K, D, f, ans = 0;
cin >> X >> K >> D;
f = X / D;
if (f > K) {
if (X > 0)
ans = abs(X - K * D);
else
ans = abs(X + K ... | #include <algorithm>
#include <bits/stdc++.h>
#include <cstdlib>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
int main() {
ll X, K, D, f, ans = 0;
cin >> X >> K >> D;
f = X / D;
if (abs(f) > K) {
if (X > 0)
ans = abs(X - K * D);
else
ans = abs(X... | [
"control_flow.branch.if.condition.change",
"call.add"
] | 284,317 | 284,318 | u220781834 | cpp |
p02584 | #include <algorithm>
#include <iostream>
using namespace std;
using ll = long long;
int main() {
ll x, k, d;
cin >> x >> k >> d;
abs(x);
ll move = min(k, x / d);
k -= move;
x -= move * d;
if (k % 2 == 0)
cout << x;
else
cout << d - x;
} | #include <algorithm>
#include <iostream>
using namespace std;
using ll = long long;
int main() {
ll x, k, d;
cin >> x >> k >> d;
x = abs(x);
ll move = min(k, x / d);
k -= move;
x -= move * d;
if (k % 2 == 0)
cout << x;
else
cout << d - x;
} | [
"assignment.change"
] | 284,323 | 284,324 | u813269900 | cpp |
p02584 | // bismillahir rahmanir rahim //Author:Fayed Anik
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
// using namespace __gnu_pbds;
//#define ordered_set tree<int, null_type,less<int>,
//rb_tree_tag,tree_order_statistics_... | // bismillahir rahmanir rahim //Author:Fayed Anik
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
// using namespace __gnu_pbds;
//#define ordered_set tree<int, null_type,less<int>,
//rb_tree_tag,tree_order_statistics_... | [
"call.add",
"call.arguments.change"
] | 284,329 | 284,330 | u769965655 | cpp |
p02584 | //
// Created by RAJ SHAH on 18-08-2020.
//
#include <bits/stdc++.h>
using namespace std;
long long solve(long long x, long long k, long long d) {
x = abs(x);
if (k == 0) {
return x;
}
if (k % 2 == 1) {
return min(solve(x - d, k - 1, d), solve(x + d, k - 1, d));
}
d *= 2;
k /= 2;
if (x / k >= ... | //
// Created by RAJ SHAH on 18-08-2020.
//
#include <bits/stdc++.h>
using namespace std;
long long solve(long long x, long long k, long long d) {
x = abs(x);
if (k == 0) {
return x;
}
if (k % 2 == 1) {
return min(solve(x - d, k - 1, d), solve(x + d, k - 1, d));
}
d *= 2;
k /= 2;
if (x / k >= ... | [
"variable_declaration.type.primitive.change",
"variable_declaration.type.widen.change"
] | 284,334 | 284,335 | u390801047 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
ll GetDigit(ll num) { return log10(num) + 1; } // numの桁数を求める
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 ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
ll GetDigit(ll num) { return log10(num) + 1; } // numの桁数を求める
int main() {
long long x, k, d;
cin >> x >> k >> d;
x = abs(x);
if (x / d >= k) {
cout << x - k * d << endl;
return 0;
... | [
"variable_declaration.type.widen.change",
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,341 | 284,342 | u848148267 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
//=====================================================
// マクロ定義部
//=====================================================
#define FOR(i, a, b) for (ll i = (a); i < (b); ++i)
#define FOR_EQ(i, a, b) for (ll i = (a); i <= (b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define rep_... | #include <bits/stdc++.h>
using namespace std;
//=====================================================
// マクロ定義部
//=====================================================
#define FOR(i, a, b) for (ll i = (a); i < (b); ++i)
#define FOR_EQ(i, a, b) for (ll i = (a); i <= (b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define rep_... | [
"identifier.change",
"expression.operation.binary.change"
] | 284,350 | 284,351 | u669551866 | cpp |
p02584 | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define PI 3.1415926535897932
#define MOD 1000000007;
using namespace std;
long long GCD(long long A, long long B) {
if (B == 0) {
return A;
} else {
return GCD(B, A % B);
}
}
long long LCM(long long A, long long B) {
long long g = GCD(A, B);
return A / ... | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define PI 3.1415926535897932
#define MOD 1000000007;
using namespace std;
long long GCD(long long A, long long B) {
if (B == 0) {
return A;
} else {
return GCD(B, A % B);
}
}
long long LCM(long long A, long long B) {
long long g = GCD(A, B);
return A / ... | [
"identifier.change",
"control_flow.loop.condition.change",
"assignment.variable.change",
"io.output.change"
] | 284,356 | 284,357 | u838276016 | cpp |
p02584 | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <se... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <se... | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"call.add",
"call.arguments.change"
] | 284,362 | 284,361 | u118225776 | cpp |
p02584 | #include <bits/stdc++.h>
#define Phuong_ \
ios_base::sync_with_stdio(0); \
cin.tie(0);
#define REP(i, a, b) for (int i = a; i <= b; ++i)
/// easy access -------------
using namespace std;
using ll = long l... | #include <bits/stdc++.h>
#define Phuong_ \
ios_base::sync_with_stdio(0); \
cin.tie(0);
#define REP(i, a, b) for (int i = a; i <= b; ++i)
/// easy access -------------
using namespace std;
using ll = long l... | [
"call.add",
"call.arguments.change"
] | 284,366 | 284,367 | u624463308 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define all(c) begin(c), end(c)
#define PI acos(-1)
#define oo LLONG_MAX
template <typename T1, typename T2> bool chmax(T1 &a, T2 b) {
if (a < b) {
a = b;
return true;
} else
return false;
}
... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define all(c) begin(c), end(c)
#define PI acos(-1)
#define oo LLONG_MAX
template <typename T1, typename T2> bool chmax(T1 &a, T2 b) {
if (a < b) {
a = b;
return true;
} else
return false;
}
... | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,370 | 284,371 | u071282706 | cpp |
p02584 | #include <iostream>
using namespace std;
long long x, k, d;
int main() {
cin >> x >> k >> d;
if (x / d <= k) {
k -= (x / d);
x -= d * (x / d);
if (k) {
if (x >= 0 && abs(x - d) < abs(x)) {
x -= d;
k--;
} else if (x < 0 && abs(x + d) < abs(x)) {
x += d;
k--;
... | #include <iostream>
using namespace std;
long long x, k, d;
int main() {
cin >> x >> k >> d;
if (abs(x / d) <= k) {
k -= (x / d);
x -= d * (x / d);
if (k) {
if (x >= 0 && abs(x - d) < abs(x)) {
x -= d;
k--;
} else if (x < 0 && abs(x + d) < abs(x)) {
x += d;
... | [
"control_flow.branch.if.condition.change"
] | 284,372 | 284,373 | u581328116 | cpp |
p02584 | #include "bits/stdc++.h"
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
long long x, k, d;
cin >> x >> k >> d;
x = abs(x);
if (x > k * d) {
cout << x - k * d << endl;
} else {
long long ans = x % d;
long long f = k - x / d;
if (f & 1)
ans = abs((d - ans));
... | #include "bits/stdc++.h"
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
long long x, k, d;
cin >> x >> k >> d;
x = abs(x);
if (x / d >= k) {
cout << x - k * d << endl;
} else {
long long ans = x % d;
long long f = k - x / d;
if (f & 1)
ans = abs((d - ans));... | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,374 | 284,375 | u071670228 | cpp |
p02584 | #include <iostream>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
x = abs(x);
long long ans;
if (x / k >= d)
ans = x - k * d;
else {
if ((k - x / d) % 2 == 0)
ans = x - x / d * d;
else
ans == d - x + x / d *d;
}
cout << ans << endl;
return 0;
} | #include <iostream>
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 - k * d;
else {
if ((k - x / d) % 2 == 0)
ans = x - x / d * d;
else
ans = d - x + x / d * d;
}
cout << ans << endl;
return 0;
} | [
"expression.operation.binary.remove",
"control_flow.branch.if.condition.change",
"expression.operation.compare.replace.remove",
"assignment.replace.add",
"misc.typo"
] | 284,380 | 284,381 | u618263300 | cpp |
p02584 | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main() {
ll X, k, d;
cin >> X >> k >> d;
int x =... | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main() {
ll X, k, d;
cin >> X >> k >> d;
ll x = ... | [
"variable_declaration.type.change"
] | 284,382 | 284,383 | u771327443 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
long long x, k, d;
int main() {
scanf("%lld%lld%lld", &x, &k, &d);
x = abs(x);
if (x >= k * d)
return 0 * printf("%lld\n", x - k * d);
long long cnt = k - x / d;
if (cnt % 2 == 0)
printf("%lld\n", x % d);
else
printf("%lld\n", d - x % d);
}
| #include <bits/stdc++.h>
using namespace std;
long long x, k, d;
int main() {
scanf("%lld%lld%lld", &x, &k, &d);
x = abs(x);
if (x / d >= k)
return 0 * printf("%lld\n", x - k * d);
long long cnt = k - x / d;
if (cnt % 2 == 0)
printf("%lld\n", x % d);
else
printf("%lld\n", d - x % d);
}
| [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,386 | 284,387 | u851965109 | cpp |
p02584 | #include <cmath>
#include <iostream>
using namespace std;
int main() {
long long X, K, D;
cin >> X >> K >> D;
X = abs(X);
if (X >= K * D) {
cout << (X - (K * D));
} else {
long long cnt = X / D;
long long step = K - cnt; // 残回数
long long near = X % D;
if (step % 2 == 0) {
cout << n... | #include <cmath>
#include <iostream>
using namespace std;
int main() {
long long X, K, D;
cin >> X >> K >> D;
X = abs(X);
if (X / D >= K) {
cout << (X - (K * D));
} else {
long long cnt = X / D;
long long step = K - cnt; // 残回数
long long near = X % D;
if (step % 2 == 0) {
cout << n... | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,394 | 284,395 | u541032448 | cpp |
p02584 | #include <cmath>
#include <iostream>
using namespace std;
int main() {
long long X, K, D;
cin >> X >> K >> D;
X = abs(X);
if (X >= K * D) {
cout << X - (K * D);
} else {
long long cnt = X / D;
long long step = K - cnt; // 残回数
long long near = X % D;
if (step % 2 == 0) {
cout << nea... | #include <cmath>
#include <iostream>
using namespace std;
int main() {
long long X, K, D;
cin >> X >> K >> D;
X = abs(X);
if (X / D >= K) {
cout << (X - (K * D));
} else {
long long cnt = X / D;
long long step = K - cnt; // 残回数
long long near = X % D;
if (step % 2 == 0) {
cout << n... | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,396 | 284,395 | u541032448 | 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)
cout << x - k * d << endl;
else if ((k - x / d) % 2 == 0)
cout << x % d << endl;
else if (x % d - d <= 0)
cout << abs(x % d - d) << endl;
else
cout << x % d + d <... | #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)
cout << x - k * d << endl;
else if ((k - x / d) % 2 == 0)
cout << x % d << endl;
else if (x % d - d <= 0)
cout << abs(x % d - d) << endl;
else
cout << x % d + d <... | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,397 | 284,398 | u199441105 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
// freopen("in.txt","r",stdin);
// freopen("out.txt","w",stdout);
long long x, k, d;
cin >> x >> k >> d;
long long ax = abs(x);
long long res = min(k, x / d);
long long ns = ax - d ... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
// freopen("in.txt","r",stdin);
// freopen("out.txt","w",stdout);
long long x, k, d;
cin >> x >> k >> d;
long long ax = abs(x);
long long res = min(k, ax / d);
long long ns = ax - d... | [
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 284,399 | 284,400 | u665138123 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
// freopen("in.txt","r",stdin);
// freopen("out.txt","w",stdout);
long long x, k, d;
cin >> x >> k >> d;
long long ax = abs(x);
long long res = min(k, x / d);
long long ns = ax - d ... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
// freopen("in.txt","r",stdin);
// freopen("out.txt","w",stdout);
long long x, k, d;
cin >> x >> k >> d;
long long ax = abs(x);
long long res = min(k, ax / d);
long long ns = ax - d... | [
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 284,401 | 284,400 | u665138123 | cpp |
p02584 | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
//#define t ll t;cin>>t;while(t--)
... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
//#define t ll t;cin>>t;while(t--)
... | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,407 | 284,408 | u810792656 | cpp |
p02584 | /**********************************************************************************************
******************************AUTHOR:**********************************************************
****************************ASHISH
*RANJAN******************************************************
*******************************... | /**********************************************************************************************
******************************AUTHOR:**********************************************************
****************************ASHISH
*RANJAN******************************************************
*******************************... | [
"expression.operation.binary.remove",
"control_flow.branch.if.condition.change"
] | 284,411 | 284,412 | u714708745 | cpp |
p02584 | #include <bits/stdc++.h>
// Begin Header {{{
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define loop(i, j, n) for (ll i = j; i < n; i++)
#define all(x) (x).begin(), (x).end()
constexpr int INF = 0x3f3f3f40;
const long... | #include <bits/stdc++.h>
// Begin Header {{{
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define loop(i, j, n) for (ll i = j; i < n; i++)
#define all(x) (x).begin(), (x).end()
constexpr int INF = 0x3f3f3f40;
const long... | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,419 | 284,420 | u971811058 | cpp |
p02584 | #include <algorithm>
#include <bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
long long X, K, D;
int main() {
cin >> X >> K >> D;
long long tmp_cnt = 0;
X = abs(X);
//整数
tmp_cnt = X / D;
if (tmp_cnt > K) {
cout << abs(X - K * D);
return 0;
} else {
long near_v... | #include <algorithm>
#include <bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
long long X, K, D;
int main() {
cin >> X >> K >> D;
long long tmp_cnt = 0;
X = abs(X);
//整数
tmp_cnt = X / D;
if (tmp_cnt >= K) {
cout << abs(X - K * D);
return 0;
} else {
long near_... | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 284,423 | 284,424 | u985205172 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) \
for (int i = 0; i < (int)(n); i++) \
;
#define _GLIBCXX_DEBUG
#define _LIBCPP_DEBUG 0
int main() {
long x, k, d;
cin >> x >> k >> d;
long... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) \
for (int i = 0; i < (int)(n); i++) \
;
#define _GLIBCXX_DEBUG
#define _LIBCPP_DEBUG 0
int main() {
long x, k, d;
cin >> x >> k >> d;
long... | [
"control_flow.branch.if.condition.change"
] | 284,427 | 284,428 | u216579347 | cpp |
p02584 | #include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
int main() {
ll x, k, d;
cin >> x >> k >> d;
x = abs(x);
if (x - (k * d) >= 0) {
cout << x - (k * d) << endl;
} else {
ll memo = x / d;
k -= memo;
x %= d;
if (k % 2 == 0) {
... | #include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
int main() {
ll x, k, d;
cin >> x >> k >> d;
x = abs(x);
if (x / d - k >= 0) {
cout << x - (k * d) << endl;
} else {
ll memo = x / d;
k -= memo;
x %= d;
if (k % 2 == 0) {
... | [
"expression.operator.arithmetic.change",
"control_flow.branch.if.condition.change"
] | 284,429 | 284,430 | u708625735 | cpp |
p02584 | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
long long int x, k, d, min;
cin >> x >> k >> d;
int m = abs(x);
if (k <= m / d) {
min = m - k * d;
} else {
if ((k - (m / d)) % 2 == 0) {
min = m % d;
} else {
min = d - (m % d);
}
}
cout << min;
} | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
long long int x, k, d, min;
cin >> x >> k >> d;
long long int m = abs(x);
if (k <= m / d) {
min = m - k * d;
} else {
if ((k - (m / d)) % 2 == 0) {
min = m % d;
} else {
min = d - (m % d);
}
}
cout... | [
"variable_declaration.type.widen.change"
] | 284,431 | 284,432 | u451428171 | cpp |
p02584 | #include <bits/stdc++.h>
#include <stdio.h>
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)
#define _USE_MATH_DEFINES
#define f first
//#define s second
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define INF 1000000000000000000
#define MAXN (int)(1e7)... | #include <bits/stdc++.h>
#include <stdio.h>
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)
#define _USE_MATH_DEFINES
#define f first
//#define s second
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define INF 1000000000000000000
#define MAXN (int)(1e7)... | [
"misc.opposites",
"expression.operator.arithmetic.change",
"io.output.change"
] | 284,455 | 284,456 | u797664206 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, k, d, ans;
cin >> x >> k >> d;
x = abs(x);
int c = x / d;
ans = x - min(k, c) * d;
if (k <= c || (k - c) % 2 == 0) {
cout << abs(ans);
} else
cout << abs(ans - d);
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
long long x, k, d, ans;
cin >> x >> k >> d;
x = abs(x);
long long c = x / d;
ans = x - min(k, c) * d;
if (k <= c || (k - c) % 2 == 0) {
cout << abs(ans);
} else
cout << abs(ans - d);
}
| [
"variable_declaration.type.primitive.change",
"variable_declaration.type.widen.change"
] | 284,457 | 284,458 | u607003364 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(v) begin(v), end(v)
using ll = long long;
int main() {
ll x, k, d;
cin >> x >> k >> d;
ll n = abs(x) / d, ans1 = abs(x) % d, ans2 = abs(ans1 - d);
if (k > n) {
if ((k - n) % 2 == 1)
cout << ans2 ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(v) begin(v), end(v)
using ll = long long;
int main() {
ll x, k, d;
cin >> x >> k >> d;
ll n = abs(x) / d, ans1 = abs(x) % d, ans2 = abs(ans1 - d);
if (k > n) {
if ((k - n) % 2 == 1)
cout << ans2 ... | [
"call.add",
"call.arguments.change"
] | 284,463 | 284,464 | u587622858 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(v) begin(v), end(v)
using ll = long long;
int main() {
ll x, k, d;
cin >> x >> k >> d;
ll n = abs(x) / d, ans1 = abs(x) % d, ans2 = abs(ans1 - d);
if (k >= n) {
if ((k - n) % 2 == 1)
cout << ans2... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(v) begin(v), end(v)
using ll = long long;
int main() {
ll x, k, d;
cin >> x >> k >> d;
ll n = abs(x) / d, ans1 = abs(x) % d, ans2 = abs(ans1 - d);
if (k > n) {
if ((k - n) % 2 == 1)
cout << ans2 ... | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"call.add",
"call.arguments.change"
] | 284,465 | 284,464 | u587622858 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
const long double PI = 3.141592653589793;
const long double DEL = 1e-10;
const int mod = 1000000007;
#define fio \
ios_base::sync_with_stdio(0); \
cin.tie(... | #include <bits/stdc++.h>
using namespace std;
const long double PI = 3.141592653589793;
const long double DEL = 1e-10;
const int mod = 1000000007;
#define fio \
ios_base::sync_with_stdio(0); \
cin.tie(... | [
"control_flow.branch.if.condition.change",
"call.add"
] | 284,470 | 284,471 | u116521736 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define fast \
ios::sync_with_stdio(false); \
cin.tie(NULL);
#define rep(n) for (int i = 0; i < n; i++)
#define rep1... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define fast \
ios::sync_with_stdio(false); \
cin.tie(NULL);
#define rep(n) for (int i = 0; i < n; i++)
#define rep1... | [
"assignment.change"
] | 284,478 | 284,479 | u836263844 | cpp |
p02584 | #include <bits/stdc++.h>
#define boost \
ios_base::sync_with_stdio(0); \
cin.tie(); \
cout.tie()
#define all(x) x.begin(), x.end()
#defi... | #include <bits/stdc++.h>
#define boost \
ios_base::sync_with_stdio(0); \
cin.tie(); \
cout.tie()
#define all(x) x.begin(), x.end()
#defi... | [
"variable_declaration.type.change"
] | 284,497 | 284,498 | u660524286 | cpp |
p02584 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> P;
constexpr int INF = 1e9;
constexpr int MOD = 1e9 + 7;
int main() {
ll x, k, d;
cin >> x >> k >> d;
l... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> P;
constexpr int INF = 1e9;
constexpr int MOD = 1e9 + 7;
int main() {
ll x, k, d;
cin >> x >> k >> d;
l... | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 284,499 | 284,500 | u833206087 | cpp |
p02584 | #include <algorithm>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <queue>
#include <set>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define PI 3.14159265358979323846264338327950L
ll res;
int main() {
cin.tie(nullptr);
io... | #include <algorithm>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <queue>
#include <set>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define PI 3.14159265358979323846264338327950L
ll res;
int main() {
cin.tie(nullptr);
io... | [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 284,513 | 284,514 | u375948148 | cpp |
p02584 | #include <iostream>
#include <vector>
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;
if (X < 0)
X = -X;
long long ans;
long long r = X % D;
long long a = (X - r) / D;
if (K * D + r <= X) {
ans = X - K * D;
} else if ... | #include <iostream>
#include <vector>
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;
if (X < 0)
X = -X;
long long ans;
long long r = X % D;
long long a = (X - r) / D;
if (K - a <= 0) {
ans = X - K * D;
} else if ((K ... | [
"expression.operation.binary.remove",
"identifier.replace.remove",
"literal.replace.add",
"control_flow.branch.if.condition.change"
] | 284,516 | 284,517 | u235321041 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const static ll INF = 1e15;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
// __uint128_t
const ll MOD = 1e9 + 7;
int main() {
ll X, K, D;
cin >> X >> K >> D;
X = abs(X);
if ((__uint128_t)D * (__uint128_t)K <= K) {
cout << X - D * K ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const static ll INF = 1e15;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
// __uint128_t
const ll MOD = 1e9 + 7;
int main() {
ll X, K, D;
cin >> X >> K >> D;
X = abs(X);
if ((__uint128_t)D * (__uint128_t)K <= X) {
cout << X - D * K ... | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 284,518 | 284,519 | u521973174 | cpp |
p02584 | #include <iostream>
#include <vector>
using namespace std;
int main() {
long long X, K, D;
cin >> X >> K >> D;
long long ans;
if (X < 0) {
X = -1 * X;
}
long count = X / D; // 残り距離が正としたときの試行回数
if (X >= count) {
ans = X - K * D;
cout << ans << endl;
return 0;
}
long distance = X % D; /... | #include <iostream>
#include <vector>
using namespace std;
int main() {
long long X, K, D;
cin >> X >> K >> D;
long long ans;
if (X < 0) {
X = -1 * X;
}
long count = X / D; // 残り距離が正としたときの試行回数
if (count > K) {
ans = X - K * D;
cout << ans << endl;
return 0;
}
long distance = X % D; //... | [
"expression.operation.binary.remove",
"control_flow.branch.if.condition.change"
] | 284,522 | 284,523 | u099006712 | cpp |
p02584 | #include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define P pair<int, int>
typedef vector<int> vec;
typedef vector<vec> mat;
ll abs_... | #include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define P pair<int, int>
typedef vector<int> vec;
typedef vector<vec> mat;
ll abs_... | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,529 | 284,530 | u416773418 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
#define inf 0x3f3f3f3f
#define INF 2e18
#define eps 1e-9
#define FastRead \
ios_base::sync_with_stdio(0); \
cin.tie(0)
#define fRead freopen("input.txt", "r", ... | #include <bits/stdc++.h>
using namespace std;
#define inf 0x3f3f3f3f
#define INF 2e18
#define eps 1e-9
#define FastRead \
ios_base::sync_with_stdio(0); \
cin.tie(0)
#define fRead freopen("input.txt", "r", ... | [
"expression.operation.binary.remove",
"control_flow.branch.if.condition.change"
] | 284,531 | 284,532 | u560858626 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
#define inf 0x3f3f3f3f
#define INF 2e18
#define eps 1e-9
#define FastRead \
ios_base::sync_with_stdio(0); \
cin.tie(0)
#define fRead freopen("input.txt", "r", ... | #include <bits/stdc++.h>
using namespace std;
#define inf 0x3f3f3f3f
#define INF 2e18
#define eps 1e-9
#define FastRead \
ios_base::sync_with_stdio(0); \
cin.tie(0)
#define fRead freopen("input.txt", "r", ... | [
"expression.operation.binary.remove",
"control_flow.branch.if.condition.change"
] | 284,533 | 284,534 | u560858626 | cpp |
p02584 | // C.cpp : このファイルには 'main'
// 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//
#include <cmath>
#include <iostream>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
if (abs(x) > k * d) {
cout << abs(x) - k * d << endl;
} else {
long long a = abs(x) % d;
long long b = abs(x) / d;
... | // C.cpp : このファイルには 'main'
// 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//
#include <cmath>
#include <iostream>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
if (abs(x) / d > k) {
cout << abs(x) - k * d << endl;
} else {
long long a = abs(x) % d;
long long b = abs(x) / d;
... | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 284,537 | 284,538 | u902619368 | 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>;
const int MAX = 1000;
const int INF = 1e9;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
#define PI 3.14159265358979323846264338327950L
int main() {
ll X, K,... | #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>;
const int MAX = 1000;
const int INF = 1e9;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
#define PI 3.14159265358979323846264338327950L
int main() {
ll X, K,... | [
"identifier.change",
"io.output.change"
] | 284,544 | 284,545 | u624076058 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, k, d;
cin >> n >> k >> d;
n = abs(n);
if (n / d >= k) {
n = n - d * k;
cout << n;
return 0;
}
int x = n / d;
n = n - x * d;
k = k - x; // Hope's are left
if (k % 2 =... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int64_t n, k, d;
cin >> n >> k >> d;
n = abs(n);
if (n / d >= k) {
n = n - d * k;
cout << n;
return 0;
}
int64_t x = n / d;
n = n - x * d;
k = k - x; // Hope's are left
if ... | [
"variable_declaration.type.primitive.change"
] | 284,548 | 284,549 | u924036615 | cpp |
p02584 | #define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <ctime>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>... | #define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <ctime>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>... | [
"call.add",
"call.arguments.change"
] | 284,550 | 284,551 | u330326085 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Edge = int;
using Graph = vector<vector<Edge>>;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
const ll MOD = 1000000007;
const ll nmax = 8;
const ll IN... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Edge = int;
using Graph = vector<vector<Edge>>;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
const ll MOD = 1000000007;
const ll nmax = 8;
const ll IN... | [
"call.add",
"call.arguments.change"
] | 284,554 | 284,555 | u228295160 | cpp |
p02584 | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;
int main() {
ios::sync_with_stdio(false);
ll x, k, d;
cin >> x >> k >> d;
if (x > 0) {
if (k < x / d)
cout <... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;
int main() {
ios::sync_with_stdio(false);
ll x, k, d;
cin >> x >> k >> d;
if (x > 0) {
if (k < x / d)
cout <... | [
"expression.operation.unary.add",
"misc.opposites",
"expression.operator.arithmetic.change",
"io.output.change"
] | 284,556 | 284,557 | u151855078 | cpp |
p02584 | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ll x, k, d;
cin >> x >> k >> d;
x = abs(x);
ll t = ceil(1.0 * x / d);
if (t > k) {
cout << (x - k * d);
} else {
if ((k - t) % 2 == 0) {
;
} else {
t--;
}
cout << (x - t * d);
}
return 0;
}
| #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ll x, k, d;
cin >> x >> k >> d;
x = abs(x);
ll t = ceil(1.0 * x / d);
if (t > k) {
cout << (x - k * d);
} else {
if ((k - t) % 2 == 0) {
;
} else {
t--;
}
cout << (abs(x - t * d));
}
return 0... | [] | 284,564 | 284,565 | u804042948 | cpp |
p02584 | #include <bits/stdc++.h>
#include <sstream>
#define rep2(i, x, y) for (int i = x; i < (y); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
int INF = 100100101;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
ll x, k, d;
cin >> x >> k >> d... | #include <bits/stdc++.h>
#include <sstream>
#define rep2(i, x, y) for (int i = x; i < (y); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
int INF = 100100101;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
ll x, k, d;
cin >> x >> k >> d... | [
"expression.operator.arithmetic.change",
"control_flow.branch.if.condition.change"
] | 284,569 | 284,570 | u415671616 | cpp |
p02584 | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
#define REP(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define rep(i, n) REP(i, 0, n)
#define square(x) pow(x, 2.0)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define max_queue(x) priority_queue<x>
#define min_queue... | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
#define REP(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define rep(i, n) REP(i, 0, n)
#define square(x) pow(x, 2.0)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define max_queue(x) priority_queue<x>
#define min_queue... | [
"expression.operation.binary.add"
] | 284,578 | 284,579 | u951112139 | cpp |
p02584 | //بسم الله الرحمن الرحيم
/// *** --- ||| In the name of ALLAH ||| --- ***
/// ///
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define el << endl
#define PI 3.141592653589793238
#define _test_ \
int t; ... | //بسم الله الرحمن الرحيم
/// *** --- ||| In the name of ALLAH ||| --- ***
/// ///
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define el << endl
#define PI 3.141592653589793238
#define _test_ \
int t; ... | [
"expression.operation.unary.logical.remove",
"control_flow.branch.if.condition.change"
] | 284,587 | 284,588 | u037136948 | cpp |
p02584 | //بسم الله الرحمن الرحيم
/// *** --- ||| In the name of ALLAH ||| --- ***
/// ///
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define el << endl
#define PI 3.141592653589793238
#define _test_ \
int t; ... | //بسم الله الرحمن الرحيم
/// *** --- ||| In the name of ALLAH ||| --- ***
/// ///
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define el << endl
#define PI 3.141592653589793238
#define _test_ \
int t; ... | [
"expression.operation.unary.logical.remove",
"control_flow.branch.if.condition.change"
] | 284,589 | 284,590 | u037136948 | cpp |
p02584 | // https://atcoder.jp/contests/abc175/tasks/abc175_c
#include <algorithm>
#include <deque>
#include <iostream>
#include <iterator> // std::back_inserter
#include <tuple>
#include <vector>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
x = abs(x);
long long mod = x % d;
long long d... | // https://atcoder.jp/contests/abc175/tasks/abc175_c
#include <algorithm>
#include <deque>
#include <iostream>
#include <iterator> // std::back_inserter
#include <tuple>
#include <vector>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
x = abs(x);
long long mod = x % d;
long long d... | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 284,591 | 284,592 | u904912386 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
using ll = long long;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define MOD 1000000007
c... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
using ll = long long;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define MOD 1000000007
c... | [
"call.add",
"identifier.change",
"io.output.change",
"call.arguments.change"
] | 284,610 | 284,611 | u406237526 | cpp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.