problem_id stringlengths 6 6 | buggy_code stringlengths 8 526k ⌀ | fixed_code stringlengths 12 526k ⌀ | labels listlengths 0 15 ⌀ | buggy_submission_id int64 1 1.54M ⌀ | fixed_submission_id int64 2 1.54M ⌀ | user_id stringlengths 10 10 ⌀ | language stringclasses 9
values |
|---|---|---|---|---|---|---|---|
p03104 | #include <algorithm>
#include <chrono>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <time.h>
#include <unordered_map>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define ll long long
#define INF 1000000001
#define mod 1000000007
#define sort(s) sort(s.begin(), s.end());
#define reverse(s) reverse(s.begin(), s.end());
#define P pair<int, int>
#define valid(x, y, h, w) (0 <= x && x < h && 0 <= y && y < w)
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
using namespace std;
int POW(int x, int y) { return int(pow(double(x), double(y))); }
double log(double a, double b) { return log(b) / log(a); }
// 2進数を10進数に変換_63個の要素を持つ配列
ll Convert2to10(vector<int> a) {
ll ans = 0;
ll j = 1;
rep(i, a.size()) {
ans += a[i] * j;
if (i != a.size() - 1) {
j *= 2;
}
}
return ans;
}
// 10進数を2進数に変換_63個の要素を持つ配列
vector<int> Convert10to2(ll n) {
vector<int> ans(63);
rep(i, 63) {
ans[i] = n % 2;
n -= n % 2;
n /= 2;
}
return ans;
}
int main() {
ll a, b;
cin >> a >> b;
vector<int> ans;
if (a % 2 == 1) {
if ((b - a) % 4 == 2 || (b - a) % 4 == 3) {
ans.push_back(0);
} else {
ans.push_back(1);
}
} else {
if ((b - a) % 4 == 0 || (b - a) % 4 == 3) {
ans.push_back(0);
} else {
ans.push_back(1);
}
}
vector<int> a2 = Convert10to2(a);
vector<int> b2 = Convert10to2(b);
int index = 1;
ll r = 4;
while (r <= 2000000000000) {
if (a / r != b / r) {
ll c = (a / r + 1) * r;
if (a2[index] == 0) {
c = a;
}
ll d = (b / r) * r;
if (a2[index] == 0) {
d = b;
}
ll kazu1 = (c - a) + (b - d);
if (b % (r) >= r / 2) {
kazu1++;
}
if (kazu1 % 2 == 0) {
ans.push_back(0);
} else {
ans.push_back(1);
}
} else {
if (a / (r / 2) == b / (r / 2)) {
if (b % (r) >= r / 2) {
ll kazu1 = b - a + 1;
if (kazu1 % 2 == 0) {
ans.push_back(0);
} else {
ans.push_back(1);
}
} else {
ans.push_back(0);
}
} else {
ll kazu1 = b - (a / (r / 2) + 1) * (r / 2) + 1;
if (kazu1 < 0 || kazu1 % 2 == 0) {
ans.push_back(0);
} else {
ans.push_back(1);
}
}
}
r *= 2;
index++;
}
cout << Convert2to10(ans) << endl;
;
}
| #include <algorithm>
#include <chrono>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <time.h>
#include <unordered_map>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define ll long long
#define INF 1000000001
#define mod 1000000007
#define sort(s) sort(s.begin(), s.end());
#define reverse(s) reverse(s.begin(), s.end());
#define P pair<int, int>
#define valid(x, y, h, w) (0 <= x && x < h && 0 <= y && y < w)
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
using namespace std;
int POW(int x, int y) { return int(pow(double(x), double(y))); }
double log(double a, double b) { return log(b) / log(a); }
// 2進数を10進数に変換_63個の要素を持つ配列
ll Convert2to10(vector<int> a) {
ll ans = 0;
ll j = 1;
rep(i, a.size()) {
ans += a[i] * j;
if (i != a.size() - 1) {
j *= 2;
}
}
return ans;
}
// 10進数を2進数に変換_63個の要素を持つ配列
vector<int> Convert10to2(ll n) {
vector<int> ans(63);
rep(i, 63) {
ans[i] = n % 2;
n -= n % 2;
n /= 2;
}
return ans;
}
int main() {
ll a, b;
cin >> a >> b;
vector<int> ans;
if (a % 2 == 1) {
if ((b - a) % 4 == 2 || (b - a) % 4 == 3) {
ans.push_back(0);
} else {
ans.push_back(1);
}
} else {
if ((b - a) % 4 == 0 || (b - a) % 4 == 3) {
ans.push_back(0);
} else {
ans.push_back(1);
}
}
vector<int> a2 = Convert10to2(a);
vector<int> b2 = Convert10to2(b);
int index = 1;
ll r = 4;
while (r <= 2000000000000) {
if (a / r != b / r) {
ll c = (a / r + 1) * r;
if (a2[index] == 0) {
c = a;
}
ll d = (b / r) * r;
if (b2[index] == 0) {
d = b;
}
ll kazu1 = (c - a) + (b - d);
if (b % (r) >= r / 2) {
kazu1++;
}
if (kazu1 % 2 == 0) {
ans.push_back(0);
} else {
ans.push_back(1);
}
} else {
if (a / (r / 2) == b / (r / 2)) {
if (b % (r) >= r / 2) {
ll kazu1 = b - a + 1;
if (kazu1 % 2 == 0) {
ans.push_back(0);
} else {
ans.push_back(1);
}
} else {
ans.push_back(0);
}
} else {
ll kazu1 = b - (a / (r / 2) + 1) * (r / 2) + 1;
if (kazu1 < 0 || kazu1 % 2 == 0) {
ans.push_back(0);
} else {
ans.push_back(1);
}
}
}
r *= 2;
index++;
}
cout << Convert2to10(ans) << endl;
;
}
| [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 912,085 | 912,086 | u376103660 | cpp |
p03104 | #include <bits/stdc++.h>
#define INT long long int
#define oo 987654321
using namespace std;
INT a, b, A, B;
int main() {
ios::sync_with_stdio(false);
cin >> a >> b;
a--;
if (b > 2) {
if (b % 4 == 3)
B = 0;
else if (b % 4 == 2)
B = b + 1;
else if (b % 4 == 1)
B = 1;
else if (b % 4 == 0)
B = b;
} else
for (INT i = 0; i <= b; i++)
B ^= i;
if (a > 2) {
if (a % 4 == 3)
A = 0;
else if (a % 4 == 2)
A = a + 1;
else if (a % 4 == 1)
A = 1;
else if (a % 4 == 0)
a = a;
} else
for (INT i = 0; i <= a; i++)
A ^= i;
cout << (B ^ A) << endl;
return 0;
} | #include <bits/stdc++.h>
#define INT long long int
#define oo 987654321
using namespace std;
INT a, b, A, B;
int main() {
ios::sync_with_stdio(false);
cin >> a >> b;
a--;
if (b > 2) {
if (b % 4 == 3)
B = 0;
else if (b % 4 == 2)
B = b + 1;
else if (b % 4 == 1)
B = 1;
else if (b % 4 == 0)
B = b;
} else
for (INT i = 0; i <= b; i++)
B ^= i;
if (a > 2) {
if (a % 4 == 3)
A = 0;
else if (a % 4 == 2)
A = a + 1;
else if (a % 4 == 1)
A = 1;
else if (a % 4 == 0)
A = a;
} else
for (INT i = 0; i <= a; i++)
A ^= i;
cout << (B ^ A) << endl;
return 0;
} | [
"assignment.variable.change",
"identifier.change"
] | 912,089 | 912,090 | u846271630 | cpp |
p03104 | #include <algorithm>
#include <array>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
using namespace std;
using ll = long long int;
ll cx(ll n) {
ll b = (n >> 1) & 1LL;
if (n % 2 == 1)
return ~b;
else
return n | b;
}
int main() {
ll a, b;
cin >> a >> b;
cout << (cx(b) ^ cx(a) ^ a) << endl;
return 0;
}
| #include <algorithm>
#include <array>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
using namespace std;
using ll = long long int;
ll cx(ll n) {
ll c = (n >> 1) & 1LL;
if (n % 2 == 1)
return c ^ 1;
else
return n | c;
}
int main() {
ll a, b;
cin >> a >> b;
cout << (cx(b) ^ cx(a) ^ a) << endl;
return 0;
}
| [
"variable_declaration.name.change",
"identifier.change",
"function.return_value.change",
"expression.operation.binary.change"
] | 912,097 | 912,098 | u158253287 | cpp |
p03104 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ITR(x, c) for(__typeof(c.begin() x=c.begin();x!=c.end();x++)
#define RITR(x, c) for(__typeof(c.rbegin() x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)
#define lf double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll, ll>
#define pi pair<int, int>
#define all(a) (a.begin()), (a.end())
#define rall(a) (a.rbegin()), (a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert
using namespace std;
int main(void) {
cin.tie(0);
ios::sync_with_stdio(false);
ll a, b;
cin >> a >> b;
ll A = 0, B = 0;
if (a == b) {
cout << a << "\n";
return 0;
}
b++;
rep(i, 40) {
ll mask = 1LL << i;
ll k = b / (mask * 2) * mask + min(0ll, b % (mask * 2) - mask);
B |= mask * (k % 2);
}
rep(i, 40) {
ll mask = 1LL << i;
ll k = a / (mask * 2) * mask + min(0ll, a % (mask * 2) - mask);
A |= mask * (k % 2);
}
cout << (B ^ A) << endl;
return 0;
} | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ITR(x, c) for(__typeof(c.begin() x=c.begin();x!=c.end();x++)
#define RITR(x, c) for(__typeof(c.rbegin() x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)
#define lf double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll, ll>
#define pi pair<int, int>
#define all(a) (a.begin()), (a.end())
#define rall(a) (a.rbegin()), (a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert
using namespace std;
int main(void) {
cin.tie(0);
ios::sync_with_stdio(false);
ll a, b;
cin >> a >> b;
ll A = 0, B = 0;
if (a == b) {
cout << a << "\n";
return 0;
}
b++;
rep(i, 40) {
ll mask = 1LL << i;
ll k = b / (mask * 2) * mask + max(0ll, b % (mask * 2) - mask);
B |= mask * (k % 2);
}
rep(i, 40) {
ll mask = 1LL << i;
ll k = a / (mask * 2) * mask + max(0ll, a % (mask * 2) - mask);
A |= mask * (k % 2);
}
cout << (B ^ A) << endl;
return 0;
} | [
"misc.opposites",
"identifier.change",
"call.function.change",
"expression.operation.binary.change"
] | 912,109 | 912,110 | u682686221 | cpp |
p03104 | #define debug_interval ','
#define dump_interval ' '
#define debug_toggle 1
//{
#include <bits/stdc++.h>
using namespace std;
#define hi cerr << "hi" << endl;
#define int long long
#define INT_MAX LLONG_MAX
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define fi first
#define se second
#define mp make_pair
#define rev reverse
#define dans dump(ans)
#define MOD 1000000007
#define amp(v, n) (v).count(n) ? v[n]++ : v[n] = 1
#define sysp system("pause")
#define PI acos(-1)
#define pf push_front
#define ins insert
//{
inline int toInt(string s) {
int v;
istringstream sin(s);
sin >> v;
return v;
}
template <class T> inline string toString(T x) {
ostringstream sout;
sout << x;
return sout.str();
}
template <class... A> inline void dump() { cout << endl; }
template <class... A> inline void dump_rest() { cout << endl; }
template <class T, class... A>
inline void dump_rest(const T &first, const A &...rest) {
cout << dump_interval << first;
dump_rest(rest...);
}
template <class T, class... A>
inline void dump(const T &first, const A &...rest) {
cout << first;
dump_rest(rest...);
}
template <class... A> inline void debug() { cerr << endl; }
template <class... A> inline void debug_rest() { cerr << endl; }
template <class T, class... A>
inline void debug_rest(const T &first, const A &...rest) {
cerr << debug_interval << first;
debug_rest(rest...);
}
template <class T, class... A>
inline void debug(const T &first, const A &...rest) {
if (debug_toggle)
cerr << first, debug_rest(rest...);
}
unsigned XorShift(void) {
static unsigned x = 123456789;
static unsigned y = 362436069;
static unsigned z = 521288629;
static unsigned w = 88675123;
unsigned t;
t = x ^ (x << 11);
x = y;
y = z;
z = w;
return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
}
//}
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<pint> vpint;
template <typename A, typename B> inline void chmin(A &a, B b) {
if (a > b)
a = b;
}
template <typename A, typename B> inline void chmax(A &a, B b) {
if (a < b)
a = b;
}
template <int m> class mint {
private:
int i;
public:
mint() : i(0) {}
mint(int i) : i((i % m + m) % m) {}
mint operator+(const mint &o) { return o.i + i; }
mint operator*(const mint &o) { return o.i * i; }
mint operator-() { return -i; }
operator int() { return i; }
};
//}
int f(int x) {
if (x % 4 == 0)
return x;
if (x % 4 == 1)
return 1;
if (x % 4 == 2)
return x + 1;
if (x % 4 == 3)
return 0;
}
int a, b;
main() {
cin >> a >> b;
dump(f(b) ^ f(a - 1 + 4));
}
/*for(;;){
cin>>a>>b;
for(int i=a+1;i<=b;i++){
a^=i;
}
dump(a);
}*/ | #define debug_interval ','
#define dump_interval ' '
#define debug_toggle 1
//{
#include <bits/stdc++.h>
using namespace std;
#define hi cerr << "hi" << endl;
#define int long long
#define INT_MAX LLONG_MAX
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define fi first
#define se second
#define mp make_pair
#define rev reverse
#define dans dump(ans)
#define MOD 1000000007
#define amp(v, n) (v).count(n) ? v[n]++ : v[n] = 1
#define sysp system("pause")
#define PI acos(-1)
#define pf push_front
#define ins insert
//{
inline int toInt(string s) {
int v;
istringstream sin(s);
sin >> v;
return v;
}
template <class T> inline string toString(T x) {
ostringstream sout;
sout << x;
return sout.str();
}
template <class... A> inline void dump() { cout << endl; }
template <class... A> inline void dump_rest() { cout << endl; }
template <class T, class... A>
inline void dump_rest(const T &first, const A &...rest) {
cout << dump_interval << first;
dump_rest(rest...);
}
template <class T, class... A>
inline void dump(const T &first, const A &...rest) {
cout << first;
dump_rest(rest...);
}
template <class... A> inline void debug() { cerr << endl; }
template <class... A> inline void debug_rest() { cerr << endl; }
template <class T, class... A>
inline void debug_rest(const T &first, const A &...rest) {
cerr << debug_interval << first;
debug_rest(rest...);
}
template <class T, class... A>
inline void debug(const T &first, const A &...rest) {
if (debug_toggle)
cerr << first, debug_rest(rest...);
}
unsigned XorShift(void) {
static unsigned x = 123456789;
static unsigned y = 362436069;
static unsigned z = 521288629;
static unsigned w = 88675123;
unsigned t;
t = x ^ (x << 11);
x = y;
y = z;
z = w;
return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
}
//}
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<pint> vpint;
template <typename A, typename B> inline void chmin(A &a, B b) {
if (a > b)
a = b;
}
template <typename A, typename B> inline void chmax(A &a, B b) {
if (a < b)
a = b;
}
template <int m> class mint {
private:
int i;
public:
mint() : i(0) {}
mint(int i) : i((i % m + m) % m) {}
mint operator+(const mint &o) { return o.i + i; }
mint operator*(const mint &o) { return o.i * i; }
mint operator-() { return -i; }
operator int() { return i; }
};
//}
int f(int x) {
if (x % 4 == 0)
return x;
if (x % 4 == 1)
return 1;
if (x % 4 == 2)
return x + 1;
if (x % 4 == 3)
return 0;
}
int a, b;
main() {
cin >> a >> b;
dump(f(b) ^ f(a - 1));
}
/*for(;;){
cin>>a>>b;
for(int i=a+1;i<=b;i++){
a^=i;
}
dump(a);
}*/ | [
"expression.operation.binary.remove"
] | 912,113 | 912,114 | u130196064 | cpp |
p03104 | #include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
ll a, b, bita[40], bitb[42], pow2[42], A[42], B[42], ans;
int main() {
cin >> a >> b;
ll c = a, d = b;
ll s = 0, t = 0;
while (c) {
A[s] = c % 2;
s++, c /= 2;
}
while (d) {
B[t] = d % 2;
t++, d /= 2;
}
pow2[0] = 1;
for (int i = 1; i <= 41; i++)
pow2[i] = pow2[i - 1] * 2;
for (int i = 0; i <= 40; i++) {
bita[i] += a / pow2[i + 1] * pow2[i + 1] / 2;
if (A[i] == 1) {
bita[i] += a % pow2[i] + 1;
}
}
for (int i = 0; i <= 40; i++) {
bitb[i] += b / pow2[i + 1] * pow2[i + 1] / 2;
if (B[i] == 1) {
bitb[i] += b % pow2[i] + 1;
}
}
for (int i = 0; i <= 40; i++) {
ans += pow2[i] * ((bitb[i] - bita[i] + A[i]) % 2);
}
cout << ans << endl;
int www;
cin >> www;
} | #include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
ll a, b, bita[42], bitb[42], pow2[42], A[42], B[42], ans;
int main() {
cin >> a >> b;
ll c = a, d = b;
ll s = 0, t = 0;
while (c) {
A[s] = c % 2;
s++, c /= 2;
}
while (d) {
B[t] = d % 2;
t++, d /= 2;
}
pow2[0] = 1;
for (int i = 1; i <= 41; i++)
pow2[i] = pow2[i - 1] * 2;
for (int i = 0; i <= 40; i++) {
bita[i] += a / pow2[i + 1] * pow2[i + 1] / 2;
if (A[i] == 1) {
bita[i] += a % pow2[i] + 1;
}
}
for (int i = 0; i <= 40; i++) {
bitb[i] += b / pow2[i + 1] * pow2[i + 1] / 2;
if (B[i] == 1) {
bitb[i] += b % pow2[i] + 1;
}
}
for (int i = 0; i <= 40; i++) {
ans += pow2[i] * ((bitb[i] - bita[i] + A[i]) % 2);
}
cout << ans << endl;
int www;
cin >> www;
} | [
"literal.number.change",
"variable_declaration.array_dimensions.change"
] | 912,115 | 912,116 | u475007080 | cpp |
p03104 | #pragma GCC optimize("O3")
#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
using QWORD = uint64_t;
using SQWORD = int64_t;
using DWORD = uint32_t;
using SDWORD = int32_t;
using WORD = uint16_t;
using SWORD = int16_t;
using BYTE = uint8_t;
using SBYTE = int8_t;
using DOUBLE = double;
using FLOAT = float;
#define MIN_SDWORD (-2147483648)
#define MAX_SDWORD (2147483647)
#define MIN_SBYTE (-128)
#define MAX_SBYTE (127)
#define MIN_SQWORD (0x8000000000000000)
#define MAX_SQWORD (0x7FFFFFFFFFFFFFFF)
#define MAX_QWORD (0xFFFFFFFFFFFFFFFF)
#define MAX_DWORD (0xFFFFFFFF)
#define MAX_WORD (0xFFFF)
#define MAX_BYTE (0xFF)
#define ArrayLength(a) (sizeof(a) / sizeof(a[0]))
static inline QWORD MAX(QWORD a, QWORD b) { return a > b ? a : b; }
static inline DWORD MAX(DWORD a, DWORD b) { return a > b ? a : b; }
static inline SDWORD MAX(SDWORD a, SDWORD b) { return a > b ? a : b; }
static inline QWORD MIN(QWORD a, QWORD b) { return a < b ? a : b; }
static inline DWORD MIN(DWORD a, DWORD b) { return a < b ? a : b; }
static inline SDWORD MIN(SDWORD a, SDWORD b) { return a < b ? a : b; }
#define BYTE_BITS (8)
#define WORD_BITS (16)
#define DWORD_BITS (32)
#define QWORD_BITS (64)
using M_BOOL = bool;
#define M_TRUE (true)
#define M_FALSE (false)
#define DIVISOR (1000000007)
static inline void inputString(char *pcStr) {
char *pcCur = pcStr;
for (;;) {
char c = getchar();
if (('\n' == c) || (EOF == c)) {
break;
}
*pcCur = c;
pcCur++;
}
*pcCur = '\0';
}
static inline SQWORD inputSQWORD(void) {
SQWORD sqNumber = 0;
SQWORD sqMultiplier = 1;
M_BOOL bRead = M_FALSE;
for (;;) {
char c = getchar();
if (!bRead) {
if ('-' == c) {
sqMultiplier = -1;
}
}
if (('0' <= c) && (c <= '9')) {
sqNumber *= 10LL;
sqNumber += (SQWORD)(c - '0');
bRead = M_TRUE;
} else {
if (bRead) {
return sqNumber * sqMultiplier;
}
}
}
}
static inline SDWORD inputSDWORD(void) {
SDWORD lNumber = 0;
SDWORD lMultiplier = 1;
M_BOOL bRead = M_FALSE;
for (;;) {
char c = getchar();
if (!bRead) {
if ('-' == c) {
lMultiplier = -1;
}
}
if (('0' <= c) && (c <= '9')) {
lNumber *= 10;
lNumber += (c - '0');
bRead = M_TRUE;
} else {
if (bRead) {
return lNumber * lMultiplier;
}
}
}
}
static inline DOUBLE inputFP(void) {
DOUBLE dInt = 0.0;
DOUBLE dFrac = 0.0;
DOUBLE dMultiplier = 1.0;
DWORD dwFpCnt = 0;
DOUBLE *pdCur = &dInt;
M_BOOL bRead = M_FALSE;
for (;;) {
char c = getchar();
if (!bRead) {
if ('-' == c) {
dMultiplier = -1;
}
}
if ('.' == c) {
pdCur = &dFrac;
} else if (('0' <= c) && (c <= '9')) {
(*pdCur) *= 10;
(*pdCur) += (DOUBLE)(c - '0');
bRead = M_TRUE;
if (pdCur == &dFrac) {
dwFpCnt++;
}
} else {
if (bRead) {
return dMultiplier *
(dInt + dFrac / (pow((DOUBLE)10.0, (DOUBLE)dwFpCnt)));
}
}
}
}
static SQWORD calcZeroToNumXor(SQWORD sqNum) {
SQWORD sqRet = 0;
for (DWORD dwBit = 1; dwBit < 64; dwBit++) {
SQWORD sqMask = 0x1LL << dwBit;
if (sqMask & sqNum) {
if (0 == (sqMask & 0x1)) {
sqRet |= sqMask;
}
}
}
/* lowest bit */
if ((sqNum % 4 == 1) || (sqNum % 4 == 2)) {
sqRet |= 1;
}
return sqRet;
}
int main() {
SQWORD sqInput_A = inputSQWORD();
SQWORD sqInput_B = inputSQWORD();
SQWORD sqAns;
if (sqInput_A == sqInput_B) {
sqAns = sqInput_A;
} else if (0 == sqInput_A) {
sqAns = calcZeroToNumXor(sqInput_B);
} else {
SQWORD sqXorA = calcZeroToNumXor(sqInput_A - 1);
SQWORD sqXorB = calcZeroToNumXor(sqInput_B);
sqAns = (sqXorA ^ sqXorB);
}
printf("%lld\n", sqAns);
return 0;
} | #pragma GCC optimize("O3")
#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
using QWORD = uint64_t;
using SQWORD = int64_t;
using DWORD = uint32_t;
using SDWORD = int32_t;
using WORD = uint16_t;
using SWORD = int16_t;
using BYTE = uint8_t;
using SBYTE = int8_t;
using DOUBLE = double;
using FLOAT = float;
#define MIN_SDWORD (-2147483648)
#define MAX_SDWORD (2147483647)
#define MIN_SBYTE (-128)
#define MAX_SBYTE (127)
#define MIN_SQWORD (0x8000000000000000)
#define MAX_SQWORD (0x7FFFFFFFFFFFFFFF)
#define MAX_QWORD (0xFFFFFFFFFFFFFFFF)
#define MAX_DWORD (0xFFFFFFFF)
#define MAX_WORD (0xFFFF)
#define MAX_BYTE (0xFF)
#define ArrayLength(a) (sizeof(a) / sizeof(a[0]))
static inline QWORD MAX(QWORD a, QWORD b) { return a > b ? a : b; }
static inline DWORD MAX(DWORD a, DWORD b) { return a > b ? a : b; }
static inline SDWORD MAX(SDWORD a, SDWORD b) { return a > b ? a : b; }
static inline QWORD MIN(QWORD a, QWORD b) { return a < b ? a : b; }
static inline DWORD MIN(DWORD a, DWORD b) { return a < b ? a : b; }
static inline SDWORD MIN(SDWORD a, SDWORD b) { return a < b ? a : b; }
#define BYTE_BITS (8)
#define WORD_BITS (16)
#define DWORD_BITS (32)
#define QWORD_BITS (64)
using M_BOOL = bool;
#define M_TRUE (true)
#define M_FALSE (false)
#define DIVISOR (1000000007)
static inline void inputString(char *pcStr) {
char *pcCur = pcStr;
for (;;) {
char c = getchar();
if (('\n' == c) || (EOF == c)) {
break;
}
*pcCur = c;
pcCur++;
}
*pcCur = '\0';
}
static inline SQWORD inputSQWORD(void) {
SQWORD sqNumber = 0;
SQWORD sqMultiplier = 1;
M_BOOL bRead = M_FALSE;
for (;;) {
char c = getchar();
if (!bRead) {
if ('-' == c) {
sqMultiplier = -1;
}
}
if (('0' <= c) && (c <= '9')) {
sqNumber *= 10LL;
sqNumber += (SQWORD)(c - '0');
bRead = M_TRUE;
} else {
if (bRead) {
return sqNumber * sqMultiplier;
}
}
}
}
static inline SDWORD inputSDWORD(void) {
SDWORD lNumber = 0;
SDWORD lMultiplier = 1;
M_BOOL bRead = M_FALSE;
for (;;) {
char c = getchar();
if (!bRead) {
if ('-' == c) {
lMultiplier = -1;
}
}
if (('0' <= c) && (c <= '9')) {
lNumber *= 10;
lNumber += (c - '0');
bRead = M_TRUE;
} else {
if (bRead) {
return lNumber * lMultiplier;
}
}
}
}
static inline DOUBLE inputFP(void) {
DOUBLE dInt = 0.0;
DOUBLE dFrac = 0.0;
DOUBLE dMultiplier = 1.0;
DWORD dwFpCnt = 0;
DOUBLE *pdCur = &dInt;
M_BOOL bRead = M_FALSE;
for (;;) {
char c = getchar();
if (!bRead) {
if ('-' == c) {
dMultiplier = -1;
}
}
if ('.' == c) {
pdCur = &dFrac;
} else if (('0' <= c) && (c <= '9')) {
(*pdCur) *= 10;
(*pdCur) += (DOUBLE)(c - '0');
bRead = M_TRUE;
if (pdCur == &dFrac) {
dwFpCnt++;
}
} else {
if (bRead) {
return dMultiplier *
(dInt + dFrac / (pow((DOUBLE)10.0, (DOUBLE)dwFpCnt)));
}
}
}
}
static SQWORD calcZeroToNumXor(SQWORD sqNum) {
SQWORD sqRet = 0;
for (DWORD dwBit = 1; dwBit < 64; dwBit++) {
SQWORD sqMask = 0x1LL << dwBit;
if (sqMask & sqNum) {
if (0 == (sqNum & 0x1)) {
sqRet |= sqMask;
}
}
}
/* lowest bit */
if ((sqNum % 4 == 1) || (sqNum % 4 == 2)) {
sqRet |= 1;
}
return sqRet;
}
int main() {
SQWORD sqInput_A = inputSQWORD();
SQWORD sqInput_B = inputSQWORD();
SQWORD sqAns;
if (sqInput_A == sqInput_B) {
sqAns = sqInput_A;
} else if (0 == sqInput_A) {
sqAns = calcZeroToNumXor(sqInput_B);
} else {
SQWORD sqXorA = calcZeroToNumXor(sqInput_A - 1);
SQWORD sqXorB = calcZeroToNumXor(sqInput_B);
sqAns = (sqXorA ^ sqXorB);
}
printf("%lld\n", sqAns);
return 0;
} | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 912,128 | 912,129 | u487476769 | cpp |
p03104 | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <utility>
#include <vector>
#define ALL(obj) (obj).begin(), (obj).end()
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (a); (b) <= i; i--)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = n; n <= i; i--)
#define ABS(a) ((a < 0) ? ((-1) * (a)) : (a))
#define elif else if
#define MOD 1000000007
#define INF (1 << 30)
using namespace std;
#define ld long double
#define ll long long
map<int, int> mpa, mpb;
typedef pair<ll, ll> P;
priority_queue<P, vector<P>, greater<P>> pque;
ll calc(ll num) {
if (num % 4 == 0) {
return num;
} else if (num % 4 == 1) {
return 1;
} else if (num % 4 == 2) {
return 1 ^ (num - 2);
} else if (num % 4 == 3) {
return 0;
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
ll A, B;
ll ans = 0;
cin >> A >> B;
if (A == B) {
cout << A << endl;
return 0;
}
A--;
ll a = calc(A);
ll b = calc(B);
ans = a ^ b;
cout << ans << endl;
return 0;
} | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <utility>
#include <vector>
#define ALL(obj) (obj).begin(), (obj).end()
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (a); (b) <= i; i--)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = n; n <= i; i--)
#define ABS(a) ((a < 0) ? ((-1) * (a)) : (a))
#define elif else if
#define MOD 1000000007
#define INF (1 << 30)
using namespace std;
#define ld long double
#define ll long long
map<int, int> mpa, mpb;
typedef pair<ll, ll> P;
priority_queue<P, vector<P>, greater<P>> pque;
ll calc(ll num) {
if (num % 4 == 0) {
return num;
} else if (num % 4 == 1) {
return 1;
} else if (num % 4 == 2) {
return num + 1;
} else if (num % 4 == 3) {
return 0;
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
ll A, B;
ll ans = 0;
cin >> A >> B;
if (A == B) {
cout << A << endl;
return 0;
}
A--;
ll a = calc(A);
ll b = calc(B);
ans = a ^ b;
cout << ans << endl;
return 0;
} | [
"expression.operation.binary.remove"
] | 912,146 | 912,145 | u789417951 | cpp |
p03104 | #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 FORR(i, m, n) for (int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
#define MOD 10007
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
llong F(llong x) {
switch (x % 4) {
case 0:
return x;
case 1:
return 1;
case 2:
return x + 1;
case 3:
return 0;
}
}
int main() {
llong A, B;
cin >> A >> B;
llong ans = F(A - 1) + F(B);
cout << ans << endl;
return 0;
} | #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 FORR(i, m, n) for (int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
#define MOD 10007
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
llong F(llong x) {
switch (x % 4) {
case 0:
return x;
case 1:
return 1;
case 2:
return x + 1;
case 3:
return 0;
}
}
int main() {
llong A, B;
cin >> A >> B;
llong ans = F(A - 1) ^ F(B);
cout << ans << endl;
return 0;
} | [
"expression.operation.binary.change"
] | 912,152 | 912,153 | u186359321 | cpp |
p03104 | #include <iostream>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
long long f(long long a) {
long long t, s;
if ((a + 1) % 2 == 0)
t = 0;
else
t = 1;
if ((a + 1) % 2 == 0)
s = 0;
else
s = a;
return t ^ s;
}
int main() {
long long a, b;
cin >> a >> b;
cout << (f(a - 1) ^ f(b)) << endl;
return 0;
}
| #include <iostream>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
long long f(long long a) {
long long t, s;
if (((a + 1) / 2) % 2 == 0)
t = 0;
else
t = 1;
if ((a + 1) % 2 == 0)
s = 0;
else
s = a;
return t ^ s;
}
int main() {
long long a, b;
cin >> a >> b;
cout << (f(a - 1) ^ f(b)) << endl;
return 0;
}
| [
"control_flow.branch.if.condition.change"
] | 912,160 | 912,161 | u886790158 | cpp |
p03104 | #include <algorithm>
#include <bitset>
#include <iostream>
#include <list>
#include <map>
#include <set>
#include <vector>
using namespace std;
template <typename T = int> T in() {
T temp;
cin >> temp;
return temp;
}
uint64_t GetXor(uint64_t A, uint64_t B) {
uint64_t ret;
for (uint64_t i = A; i <= B; i++) {
if (i == A)
ret = i;
else
ret ^= i;
}
return ret;
}
int main() {
uint64_t A(in<uint64_t>()), B(in<uint64_t>());
uint64_t diff = B - A + 1;
uint64_t ret;
if (diff < 6) {
ret = GetXor(A, B);
} else {
if ((A & 1) == 0) {
diff = (diff & 3);
A = B - diff + 1;
ret = GetXor(A, B);
} else if ((B & 1) == 1) {
diff = (diff & 3);
B = A + diff + 1;
ret = GetXor(A, B);
// Both are odd numbers
} else {
uint64_t A1 = A + 1;
diff--;
diff = (diff & 3);
A1 = B + diff + 1;
ret = A ^ GetXor(A1, B);
}
}
cout << ret << endl;
return 0;
}
| #include <algorithm>
#include <bitset>
#include <iostream>
#include <list>
#include <map>
#include <set>
#include <vector>
using namespace std;
template <typename T = int> T in() {
T temp;
cin >> temp;
return temp;
}
uint64_t GetXor(uint64_t A, uint64_t B) {
uint64_t ret;
for (uint64_t i = A; i <= B; i++) {
if (i == A)
ret = i;
else
ret ^= i;
}
return ret;
}
int main() {
uint64_t A(in<uint64_t>()), B(in<uint64_t>());
uint64_t diff = B - A + 1;
uint64_t ret;
// uint64_t exa = GetXor(A, B);
if (diff < 6) {
ret = GetXor(A, B);
} else {
if ((A & 1) == 0) {
diff = (diff & 3);
A = B - diff + 1;
ret = GetXor(A, B);
} else if ((B & 1) == 1) {
diff = (diff & 3);
B = A + diff - 1;
ret = GetXor(A, B);
// Both are odd numbers
} else {
uint64_t A1 = A + 1;
diff--;
diff = (diff & 3);
A1 = B - diff + 1;
ret = A ^ GetXor(A1, B);
}
}
// cout << exa << endl;
cout << ret << endl;
return 0;
}
| [
"misc.opposites",
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 912,162 | 912,163 | u074059110 | cpp |
p03104 | #include <algorithm>
#include <bitset>
#include <iostream>
#include <list>
#include <map>
#include <set>
#include <vector>
using namespace std;
template <typename T = int> T in() {
T temp;
cin >> temp;
return temp;
}
uint64_t GetXor(uint64_t A, uint64_t B) {
uint64_t ret;
for (uint64_t i = A; i <= B; i++) {
if (i == A)
ret = i;
else
ret ^= i;
}
return ret;
}
int main() {
uint64_t A(in<uint64_t>()), B(in<uint64_t>());
uint64_t diff = B - A + 1;
uint64_t ret;
if (diff < 5) {
ret = GetXor(A, B);
} else {
if ((A & 1) == 0) {
diff = (diff & 3);
A = B - diff + 1;
ret = GetXor(A, B);
} else if ((B & 1) == 1) {
diff = (diff & 3);
B = A + diff + 1;
ret = GetXor(A, B);
// Both are odd numbers
} else {
uint64_t A1 = A + 1;
diff--;
diff = (diff & 3);
A1 = B + diff + 1;
ret = A ^ GetXor(A1, B);
}
}
cout << ret << endl;
return 0;
}
| #include <algorithm>
#include <bitset>
#include <iostream>
#include <list>
#include <map>
#include <set>
#include <vector>
using namespace std;
template <typename T = int> T in() {
T temp;
cin >> temp;
return temp;
}
uint64_t GetXor(uint64_t A, uint64_t B) {
uint64_t ret;
for (uint64_t i = A; i <= B; i++) {
if (i == A)
ret = i;
else
ret ^= i;
}
return ret;
}
int main() {
uint64_t A(in<uint64_t>()), B(in<uint64_t>());
uint64_t diff = B - A + 1;
uint64_t ret;
// uint64_t exa = GetXor(A, B);
if (diff < 6) {
ret = GetXor(A, B);
} else {
if ((A & 1) == 0) {
diff = (diff & 3);
A = B - diff + 1;
ret = GetXor(A, B);
} else if ((B & 1) == 1) {
diff = (diff & 3);
B = A + diff - 1;
ret = GetXor(A, B);
// Both are odd numbers
} else {
uint64_t A1 = A + 1;
diff--;
diff = (diff & 3);
A1 = B - diff + 1;
ret = A ^ GetXor(A1, B);
}
}
// cout << exa << endl;
cout << ret << endl;
return 0;
}
| [
"literal.number.change",
"control_flow.branch.if.condition.change",
"misc.opposites",
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 912,164 | 912,163 | u074059110 | cpp |
p03104 | #include <bits/stdc++.h>
using namespace std;
long long f(long long x) {
if (x % 4 == 0) {
return x;
} else if (x % 4 == 1) {
return 1;
} else if (x % 4 == 2) {
return x + 1;
} else {
return 0;
}
}
int main() {
long long a, b;
cin >> a >> b;
cout << (f(b) ^ (a == 0 ? 0 : (a - 1))) << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
long long f(long long x) {
if (x % 4 == 0) {
return x;
} else if (x % 4 == 1) {
return 1;
} else if (x % 4 == 2) {
return x + 1;
} else {
return 0;
}
}
int main() {
long long a, b;
cin >> a >> b;
cout << (f(b) ^ (a == 0 ? 0 : f(a - 1))) << endl;
return 0;
} | [
"call.add"
] | 912,167 | 912,168 | u653786383 | cpp |
p03104 | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; i++)
#define REP(i, n) FOR(i, 0, n)
ll f_func(ll x) {
if (x < 0) {
return 0;
}
ll ans;
if (x % 2) {
ans = (x + 1) / 2 % 2;
} else {
ans = x / 2 % 2 + x;
}
return ans;
}
ll xor_sum(ll a, ll b) {
ll ans = 0;
ll num = 1;
while (b > 0) {
if (a % 2 + b % 2 == 1) {
ans += num / 1;
}
a /= 2;
b /= 2;
num *= 2;
}
return ans;
}
int main() {
ll a, b;
cin >> a >> b;
ll ans = xor_sum(f_func(a - 1), f_func(b));
cout << ans << endl;
} | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; i++)
#define REP(i, n) FOR(i, 0, n)
ll f_func(ll x) {
if (x < 0) {
return 0;
}
ll ans;
if (x % 2) {
ans = (x + 1) / 2 % 2;
} else {
ans = x / 2 % 2 + x;
}
return ans;
}
ll xor_sum(ll a, ll b) {
ll ans = 0;
ll num = 1;
while (a > 0 || b > 0) {
if (a % 2 + b % 2 == 1) {
ans += num;
}
a /= 2;
b /= 2;
num *= 2;
}
return ans;
}
int main() {
ll a, b;
cin >> a >> b;
// cout << f_func(a-1) << endl;;
// cout << f_func(b) << endl;
ll ans = xor_sum(f_func(a - 1), f_func(b));
cout << ans << endl;
} | [
"control_flow.loop.condition.change",
"expression.operation.binary.remove"
] | 912,180 | 912,181 | u960732690 | cpp |
p03104 | #include <bits/stdc++.h>
using namespace std;
long long func(long long x) {
if (x % 4 == 0)
return x;
if (x % 4 == 1)
return 1;
if (x % 4 == 2)
return x + 1;
if (x % 4 == 0)
return 0;
}
int main() {
long long A, B;
cin >> A >> B;
if (A == 0) {
cout << func(B) << endl;
return 0;
}
cout << (func(B) ^ func(A - 1)) << endl;
} | #include <bits/stdc++.h>
using namespace std;
long long func(long long x) {
if (x % 4 == 0)
return x;
if (x % 4 == 1)
return 1;
if (x % 4 == 2)
return x + 1;
if (x % 4 == 3)
return 0;
}
int main() {
long long A, B;
cin >> A >> B;
if (A == 0) {
cout << func(B) << endl;
return 0;
}
cout << (func(B) ^ func(A - 1)) << endl;
} | [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 912,184 | 912,185 | u546943614 | cpp |
p03104 | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long int ll;
#define rep(i, n) for (int i = 0; i < n; i++)
#define cinf(n, x, y) \
for (int i = 0; i < (n); i++) \
cin >> x[i] >> y[i];
int main() {
ll A, B;
cin >> A >> B;
ll ans = 0;
ll res = (B - A - 1) % 2;
if (A % 2 == 0) {
if (B % 2 == 1) {
ans = (B - A + 1) / 2 % 2;
} else {
ans = (B - A) / 2 % 2;
ans += B;
}
} else {
if (B % 2 == 1) {
ans = A - ((B - A) / 2 % 2);
} else {
int i = 0;
while (A > 0 || B > 0) {
if (A % 2 != B % 2) {
ans += pow(2, i);
}
i++;
A /= 2;
B /= 2;
}
}
if (ans % 2 == 0) {
ans += res;
} else {
ans -= res;
}
}
cout << ans << endl;
}
| #include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long int ll;
#define rep(i, n) for (int i = 0; i < n; i++)
#define cinf(n, x, y) \
for (int i = 0; i < (n); i++) \
cin >> x[i] >> y[i];
int main() {
ll A, B;
cin >> A >> B;
ll ans = 0;
int res = (B - A - 1) / 2 % 2;
if (A % 2 == 0) {
if (B % 2 == 1) {
ans = (B - A + 1) / 2 % 2;
} else {
ans = (B - A) / 2 % 2;
ans += B;
}
} else {
if (B % 2 == 1) {
ans = A - ((B - A) / 2 % 2);
} else {
int i = 0;
while (A > 0 || B > 0) {
if (A % 2 != B % 2) {
ans += pow(2, i);
}
i++;
A /= 2;
B /= 2;
}
if (ans % 2 == 0) {
ans += res;
} else {
ans -= res;
}
}
}
cout << ans << endl;
}
| [
"variable_declaration.type.change"
] | 912,193 | 912,194 | u928536113 | cpp |
p03104 | #include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
long long A, B;
long long func_xor(long long a) {
// int max_2_power = std::log2(a);
if (a == 0) {
return 0;
} else if (a == 1) {
return 1;
} else if (a == 2) {
return 3;
} else {
long long souwa_xor = 0;
int mod4_plus1 = ((a % 4) + 1) % 4;
for (long long i = (a - mod4_plus1 + 1); i < a + 1; i++) {
souwa_xor += std::bit_xor<long long>()(souwa_xor, i);
}
return souwa_xor;
}
}
long long sub_xor(long long a, long long b) {
int max_2_power = std::max(int(std::log2(a)), int(std::log2(b)));
// std::cout << int(int(std::log2(a))) << "\n";
// std::cout << int(int(std::log2(b))) << "\n";
long long c = 0;
for (int i = 0; i < max_2_power + 1; i++) {
if (b % 2) {
// std::cout << "(int(!a%2), i) = " << "(" << int(!(a%2)) << "," << i <<
// ")" << "\n";
c += int(!(a % 2)) * std::pow(2, i);
// std::cout << "b%2 = 1" << c << "\n";
} else {
c += (a % 2) * std::pow(2, i);
// std::cout << "b%2 = 0" << c << "\n";
}
a = (a >> 1);
b = (b >> 1);
}
return c;
}
int main() {
std::cin >> A >> B;
long long AC = func_xor((A == 0) ? 0 : A - 1);
long long BC = func_xor(B);
// std::cout << "AC" << AC << "\n";
// std::cout << "BC" << BC << "\n";
long long C = sub_xor(AC, BC);
std::cout << C;
} | #include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
long long A, B;
long long func_xor(long long a) {
// int max_2_power = std::log2(a);
if (a == 0) {
return 0;
} else if (a == 1) {
return 1;
} else if (a == 2) {
return 3;
} else {
long long souwa_xor = 0;
int mod4_plus1 = ((a % 4) + 1) % 4;
// std::cout << mod4_plus1 << "\n";
for (long long i = (a - mod4_plus1 + 1); i < a + 1; i++) {
souwa_xor = std::bit_xor<long long>()(souwa_xor, i);
// std::cout << souwa_xor << "\n";
}
return souwa_xor;
}
}
long long sub_xor(long long a, long long b) {
int max_2_power = std::max(int(std::log2(a)), int(std::log2(b)));
// std::cout << int(int(std::log2(a))) << "\n";
// std::cout << int(int(std::log2(b))) << "\n";
long long c = 0;
for (int i = 0; i < max_2_power + 1; i++) {
if (b % 2) {
// std::cout << "(int(!a%2), i) = " << "(" << int(!(a%2)) << "," << i <<
// ")" << "\n";
c += int(!(a % 2)) * std::pow(2, i);
// std::cout << "b%2 = 1" << c << "\n";
} else {
c += (a % 2) * std::pow(2, i);
// std::cout << "b%2 = 0" << c << "\n";
}
a = (a >> 1);
b = (b >> 1);
}
return c;
}
int main() {
std::cin >> A >> B;
long long AC = func_xor((A == 0) ? 0 : (A - 1));
long long BC = func_xor(B);
// std::cout << "AC" << AC << "\n";
// std::cout << "BC" << BC << "\n";
long long C = sub_xor(AC, BC);
std::cout << C;
} | [
"assignment.value.change",
"call.arguments.change"
] | 912,195 | 912,196 | u604262137 | cpp |
p03104 | #include <bits/stdc++.h>
using namespace std;
#define llong long long int
#define ldouble long double
#define rep(i, n) for (int i = 0; i < n; ++i)
#define repr(i, n) for (int i = n; i >= 0; --i)
#define stl_rep(itr, x) for (auto itr = x.begin(); itr != x.end(); ++itr)
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
const static int MOD = 1000000000 + 7;
const static int INT_INF = 999999999;
const static llong INF = 1LL << 60;
const static double eps = 1e-6;
const static int dx[] = {1, 0, -1, 0};
const static int dy[] = {0, 1, 0, -1};
signed main(int argc, char *argv[]) {
cin.tie(0);
ios::sync_with_stdio(false);
llong a, b, c;
cin >> a >> b;
c = b;
int loop_cnt = 0;
while (1) {
++loop_cnt;
c /= 2;
if (c == 0)
break;
}
vector<llong> counter(loop_cnt, 0);
for (int i = 0; i < loop_cnt; ++i) {
llong tmp1 = (b / (llong)pow(2, i + 1)) * (llong)pow(2, i);
llong tmp2 = b % (llong)pow(2, i + 1);
++tmp2;
tmp1 += max((llong)0, tmp2 - (llong)pow(2, i));
counter[i] += tmp1;
// cout << i << " " << counter[i] << endl;
}
// cout << "----" << endl;
if (a != 0)
--a;
for (int i = 0; i < loop_cnt; ++i) {
llong tmp1 = (a / (llong)pow(2, i + 1)) * (llong)pow(2, i);
llong tmp2 = a % (llong)pow(2, i + 1);
++tmp2;
tmp1 += max((llong)0, tmp2 - (llong)pow(2, i));
if (!a)
counter[i] += tmp1;
// cout << i << " " << counter[i] << endl;
}
llong ans = 0;
rep(i, loop_cnt) {
// cout << counter[i] << endl;
if (counter[i] % 2 == 1)
ans += (llong)pow(2, i);
}
cout << ans << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define llong long long int
#define ldouble long double
#define rep(i, n) for (int i = 0; i < n; ++i)
#define repr(i, n) for (int i = n; i >= 0; --i)
#define stl_rep(itr, x) for (auto itr = x.begin(); itr != x.end(); ++itr)
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
const static int MOD = 1000000000 + 7;
const static int INT_INF = 999999999;
const static llong INF = 1LL << 60;
const static double eps = 1e-6;
const static int dx[] = {1, 0, -1, 0};
const static int dy[] = {0, 1, 0, -1};
signed main(int argc, char *argv[]) {
cin.tie(0);
ios::sync_with_stdio(false);
llong a, b, c;
cin >> a >> b;
c = b;
int loop_cnt = 0;
while (1) {
++loop_cnt;
c /= 2;
if (c == 0)
break;
}
vector<llong> counter(loop_cnt, 0);
for (int i = 0; i < loop_cnt; ++i) {
llong tmp1 = (b / (llong)pow(2, i + 1)) * (llong)pow(2, i);
llong tmp2 = b % (llong)pow(2, i + 1);
++tmp2;
tmp1 += max((llong)0, tmp2 - (llong)pow(2, i));
counter[i] += tmp1;
// cout << i << " " << counter[i] << endl;
}
// cout << "----" << endl;
if (a != 0)
--a;
for (int i = 0; i < loop_cnt; ++i) {
llong tmp1 = (a / (llong)pow(2, i + 1)) * (llong)pow(2, i);
llong tmp2 = a % (llong)pow(2, i + 1);
++tmp2;
tmp1 += max((llong)0, tmp2 - (llong)pow(2, i));
if (a)
counter[i] -= tmp1;
// cout << i << " " << tmp1 << endl;
}
llong ans = 0;
rep(i, loop_cnt) {
// cout << counter[i] << endl;
if (counter[i] % 2 == 1)
ans += (llong)pow(2, i);
}
cout << ans << endl;
return 0;
} | [
"expression.operation.unary.logical.remove",
"control_flow.branch.if.condition.change",
"expression.operator.change"
] | 912,199 | 912,200 | u943004959 | cpp |
p03104 | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
#define SZ(x) ((int)(x).size())
#define int long long
using namespace std;
typedef vector<int> vint;
typedef pair<int, int> pint;
int calc(int N) // 0^1^...^N
{
int res = 0;
for (int i = N / 4 * 4; i <= N; i++)
res |= i;
return res;
}
signed main() {
int A, B;
cin >> A >> B;
if (A == 0)
cout << calc(B) << endl;
else
cout << (calc(B) ^ calc(A - 1)) << endl;
}
| #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
#define SZ(x) ((int)(x).size())
#define int long long
using namespace std;
typedef vector<int> vint;
typedef pair<int, int> pint;
int calc(int N) // 0^1^...^N
{
int res = 0;
for (int i = N / 4 * 4; i <= N; i++)
res ^= i;
return res;
}
signed main() {
int A, B;
cin >> A >> B;
if (A == 0)
cout << calc(B) << endl;
else
cout << (calc(B) ^ calc(A - 1)) << endl;
} | [
"expression.operator.change"
] | 912,205 | 912,206 | u738450435 | cpp |
p03104 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (long long int i = 0; i < n; ++i)
typedef long long int ll;
int main() {
ll a, b;
cin >> a >> b;
if (a % 2 == 0 && b % 2 == 0) {
if (((b - 1 - a + 1) / 2) % 2 == 1) {
cout << (1 ^ b) << endl;
} else {
cout << b << endl;
}
} else if (a % 2 == 0) {
if ((b - a + 1) % 2 == 1) {
cout << 1 << endl;
} else {
cout << 0 << endl;
}
} else if (b % 2 == 0) {
if (((b - 1 - (a + 1) + 1) / 2) % 2 == 1) {
cout << (1 ^ a ^ b) << endl;
} else {
cout << (a ^ b) << endl;
}
} else {
if (((b - a + 1 + 1) / 2) % 2 == 1) {
cout << (1 ^ a) << endl;
} else {
cout << (a) << endl;
}
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (long long int i = 0; i < n; ++i)
typedef long long int ll;
int main() {
ll a, b;
cin >> a >> b;
if (a % 2 == 0 && b % 2 == 0) {
if (((b - 1 - a + 1) / 2) % 2 == 1) {
cout << (1 ^ b) << endl;
} else {
cout << b << endl;
}
} else if (a % 2 == 0) {
if (((b - a + 1) / 2) % 2 == 1) {
cout << 1 << endl;
} else {
cout << 0 << endl;
}
} else if (b % 2 == 0) {
if (((b - 1 - (a + 1) + 1) / 2) % 2 == 1) {
cout << (1 ^ a ^ b) << endl;
} else {
cout << (a ^ b) << endl;
}
} else {
if (((b - (a + 1) + 1) / 2) % 2 == 1) {
cout << (1 ^ a) << endl;
} else {
cout << (a) << endl;
}
}
return 0;
} | [
"control_flow.branch.if.condition.change"
] | 912,211 | 912,212 | u376817785 | cpp |
p03104 | #define _USE_MATH_DEFINES
#include <algorithm>
#include <array>
#include <bitset>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int main() {
long long a, b;
cin >> a >> b;
long long ans = 0;
if (((b / 2) - (a / 2)) % 2 != 0)
ans = 1;
if (a % 2 != 0)
ans ^= a & ~1;
if (b % 2 == 0)
ans ^= b & ~1;
cout << ans << endl;
return 0;
}
| #define _USE_MATH_DEFINES
#include <algorithm>
#include <array>
#include <bitset>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int main() {
long long a, b;
cin >> a >> b;
++b;
long long ans = 0;
if (((b / 2) - (a / 2)) % 2 != 0)
ans = 1;
if (a % 2 != 0)
ans ^= a & ~1;
if (b % 2 != 0)
ans ^= b & ~1;
cout << ans << endl;
return 0;
}
| [
"expression.unary.arithmetic.add",
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 912,230 | 912,231 | u917944707 | cpp |
p03104 | #define _USE_MATH_DEFINES
#include <algorithm>
#include <array>
#include <bitset>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int main() {
long long a, b;
cin >> a >> b;
long long ans = 0;
if (((b / 2) - (a / 2)) % 2 != 0)
ans = 1;
if (a % 2 != 0)
ans ^= a & ~1;
if (b % 2 == 0)
ans ^= b & ~1;
cout << ans << endl;
return 0;
}
| #define _USE_MATH_DEFINES
#include <algorithm>
#include <array>
#include <bitset>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int main() {
long long a, b;
cin >> a >> b;
long long ans = 0;
if ((((b + 1) / 2) - (a / 2)) % 2 != 0)
ans = 1;
if (a % 2 != 0)
ans ^= a & ~1;
if (b % 2 == 0)
ans ^= b & ~1;
cout << ans << endl;
return 0;
}
| [
"control_flow.branch.if.condition.change"
] | 912,230 | 912,232 | u917944707 | cpp |
p03104 | #include <bits/stdc++.h>
using namespace std;
long long ans(long long n) {
if (n & 1LL)
return ((n + 1) / 2) & 1LL;
else
return ((n / 2) & 1LL) ^ n;
}
int main() {
long long a, b;
cin >> a >> b;
cout << (ans(a > 0 ? a : 1LL) ^ ans(b)) << endl;
} | #include <bits/stdc++.h>
using namespace std;
long long ans(long long n) {
if (n & 1LL)
return ((n + 1) / 2) & 1LL;
else
return ((n / 2) & 1LL) ^ n;
}
int main() {
long long a, b;
cin >> a >> b;
cout << (ans(a > 0 ? a - 1 : a) ^ ans(b)) << endl;
} | [
"io.output.change",
"call.arguments.change"
] | 912,235 | 912,236 | u647474992 | cpp |
p03104 | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i <= n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll a, b;
cin >> a >> b;
ll c = a ^ b, d = (a - 1) ^ b;
if (a % 4 == 3) {
if (b % 4 == 3)
cout << b << endl;
if (b % 4 == 0)
cout << c << endl;
if (b % 4 == 1)
cout << a - 1 << endl;
if (b % 4 == 2)
cout << d << endl;
return 0;
}
if (a % 4 == 2) {
if (b % 4 == 2)
cout << b << endl;
if (b % 4 == 3)
cout << 1 << endl;
if (b % 4 == 0)
cout << b + 1 << endl;
if (b % 4 == 1)
cout << 0 << endl;
return 0;
}
if (a % 4 == 0) {
if (b % 4 == 0)
cout << b << endl;
if (b % 4 == 1)
cout << 1 << endl;
if (b % 4 == 2)
cout << b + 1 << endl;
if (b % 4 == 3)
cout << 0 << endl;
return 0;
}
if (a % 4 == 1) {
if (b % 4 == 1)
cout << a << endl;
if (b % 4 == 2)
cout << c << endl;
if (b % 4 == 3)
cout << a - 1 << endl;
if (b % 4 == 0)
cout << d << endl;
return 0;
}
}
| #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i <= n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll a, b;
cin >> a >> b;
ll c = a ^ b, d = (a - 1) ^ b;
if (a % 4 == 3) {
if (b % 4 == 3)
cout << a << endl;
if (b % 4 == 0)
cout << c << endl;
if (b % 4 == 1)
cout << a - 1 << endl;
if (b % 4 == 2)
cout << d << endl;
return 0;
}
if (a % 4 == 2) {
if (b % 4 == 2)
cout << b << endl;
if (b % 4 == 3)
cout << 1 << endl;
if (b % 4 == 0)
cout << b + 1 << endl;
if (b % 4 == 1)
cout << 0 << endl;
return 0;
}
if (a % 4 == 0) {
if (b % 4 == 0)
cout << b << endl;
if (b % 4 == 1)
cout << 1 << endl;
if (b % 4 == 2)
cout << b + 1 << endl;
if (b % 4 == 3)
cout << 0 << endl;
return 0;
}
if (a % 4 == 1) {
if (b % 4 == 1)
cout << a << endl;
if (b % 4 == 2)
cout << c << endl;
if (b % 4 == 3)
cout << a - 1 << endl;
if (b % 4 == 0)
cout << d << endl;
return 0;
}
}
| [
"identifier.change",
"io.output.change"
] | 912,239 | 912,240 | u986276444 | cpp |
p03104 | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <float.h>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define endl '\n'
#define MOD 1000000007
#define INF 1ll << 30
#define MAX 100010
#define eps 1e-11
#define bit_max 1ll << 32
#define _USE_MATH_DEFINES
long long int f(long long int a) {
if (a % 2 == 0) {
a = ((a / 2) % 2 == 0 ? 0 : 1) ^ a;
} else {
a = (a / 2) % 2 == 0 ? 0 : 1;
}
return a;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
long long int a, b;
cin >> a >> b;
long long int x_a = f(max(a - 1, (long long int)0));
long long int x_b = f(b);
cout << (x_b ^ x_a);
return 0;
}
| #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <float.h>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define endl '\n'
#define MOD 1000000007
#define INF 1ll << 30
#define MAX 100010
#define eps 1e-11
#define bit_max 1ll << 32
#define _USE_MATH_DEFINES
long long int f(long long int a) {
if (a % 2 == 0) {
a = ((a / 2) % 2 == 0 ? 0 : 1) ^ a;
} else {
a++;
a = (a / 2) % 2 == 0 ? 0 : 1;
}
return a;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
long long int a, b;
cin >> a >> b;
long long int x_a = f(max(a - 1, (long long int)0));
long long int x_b = f(b);
// cout<<x_a<<" "<<x_b;
cout << (x_b ^ x_a);
return 0;
}
| [
"expression.unary.arithmetic.add"
] | 912,243 | 912,244 | u566864240 | cpp |
p03104 | #include <bits/stdc++.h>
using namespace std;
long cal(long n) {
if (n % 2 == 0) {
return ((long)(n / 2) % 2) ^ n;
} else {
return ((long)((n + 1) / 2) % 2);
}
}
int main() {
long A, B;
cin >> A >> B;
long C = cal(A) ^ cal(B);
cout << C;
}
| #include <bits/stdc++.h>
using namespace std;
long cal(long n) {
if (n % 2 == 0) {
return ((long)(n / 2) % 2) ^ n;
} else {
return ((long)((n + 1) / 2) % 2);
}
}
int main() {
long A, B;
cin >> A >> B;
long C = cal(A - 1) ^ cal(B);
cout << C;
}
| [
"assignment.change"
] | 912,245 | 912,246 | u873627575 | cpp |
p03104 |
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <vector>
using sll = signed long long;
using bs = std::bitset<16>;
auto f(sll a) -> sll {
if (a < 0)
return 0;
auto m4 = a % 4;
auto ans = a - m4;
for (sll i{ans + 1}; i <= a; ++i)
ans ^= i;
return -1;
}
int main() {
sll A, B;
std::cin >> A >> B;
std::cout << (f(B) ^ f(A - 1)) << "\n";
return 0;
} |
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <vector>
using sll = signed long long;
using bs = std::bitset<16>;
auto f(sll a) -> sll {
if (a < 0)
return 0;
auto m4 = a % 4;
auto ans = a - m4;
for (sll i{ans + 1}; i <= a; ++i)
ans ^= i;
return ans;
}
int main() {
sll A, B;
std::cin >> A >> B;
std::cout << (f(B) ^ f(A - 1)) << "\n";
return 0;
} | [
"identifier.replace.add",
"literal.replace.remove",
"function.return_value.change"
] | 912,247 | 912,248 | u837286475 | cpp |
p03104 | #include <algorithm>
#include <iostream>
#include <limits.h>
#include <math.h>
#include <vector>
using namespace std;
typedef long long ll;
int main(void) {
ll a, b;
cin >> a >> b;
ll ans = 0;
for (int i = 0; i < 40; i++) {
ll k;
if (i == 0) {
if (a % 2 == 0 && b % 2 == 0)
k = (b - a);
else
k = (b - a) / 2 + 1;
} else {
if (b < pow(2, i))
break;
if (a / ll(pow(2, i)) % 2 == 1) {
if (b / ll(pow(2, i)) % 2 == 1) {
if (a % ll(pow(2, i)) >= b % ll(pow(2, i)))
k = ll(pow(2, i)) - a % ll(pow(2, i)) + b % ll(pow(2, i)) + 1;
else
k = -a % ll(pow(2, i)) + b % ll(pow(2, i)) + 1;
} else {
k = -a % ll(pow(2, i)) + ll(pow(2, i));
}
} else {
if (b / ll(pow(2, i)) % 2 == 1) {
k = -ll(pow(2, i)) + b % ll(pow(2, i + 1)) + 1;
} else {
k = 0;
}
}
}
// cout << k << endl;
// cout << a / ll(pow(2, i + 1)) << " " << a % ll(pow(2, i + 1))
//<< " " << b / ll(pow(2, i + 1)) << " " << b % ll(pow(2, i + 1)) << endl;
if (k % 2 == 1)
ans += pow(2, i);
}
cout << ans << endl;
} | #include <algorithm>
#include <iostream>
#include <limits.h>
#include <math.h>
#include <vector>
using namespace std;
typedef long long ll;
int main(void) {
ll a, b;
cin >> a >> b;
ll ans = 0;
for (int i = 0; i < 40; i++) {
ll k;
if (i == 0) {
if (a % 2 == 0 && b % 2 == 0)
k = (b - a) / 2;
else
k = (b - a) / 2 + 1;
} else {
if (b < pow(2, i))
break;
if (a / ll(pow(2, i)) % 2 == 1) {
if (b / ll(pow(2, i)) % 2 == 1) {
if (a % ll(pow(2, i)) >= b % ll(pow(2, i)))
k = ll(pow(2, i)) - a % ll(pow(2, i)) + b % ll(pow(2, i)) + 1;
else
k = -a % ll(pow(2, i)) + b % ll(pow(2, i)) + 1;
} else {
k = -a % ll(pow(2, i)) + ll(pow(2, i));
}
} else {
if (b / ll(pow(2, i)) % 2 == 1) {
k = -ll(pow(2, i)) + b % ll(pow(2, i + 1)) + 1;
} else {
k = 0;
}
}
}
// cout << k << endl;
// cout << a / ll(pow(2, i + 1)) << " " << a % ll(pow(2, i + 1))
//<< " " << b / ll(pow(2, i + 1)) << " " << b % ll(pow(2, i + 1)) << endl;
if (k % 2 == 1)
ans += pow(2, i);
}
cout << ans << endl;
} | [
"assignment.change"
] | 912,251 | 912,252 | u921168761 | cpp |
p03104 | #include <iostream>
using namespace std;
typedef long long ll;
ll two(ll n) {
ll ans = 1;
for (int i = 0; i < n; i++) {
ans *= 2;
}
return ans;
}
string bit(ll n) {
string ans = "";
for (int i = 0; i < 42; i++) {
char c = '0' + n % 2;
ans = ans + c;
n /= 2;
}
return ans;
}
ll my_xor(ll n, ll m) {
string a = bit(n);
string b = bit(m);
ll ans = 0;
for (int i = 0; i < 40; i++) {
int x = a.at(i) - '0';
int y = b.at(i) - '0';
if (x + y == 1) {
ans += two(i);
}
}
return ans;
}
int main() {
ll a, b;
cin >> a >> b;
if (a % 2 == 0 && b % 2 == 1) {
if ((b - a) % 4 == 1) {
cout << 1 << endl;
} else {
cout << 0 << endl;
}
} else if (a % 2 == 0 && b % 2 == 0) {
if ((b - a) % 4 == 2) {
cout << b + 1 << endl;
} else {
cout << b << endl;
}
} else if (a % 2 == 1 && b % 2 == 1) {
if ((b - a) % 4 == 2) {
cout << a + 1 << endl;
} else {
cout << a << endl;
}
} else {
if ((b - a) % 4 == 3) {
cout << my_xor(a, b) + 1 << endl;
} else {
cout << my_xor(a, b) << endl;
}
}
} | #include <iostream>
using namespace std;
typedef long long ll;
ll two(ll n) {
ll ans = 1;
for (int i = 0; i < n; i++) {
ans *= 2;
}
return ans;
}
string bit(ll n) {
string ans = "";
for (int i = 0; i < 42; i++) {
char c = '0' + n % 2;
ans = ans + c;
n /= 2;
}
return ans;
}
ll my_xor(ll n, ll m) {
string a = bit(n);
string b = bit(m);
ll ans = 0;
for (int i = 0; i < 40; i++) {
int x = a.at(i) - '0';
int y = b.at(i) - '0';
if (x + y == 1) {
ans += two(i);
}
}
return ans;
}
int main() {
ll a, b;
cin >> a >> b;
if (a % 2 == 0 && b % 2 == 1) {
if ((b - a) % 4 == 1) {
cout << 1 << endl;
} else {
cout << 0 << endl;
}
} else if (a % 2 == 0 && b % 2 == 0) {
if ((b - a) % 4 == 2) {
cout << b + 1 << endl;
} else {
cout << b << endl;
}
} else if (a % 2 == 1 && b % 2 == 1) {
if ((b - a) % 4 == 2) {
cout << a - 1 << endl;
} else {
cout << a << endl;
}
} else {
if ((b - a) % 4 == 3) {
cout << my_xor(a, b) - 1 << endl;
} else {
cout << my_xor(a, b) << endl;
}
}
} | [
"misc.opposites",
"expression.operator.arithmetic.change",
"io.output.change"
] | 912,253 | 912,254 | u179970156 | cpp |
p03104 | #include <bits/stdc++.h>
using namespace std;
;
#define ll long long
#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 FORR(i, m, n) for (int i = m; i >= n; i--)
#define INF 1 << 30
#define LINF 1LL << 62
#define all(x) (x).begin(), (x).end()
#define mp make_pair
#define pb push_back
const int MOD = 1000000007;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll a, b;
cin >> a >> b;
ll ans = 0;
REP(i, 45) {
if (i == 0) {
if (((b + 1) / 2 - (a + 1) / 2) % 2 == 1) {
ans++;
}
continue;
}
ll now = 1ll << i;
ll cnt = 0;
if ((a / now) % 2 == 1) {
cnt += now - (a - a / now * now);
}
if ((b / now) % 2 == 1) {
cnt += b - b / now * now + 1;
}
if (cnt % 2 == 1) {
ans += now;
}
}
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
;
#define ll long long
#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 FORR(i, m, n) for (int i = m; i >= n; i--)
#define INF 1 << 30
#define LINF 1LL << 62
#define all(x) (x).begin(), (x).end()
#define mp make_pair
#define pb push_back
const int MOD = 1000000007;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll a, b;
cin >> a >> b;
ll ans = 0;
REP(i, 45) {
if (i == 0) {
if (((b + 1) / 2 - a / 2) % 2 == 1) {
ans++;
}
continue;
}
ll now = 1ll << i;
ll cnt = 0;
if ((a / now) % 2 == 1) {
cnt += now - (a - a / now * now);
}
if ((b / now) % 2 == 1) {
cnt += b - b / now * now + 1;
}
if (cnt % 2 == 1) {
ans += now;
}
}
cout << ans << endl;
} | [
"control_flow.branch.if.condition.change"
] | 912,265 | 912,266 | u013628553 | cpp |
p03104 | #include <bits/stdc++.h>
using namespace std;
;
#define ll long long
#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 FORR(i, m, n) for (int i = m; i >= n; i--)
#define INF 1 << 30
#define LINF 1LL << 62
#define all(x) (x).begin(), (x).end()
#define mp make_pair
#define pb push_back
const int MOD = 1000000007;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll a, b;
cin >> a >> b;
ll ans = 0;
REP(i, 45) {
if (i == 0) {
if (((b + 1) / 2 - (a + 1) / 2) % 2 == 1) {
ans++;
continue;
}
}
ll now = 1ll << i;
ll cnt = 0;
if ((a / now) % 2 == 1) {
cnt += now - (a - a / now * now);
}
if ((b / now) % 2 == 1) {
cnt += b - b / now * now + 1;
}
if (cnt % 2 == 1) {
ans += now;
}
}
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
;
#define ll long long
#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 FORR(i, m, n) for (int i = m; i >= n; i--)
#define INF 1 << 30
#define LINF 1LL << 62
#define all(x) (x).begin(), (x).end()
#define mp make_pair
#define pb push_back
const int MOD = 1000000007;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll a, b;
cin >> a >> b;
ll ans = 0;
REP(i, 45) {
if (i == 0) {
if (((b + 1) / 2 - a / 2) % 2 == 1) {
ans++;
}
continue;
}
ll now = 1ll << i;
ll cnt = 0;
if ((a / now) % 2 == 1) {
cnt += now - (a - a / now * now);
}
if ((b / now) % 2 == 1) {
cnt += b - b / now * now + 1;
}
if (cnt % 2 == 1) {
ans += now;
}
}
cout << ans << endl;
} | [
"control_flow.branch.if.condition.change"
] | 912,267 | 912,266 | u013628553 | cpp |
p03104 | #include <algorithm>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;
long long f(long long n) {
long long s = 0;
if (n % 4 == 1 || n % 4 == 2)
s ^= 1;
for (int i = 1; i < 40; i++) {
long long t = 1LL << i;
if (n % (2 * t) >= t) {
if (n / t % 2 == 1) {
s ^= 1LL << i;
}
}
}
return s;
}
int main() {
long long a, b;
cin >> a >> b;
cout << (f(b) ^ f(a - 1)) << endl;
} | #include <algorithm>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;
long long f(long long n) {
long long s = 0;
if (n % 4 == 1 || n % 4 == 2)
s ^= 1;
for (int i = 1; i < 40; i++) {
long long t = 1LL << i;
if (n % (2 * t) >= t) {
if (n % 2 == 0) {
s ^= 1LL << i;
}
}
}
return s;
}
int main() {
long long a, b;
cin >> a >> b;
cout << (f(b) ^ f(a - 1)) << endl;
} | [
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove",
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 912,298 | 912,299 | u006493569 | cpp |
p03103 | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string.h>
#include <vector>
using namespace std;
struct node {
int num, val;
} a[111111];
int cmp(node a, node b) { return a.val < b.val; }
int main() {
int n, m, sum = 0;
cin >> n >> m;
for (int i = 1; i <= n; i++) {
cin >> a[i].val >> a[i].num;
}
sort(a + 1, a + 1 + n, cmp);
for (int i = 1; i <= n; i++) {
if (m >= a[i].num) {
m -= a[i].num;
sum += (a[i].val * a[i].num);
} else {
sum += (m * a[i].val);
break;
}
}
cout << sum << endl;
return 0;
}
| #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string.h>
#include <vector>
using namespace std;
struct node {
long long num, val;
} a[111111];
int cmp(node a, node b) { return a.val < b.val; }
int main() {
int n, m;
long long sum = 0;
cin >> n >> m;
for (int i = 1; i <= n; i++) {
cin >> a[i].val >> a[i].num;
}
sort(a + 1, a + 1 + n, cmp);
for (int i = 1; i <= n; i++) {
if (m >= a[i].num) {
m -= a[i].num;
sum += (a[i].val * a[i].num);
} else {
sum += (m * a[i].val);
break;
}
}
cout << sum << endl;
return 0;
}
| [
"variable_declaration.type.primitive.change",
"variable_declaration.type.widen.change"
] | 912,302 | 912,303 | u173380057 | cpp |
p03103 | #include <algorithm>
#include <iostream>
#include <vector>
#define all(c) (c).begin(), (c).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
int main(void) {
int n, m;
cin >> n >> m;
vector<pii> ab(n);
for (int i = 0; i < n; i++) {
cin >> ab[i].first >> ab[i].second;
}
sort(all(ab));
ll sum = 0, i = 0;
while (m > 0) {
sum += ab[i].first * min(m, ab[i].second);
m -= ab[i++].second;
}
cout << sum << endl;
}
| #include <algorithm>
#include <iostream>
#include <vector>
#define all(c) (c).begin(), (c).end()
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pii;
int main(void) {
ll n, m;
cin >> n >> m;
vector<pii> ab(n);
for (int i = 0; i < n; i++) {
cin >> ab[i].first >> ab[i].second;
}
sort(all(ab));
ll sum = 0, i = 0;
while (m > 0) {
sum += ab[i].first * min(m, ab[i].second);
m -= ab[i++].second;
}
cout << sum << endl;
}
| [
"variable_declaration.type.change"
] | 912,312 | 912,313 | u188020698 | cpp |
p03103 | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int N, M; // N個の店舗(値段と購入制限をのちに持たせる), M個のドリンクが欲しい
cin >> N >> M;
vector<int> A(N), B(N); // Aは値段のみを格納, Bは購入制限のみを格納
for (int i = 0; i < M; i++) {
cin >> A[i] >> B[i];
}
// AとBをソートする
// pair<int, int>は int2つの方
vector<pair<int, int>> AB(N);
for (int i = 0; i < N; i++) {
AB[i] = make_pair(A[i], B[i]); //店の値段と購入制限をセットで管理
}
sort(AB.begin(), AB.end()); //デフォルトで最初の要素でソートするようになってる
long long ans = 0;
for (int i = 0; i < N; i++) {
//このお店で購入する数を決める
int buy_amount =
min(M, AB[i].second); //残りの欲しい本数or購入制限分を購入する
//欲しい本数揃っていればbuy_amountはそれ以降はずっと0
//買った金額を加算する
ans += (long long)buy_amount * AB[i].first; //買った本数*値段
//残り本数を減らす
M -= buy_amount; //欲しい本数を減らす
}
cout << ans << endl;
}
// """
// 補足:class Shopなどを定義すると賢くなる
// """
| #include <algorithm>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int N, M; // N個の店舗(値段と購入制限をのちに持たせる), M個のドリンクが欲しい
cin >> N >> M;
vector<int> A(N), B(N); // Aは値段のみを格納, Bは購入制限のみを格納
for (int i = 0; i < N; i++) {
cin >> A[i] >> B[i];
}
// AとBをソートする
// pair<int, int>は int2つの方
vector<pair<int, int>> AB(N);
for (int i = 0; i < N; i++) {
AB[i] = make_pair(A[i], B[i]); //店の値段と購入制限をセットで管理
}
sort(AB.begin(), AB.end()); //デフォルトで最初の要素でソートするようになってる
long long ans = 0;
for (int i = 0; i < N; i++) {
//このお店で購入する数を決める
int buy_amount =
min(M, AB[i].second); //残りの欲しい本数or購入制限分を購入する
//欲しい本数揃っていればbuy_amountはそれ以降はずっと0
//買った金額を加算する
ans += (long long)buy_amount * AB[i].first; //買った本数*値段
//残り本数を減らす
M -= buy_amount; //欲しい本数を減らす
}
cout << ans << endl;
}
// """
// 補足:class Shopなどを定義すると賢くなる
// """
| [
"identifier.change",
"control_flow.loop.for.condition.change",
"expression.operation.binary.change"
] | 912,314 | 912,315 | u708255304 | cpp |
p03103 | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<pair<int, int>> drink(N);
for (int i = 0; i < N; i++) {
cin >> drink[i].first >> drink[i].second;
}
sort(drink.begin(), drink.end());
int i = 0;
int money = 0;
while (M > drink[i].second) {
M -= drink[i].second;
money += (long)drink[i].first * drink[i].second;
i++;
}
for (i; M > 0;) {
M--;
money += (long)drink[i].first;
}
cout << money << endl;
return 0;
} | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<pair<int, int>> drink(N);
for (int i = 0; i < N; i++) {
cin >> drink[i].first >> drink[i].second;
}
sort(drink.begin(), drink.end());
int i = 0;
long money = 0;
while (M > drink[i].second) {
M -= drink[i].second;
money += (long)drink[i].first * drink[i].second;
i++;
}
for (i; M > 0;) {
M--;
money += (long)drink[i].first;
}
cout << money << endl;
return 0;
} | [
"variable_declaration.type.primitive.change"
] | 912,321 | 912,322 | u761510695 | cpp |
p03103 | #include <functional>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n, x;
cin >> n >> x;
pair<int, int> m[100010];
for (int i = 0; i < n; i++) {
cin >> m[i].first >> m[i].second;
}
sort(m, m + n);
long long int ans = 0;
for (int j = 0; j < n; j++) {
if (m[j].second > x) {
ans += x * m[j].first;
break;
} else {
ans += m[j].first * m[j].second;
x -= m[j].second;
}
}
cout << ans << endl;
} | #include <functional>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n, x;
cin >> n >> x;
pair<long int, int> m[100010];
for (int i = 0; i < n; i++) {
cin >> m[i].first >> m[i].second;
}
sort(m, m + n);
long long int ans = 0;
for (int j = 0; j < n; j++) {
if (m[j].second > x) {
ans += x * m[j].first;
break;
} else {
ans += m[j].first * m[j].second;
x -= m[j].second;
}
}
cout << ans << endl;
} | [
"variable_declaration.type.widen.change"
] | 912,323 | 912,324 | u127856129 | cpp |
p03103 | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i <= n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll n, m;
cin >> n >> m;
ll a, b;
map<ll, ll> mp;
for (int i = 0; i < n; i++) {
cin >> a >> b;
mp[a] = b;
}
ll cnt = 0, ans = 0;
for (auto &itr : mp) {
cnt = min(m, itr.second);
ans += itr.first * cnt;
m -= cnt;
}
cout << ans << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i <= n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll n, m;
cin >> n >> m;
ll a, b;
map<ll, ll> mp;
for (int i = 0; i < n; i++) {
cin >> a >> b;
mp[a] += b;
}
ll cnt, ans = 0;
for (auto &itr : mp) {
cnt = min(m, itr.second);
ans += itr.first * cnt;
m -= cnt;
}
cout << ans << endl;
return 0;
}
| [
"assignment.value.change"
] | 912,327 | 912,328 | u986276444 | cpp |
p03103 | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
struct AB {
long long a;
long long b;
AB(long long sub_a, long long sub_b) {
a = sub_a;
b = sub_b;
}
bool operator<(const AB &another) const { return a < another.a; };
};
int main() {
int N, M;
long long ans = 0;
cin >> N >> M;
vector<AB> vec(M, AB(0, 0));
for (int i = 0; i < N; i++)
cin >> vec[i].a >> vec[i].b;
sort(vec.begin(), vec.end());
for (int i = 0; M > 0; i++) {
if (M - vec[i].b > 0) {
ans += vec[i].b * vec[i].a;
M -= vec[i].b;
} else {
ans += vec[i].a * M;
break;
}
}
cout << ans << endl;
}
| #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
struct AB {
long long a;
long long b;
AB(long long sub_a, long long sub_b) {
a = sub_a;
b = sub_b;
}
bool operator<(const AB &another) const { return a < another.a; };
};
int main() {
long long N, M;
long long ans = 0;
cin >> N >> M;
vector<AB> vec(N, AB(0, 0));
for (int i = 0; i < N; i++)
cin >> vec[i].a >> vec[i].b;
sort(vec.begin(), vec.end());
for (int i = 0; M > 0; i++) {
if (M - vec[i].b > 0) {
ans += vec[i].b * vec[i].a;
M -= vec[i].b;
} else {
ans += vec[i].a * M;
break;
}
}
cout << ans << endl;
}
| [
"variable_declaration.type.primitive.change",
"variable_declaration.type.widen.change",
"identifier.change",
"call.arguments.change"
] | 912,329 | 912,330 | u950603962 | cpp |
p03103 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
int main() {
ios::sync_with_stdio(false);
int N, M;
map<int, int> m;
cin >> N >> M;
for (int i = 0; i < N; i++) {
int A, B;
cin >> A >> B;
m[A] += B;
}
ll ans = 0;
for (auto shop : m) {
int c = min(M, shop.second);
ans += c * shop.first;
M -= c;
if (M == 0)
break;
}
cout << ans << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
int main() {
ios::sync_with_stdio(false);
int N, M;
map<int, int> m;
cin >> N >> M;
for (int i = 0; i < N; i++) {
int A, B;
cin >> A >> B;
m[A] += B;
}
ll ans = 0;
for (auto shop : m) {
int c = min(M, shop.second);
ans += (ll)c * shop.first;
M -= c;
if (M == 0)
break;
}
cout << ans << endl;
return 0;
}
| [
"type_conversion.add"
] | 912,331 | 912,332 | u572532976 | cpp |
p03103 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<pair<int, int>> p(N);
int cnt = 0;
long long sum = 0;
for (int i = 0; i < N; i++) {
cin >> p.at(i).first >> p.at(i).second;
}
sort(p.begin(), p.end());
for (int i = 0; i < N; i++) {
cnt = min(M, p.at(i).second);
M -= cnt;
sum += cnt * p.at(i).first;
if (M <= 0) {
break;
}
}
cout << sum;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
long M;
cin >> N >> M;
vector<pair<long, long>> p(N);
long cnt = 0;
long sum = 0;
for (int i = 0; i < N; i++) {
cin >> p.at(i).first >> p.at(i).second;
}
sort(p.begin(), p.end());
for (int i = 0; i < N; i++) {
cnt = min(M, p.at(i).second);
M -= cnt;
sum += cnt * p.at(i).first;
if (M <= 0) {
break;
}
}
cout << sum;
}
| [
"variable_declaration.type.widen.change",
"variable_declaration.type.primitive.change",
"variable_declaration.type.narrow.change"
] | 912,335 | 912,336 | u873627575 | cpp |
p03103 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<pair<int, int>> p(N);
int cnt = 0;
long sum = 0;
for (int i = 0; i < N; i++) {
cin >> p.at(i).first >> p.at(i).second;
}
sort(p.begin(), p.end());
for (int i = 0; i < N; i++) {
cnt = min(M, p.at(i).second);
M -= cnt;
sum += cnt * p.at(i).first;
if (M <= 0) {
break;
}
}
cout << sum;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
long M;
cin >> N >> M;
vector<pair<long, long>> p(N);
long cnt = 0;
long sum = 0;
for (int i = 0; i < N; i++) {
cin >> p.at(i).first >> p.at(i).second;
}
sort(p.begin(), p.end());
for (int i = 0; i < N; i++) {
cnt = min(M, p.at(i).second);
M -= cnt;
sum += cnt * p.at(i).first;
if (M <= 0) {
break;
}
}
cout << sum;
}
| [
"variable_declaration.type.widen.change",
"variable_declaration.type.primitive.change"
] | 912,337 | 912,336 | u873627575 | cpp |
p03103 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<pair<int, int>> p(N);
int cnt = 0;
int sum = 0;
for (int i = 0; i < N; i++) {
cin >> p.at(i).first >> p.at(i).second;
}
sort(p.begin(), p.end());
for (int i = 0; i < N; i++) {
cnt = min(M, p.at(i).second);
M -= cnt;
sum += cnt * p.at(i).first;
if (M <= 0) {
break;
}
}
cout << sum;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
long M;
cin >> N >> M;
vector<pair<long, long>> p(N);
long cnt = 0;
long sum = 0;
for (int i = 0; i < N; i++) {
cin >> p.at(i).first >> p.at(i).second;
}
sort(p.begin(), p.end());
for (int i = 0; i < N; i++) {
cnt = min(M, p.at(i).second);
M -= cnt;
sum += cnt * p.at(i).first;
if (M <= 0) {
break;
}
}
cout << sum;
}
| [
"variable_declaration.type.widen.change",
"variable_declaration.type.primitive.change"
] | 912,338 | 912,336 | u873627575 | cpp |
p03103 | /*
Date:
Author:
Descipction
*/
#include <algorithm>
#include <iostream>
#include <stdlib.h>
using namespace std;
struct store {
int price;
int num;
};
bool compare(store a, store b) { return a.price < b.price; };
int main() {
int n, m, i = 0, j, sum = 0 /*算累積錢*/, need /*差幾罐*/;
cin >> n >> m;
need = m;
store data[n];
for (; i < n; i++) {
cin >> data[i].price >> data[i].num;
}
sort(data, data + n, compare);
i = 0;
while (need > 0) {
if (data[i].num <= need) {
sum += data[i].num * data[i].price;
need -= data[i].num;
} else {
sum += need * data[i].price;
need = 0;
}
i++;
}
cout << sum << endl;
return 0;
}
| /*
Date:
Author:
Descipction
*/
#include <algorithm>
#include <iostream>
#include <stdlib.h>
using namespace std;
struct store {
long long int price;
long long int num;
};
bool compare(store a, store b) { return a.price < b.price; };
int main() {
long long int n, m, i = 0, j, sum = 0 /*算累積錢*/, need /*差幾罐*/;
cin >> n >> m;
need = m;
store data[n];
for (; i < n; i++) {
cin >> data[i].price >> data[i].num;
}
sort(data, data + n, compare);
i = 0;
while (need > 0) {
if (data[i].num <= need) {
sum += data[i].num * data[i].price;
need -= data[i].num;
} else {
sum += need * data[i].price;
need = 0;
}
i++;
}
cout << sum << endl;
return 0;
}
| [
"variable_declaration.type.widen.change"
] | 912,342 | 912,343 | u046140700 | cpp |
p03103 | #include <algorithm>
#include <bits/stdc++.h>
#include <map>
#include <math.h>
#include <set>
#include <string.h>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
#define All(a) (a).begin(), (a).end()
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<pair<int, int>> a(n);
rep(i, n) cin >> a[i].first >> a[i].second;
sort(a.begin(), a.end());
long ans = 0;
int index = 0;
while (1) {
if (m >= a[index].second) {
m -= a[index].second;
ans += a[index].first * a[index].second;
index++;
} else
break;
}
ans += m * a[index].first;
cout << ans << endl;
}
| #include <algorithm>
#include <bits/stdc++.h>
#include <map>
#include <math.h>
#include <set>
#include <string.h>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
#define All(a) (a).begin(), (a).end()
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<pair<long, long>> a(n);
rep(i, n) cin >> a[i].first >> a[i].second;
sort(a.begin(), a.end());
long ans = 0;
int index = 0;
while (index < n) {
if (m >= a[index].second) {
m -= a[index].second;
ans += a[index].first * a[index].second;
index++;
} else
break;
}
ans += m * a[index].first;
cout << ans << endl;
}
| [
"variable_declaration.type.primitive.change",
"identifier.replace.add",
"literal.replace.remove",
"control_flow.loop.condition.change"
] | 912,346 | 912,347 | u434662823 | cpp |
p03103 | #include <bits/stdc++.h>
using namespace std;
typedef struct {
int a;
int b;
} mise;
bool cmp(const mise &x, const mise &y) { return x.a < y.a; }
int main(void) {
long long n, m, ans = 0;
mise da[100010];
cin >> n >> m;
for (int i = 0; i < n; ++i)
cin >> da[i].a >> da[i].b;
sort(da, da + 2 * n, cmp);
for (int i = 0; i < n; ++i) {
if (da[i].b < m) {
ans += da[i].a * da[i].b;
m -= da[i].b;
} else {
ans += da[i].a * m;
break;
}
}
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
typedef struct {
long long a;
long long b;
} mise;
bool cmp(const mise &x, const mise &y) { return x.a < y.a; }
int main(void) {
long long n, m, ans = 0;
mise da[100010];
cin >> n >> m;
for (int i = 0; i < n; ++i)
cin >> da[i].a >> da[i].b;
sort(da, da + n, cmp);
for (int i = 0; i < n; ++i) {
if (da[i].b < m) {
ans += da[i].a * da[i].b;
m -= da[i].b;
} else {
ans += da[i].a * m;
break;
}
}
cout << ans << endl;
}
| [
"variable_declaration.type.primitive.change",
"variable_declaration.type.widen.change",
"expression.operation.binary.remove"
] | 912,352 | 912,353 | u314988220 | cpp |
p03103 | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define re return
typedef vector<int> vi;
typedef long long ll;
typedef pair<int, int> pii;
int n, m;
pair<int, int> a[100001];
bool cmp(pii x, pii y) { return x.first < y.first; }
ll ans;
int main() {
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
cin >> n >> m;
for (int i = 0; i < n; i++) {
cin >> a[i].first >> a[i].second;
}
sort(a, a + n);
int nw = 0;
while (m > 0) {
ans += min(m, a[nw++].second) * a[nw - 1].first;
m -= a[nw - 1].second;
}
cout << ans << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define re return
typedef vector<int> vi;
typedef long long ll;
typedef pair<int, int> pii;
int n, m;
pair<int, int> a[100001];
bool cmp(pii x, pii y) { return x.first < y.first; }
ll ans;
int main() {
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
cin >> n >> m;
for (int i = 0; i < n; i++) {
cin >> a[i].first >> a[i].second;
}
sort(a, a + n);
int nw = 0;
while (m > 0) {
ans += 1ll * min(m, a[nw++].second) * a[nw - 1].first;
m -= a[nw - 1].second;
}
cout << ans << endl;
return 0;
} | [
"assignment.change"
] | 912,367 | 912,368 | u247996218 | cpp |
p03103 | #include <iostream>
#include <map>
#include <utility>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
std::map<long, int> sorted_map;
long long result = 0;
for (int i = 0; i < N; i++) {
long a = 0;
int b = 0;
cin >> a;
cin >> b;
sorted_map.insert(std::make_pair(a, b));
}
for (auto const &entry : sorted_map) {
if (M - entry.second <= 0) {
result += entry.first * M;
break;
}
result += entry.first * entry.second;
M -= entry.second;
}
cout << result << endl;
} | #include <iostream>
#include <map>
#include <utility>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
std::multimap<long, int> sorted_map;
long long result = 0;
for (int i = 0; i < N; i++) {
long a = 0;
int b = 0;
cin >> a;
cin >> b;
sorted_map.insert(std::make_pair(a, b));
}
for (auto const &entry : sorted_map) {
if (M - entry.second <= 0) {
result += entry.first * M;
break;
}
result += entry.first * entry.second;
M -= entry.second;
}
cout << result << endl;
} | [] | 912,405 | 912,406 | u475695911 | cpp |
p03103 | #include <iostream>
#include <map>
#include <utility>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
std::map<long, int> sorted_map;
long result = 0;
for (int i = 0; i < N; i++) {
long a = 0;
int b = 0;
cin >> a;
cin >> b;
sorted_map.insert(std::make_pair(a, b));
}
for (auto const &entry : sorted_map) {
if (M - entry.second <= 0) {
result += entry.first * M;
break;
}
result += entry.first * entry.second;
M -= entry.second;
}
cout << result << endl;
} | #include <iostream>
#include <map>
#include <utility>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
std::multimap<long, int> sorted_map;
long long result = 0;
for (int i = 0; i < N; i++) {
long a = 0;
int b = 0;
cin >> a;
cin >> b;
sorted_map.insert(std::make_pair(a, b));
}
for (auto const &entry : sorted_map) {
if (M - entry.second <= 0) {
result += entry.first * M;
break;
}
result += entry.first * entry.second;
M -= entry.second;
}
cout << result << endl;
} | [
"variable_declaration.type.widen.change"
] | 912,407 | 912,406 | u475695911 | cpp |
p03103 | #include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;
struct juice {
int money;
int number;
} a[100000];
bool cmp(juice a, juice b) { return a.money < b.money; }
int main() {
int n, m, sum = 0, sum2 = 0;
cin >> n >> m;
for (int i = 0; i < n; i++)
cin >> a[i].money >> a[i].number;
sort(a, a + n, cmp);
for (int i = 0;; i++) {
if ((sum + a[i].number) < m) {
sum2 = sum2 + a[i].number * a[i].money;
sum = sum + a[i].number;
} else if ((sum + a[i].number) >= m) {
sum2 = sum2 + (m - sum) * a[i].money;
break;
}
}
cout << sum2;
return 0;
} | #include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;
struct juice {
long money;
long number;
} a[100000];
bool cmp(juice a, juice b) { return a.money < b.money; }
int main() {
long long n, m, sum = 0, sum2 = 0;
cin >> n >> m;
for (int i = 0; i < n; i++)
cin >> a[i].money >> a[i].number;
sort(a, a + n, cmp);
for (int i = 0;; i++) {
if ((sum + a[i].number) < m) {
sum2 = sum2 + a[i].number * a[i].money;
sum = sum + a[i].number;
} else if ((sum + a[i].number) >= m) {
sum2 = sum2 + (m - sum) * a[i].money;
break;
}
}
cout << sum2;
return 0;
} | [
"variable_declaration.type.primitive.change",
"variable_declaration.type.widen.change"
] | 912,412 | 912,411 | u991748891 | cpp |
p03103 | #include <algorithm>
#include <cassert>
#include <climits>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
long long N, M;
int main() {
cin >> N >> M;
map<long long, long long> m;
for (long long i = 0; i < N; i++) {
long long tmp1, tmp2;
cin >> tmp1 >> tmp2;
m.insert(make_pair(tmp1, tmp2));
}
long long res = 0;
long long num = 0;
for (auto i = m.begin(); i != m.end(); ++i) {
res += i->first * i->second;
num += i->second;
if (num > M) {
res -= (num - M) * i->first;
break;
}
if (num == M)
break;
}
cout << res << endl;
}
| #include <algorithm>
#include <cassert>
#include <climits>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
long long N, M;
int main() {
cin >> N >> M;
multimap<long long, long long> m;
for (long long i = 0; i < N; i++) {
long long tmp1, tmp2;
cin >> tmp1 >> tmp2;
m.insert(make_pair(tmp1, tmp2));
}
long long res = 0;
long long num = 0;
for (auto i = m.begin(); i != m.end(); ++i) {
res += i->first * i->second;
num += i->second;
if (num > M) {
res -= (num - M) * i->first;
break;
}
if (num == M)
break;
}
cout << res << endl;
}
| [
"variable_declaration.type.change"
] | 912,416 | 912,417 | u393187783 | cpp |
p03103 | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
struct node {
int cans, yuan;
} a[1000005];
bool cmp(node x, node y) { return x.yuan < y.yuan; }
int main() {
int n, m;
long long sum = 0, cnt = 0;
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++)
scanf("%d%d", &a[i].yuan, &a[i].cans);
sort(a + 1, a + n + 1, cmp);
for (int i = 1; i <= n; i++) {
sum += a[i].cans * a[i].yuan;
cnt += a[i].cans;
if (cnt > m) {
sum -= (cnt - m) * a[i].yuan;
break;
}
}
printf("%lld", sum);
} | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
struct node {
long long cans, yuan;
} a[1000005];
bool cmp(node x, node y) { return x.yuan < y.yuan; }
int main() {
int n, m;
long long sum = 0, cnt = 0;
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++)
scanf("%lld%lld", &a[i].yuan, &a[i].cans);
sort(a + 1, a + n + 1, cmp);
for (int i = 1; i <= n; i++) {
sum += a[i].cans * a[i].yuan;
cnt += a[i].cans;
if (cnt > m) {
sum -= (cnt - m) * a[i].yuan;
break;
}
}
printf("%lld", sum);
} | [
"variable_declaration.type.primitive.change",
"variable_declaration.type.widen.change",
"literal.string.change",
"call.arguments.change"
] | 912,427 | 912,428 | u276626173 | cpp |
p03103 | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
struct node {
int cans, yuan;
} a[10005];
bool cmp(node x, node y) { return x.yuan < y.yuan; }
int main() {
int n, m;
long long sum = 0, cnt = 0;
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++)
scanf("%d%d", &a[i].yuan, &a[i].cans);
sort(a + 1, a + n + 1, cmp);
for (int i = 1; i <= n; i++) {
sum += a[i].cans * a[i].yuan;
cnt += a[i].cans;
if (cnt > m) {
sum -= (cnt - m) * a[i].yuan;
break;
}
}
printf("%lld", sum);
} | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
struct node {
long long cans, yuan;
} a[1000005];
bool cmp(node x, node y) { return x.yuan < y.yuan; }
int main() {
int n, m;
long long sum = 0, cnt = 0;
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++)
scanf("%lld%lld", &a[i].yuan, &a[i].cans);
sort(a + 1, a + n + 1, cmp);
for (int i = 1; i <= n; i++) {
sum += a[i].cans * a[i].yuan;
cnt += a[i].cans;
if (cnt > m) {
sum -= (cnt - m) * a[i].yuan;
break;
}
}
printf("%lld", sum);
} | [
"variable_declaration.type.primitive.change",
"variable_declaration.type.widen.change",
"literal.number.change",
"variable_declaration.array_dimensions.change",
"literal.string.change",
"call.arguments.change"
] | 912,429 | 912,428 | u276626173 | cpp |
p03103 | #include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <complex>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <cassert>
#include <functional>
typedef long long ll;
using namespace std;
#ifndef LOCAL
#define debug(x) ;
#else
#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;
template <typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &p) {
out << "{" << p.first << ", " << p.second << "}";
return out;
}
template <typename T> ostream &operator<<(ostream &out, const vector<T> &v) {
out << '{';
for (const T &item : v)
out << item << ", ";
out << "\b\b}";
return out;
}
#endif
#define mod 1000000007 // 1e9+7(prime number)
#define INF 1000000000 // 1e9
#define LLINF 2000000000000000000LL // 2e18
#define SIZE 200010
int main() {
int n, m;
pair<int, int> p[SIZE];
scanf("%d%d", &n, &m);
for (int i = 0; i < n; i++) {
int a, b;
scanf("%d%d", &a, &b);
p[i] = {a, b};
}
sort(p, p + n);
ll ans = 0;
for (int i = 0; i < n && m > 0; i++) {
ans += min(p[i].second, m) * p[i].first;
m -= p[i].second;
}
cout << ans << endl;
return 0;
}
| #include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <complex>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <cassert>
#include <functional>
typedef long long ll;
using namespace std;
#ifndef LOCAL
#define debug(x) ;
#else
#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;
template <typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &p) {
out << "{" << p.first << ", " << p.second << "}";
return out;
}
template <typename T> ostream &operator<<(ostream &out, const vector<T> &v) {
out << '{';
for (const T &item : v)
out << item << ", ";
out << "\b\b}";
return out;
}
#endif
#define mod 1000000007 // 1e9+7(prime number)
#define INF 1000000000 // 1e9
#define LLINF 2000000000000000000LL // 2e18
#define SIZE 200010
int main() {
int n, m;
pair<int, int> p[SIZE];
scanf("%d%d", &n, &m);
for (int i = 0; i < n; i++) {
int a, b;
scanf("%d%d", &a, &b);
p[i] = {a, b};
}
sort(p, p + n);
ll ans = 0;
for (int i = 0; i < n && m > 0; i++) {
ans += (ll)min(p[i].second, m) * p[i].first;
m -= p[i].second;
}
cout << ans << endl;
return 0;
}
| [
"type_conversion.add"
] | 912,438 | 912,439 | u378419207 | cpp |
p03104 | #include <algorithm>
#include <cmath>
#include <iostream>
#include <random>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
typedef long long ll;
ll A, B = 0;
int main() {
clock_t start = clock();
cin >> A >> B;
ll total = 0;
switch ((A - 1) % 4) {
case 0:
total = A;
break;
case 1:
total = 1;
break;
case 2:
total = A;
break;
case 3:
total = 0;
break;
}
switch (B % 4) {
case 0:
total = total ^ B;
break;
case 1:
total = total ^ 1;
break;
case 2:
total = total ^ (B + 1);
break;
case 3:
total = total ^ 0;
break;
}
cout << total << endl;
} | #include <algorithm>
#include <cmath>
#include <iostream>
#include <random>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
typedef long long ll;
ll A, B = 0;
int main() {
clock_t start = clock();
cin >> A >> B;
ll total = 0;
switch ((A - 1) % 4) {
case 0:
total = A - 1;
break;
case 1:
total = 1;
break;
case 2:
total = A;
break;
case 3:
total = 0;
break;
}
switch (B % 4) {
case 0:
total = total ^ B;
break;
case 1:
total = total ^ 1;
break;
case 2:
total = total ^ (B + 1);
break;
case 3:
total = total ^ 0;
break;
}
cout << total << endl;
} | [
"assignment.change"
] | 912,463 | 912,464 | u048791623 | cpp |
p03104 | #include <algorithm>
#include <cmath>
#include <iostream>
#include <random>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
typedef long long ll;
ll A, B = 0;
int main() {
clock_t start = clock();
cin >> A >> B;
ll total = 0;
switch ((A - 1) % 4) {
case 0:
total = A;
break;
case 1:
total = 1;
break;
case 2:
total = A + 1;
break;
case 3:
total = 0;
break;
}
switch (B % 4) {
case 0:
total = total ^ B;
break;
case 1:
total = total ^ 1;
break;
case 2:
total = total ^ (B + 1);
break;
case 3:
total = total ^ 0;
break;
}
cout << total << endl;
} | #include <algorithm>
#include <cmath>
#include <iostream>
#include <random>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
typedef long long ll;
ll A, B = 0;
int main() {
clock_t start = clock();
cin >> A >> B;
ll total = 0;
switch ((A - 1) % 4) {
case 0:
total = A - 1;
break;
case 1:
total = 1;
break;
case 2:
total = A;
break;
case 3:
total = 0;
break;
}
switch (B % 4) {
case 0:
total = total ^ B;
break;
case 1:
total = total ^ 1;
break;
case 2:
total = total ^ (B + 1);
break;
case 3:
total = total ^ 0;
break;
}
cout << total << endl;
} | [
"assignment.change",
"expression.operation.binary.remove"
] | 912,465 | 912,464 | u048791623 | cpp |
p03104 | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<ll> g(ll A) {
vector<ll> ret(50, 0);
for (ll i = 0; i < 50; i++) {
ll b = (ll)1 << i;
ret[i] = (A + 1) / (2 * b) * b + max((ll)0, (A + 1) % (2 * b) - b);
cout << A << " " << i << " " << ret[i] << endl;
}
return ret;
}
int main() {
ll A, B;
cin >> A >> B;
vector<ll> Acnt, Bcnt;
Acnt = g(A - 1);
Bcnt = g(B);
ll ans = 0;
ll b = 1;
for (int i = 0; i < 50; i++) {
if ((Bcnt[i] - Acnt[i]) % 2 == 1) {
ans += b;
}
b *= 2;
}
cout << ans << endl;
}
| #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<ll> g(ll A) {
vector<ll> ret(50, 0);
for (ll i = 0; i < 50; i++) {
ll b = (ll)1 << i;
ret[i] = (A + 1) / (2 * b) * b + max((ll)0, (A + 1) % (2 * b) - b);
cerr << A << " " << i << " " << ret[i] << endl;
}
return ret;
}
int main() {
ll A, B;
cin >> A >> B;
vector<ll> Acnt, Bcnt;
Acnt = g(A - 1);
Bcnt = g(B);
ll ans = 0;
ll b = 1;
for (int i = 0; i < 50; i++) {
if ((Bcnt[i] - Acnt[i]) % 2 == 1) {
ans += b;
}
b *= 2;
}
cout << ans << endl;
}
| [
"identifier.change",
"expression.operation.binary.change"
] | 912,470 | 912,471 | u119098168 | cpp |
p03104 | #include <iostream>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define all(x) (x).begin(), (x).end()
const int MOD = 1e9 + 7;
void solve() {}
ll calc(ll A) {
if (A < 0)
return 0;
ll ans = 0;
A++;
for (int i = 0; i < 50; ++i) {
//周期
ll loop = (1LL << (i + 1));
// 1の出現回数
ll cnt = (A / loop) * (loop / 2);
//端数処理
cnt += max(0LL, (A % loop) - (loop / 2));
if (cnt % 2 == 1) {
ans += 1LL << i;
}
}
}
int main() {
ll A, B;
cin >> A >> B;
ll ans = calc(B) ^ calc(A - 1);
cout << ans << endl;
return 0;
}
| #include <iostream>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define all(x) (x).begin(), (x).end()
const int MOD = 1e9 + 7;
void solve() {}
ll calc(ll A) {
if (A < 0)
return 0;
ll ans = 0;
A++;
for (int i = 0; i < 50; ++i) {
//周期
ll loop = (1LL << (i + 1));
// 1の出現回数
ll cnt = (A / loop) * (loop / 2);
//端数処理
cnt += max(0LL, (A % loop) - (loop / 2));
if (cnt % 2 == 1) {
ans += 1LL << i;
}
}
return ans;
}
int main() {
ll A, B;
cin >> A >> B;
ll ans = calc(B) ^ calc(A - 1);
cout << ans << endl;
return 0;
}
| [
"control_flow.return.add"
] | 912,474 | 912,475 | u824332405 | cpp |
p03104 | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
long long calc(long A) {
if (A <= 0)
return 0;
// 10^3 <= 2^10
// 1000 <= 1024
// 10^12 <= 2^40
// 10^12 <= 2進数 40桁くらい
long long ans = 0;
// i桁目の偶奇を調べる
for (int i = 0; i < 50; i++) {
// 0桁目 → 周期2
// 1 4
// 2 8
long long loop = (1LL << (i + 1));
long long cnt = (A / loop) * (loop / 2);
// 00000.....0011111.....11
cnt += max(0LL, (A % loop) - (loop / 2));
//その桁の1の数が奇数だったら足し算
if (cnt % 2 == 1) {
ans += 1LL << i;
}
}
return ans;
}
int main() {
long long A, B;
cin >> A >> B;
long long ans = calc(B) ^ calc(A - 1);
cout << ans << endl;
}
| #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
long long calc(long long A) {
if (A <= 0)
return 0;
// 4の時に、0,1,2,3,4までになるので、これは5つの整数まで
//なので帳尻合わせで1足してあげる。
A++;
// 10^3 <= 2^10
// 1000 <= 1024
// 10^12 <= 2^40
// 10^12 <= 2進数 40桁くらい
long long ans = 0;
// i桁目の偶奇を調べる
for (int i = 0; i < 50; i++) {
// 0桁目 → 周期2
// 1 4
// 2 8
long long loop = (1LL << (i + 1));
long long cnt = (A / loop) * (loop / 2);
// 00000.....0011111.....11
cnt += max(0LL, (A % loop) - (loop / 2));
//その桁の1の数が奇数だったら足し算
if (cnt % 2 == 1) {
ans += 1LL << i;
}
}
return ans;
}
int main() {
long long A, B;
cin >> A >> B;
long long ans = calc(B) ^ calc(A - 1);
cout << ans << endl;
}
| [
"variable_declaration.type.widen.change",
"expression.unary.arithmetic.add"
] | 912,478 | 912,479 | u987412812 | cpp |
p03104 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll a, b;
cin >> a >> b;
ll ans = 0;
if (a == b) {
cout << a << endl;
return 0;
}
if (a ^ (a + 1) != 1)
ans = a, a++;
ll p = (b - a) % 4;
if (p == 0)
ans = ans ^ b;
else if (p == 1)
ans = ans ^ b ^ (b - 1);
else if (p == 2)
ans = ans ^ b ^ (b - 1) ^ (b - 2);
else
ans = ans ^ b ^ (b - 1) ^ (b - 2) ^ (b - 3);
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll a, b;
cin >> a >> b;
ll ans = 0;
if (a == b) {
cout << a << endl;
return 0;
}
if ((a ^ (a + 1)) != 1)
ans = a, a++;
ll p = (b - a) % 4;
if (p == 0)
ans = ans ^ b;
else if (p == 1)
ans = ans ^ b ^ (b - 1);
else if (p == 2)
ans = ans ^ b ^ (b - 1) ^ (b - 2);
else
ans = ans ^ b ^ (b - 1) ^ (b - 2) ^ (b - 3);
cout << ans << endl;
}
| [
"control_flow.branch.if.condition.change"
] | 912,482 | 912,483 | u394482932 | cpp |
p03104 | #include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
long long f(long long n) {
long long ret = 0;
if (n % 2 == 0) {
ret = n;
if (n / 2 % 2 == 1)
ret |= 1;
} else {
ret = (n + 1) / 2 % 2;
}
return ret;
}
int main() {
long long A, B;
cin >> A >> B;
long long ans = f(A - 1) | f(B);
cout << ans;
return 0;
} | #include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
long long f(long long n) {
long long ret = 0;
if (n % 2 == 0) {
ret = n;
if (n / 2 % 2 == 1)
ret ^= 1;
} else {
ret = (n + 1) / 2 % 2;
}
return ret;
}
int main() {
long long A, B;
cin >> A >> B;
long long ans = f(A - 1) ^ f(B);
cout << ans;
return 0;
}
| [
"expression.operator.change",
"expression.operation.binary.change"
] | 912,488 | 912,489 | u412769245 | cpp |
p03104 | #include <algorithm>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
#include <typeinfo>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef unsigned long long ull;
ull func(ull A, ull B) {
ull ans = 0;
if (A % 2 == 0) {
ull sa = B - A;
if (sa % 2 == 0) {
if (sa % 4 == 0) {
ans = B;
} else {
ans = A + (4 * (sa / 4)) + 3;
}
} else {
ull tmp_sa = (sa + 1) / 2;
if (tmp_sa % 2 == 0) {
ans = 1;
}
}
} else {
ull i = A;
ull sa = B - A;
ull mod = sa % 4;
ans = A;
for (ull i = B - mod + 1; i <= B; ++i) {
ans = ans ^ i;
}
}
return ans;
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ull A, B;
cin >> A >> B;
cout << func(A, B) << endl;
} | #include <algorithm>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
#include <typeinfo>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef unsigned long long ull;
ull func(ull A, ull B) {
ull ans = 0;
if (A % 2 == 0) {
ull sa = B - A;
if (sa % 2 == 0) {
if (sa % 4 == 0) {
ans = B;
} else {
ans = A + (4 * (sa / 4)) + 3;
}
} else {
ull tmp_sa = (sa + 1) / 2;
if (tmp_sa % 2 == 1) {
ans = 1;
}
}
} else {
ull i = A;
ull sa = B - A;
ull mod = sa % 4;
ans = A;
for (ull i = B - mod + 1; i <= B; ++i) {
ans = ans ^ i;
}
}
return ans;
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ull A, B;
cin >> A >> B;
cout << func(A, B) << endl;
} | [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 912,532 | 912,533 | u134576652 | cpp |
p03104 | #include <algorithm>
#include <bitset> // std::bitset<N>
#include <cstring>
#include <iostream>
#include <sstream> // std::stringstream
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
int main() {
long long A, B;
cin >> A >> B;
if (A == B) {
cout << A;
} else if (A % 2 == 0) {
if ((B - A + 1) % 4 == 0) {
cout << 0;
} else if ((B - A + 1) % 4 == 2) {
cout << 1;
} else if ((B - A + 1) % 4 == 1) {
cout << B;
} else {
cout << B + 1;
}
} else {
if ((B - A) % 4 == 0) {
cout << B;
} else if ((B - A) % 4 == 2) {
cout << A - 1;
} else if ((B - A) % 4 == 1) {
bitset<100> as(A);
bitset<100> bs(B);
bitset<100> ans = as ^ bs;
string str = ans.to_string();
long long i = stoll(str, 0, 2);
std::cout << i << std::endl;
} else {
B++;
bitset<2> as(A);
bitset<2> bs(B);
bitset<2> ans = as ^ bs;
string str = ans.to_string();
long long i = stoll(str, 0, 2);
std::cout << i << std::endl;
}
}
return 0;
}
| #include <algorithm>
#include <bitset> // std::bitset<N>
#include <cstring>
#include <iostream>
#include <sstream> // std::stringstream
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
int main() {
long long A, B;
cin >> A >> B;
if (A == B) {
cout << A;
} else if (A % 2 == 0) {
if ((B - A + 1) % 4 == 0) {
cout << 0;
} else if ((B - A + 1) % 4 == 2) {
cout << 1;
} else if ((B - A + 1) % 4 == 1) {
cout << B;
} else {
cout << B + 1;
}
} else {
if ((B - A) % 4 == 0) {
cout << A;
} else if ((B - A) % 4 == 2) {
cout << A - 1;
} else if ((B - A) % 4 == 1) {
bitset<100> as(A);
bitset<100> bs(B);
bitset<100> ans = as ^ bs;
string str = ans.to_string();
long long i = stoll(str, 0, 2);
std::cout << i << std::endl;
} else {
B++;
bitset<100> as(A);
bitset<100> bs(B);
bitset<100> ans = as ^ bs;
string str = ans.to_string();
long long i = stoll(str, 0, 2);
std::cout << i << std::endl;
}
}
return 0;
}
| [
"identifier.change",
"io.output.change",
"literal.number.change"
] | 912,540 | 912,541 | u227379863 | cpp |
p03104 | #include <algorithm>
#include <array>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <stdio.h>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
int main() {
unsigned long A, B;
std::cin >> A >> B;
unsigned long result = 0;
++B;
if ((B - (A & ~1UL)) % 4UL == 3UL)
result |= 1UL;
for (unsigned long i = 1; i < 60; ++i) {
unsigned long bit = 0;
auto a = A % (1UL << (i + 1));
auto b = B % (1UL << (i + 1));
if (a >= (1UL << i))
bit ^= ((a % (1UL << i)) & 1UL);
if (b >= (1UL << i))
bit ^= ((b % (1UL << i)) & 1UL);
result |= (bit << i);
}
std::cout << result << "\n";
}
| #include <algorithm>
#include <array>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <stdio.h>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
int main() {
unsigned long A, B;
std::cin >> A >> B;
unsigned long result = 0;
++B;
if ((B - (A & ~1UL)) % 4UL >= 2UL)
result |= 1UL;
for (unsigned long i = 1; i < 60; ++i) {
unsigned long bit = 0;
auto a = A % (1UL << (i + 1));
auto b = B % (1UL << (i + 1));
if (a >= (1UL << i))
bit ^= ((a % (1UL << i)) & 1UL);
if (b >= (1UL << i))
bit ^= ((b % (1UL << i)) & 1UL);
result |= (bit << i);
}
std::cout << result << "\n";
}
| [] | 912,544 | 912,545 | u504322356 | cpp |
p03105 | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
cout << min(a / b, c) << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
cout << min(b / a, c) << endl;
}
| [
"expression.operation.binary.remove"
] | 912,567 | 912,568 | u842459010 | cpp |
p03105 | #include <iostream>
#include <math.h>
#include <stdio.h>
#include <vector>
using namespace std;
int main(void) {
double a, b, c;
cin >> a >> b >> c;
cout << min(b / a, c) << endl;
} | #include <iostream>
#include <math.h>
#include <stdio.h>
#include <vector>
using namespace std;
int main(void) {
int a, b, c;
cin >> a >> b >> c;
cout << min(b / a, c) << endl;
} | [
"variable_declaration.type.primitive.change"
] | 912,583 | 912,584 | u456303471 | cpp |
p03105 | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, C;
cin >> A >> B >> C;
if (A * C > B) {
cout << C << endl;
} else {
cout << B / A << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, C;
cin >> A >> B >> C;
if (A * C < B) {
cout << C << endl;
} else {
cout << B / A << endl;
}
} | [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 912,587 | 912,588 | u208581309 | cpp |
p03105 | #include <bits/stdc++.h>
#define foreach(i, v) \
for (__typeof((v).begin()) i = (v).begin(); i != (v).end(); ++i)
#define BETWEEN(a, x, b) (a <= x && x < b)
using namespace std;
typedef long long ll;
int main(int argc, char *argv[]) {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int a, b, c;
cin >> a >> b >> c;
cout << max(c, b / a) << endl;
return 0;
}
| #include <bits/stdc++.h>
#define foreach(i, v) \
for (__typeof((v).begin()) i = (v).begin(); i != (v).end(); ++i)
#define BETWEEN(a, x, b) (a <= x && x < b)
using namespace std;
typedef long long ll;
int main(int argc, char *argv[]) {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int a, b, c;
cin >> a >> b >> c;
cout << min(c, b / a) << endl;
return 0;
}
| [
"misc.opposites",
"identifier.change",
"call.function.change",
"io.output.change"
] | 912,594 | 912,595 | u369633456 | cpp |
p03105 | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
cout << max(b / a, c) << endl;
} | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
cout << min(b / a, c) << endl;
} | [
"misc.opposites",
"identifier.change",
"call.function.change",
"io.output.change"
] | 912,596 | 912,597 | u181719868 | cpp |
p03105 | #include <algorithm> //sort,二分探索,など
#include <bitset> //固定長bit集合
#include <cmath> //pow,logなど
#include <complex> //複素数
#include <deque> //両端アクセスのキュー
#include <functional> //sortのgreater
#include <iomanip> //setprecision(浮動小数点の出力の誤差)
#include <iostream> //入出力
#include <iterator> //集合演算(積集合,和集合,差集合など)
#include <map> //map(辞書)
#include <numeric> //iota(整数列の生成),gcdとlcm(c++17)
#include <queue> //キュー
#include <set> //集合
#include <stack> //スタック
#include <string> //文字列
#include <unordered_map> //イテレータあるけど順序保持しないmap
#include <unordered_set> //イテレータあるけど順序保持しないset
#include <utility> //pair
#include <vector> //可変長配列
// vectorの重複削除
// std::sort(test.begin(), test.end());
// test.erase(std::unique(test.begin(), test.end()), test.end());
using namespace std;
using ll = long long;
using P = pair<int, int>; // vector<P> ba(n); みたいな感じですぐ使える ba[i] =
// P(a, b); make_pairをしなくてもいい
// typedef vector<int> v;
template <class T> ostream &operator<<(ostream &o, const vector<T> &v) {
o << "{";
for (int i = 0; i < (int)v.size(); i++)
o << (i > 0 ? ", " : "") << v[i];
o << "}";
return o;
}
#define debug(v) \
{ cerr << "\033[1;36m[debug]\033[m " << #v << " : " << v << endl; }
#define rep(i, c) for (int i = 0; i < int(c); i++)
#define ALL(x) (x).begin(), (x).end() // sort(ALL(obj))みたいな
#define SIZE(x) ((ll)(x).size()) // sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値
#define pb push_back //
// const int MOD = 1000000007;
// string alpha="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
// printf("%.20f\n", ans); あれ
// const double PI = 3.141592653589793238462643383;
int main() {
// std::vector<int> v(5);
int a, b, c;
cin >> a >> b >> c;
int n = (b / 2);
cout << ((n > c) ? c : n) << endl;
}
| #include <algorithm> //sort,二分探索,など
#include <bitset> //固定長bit集合
#include <cmath> //pow,logなど
#include <complex> //複素数
#include <deque> //両端アクセスのキュー
#include <functional> //sortのgreater
#include <iomanip> //setprecision(浮動小数点の出力の誤差)
#include <iostream> //入出力
#include <iterator> //集合演算(積集合,和集合,差集合など)
#include <map> //map(辞書)
#include <numeric> //iota(整数列の生成),gcdとlcm(c++17)
#include <queue> //キュー
#include <set> //集合
#include <stack> //スタック
#include <string> //文字列
#include <unordered_map> //イテレータあるけど順序保持しないmap
#include <unordered_set> //イテレータあるけど順序保持しないset
#include <utility> //pair
#include <vector> //可変長配列
// vectorの重複削除
// std::sort(test.begin(), test.end());
// test.erase(std::unique(test.begin(), test.end()), test.end());
using namespace std;
using ll = long long;
using P = pair<int, int>; // vector<P> ba(n); みたいな感じですぐ使える ba[i] =
// P(a, b); make_pairをしなくてもいい
// typedef vector<int> v;
template <class T> ostream &operator<<(ostream &o, const vector<T> &v) {
o << "{";
for (int i = 0; i < (int)v.size(); i++)
o << (i > 0 ? ", " : "") << v[i];
o << "}";
return o;
}
#define debug(v) \
{ cerr << "\033[1;36m[debug]\033[m " << #v << " : " << v << endl; }
#define rep(i, c) for (int i = 0; i < int(c); i++)
#define ALL(x) (x).begin(), (x).end() // sort(ALL(obj))みたいな
#define SIZE(x) ((ll)(x).size()) // sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値
#define pb push_back //
// const int MOD = 1000000007;
// string alpha="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
// printf("%.20f\n", ans); あれ
// const double PI = 3.141592653589793238462643383;
int main() {
// std::vector<int> v(5);
int a, b, c;
cin >> a >> b >> c;
int n = (b / a);
cout << ((n > c) ? c : n) << endl;
}
| [
"identifier.replace.add",
"literal.replace.remove",
"expression.operation.binary.change"
] | 912,603 | 912,604 | u694422786 | cpp |
p03105 | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; i++)
#define COUT(x) cout << (x) << endl
#define dump(x) cout << #x << " = " << (x) << endl;
#define Yes(x) cout << (x ? "Yes" : "No") << endl;
#define YES(x) cout << (x ? "YES" : "NO") << endl;
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;
using M = map<int, int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int, vector<int>, greater<int>>;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
int main() {
int a, b, c;
cin >> a >> b >> c;
COUT(max(c, b / a));
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; i++)
#define COUT(x) cout << (x) << endl
#define dump(x) cout << #x << " = " << (x) << endl;
#define Yes(x) cout << (x ? "Yes" : "No") << endl;
#define YES(x) cout << (x ? "YES" : "NO") << endl;
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;
using M = map<int, int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int, vector<int>, greater<int>>;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
int main() {
int a, b, c;
cin >> a >> b >> c;
COUT(min(c, b / a));
return 0;
} | [
"misc.opposites",
"identifier.change",
"call.function.change",
"call.arguments.change"
] | 912,619 | 912,620 | u303884911 | cpp |
p03105 | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; i++)
#define COUT(x) cout << (x) << endl
#define dump(x) cout << #x << " = " << (x) << endl;
#define Yes(x) cout << (x ? "Yes" : "No") << endl;
#define YES(x) cout << (x ? "YES" : "NO") << endl;
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;
using M = map<int, int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int, vector<int>, greater<int>>;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
int main() {
int a, b, c;
cin >> a >> b >> c;
COUT(max(c, a / b));
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; i++)
#define COUT(x) cout << (x) << endl
#define dump(x) cout << #x << " = " << (x) << endl;
#define Yes(x) cout << (x ? "Yes" : "No") << endl;
#define YES(x) cout << (x ? "YES" : "NO") << endl;
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;
using M = map<int, int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int, vector<int>, greater<int>>;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
int main() {
int a, b, c;
cin >> a >> b >> c;
COUT(min(c, b / a));
return 0;
} | [
"misc.opposites",
"identifier.change",
"call.function.change",
"call.arguments.change",
"expression.operation.binary.remove"
] | 912,621 | 912,620 | u303884911 | cpp |
p03105 | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int A, B, C, times;
cin >> A >> B >> C;
times = A / B;
if (times > C)
times = C;
cout << times << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main(void) {
int A, B, C, times;
cin >> A >> B >> C;
times = B / A;
if (times > C)
times = C;
cout << times << endl;
return 0;
} | [
"expression.operation.binary.remove",
"assignment.change"
] | 912,625 | 912,626 | u346040900 | cpp |
p03104 | #include <bits/stdc++.h>
using namespace std;
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define endl "\n"
#define int long long
int f(int n) {
if (n % 4 == 0)
return n;
if (n % 4 == 1)
return 1;
if (n % 5 == 2)
return n + 1;
return 0;
}
int32_t main() {
IOS;
int a, b;
cin >> a >> b;
int ans = f(b) ^ f(max(0LL, a - 1));
cout << ans;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define endl "\n"
#define int long long
int f(int n) {
if (n % 4 == 0)
return n;
if (n % 4 == 1)
return 1;
if (n % 4 == 2)
return n + 1;
return 0;
}
int32_t main() {
IOS;
int a, b;
cin >> a >> b;
int ans = f(b) ^ f(max(0LL, a - 1));
cout << ans;
return 0;
} | [
"literal.number.change",
"control_flow.branch.if.condition.change"
] | 912,638 | 912,639 | u901862155 | cpp |
p03105 | #include <algorithm>
#include <iostream>
int main() {
int A, B, C;
std::cin >> A >> B >> C;
std::cout << std::min(A / B, C);
return 0;
} | #include <algorithm>
#include <iostream>
int main() {
int A, B, C;
std::cin >> A >> B >> C;
std::cout << std::min(B / A, C);
return 0;
} | [
"expression.operation.binary.remove"
] | 912,666 | 912,667 | u337949146 | cpp |
p03105 | #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 9223372036854775807LL
int main() {
int a, b, c;
cin >> a >> b >> c;
int count = b / a;
if (count > c)
count = c;
cout << c << endl;
} | #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 9223372036854775807LL
int main() {
int a, b, c;
cin >> a >> b >> c;
int count = b / a;
if (count > c)
count = c;
cout << count << endl;
} | [
"identifier.change",
"io.output.change"
] | 912,673 | 912,674 | u166553470 | cpp |
p03105 | #include <algorithm>
#include <array>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <stdint.h>
#include <string>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;
using ldouble = long double;
// BDD,ZDD,kdtree, bdtree,bicalc, bolonoy,
// doloney,chinesemod,segmenttree,daikusutora, saidairyuu, 2bugurahu,
// heirokenshutu, topologicalsort, kyourenketuseibun
#define PRI(s) cout << s << endl
#define PRIY PRI("Yes")
#define PRIN PRI("No")
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 '9':
return 9;
default:
cout << "ERR_ctoi" << endl;
return -1;
}
}
int main() {
int a, b, c;
cin >> a >> b >> c;
PRI(min(a / b, c));
return 0;
} | #include <algorithm>
#include <array>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <stdint.h>
#include <string>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;
using ldouble = long double;
// BDD,ZDD,kdtree, bdtree,bicalc, bolonoy,
// doloney,chinesemod,segmenttree,daikusutora, saidairyuu, 2bugurahu,
// heirokenshutu, topologicalsort, kyourenketuseibun
#define PRI(s) cout << s << endl
#define PRIY PRI("Yes")
#define PRIN PRI("No")
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 '9':
return 9;
default:
cout << "ERR_ctoi" << endl;
return -1;
}
}
int main() {
int a, b, c;
cin >> a >> b >> c;
PRI(min(b / a, c));
return 0;
} | [
"expression.operation.binary.remove"
] | 912,678 | 912,679 | u539145601 | cpp |
p03105 | #include <bits/stdc++.h>
#define rep(i, N) for (int i = 0; i < (N); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main(void) {
int a, b, c;
cin >> a >> b >> c;
int ans = min(c, a / b);
cout << ans << endl;
}
| #include <bits/stdc++.h>
#define rep(i, N) for (int i = 0; i < (N); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main(void) {
int a, b, c;
cin >> a >> b >> c;
int ans = min(c, b / a);
cout << ans << endl;
}
| [
"expression.operation.binary.remove"
] | 912,682 | 912,683 | u437633151 | cpp |
p03105 | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, C;
cin >> A >> B >> C;
int ans = (B / A);
if (ans > C) {
cout << C << endl;
return 0;
} else if (ans < C) {
cout << ans << endl;
return 0;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, C;
cin >> A >> B >> C;
int ans = (B / A);
if (ans > C) {
cout << C << endl;
return 0;
} else {
cout << ans << endl;
return 0;
}
}
| [] | 912,703 | 912,704 | u843939291 | cpp |
p03105 | #include <iostream>
using namespace std;
int main() {
int A, B, C;
cin >> A >> B >> C;
int ans = A / B;
if (ans > C)
ans = C;
cout << ans << endl;
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int A, B, C;
cin >> A >> B >> C;
int ans = B / A;
if (ans > C)
ans = C;
cout << ans << endl;
return 0;
}
| [
"expression.operation.binary.remove"
] | 912,709 | 912,710 | u016119075 | cpp |
p03105 | #include <bits/stdc++.h>
using namespace std;
#define rep0(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
int main() {
int a, b, c;
cin >> a >> b >> c;
int d = b % a;
if (d > c) {
cout << c << endl;
} else {
cout << d << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
#define rep0(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
int main() {
int a, b, c;
cin >> a >> b >> c;
int d = b / a;
if (d > c) {
cout << c << endl;
} else {
cout << d << endl;
}
} | [
"expression.operator.arithmetic.change",
"expression.operation.binary.change"
] | 912,713 | 912,714 | u680574634 | cpp |
p03105 | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
cout << min(c, a / b) << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
cout << min(c, b / a) << endl;
} | [
"expression.operation.binary.remove"
] | 912,719 | 912,720 | u652660628 | cpp |
p03105 | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
cout << max(c, a / b) << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
cout << min(c, b / a) << endl;
} | [
"misc.opposites",
"identifier.change",
"call.function.change",
"io.output.change",
"expression.operation.binary.remove"
] | 912,721 | 912,720 | u652660628 | cpp |
p03105 | #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 SHIFT_LEFT(n) (1LL << ((ll)n))
#define SUBS(s, f, t) ((s).substr((f), (t) - (f)))
#define ALL(a) (a).begin(), (a).end()
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll a, b, c;
cin >> a >> b >> c;
cout << min(c, a / b) << endl;
return 0;
}
| #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 SHIFT_LEFT(n) (1LL << ((ll)n))
#define SUBS(s, f, t) ((s).substr((f), (t) - (f)))
#define ALL(a) (a).begin(), (a).end()
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll a, b, c;
cin >> a >> b >> c;
cout << min(c, b / a) << endl;
return 0;
}
| [
"expression.operation.binary.remove"
] | 912,732 | 912,733 | u905715926 | cpp |
p03105 | #define _GLIBCXX_DEBUG
#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define rep2(i, s, n) for (int i = s; i < (int)n; i++)
#define ll long long
#define all(v) v.begin(), v.end()
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
cout << min(a * c, b / a) << endl;
}
| #define _GLIBCXX_DEBUG
#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define rep2(i, s, n) for (int i = s; i < (int)n; i++)
#define ll long long
#define all(v) v.begin(), v.end()
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
cout << min(c, b / a) << endl;
}
| [
"expression.operation.binary.remove"
] | 912,738 | 912,739 | u942085302 | cpp |
p03105 | #define _GLIBCXX_DEBUG
#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define rep2(i, s, n) for (int i = s; i < (int)n; i++)
#define ll long long
#define all(v) v.begin(), v.end()
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
cout << min(b * c, b / a) << endl;
}
| #define _GLIBCXX_DEBUG
#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define rep2(i, s, n) for (int i = s; i < (int)n; i++)
#define ll long long
#define all(v) v.begin(), v.end()
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
cout << min(c, b / a) << endl;
}
| [
"expression.operation.binary.remove"
] | 912,740 | 912,739 | u942085302 | cpp |
p03105 | #include <algorithm>
#include <iostream>
using namespace std;
int main(void) {
int A, B, C;
cin >> A >> B >> C;
cout << max(B / A, C) << endl;
return 0;
}
| #include <algorithm>
#include <iostream>
using namespace std;
int main(void) {
int A, B, C;
cin >> A >> B >> C;
cout << min(B / A, C) << endl;
return 0;
}
| [
"misc.opposites",
"identifier.change",
"call.function.change",
"io.output.change"
] | 912,743 | 912,744 | u563743611 | cpp |
p03105 | #include <algorithm>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
#define rep(i, a, n) for (int i = (a); i < (n); i++)
#define ll long long
#define llint long long int
#define reverse(v) reverse(v.begin(), v.end());
#define Yes(ans) \
if (ans) \
cout << "Yes" << endl; \
else \
cout << "No" << endl;
#define YES(ans) \
if (ans) \
cout << "YES" << endl; \
else \
cout << "NO" << endl;
#define hei(a) vector<a>
#define whei(a) vector<vector<a>>
#define UF UnionFind
#define Pint pair<int, int>
#define keta(a) fixed << setprecision(a)
constexpr auto INF = 100000000000;
constexpr auto mod = 1000000007;
//辞書順はnext_permutation( begin( v ), end( v ) );やで!
struct edge {
int to, cost;
};
// sは初めの点、vは頂点size、dは最短距離を求める(初期化はINF),Gは有向グラフ
void dijkdtra(int s, int v, vector<int> &d, whei(edge) & G) {
priority_queue<Pint, vector<Pint>, greater<Pint>>
que; // firstが距離、secondが頂点
d[s] = 0; //スタートの距離はもちろんzero
que.push(Pint(0, s));
while (!que.empty()) {
Pint p = que.top();
que.pop();
int V = p.second;
if (d[V] < p.first)
continue;
for (int i = 0; i < G[V].size(); i++) {
edge e = G[V][i];
if (d[e.to] > d[V] + e.cost) {
d[e.to] = d[V] + e.cost;
que.push(Pint(d[e.to], e.to));
}
}
}
}
int main() {
int a, b, c;
cin >> a >> b >> c;
int ans = max(b / a, c);
cout << ans << endl;
return 0;
} | #include <algorithm>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
#define rep(i, a, n) for (int i = (a); i < (n); i++)
#define ll long long
#define llint long long int
#define reverse(v) reverse(v.begin(), v.end());
#define Yes(ans) \
if (ans) \
cout << "Yes" << endl; \
else \
cout << "No" << endl;
#define YES(ans) \
if (ans) \
cout << "YES" << endl; \
else \
cout << "NO" << endl;
#define hei(a) vector<a>
#define whei(a) vector<vector<a>>
#define UF UnionFind
#define Pint pair<int, int>
#define keta(a) fixed << setprecision(a)
constexpr auto INF = 100000000000;
constexpr auto mod = 1000000007;
//辞書順はnext_permutation( begin( v ), end( v ) );やで!
struct edge {
int to, cost;
};
// sは初めの点、vは頂点size、dは最短距離を求める(初期化はINF),Gは有向グラフ
void dijkdtra(int s, int v, vector<int> &d, whei(edge) & G) {
priority_queue<Pint, vector<Pint>, greater<Pint>>
que; // firstが距離、secondが頂点
d[s] = 0; //スタートの距離はもちろんzero
que.push(Pint(0, s));
while (!que.empty()) {
Pint p = que.top();
que.pop();
int V = p.second;
if (d[V] < p.first)
continue;
for (int i = 0; i < G[V].size(); i++) {
edge e = G[V][i];
if (d[e.to] > d[V] + e.cost) {
d[e.to] = d[V] + e.cost;
que.push(Pint(d[e.to], e.to));
}
}
}
}
int main() {
int a, b, c;
cin >> a >> b >> c;
int ans = min(b / a, c);
cout << ans << endl;
return 0;
} | [
"misc.opposites",
"identifier.change",
"call.function.change"
] | 912,745 | 912,746 | u407213771 | cpp |
p03105 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
using P = pair<int, int>;
using ll = long long;
static const int INF = 1000000000;
static const ll MOD = 1000000007;
ll gcd(ll a, ll b) { return b != 0 ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int main() {
int a, b, c;
cin >> a >> b >> c;
int ans = b / a;
cout << max(c, ans) << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
using P = pair<int, int>;
using ll = long long;
static const int INF = 1000000000;
static const ll MOD = 1000000007;
ll gcd(ll a, ll b) { return b != 0 ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int main() {
int a, b, c;
cin >> a >> b >> c;
int ans = b / a;
cout << min(c, ans) << endl;
return 0;
}
| [
"misc.opposites",
"identifier.change",
"call.function.change",
"io.output.change"
] | 912,747 | 912,748 | u741815956 | cpp |
p03105 | #include <bits/stdc++.h>
#include <string>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> P1;
typedef pair<P, P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i, x) for (int i = 0; i < x; i++)
#define repn(i, x) for (int i = 1; i <= x; i++)
#define SORT(x) sort(x.begin(), x.end())
#define ERASE(x) x.erase(unique(x.begin(), x.end()), x.end())
#define POSL(x, v) (lower_bound(x.begin(), x.end(), v) - x.begin())
#define POSU(x, v) (upper_bound(x.begin(), x.end(), v) - x.begin())
int n, h[100005];
ll dp[100005];
int main() {
int A, B, C;
std::cin >> A >> B >> C;
int a, b, c;
// printf("a=%d,b=%d,c=%d",a,b,c);
if (B % A >= C) {
printf("%d", C);
return 0;
} else {
printf("%d", B % A);
}
} | #include <bits/stdc++.h>
#include <string>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> P1;
typedef pair<P, P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i, x) for (int i = 0; i < x; i++)
#define repn(i, x) for (int i = 1; i <= x; i++)
#define SORT(x) sort(x.begin(), x.end())
#define ERASE(x) x.erase(unique(x.begin(), x.end()), x.end())
#define POSL(x, v) (lower_bound(x.begin(), x.end(), v) - x.begin())
#define POSU(x, v) (upper_bound(x.begin(), x.end(), v) - x.begin())
int n, h[100005];
ll dp[100005];
int main() {
int A, B, C;
std::cin >> A >> B >> C;
int a, b, c;
// printf("a=%d,b=%d,c=%d",a,b,c);
if (B / A >= C) {
printf("%d", C);
return 0;
} else {
printf("%d", B / A);
}
} | [
"expression.operator.arithmetic.change",
"control_flow.branch.if.condition.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 912,759 | 912,760 | u069521477 | cpp |
p03105 | #include <bits/stdc++.h>
#include <string>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> P1;
typedef pair<P, P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i, x) for (int i = 0; i < x; i++)
#define repn(i, x) for (int i = 1; i <= x; i++)
#define SORT(x) sort(x.begin(), x.end())
#define ERASE(x) x.erase(unique(x.begin(), x.end()), x.end())
#define POSL(x, v) (lower_bound(x.begin(), x.end(), v) - x.begin())
#define POSU(x, v) (upper_bound(x.begin(), x.end(), v) - x.begin())
int n, h[100005];
ll dp[100005];
int main() {
int A, B, C;
std::cin >> A >> B >> C;
int a, b, c;
// printf("a=%d,b=%d,c=%d",a,b,c);
if (B % A == C) {
printf("%d", C);
return 0;
} else {
printf("%d", B % A);
}
} | #include <bits/stdc++.h>
#include <string>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> P1;
typedef pair<P, P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i, x) for (int i = 0; i < x; i++)
#define repn(i, x) for (int i = 1; i <= x; i++)
#define SORT(x) sort(x.begin(), x.end())
#define ERASE(x) x.erase(unique(x.begin(), x.end()), x.end())
#define POSL(x, v) (lower_bound(x.begin(), x.end(), v) - x.begin())
#define POSU(x, v) (upper_bound(x.begin(), x.end(), v) - x.begin())
int n, h[100005];
ll dp[100005];
int main() {
int A, B, C;
std::cin >> A >> B >> C;
int a, b, c;
// printf("a=%d,b=%d,c=%d",a,b,c);
if (B / A >= C) {
printf("%d", C);
return 0;
} else {
printf("%d", B / A);
}
} | [
"expression.operator.arithmetic.change",
"control_flow.branch.if.condition.change",
"expression.operator.compare.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 912,761 | 912,760 | u069521477 | cpp |
p03105 | #include <iostream>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
if (a * c < b)
cout << c << endl;
if (a * c > b)
cout << b / a << endl;
return 0;
} | #include <iostream>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
if (a * c <= b)
cout << c << endl;
if (a * c > b)
cout << b / a << endl;
return 0;
} | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 912,762 | 912,763 | u657208344 | cpp |
p03105 | #include <bits/stdc++.h>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
int main() {
int a, b, c;
cin >> a >> b >> c;
cout << min(a / b, c);
}
| #include <bits/stdc++.h>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
int main() {
int a, b, c;
cin >> a >> b >> c;
cout << min(b / a, c);
} | [
"expression.operation.binary.remove"
] | 912,764 | 912,765 | u683078179 | cpp |
p03105 | #define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <numeric>
#include <stdio.h>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
int main() {
ll A, B, C;
cin >> A >> B >> C;
ll out = A / B;
if (out > C)
out = C;
cout << out << endl;
return 0;
}
| #define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <numeric>
#include <stdio.h>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
int main() {
ll A, B, C;
cin >> A >> B >> C;
ll out = B / A;
if (out > C)
out = C;
cout << out << endl;
return 0;
}
| [
"expression.operation.binary.remove"
] | 912,772 | 912,773 | u742595961 | cpp |
p03105 | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, C;
cin >> A >> B >> C;
if (B / A > C) {
cout << C << endl;
}
if (B / A < C) {
cout << B / A << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, C;
cin >> A >> B >> C;
if (B / A >= C) {
cout << C << endl;
}
if (B / A < C) {
cout << B / A << endl;
}
}
| [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 912,789 | 912,790 | u834753207 | cpp |
p03105 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
int main() {
int a, b, c;
cin >> a >> b >> c;
if (a * c <= b)
cout << a * c << endl;
else
cout << b / a << endl;
}
| #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
int main() {
int a, b, c;
cin >> a >> b >> c;
if (a * c <= b)
cout << c << endl;
else
cout << b / a << endl;
}
| [
"expression.operation.binary.remove"
] | 912,793 | 912,794 | u717483569 | cpp |
p03105 | #include <iostream>
using namespace std;
int main() {
int A, B, C;
cin >> A >> B >> C;
if (C <= B / A) {
cout << C;
} else {
cout << A / B;
}
} | #include <iostream>
using namespace std;
int main() {
int A, B, C;
cin >> A >> B >> C;
if (C <= B / A) {
cout << C;
} else {
cout << B / A;
}
} | [
"expression.operation.binary.remove"
] | 912,803 | 912,804 | u079860059 | cpp |
p03105 | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <string>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;
int main() {
int a, b, c;
cin >> a >> b >> c;
int ans = a / b;
if (ans > c)
ans = c;
cout << ans << endl;
return 0;
}
| #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <string>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;
int main() {
int a, b, c;
cin >> a >> b >> c;
int ans = b / a;
if (ans > c)
ans = c;
cout << ans << endl;
return 0;
}
| [
"expression.operation.binary.remove"
] | 912,807 | 912,808 | u607564800 | cpp |
p03105 | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
b /= a;
if (b < c)
cout << a;
else
cout << c;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
b /= a;
if (b < c)
cout << b;
else
cout << c;
} | [
"identifier.change",
"io.output.change"
] | 912,822 | 912,823 | u098101671 | cpp |
p03105 | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <forward_list>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
#define ll long long int
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
int mx4[] = {0, 1, 0, -1};
int my4[] = {1, 0, -1, 0};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
int main() {
int a, b, c;
cin >> a >> b >> c;
cout << max(b / a, c) << endl;
} | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <forward_list>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
#define ll long long int
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
int mx4[] = {0, 1, 0, -1};
int my4[] = {1, 0, -1, 0};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
int main() {
int a, b, c;
cin >> a >> b >> c;
cout << min(b / a, c) << endl;
} | [
"misc.opposites",
"identifier.change",
"call.function.change",
"io.output.change"
] | 912,824 | 912,825 | u504800764 | cpp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.