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 |
|---|---|---|---|---|---|---|---|
p02969 | #include <algorithm>
#include <iostream>
#include <math.h>
#include <queue>
#include <string>
#include <vector>
using namespace std;
#define INF 210000000
static long long gcd(long long a, long long b) {
int amari = a % b;
int c = b;
if (amari == 0) {
return b;
} else {
return gcd(b, amari);
}
}
static long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
int main() {
int a;
cin >> a;
cout << 3 * a * a * a;
}
| #include <algorithm>
#include <iostream>
#include <math.h>
#include <queue>
#include <string>
#include <vector>
using namespace std;
#define INF 210000000
static long long gcd(long long a, long long b) {
int amari = a % b;
int c = b;
if (amari == 0) {
return b;
} else {
return gcd(b, amari);
}
}
static long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
int main() {
int a;
cin >> a;
cout << 3 * a * a;
}
| [
"expression.operation.binary.remove"
] | 772,715 | 772,716 | u005570675 | cpp |
p02969 | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
typedef vector<pair<ll, ll>> vp;
#define rep(i, n) for (ll i = 0; i < ll(n); i++)
#define all(v) v.begin(), v.end()
#define inputv(v, n) \
rep(i, n) { \
ll x; \
cin >> x; \
v.push_back(x); \
}
const ll INF = 99999999999999;
const ll MOD = 1000000007;
int main() {
ll r;
cout << 3 * r * r;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
typedef vector<pair<ll, ll>> vp;
#define rep(i, n) for (ll i = 0; i < ll(n); i++)
#define all(v) v.begin(), v.end()
#define inputv(v, n) \
rep(i, n) { \
ll x; \
cin >> x; \
v.push_back(x); \
}
const ll INF = 99999999999999;
const ll MOD = 1000000007;
int main() {
ll r;
cin >> r;
cout << 3 * r * r;
return 0;
}
| [] | 772,731 | 772,732 | u478997153 | cpp |
p02969 | #include "bits/stdc++.h"
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
//-----------------------------------------------------------------------------------
int a;
cin >> a;
cout << 3.0 * a * a << "endl";
} | #include "bits/stdc++.h"
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
//-----------------------------------------------------------------------------------
int a;
cin >> a;
cout << 3.0 * a * a << "\n";
} | [
"literal.string.change",
"io.output.change"
] | 772,764 | 772,765 | u373796790 | cpp |
p02969 | #include "bits/stdc++.h"
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
//-----------------------------------------------------------------------------------
int a;
cin >> a;
cout << 4.0 * a * a << "endl";
} | #include "bits/stdc++.h"
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
//-----------------------------------------------------------------------------------
int a;
cin >> a;
cout << 3.0 * a * a << "\n";
} | [
"literal.number.change",
"io.output.change",
"literal.string.change"
] | 772,766 | 772,765 | u373796790 | cpp |
p02969 | #include <iostream>
using namespace std;
int main() {
int r;
cin >> r;
int a;
a = 3 * r ^ 2;
cout << a << endl;
} | #include <iostream>
using namespace std;
int main() {
int r;
cin >> r;
int a;
a = 3 * r * r;
cout << a << endl;
} | [] | 772,769 | 772,770 | u711816529 | cpp |
p02969 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
printf("%ld", (long int)6 * n * n);
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
printf("%ld", (long int)3 * n * n);
return 0;
} | [
"literal.number.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 772,788 | 772,789 | u173000750 | cpp |
p02969 | #include <bits/stdc++.h>
using namespace std;
int main() {
int r;
cin >> r;
int x = 2 * r * r;
cout << x;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int r;
cin >> r;
int x = 3 * r * r;
cout << x;
return 0;
} | [
"literal.number.change",
"expression.operation.binary.change"
] | 772,805 | 772,806 | u549517003 | cpp |
p02969 | #include <bits/stdc++.h>
using namespace std;
int main() {
int r;
cin >> r;
cout << 3 * (r ^ 2) << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int r;
cin >> r;
cout << 3 * (r * r) << endl;
} | [] | 772,807 | 772,808 | u384561774 | cpp |
p02969 | // atcoder/abc134/A/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/
#include <bits/stdc++.h>
#define each(i, c) for (auto &i : c)
#define unless(cond) if (!(cond))
using namespace std;
typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;
template <typename P, typename Q>
ostream &operator<<(ostream &os, pair<P, Q> p) {
os << "(" << p.first << "," << p.second << ")";
return os;
}
template <typename P, typename Q>
istream &operator>>(istream &is, pair<P, Q> &p) {
is >> p.first >> p.second;
return is;
}
template <typename T> ostream &operator<<(ostream &os, vector<T> v) {
os << "(";
each(i, v) os << i << ",";
os << ")";
return os;
}
template <typename T> istream &operator>>(istream &is, vector<T> &v) {
each(i, v) is >> i;
return is;
}
template <typename T> inline T setmax(T &a, T b) { return a = std::max(a, b); }
template <typename T> inline T setmin(T &a, T b) { return a = std::min(a, b); }
int main(int argc, char *argv[]) {
ios_base::sync_with_stdio(0);
cin.tie(0);
int r;
while (cin >> r) {
cout << 3 * r * r * r << endl;
}
return 0;
}
| // atcoder/abc134/A/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/
#include <bits/stdc++.h>
#define each(i, c) for (auto &i : c)
#define unless(cond) if (!(cond))
using namespace std;
typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;
template <typename P, typename Q>
ostream &operator<<(ostream &os, pair<P, Q> p) {
os << "(" << p.first << "," << p.second << ")";
return os;
}
template <typename P, typename Q>
istream &operator>>(istream &is, pair<P, Q> &p) {
is >> p.first >> p.second;
return is;
}
template <typename T> ostream &operator<<(ostream &os, vector<T> v) {
os << "(";
each(i, v) os << i << ",";
os << ")";
return os;
}
template <typename T> istream &operator>>(istream &is, vector<T> &v) {
each(i, v) is >> i;
return is;
}
template <typename T> inline T setmax(T &a, T b) { return a = std::max(a, b); }
template <typename T> inline T setmin(T &a, T b) { return a = std::min(a, b); }
int main(int argc, char *argv[]) {
ios_base::sync_with_stdio(0);
cin.tie(0);
int r;
while (cin >> r) {
cout << 3 * r * r << endl;
}
return 0;
}
| [
"expression.operation.binary.remove"
] | 772,815 | 772,816 | u768334187 | cpp |
p02969 | #include <bits/stdc++.h>
using namespace std;
int main() {
int r;
cout << r * r * 3 << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int r;
cin >> r;
cout << r * r * 3 << endl;
}
| [] | 772,821 | 772,822 | u653482689 | cpp |
p02969 | #include <bits/stdc++.h>
using namespace std;
int main() {
int r;
cin >> r;
cout << 3 * pow(r, 3) << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int r;
cin >> r;
cout << 3 * pow(r, 2) << endl;
} | [
"literal.number.change",
"io.output.change"
] | 772,825 | 772,826 | u565692645 | cpp |
p02969 | #include <bits/stdc++.h>
#define LL long long
const int N = 1020;
const long long mod = 998244353;
using namespace std;
LL n;
int main() {
ios_base::sync_with_stdio(0);
// freopen( "input.txt" , "r" , stdin );
// freopen( "output.txt" , "w" , stdout );
cout << 3 * (n * n);
}
| #include <bits/stdc++.h>
#define LL long long
const int N = 1020;
const long long mod = 998244353;
using namespace std;
LL n;
int main() {
ios_base::sync_with_stdio(0);
// freopen( "input.txt" , "r" , stdin );
// freopen( "output.txt" , "w" , stdout );
cin >> n;
cout << 3 * (n * n);
}
| [] | 772,827 | 772,828 | u543498582 | cpp |
p02969 | #include <bits/stdc++.h>
#include <iomanip>
#define mins(a, b) a = min(a, b)
#define maxs(a, b) a = max(a, b)
template <typename T> std::string to_string(const T &n) {
std::ostringstream stm;
stm << n;
return stm.str();
}
using namespace std;
const long long INF = 9000000000000000;
const long long mod = 1000000007;
typedef long long ll;
int main() {
ll n, ans = 0, k, m = 0, x = 0, y = 0;
cin >> n;
cout << 4 * n * n << endl;
}
| #include <bits/stdc++.h>
#include <iomanip>
#define mins(a, b) a = min(a, b)
#define maxs(a, b) a = max(a, b)
template <typename T> std::string to_string(const T &n) {
std::ostringstream stm;
stm << n;
return stm.str();
}
using namespace std;
const long long INF = 9000000000000000;
const long long mod = 1000000007;
typedef long long ll;
int main() {
ll n, ans = 0, k, m = 0, x = 0, y = 0;
cin >> n;
cout << 3 * n * n << endl;
}
| [
"literal.number.change",
"io.output.change"
] | 772,839 | 772,840 | u127856129 | cpp |
p02969 | #include <bits/stdc++.h>
using namespace std;
void solve() {
long long a;
cout << 3 * (a * a) << endl;
}
int main() {
solve();
return 0;
} | #include <bits/stdc++.h>
using namespace std;
void solve() {
long long a;
cin >> a;
cout << 3 * (a * a) << endl;
}
int main() {
solve();
return 0;
} | [] | 772,845 | 772,846 | u573945813 | cpp |
p02969 | #include <iostream>
int main() {
int r;
std::cin >> r;
std::cout << 3 * r * r * r << std::endl;
return 0;
} | #include <iostream>
int main() {
int r;
std::cin >> r;
std::cout << 3 * r * r << std::endl;
return 0;
} | [
"expression.operation.binary.remove"
] | 772,858 | 772,859 | u675512317 | cpp |
p02969 | #include <bits/stdc++.h>
using namespace std;
int main() {
int x;
cin >> x;
cout << 3 * x * x * x << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int x;
cin >> x;
cout << 3 * x * x << endl;
} | [
"expression.operation.binary.remove"
] | 772,860 | 772,861 | u806503933 | cpp |
p02969 | #include <bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(), x.end()
#define ll long long
#define FOR(i, n) for (int i = 0; i < n; i++)
// map<key,value>
int main() {
ll r;
cin >> r;
cout << r * r * r;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(), x.end()
#define ll long long
#define FOR(i, n) for (int i = 0; i < n; i++)
// map<key,value>
int main() {
ll r;
cin >> r;
cout << r * r * 3;
return 0;
} | [
"identifier.replace.remove",
"literal.replace.add",
"io.output.change"
] | 772,866 | 772,867 | u662665711 | cpp |
p02969 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; (i) < (n); ++(i))
#define loop(i, a, n) for (int i = (a); (i) < (n); ++(i))
#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF (int)1e9
#define MOD 0
//#define int ll
using namespace std;
typedef vector<long long> vl;
signed main() {
int r;
cin.tie(0);
ios::sync_with_stdio(false);
cin >> r;
cout << 3 * r * r * r << endl;
}
| #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; (i) < (n); ++(i))
#define loop(i, a, n) for (int i = (a); (i) < (n); ++(i))
#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF (int)1e9
#define MOD 0
//#define int ll
using namespace std;
typedef vector<long long> vl;
signed main() {
int r;
cin.tie(0);
ios::sync_with_stdio(false);
cin >> r;
cout << 3 * r * r << endl;
}
| [
"expression.operation.binary.remove"
] | 772,872 | 772,873 | u244583418 | cpp |
p02969 | #include <iostream>
#include <stdio.h>
using namespace std;
int main(void) {
// Your code here!
int r;
scanf("%d", &r);
printf("%d", 3 * r * r * r);
return 0;
}
| #include <iostream>
#include <stdio.h>
using namespace std;
int main(void) {
// Your code here!
int r;
scanf("%d", &r);
printf("%d", 3 * r * r);
return 0;
}
| [
"expression.operation.binary.remove"
] | 772,892 | 772,893 | u237374575 | cpp |
p02969 | #include <iostream>
using namespace std;
typedef long long ll;
ll a;
ll bp(ll a, ll n) {
if (n == 0)
return 1ll;
if (n == 1)
return a;
ll res = bp(a, n / 2);
if (n & 1)
return res * res * a;
else
return res * res;
}
int main() {
ll a;
cin >> a;
cout << 3ll * bp(a, 22ll);
return 0;
} | #include <iostream>
using namespace std;
typedef long long ll;
ll a;
ll bp(ll a, ll n) {
if (n == 0)
return 1ll;
if (n == 1)
return a;
ll res = bp(a, n / 2);
if (n & 1)
return res * res * a;
else
return res * res;
}
int main() {
ll a;
cin >> a;
cout << 3 * bp(a, 2ll);
return 0;
} | [
"literal.number.change",
"io.output.change"
] | 772,894 | 772,895 | u585969999 | cpp |
p02969 | #include <algorithm>
#include <iostream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef unsigned char uchar;
#define umap unordered_map
const static ull INVALID_DIGIT = ~(ull)0;
int main() {
ull r;
cin >> r;
cout << (3 * r * r * r) << endl;
return 0;
} | #include <algorithm>
#include <iostream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef unsigned char uchar;
#define umap unordered_map
const static ull INVALID_DIGIT = ~(ull)0;
int main() {
ull r;
cin >> r;
cout << (3 * r * r) << endl;
return 0;
} | [
"expression.operation.binary.remove"
] | 772,911 | 772,912 | u097665156 | cpp |
p02969 | #include <stdio.h>
int main(void) {
int r = 0;
scanf("%d", &r);
int ans = 3 * (r * r);
printf("%lf", ans);
return 0;
} | #include <stdio.h>
int main(void) {
int r = 0;
scanf("%d", &r);
int ans = 3 * (r * r);
printf("%d", ans);
return 0;
} | [
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 772,931 | 772,932 | u245335950 | cpp |
p02969 | #include <math.h>
#include <stdio.h>
int cul(int r);
int main(void) {
int r, m;
scanf("%d", &r);
m = cul(r);
printf("%d\n", m);
return 0;
}
int cul(int r) {
int m;
m = int(3 * pow(double(r), 3.0));
return m;
} | #include <math.h>
#include <stdio.h>
int cul(int r);
int main(void) {
int r, m;
scanf("%d", &r);
m = cul(r);
printf("%d\n", m);
return 0;
}
int cul(int r) {
int m;
m = int(3 * pow(double(r), 2.0));
return m;
} | [
"literal.number.change",
"assignment.value.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 772,937 | 772,938 | u456658814 | cpp |
p02969 | #include <stdio.h>
int main() {
int a;
scanf("%d", &a);
printf("%d", 3 * (a ^ 2));
}
| #include <stdio.h>
int main() {
int a;
scanf("%d", &a);
printf("%d", 3 * a * a);
}
| [
"call.arguments.change"
] | 772,945 | 772,946 | u222643545 | cpp |
p02969 | #include <stdio.h>
int main() {
int a;
scanf("%d", &a);
printf("%d", 3 * a ^ 2);
} | #include <stdio.h>
int main() {
int a;
scanf("%d", &a);
printf("%d", 3 * a * a);
}
| [] | 772,947 | 772,946 | u222643545 | cpp |
p02969 | #include <bits/stdc++.h>
using namespace std;
int main() {
int a;
cin >> a;
cout << 3 * a * a * a << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int a;
cin >> a;
cout << 3 * a * a << endl;
} | [
"expression.operation.binary.remove"
] | 772,950 | 772,951 | u936271647 | cpp |
p02969 | #include <iostream>
using namespace std;
int main() {
int i;
cout << 3 * i * i << endl;
} | #include <iostream>
using namespace std;
int main() {
int i;
cin >> i;
cout << 3 * i * i << endl;
} | [] | 772,952 | 772,953 | u621509943 | cpp |
p02969 | #include <bits/stdc++.h>
int main() {
int a;
scanf("%d", &a);
printf("%d\n", 3 * a * a * a);
return 0;
} | #include <bits/stdc++.h>
int main() {
int a;
scanf("%d", &a);
printf("%d\n", 3 * a * a);
return 0;
} | [
"expression.operation.binary.remove"
] | 772,954 | 772,955 | u783764370 | cpp |
p02969 | #include <bits/stdc++.h>
#define int int64_t
using namespace std;
typedef pair<int, int> P;
const int INF = 100000000;
// グローバル変数
// 関数:
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
int r, s;
cin >> r;
s = 3 * r * r * r;
cout << s << endl;
}
| #include <bits/stdc++.h>
#define int int64_t
using namespace std;
typedef pair<int, int> P;
const int INF = 100000000;
// グローバル変数
// 関数:
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
int r, s;
cin >> r;
s = 3 * r * r;
cout << s << endl;
}
| [
"expression.operation.binary.remove"
] | 772,958 | 772,959 | u881160582 | cpp |
p02969 | #include <iostream>
using namespace std;
int main() {
int r, ans;
cin >> r;
ans = 3 * r * r;
cout << "ans\n";
} | #include <iostream>
using namespace std;
int main() {
int r, ans;
cin >> r;
ans = 3 * r * r;
cout << ans << endl;
} | [] | 772,964 | 772,965 | u218369588 | cpp |
p02969 | #include <iostream>
using namespace std;
int main() {
int r, ans;
cin >> r;
ans = 3 * r * r;
cout << "and\n";
} | #include <iostream>
using namespace std;
int main() {
int r, ans;
cin >> r;
ans = 3 * r * r;
cout << ans << endl;
} | [] | 772,966 | 772,965 | u218369588 | cpp |
p02969 | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
// for(int i = 0; i < n; i++)
int main() {
int r;
cin >> r;
cout << 6 * r * r << endl;
return 0;
} | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
// for(int i = 0; i < n; i++)
int main() {
int r;
cin >> r;
cout << 3 * r * r << endl;
return 0;
} | [
"literal.number.change",
"io.output.change"
] | 772,969 | 772,970 | u534417782 | cpp |
p02969 | #include <cmath>
#include <iostream>
using namespace std;
int main() {
int r;
cout << 3 * pow(r, 3);
return 0;
} | #include <cmath>
#include <iostream>
using namespace std;
int main() {
int r;
cin >> r;
cout << 3 * pow(r, 2);
return 0;
} | [
"literal.number.change",
"io.output.change"
] | 772,975 | 772,976 | u961523950 | cpp |
p02969 | #include <iostream>
using namespace std;
int main() {
int r;
cout << (3 * (r * r)) << endl;
} | #include <iostream>
using namespace std;
int main() {
int r;
cin >> r;
cout << (3 * (r * r)) << endl;
}
| [] | 772,983 | 772,984 | u646148705 | cpp |
p02969 | #include <bits/stdc++.h>
#define N
using namespace std;
bool cur1;
int n;
inline void Rd(int &res) {
char c;
res = 0;
while (c = getchar(), c < 48)
;
do
res = (res << 3) + (res << 1) + (c ^ 48);
while (c = getchar(), c > 47);
return;
}
bool cur2;
int main() {
// printf("%lf MB\n",(&cur2-&cur1)/1024.0/1024);
Rd(n);
printf("%lld\n", 1ll * 3 * n * n * n);
return 0;
} | #include <bits/stdc++.h>
#define N
using namespace std;
bool cur1;
int n;
inline void Rd(int &res) {
char c;
res = 0;
while (c = getchar(), c < 48)
;
do
res = (res << 3) + (res << 1) + (c ^ 48);
while (c = getchar(), c > 47);
return;
}
bool cur2;
int main() {
// printf("%lf MB\n",(&cur2-&cur1)/1024.0/1024);
Rd(n);
printf("%lld\n", 1ll * 3 * n * n);
return 0;
} | [
"expression.operation.binary.remove"
] | 772,994 | 772,995 | u264225633 | cpp |
p02969 | #include <bits/stdc++.h>
using namespace std;
int main() {
int r;
cin >> r;
int answer = 3 * r * r * r;
cout << answer << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int r;
cin >> r;
int answer = 3 * r * r;
cout << answer << endl;
}
| [
"expression.operation.binary.remove"
] | 772,996 | 772,997 | u273355214 | cpp |
p02969 | #include <bits/stdc++.h>
#include <math.h>
#include <sstream>
#include <string>
using namespace std;
#define endl "\n"
#define fastio \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
// STANDARD DATA TYPES
#define ll long long
#define llu unsigned long long
#define ld long double
// ADV DATA TYPES
#define pii pair<int, int>
#define pll pair<ll, ll>
#define mp make_pair
#define ff first
#define ss second
// C 9/++ DS
#define vi vector<int>
#define vll vector<ll>
#define pb push_back
#define pf push_front
#define iter ::iterator
#define all(x) x.begin(), x.end()
// priority_queue < pii, vector < pii >, greater < pii > > pq;
// lower_bound(v.begin(),v.end(),20);//for any sorted container
// CONSTANTS
#define MOD 998244353
#define INF 0x3f3f3f3f
#define MAXN (int)(2e4 + 20)
#define fori(i, n) for (int i = 0; i < n; i++)
#define forl(i, n) for (ll i = 0; i < n; i++)
// MOD OPERATIONS
inline ll fpow(ll n, ll k, int p = MOD) {
ll r = 1;
for (; k; k >>= 1) {
if (k & 1)
r = r * n % p;
n = n * n % p;
}
return r;
}
inline ll inv(ll a, ll p = MOD) { return fpow(a, p - 2, p); }
inline ll addmod(ll a, ll val, ll p = MOD) {
{
if ((a = (a + val)) >= p)
a -= p;
}
return a;
}
inline ll submod(ll a, ll val, ll p = MOD) {
{
if ((a = (a - val)) < 0)
a += p;
}
return a;
}
inline ll mult(ll a, ll b, ll p = MOD) { return (ll)a * b % p; }
const llu int_max = pow(2, 32) - 1;
bool compare(const pair<int, int> &i, const pair<int, int> &j) {
return i.ff < j.ff;
}
int main() {
fastio int r;
cin >> r;
cout << 3 * r * r / 2;
}
| #include <bits/stdc++.h>
#include <math.h>
#include <sstream>
#include <string>
using namespace std;
#define endl "\n"
#define fastio \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
// STANDARD DATA TYPES
#define ll long long
#define llu unsigned long long
#define ld long double
// ADV DATA TYPES
#define pii pair<int, int>
#define pll pair<ll, ll>
#define mp make_pair
#define ff first
#define ss second
// C 9/++ DS
#define vi vector<int>
#define vll vector<ll>
#define pb push_back
#define pf push_front
#define iter ::iterator
#define all(x) x.begin(), x.end()
// priority_queue < pii, vector < pii >, greater < pii > > pq;
// lower_bound(v.begin(),v.end(),20);//for any sorted container
// CONSTANTS
#define MOD 998244353
#define INF 0x3f3f3f3f
#define MAXN (int)(2e4 + 20)
#define fori(i, n) for (int i = 0; i < n; i++)
#define forl(i, n) for (ll i = 0; i < n; i++)
// MOD OPERATIONS
inline ll fpow(ll n, ll k, int p = MOD) {
ll r = 1;
for (; k; k >>= 1) {
if (k & 1)
r = r * n % p;
n = n * n % p;
}
return r;
}
inline ll inv(ll a, ll p = MOD) { return fpow(a, p - 2, p); }
inline ll addmod(ll a, ll val, ll p = MOD) {
{
if ((a = (a + val)) >= p)
a -= p;
}
return a;
}
inline ll submod(ll a, ll val, ll p = MOD) {
{
if ((a = (a - val)) < 0)
a += p;
}
return a;
}
inline ll mult(ll a, ll b, ll p = MOD) { return (ll)a * b % p; }
const llu int_max = pow(2, 32) - 1;
bool compare(const pair<int, int> &i, const pair<int, int> &j) {
return i.ff < j.ff;
}
int main() {
fastio int r;
cin >> r;
cout << 3 * r * r;
}
| [
"expression.operation.binary.remove"
] | 772,998 | 772,999 | u806556718 | cpp |
p02969 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORD(i, a, b) for (ll i = (a); i >= (b); i--)
#define pb push_back
int main() {
ll r;
cout << 3 * r * r;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORD(i, a, b) for (ll i = (a); i >= (b); i--)
#define pb push_back
int main() {
ll r;
cin >> r;
cout << 3 * r * r;
return 0;
} | [] | 773,000 | 773,001 | u927396071 | cpp |
p02969 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = int(1e8) + 7;
void init() {}
void solve() {
int a;
scanf("%d", &a);
printf("%d\n", a * a * a * 3);
}
const bool mtc = false;
int main() {
int t;
if (mtc) {
scanf("%d", &t);
while (t--)
solve();
} else
solve();
}
| #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = int(1e8) + 7;
void init() {}
void solve() {
int a;
scanf("%d", &a);
printf("%d\n", a * a * 3);
}
const bool mtc = false;
int main() {
int t;
if (mtc) {
scanf("%d", &t);
while (t--)
solve();
} else
solve();
}
| [
"expression.operation.binary.remove"
] | 773,017 | 773,018 | u800645121 | cpp |
p02969 | #include <bits/stdc++.h>
using namespace std;
int main() {
int r;
cin >> r;
cout << 2 * r * r;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int r;
cin >> r;
cout << 3 * r * r;
} | [
"literal.number.change",
"io.output.change"
] | 773,019 | 773,020 | u183131551 | cpp |
p02969 | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
typedef long long ll;
typedef pair<int, int> pint;
typedef vector<int> vint;
#define MSG(a) cout << #a << " " << a << "\n";
int main() {
int r;
cin >> r;
cout << 4 * r * r << "\n";
} | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
typedef long long ll;
typedef pair<int, int> pint;
typedef vector<int> vint;
#define MSG(a) cout << #a << " " << a << "\n";
int main() {
int r;
cin >> r;
cout << 3 * r * r << "\n";
} | [
"literal.number.change",
"io.output.change"
] | 773,021 | 773,022 | u547748135 | cpp |
p02969 | #include <iostream>
using namespace std;
int main() {
int r = 0;
cin >> r;
int s = 0;
s = 3 * r * r * r;
cout << s << endl;
return 0;
} | #include <iostream>
using namespace std;
int main() {
int r = 0;
cin >> r;
int s = 0;
s = 3 * r * r;
cout << s << endl;
return 0;
} | [
"expression.operation.binary.remove"
] | 773,042 | 773,043 | u830087664 | cpp |
p02969 | #include <iostream>
using namespace std;
int main() {
int r;
cin >> r;
cout << 3 * (r ^ 2) << endl;
return 0;
} | #include <iostream>
using namespace std;
int main() {
int r;
cin >> r;
cout << 3 * r * r << endl;
return 0;
} | [] | 773,048 | 773,049 | u323966851 | cpp |
p02969 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(void) {
int a;
cin >> a;
cout << pow(a, 3) * 3 << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(void) {
int a;
cin >> a;
cout << pow(a, 2) * 3 << endl;
return 0;
} | [
"literal.number.change",
"io.output.change"
] | 773,056 | 773,057 | u030848580 | cpp |
p02969 | //*INDENT-OFF*
#include <bits/stdc++.h>
using namespace std;
template <typename V> bool tomin(V &x, V y) {
if (y < x) {
x = y;
return true;
}
return false;
}
template <typename V> bool tomax(V &x, V y) {
if (x < y) {
x = y;
return true;
}
return false;
}
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> PII;
#pragma GCC optimize(3)
#define lowbit(x) ((x) & -(x))
//*INDENT-ON*
int main() {
ll a;
cin >> a;
cout << a * a * 4 << endl;
return 0;
} | //*INDENT-OFF*
#include <bits/stdc++.h>
using namespace std;
template <typename V> bool tomin(V &x, V y) {
if (y < x) {
x = y;
return true;
}
return false;
}
template <typename V> bool tomax(V &x, V y) {
if (x < y) {
x = y;
return true;
}
return false;
}
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> PII;
#pragma GCC optimize(3)
#define lowbit(x) ((x) & -(x))
//*INDENT-ON*
int main() {
ll a;
cin >> a;
cout << a * a * 3 << endl;
return 0;
} | [
"literal.number.change",
"io.output.change"
] | 773,061 | 773,062 | u613623257 | cpp |
p02969 | #include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define rep(i, n) for (auto i = 0; i < (n); i++)
#define rep1(i, n) for (auto i = 1; i <= (n); i++)
#define all(x) (x).begin(), (x).end()
using namespace std;
struct init {
init() {
cin.tie(0);
ios::sync_with_stdio(0);
cout << fixed << setprecision(20);
};
} aaaaaaa;
int main() {
ll r;
cout << 3 * r * r << endl;
return 0;
}
| #include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define rep(i, n) for (auto i = 0; i < (n); i++)
#define rep1(i, n) for (auto i = 1; i <= (n); i++)
#define all(x) (x).begin(), (x).end()
using namespace std;
struct init {
init() {
cin.tie(0);
ios::sync_with_stdio(0);
cout << fixed << setprecision(20);
};
} aaaaaaa;
int main() {
ll r;
cin >> r;
cout << 3 * r * r << endl;
return 0;
}
| [] | 773,063 | 773,064 | u779159595 | cpp |
p02969 | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
int main() {
int r;
int s;
cin >> r;
cout << 3 * r + r;
} | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
int main() {
int r;
int s;
cin >> r;
cout << 3 * r * r;
} | [
"expression.operator.arithmetic.change",
"io.output.change"
] | 773,067 | 773,068 | u941705222 | cpp |
p02969 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll a;
cin >> a;
cout << 3 * a * a * a << endl;
} | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll a;
cin >> a;
cout << 3 * a * a << endl;
}
| [
"expression.operation.binary.remove"
] | 773,069 | 773,070 | u330689597 | cpp |
p02969 | #pragma comment(linker, "/stack:247474112")
#pragma GCC optimize("Ofast")
#include "bits/stdc++.h"
using namespace std;
#define IOS ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define int long long
#define ends ' '
#define endl '\n'
#define pb emplace_back
#define x first
#define y second
#define pii pair<int, int>
#define sz(x) (int)(x).size()
int32_t main() {
// #ifndef ONLINE_JUDGE
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
// #endif
IOS;
int n;
cin >> n;
cout << 2 * n * n;
return 0;
} | #pragma comment(linker, "/stack:247474112")
#pragma GCC optimize("Ofast")
#include "bits/stdc++.h"
using namespace std;
#define IOS ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define int long long
#define ends ' '
#define endl '\n'
#define pb emplace_back
#define x first
#define y second
#define pii pair<int, int>
#define sz(x) (int)(x).size()
int32_t main() {
// #ifndef ONLINE_JUDGE
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
// #endif
IOS;
int n;
cin >> n;
cout << 3 * n * n;
return 0;
} | [
"literal.number.change",
"io.output.change"
] | 773,071 | 773,072 | u845159850 | cpp |
p02969 | #include <bits/stdc++.h>
#define ___ \
ios::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(0);
#define endl '\n'
#define pii pair<int, int>
#define MAX INT_MAX
#pragma GCC optimize("Ofast")
#define int long long
const int MOD = (1e9 + 7);
using namespace std;
#define vvi vector<vector<int>>
const int mod = 998244353;
signed main() {
___ int r;
cout << 3 * r * r << endl;
}
| #include <bits/stdc++.h>
#define ___ \
ios::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(0);
#define endl '\n'
#define pii pair<int, int>
#define MAX INT_MAX
#pragma GCC optimize("Ofast")
#define int long long
const int MOD = (1e9 + 7);
using namespace std;
#define vvi vector<vector<int>>
const int mod = 998244353;
signed main() {
___ int r;
cin >> r;
cout << 3 * r * r << endl;
}
| [] | 773,077 | 773,078 | u699580536 | cpp |
p02970 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL << 62
#define inf 1000000007
int main() {
ll n, d;
cin >> n >> d;
d = d * 2 + 1;
cout << (n + d + 1) / d;
// your code goes here
return 0;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL << 62
#define inf 1000000007
int main() {
ll n, d;
cin >> n >> d;
d = d * 2 + 1;
cout << (n + d - 1) / d;
// your code goes here
return 0;
} | [
"misc.opposites",
"expression.operator.arithmetic.change",
"io.output.change"
] | 773,087 | 773,088 | u166378830 | cpp |
p02970 | #include <bits/stdc++.h>
#define lld long long int
#define vec vector<lld>
#define pll pair<lld, lld>
#define pb push_back
#define ss second
#define ff first
#define mp make_pair
#define mod 1000000007
#define answer cout << endl << "answer : ";
#define maxn 100005
#define messi \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
using namespace std;
int main() {
messi lld t = 1; // cin>>t;
while (t--) {
lld n = 0, m = 0, k = 0, i = 0, j = 0, p = 0, q = 0, x = 0, y = 0, z = 0,
ans = 0, cnt = 0;
string s;
bool flag = false;
cin >> n >> x;
x = 2 * x + 1;
ans = (n + (x - 1)) / 2;
cout << ans << endl;
}
return 0;
}
/* CODED BY:-
________________________________________
| __ __ |
| /\ /\ |__) /\ | \ |__| \ / /\ |
| /~~\ /~~\ | \ /~~\ |__/ | | | /~~\ |
|________________________________________|
*/
| #include <bits/stdc++.h>
#define lld long long int
#define vec vector<lld>
#define pll pair<lld, lld>
#define pb push_back
#define ss second
#define ff first
#define mp make_pair
#define mod 1000000007
#define answer cout << endl << "answer : ";
#define maxn 100005
#define messi \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
using namespace std;
int main() {
messi lld t = 1; // cin>>t;
while (t--) {
lld n = 0, m = 0, k = 0, i = 0, j = 0, p = 0, q = 0, x = 0, y = 0, z = 0,
ans = 0, cnt = 0;
string s;
bool flag = false;
cin >> n >> x;
x = 2 * x + 1;
ans = (n + (x - 1)) / x;
cout << ans << endl;
}
return 0;
}
/* CODED BY:-
________________________________________
| __ __ |
| /\ /\ |__) /\ | \ |__| \ / /\ |
| /~~\ /~~\ | \ /~~\ |__/ | | | /~~\ |
|________________________________________|
*/
| [
"assignment.value.change",
"identifier.replace.add",
"literal.replace.remove",
"expression.operation.binary.change"
] | 773,109 | 773,110 | u606883845 | cpp |
p02970 | #include <bits/stdc++.h>
#define lld long long int
#define vec vector<lld>
#define pll pair<lld, lld>
#define pb push_back
#define ss second
#define ff first
#define mp make_pair
#define mod 1000000007
#define answer cout << endl << "answer : ";
#define maxn 100005
#define messi \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
using namespace std;
int main() {
messi lld t = 1; // cin>>t;
while (t--) {
lld n = 0, m = 0, k = 0, i = 0, j = 0, p = 0, q = 0, x = 0, y = 0, z = 0,
ans = 0, cnt = 0;
string s;
bool flag = false;
cin >> n >> x;
x = 2 * x;
ans = (n + (x - 1)) / 2;
cout << ans << endl;
}
return 0;
}
/* CODED BY:-
________________________________________
| __ __ |
| /\ /\ |__) /\ | \ |__| \ / /\ |
| /~~\ /~~\ | \ /~~\ |__/ | | | /~~\ |
|________________________________________|
*/
| #include <bits/stdc++.h>
#define lld long long int
#define vec vector<lld>
#define pll pair<lld, lld>
#define pb push_back
#define ss second
#define ff first
#define mp make_pair
#define mod 1000000007
#define answer cout << endl << "answer : ";
#define maxn 100005
#define messi \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
using namespace std;
int main() {
messi lld t = 1; // cin>>t;
while (t--) {
lld n = 0, m = 0, k = 0, i = 0, j = 0, p = 0, q = 0, x = 0, y = 0, z = 0,
ans = 0, cnt = 0;
string s;
bool flag = false;
cin >> n >> x;
x = 2 * x + 1;
ans = (n + (x - 1)) / x;
cout << ans << endl;
}
return 0;
}
/* CODED BY:-
________________________________________
| __ __ |
| /\ /\ |__) /\ | \ |__| \ / /\ |
| /~~\ /~~\ | \ /~~\ |__/ | | | /~~\ |
|________________________________________|
*/
| [
"assignment.change",
"assignment.value.change",
"identifier.replace.add",
"literal.replace.remove",
"expression.operation.binary.change"
] | 773,111 | 773,110 | u606883845 | cpp |
p02970 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, d, a;
cin >> n >> d;
a = d * 2 + 1;
cout << ceil(n / a) << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
double n, d, a;
cin >> n >> d;
a = d * 2 + 1;
cout << ceil(n / a) << endl;
}
| [
"variable_declaration.type.primitive.change"
] | 773,114 | 773,115 | u264265458 | cpp |
p02970 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int n, d;
cin >> n >> d;
int range = 2 * d + 1;
cout << n + (range - 1) / range << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int n, d;
cin >> n >> d;
int range = 2 * d + 1;
cout << (n + (range - 1)) / range << endl;
return 0;
}
| [] | 773,152 | 773,153 | u442855610 | cpp |
p02970 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int n, d;
cin >> n >> d;
int uni_range = d * 2 + 1;
cout << n + (uni_range - 1) / uni_range << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int n, d;
cin >> n >> d; // 6 2
int uni_range = d * 2 + 1; // 2*2+1=5
cout << (n + (uni_range - 1)) / uni_range << endl; //(6+4)/5=2
return 0;
}
| [] | 773,154 | 773,155 | u442855610 | cpp |
p02970 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int n, d;
cin >> n >> d;
cout << ceil(n / (1 + d * 2)) << endl;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int n, d;
cin >> n >> d;
cout << ceil((double)n / (1 + d * 2)) << endl;
} | [
"type_conversion.add"
] | 773,158 | 773,159 | u582684800 | cpp |
p02970 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define pf push_front
#define all(t) t.begin(), t.end()
#define inrange(i, a, b) (((i) >= min((a), (b))) && ((i) <= max((a), (b))))
typedef vector<ll> vi;
#define fi first
#define se second
#define show(x) cout << #x << " is " << x << "\n";
const ll inf = 9e18;
const ll mod = 1e9 + 7;
const ld pi = 3.141592653589793238462643383279502884;
void print(ll a[], ll n) {
for (ll i = 0; i < n; i++) {
cout << a[i] << " ";
}
cout << "\n";
}
ll power(ll x, ll y, ll M = inf) {
if (y <= 0)
return 1;
ll ans = 1;
x %= M;
while (y) {
if (y & 1)
ans = (x * ans) % M;
x = (x * x) % M;
y >>= 1;
}
return ans;
}
ll modInverse(ll n) { return power(n, mod - 2, mod); }
inline ll mul(ll a, ll b) { return (a * b) % mod; }
inline ll sub(ll a, ll b) {
ll c = a - b;
if (c < 0)
c += mod;
return c;
}
inline ll add(ll a, ll b) {
ll c = a + b;
if (c > mod)
c -= mod;
return c;
}
inline ll divi(ll a, ll b) { return mul(a, modInverse(b)); }
//------------------------------------------------------------------------------------------
// const ll N = 1e5 + 1;
// vector<ll> adj[N];
// bool visited[N];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cout << fixed << setprecision(10);
ll n, d;
cin >> n >> d;
cout << (n + 2 * d - 1) / (2 * d);
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define pf push_front
#define all(t) t.begin(), t.end()
#define inrange(i, a, b) (((i) >= min((a), (b))) && ((i) <= max((a), (b))))
typedef vector<ll> vi;
#define fi first
#define se second
#define show(x) cout << #x << " is " << x << "\n";
const ll inf = 9e18;
const ll mod = 1e9 + 7;
const ld pi = 3.141592653589793238462643383279502884;
void print(ll a[], ll n) {
for (ll i = 0; i < n; i++) {
cout << a[i] << " ";
}
cout << "\n";
}
ll power(ll x, ll y, ll M = inf) {
if (y <= 0)
return 1;
ll ans = 1;
x %= M;
while (y) {
if (y & 1)
ans = (x * ans) % M;
x = (x * x) % M;
y >>= 1;
}
return ans;
}
ll modInverse(ll n) { return power(n, mod - 2, mod); }
inline ll mul(ll a, ll b) { return (a * b) % mod; }
inline ll sub(ll a, ll b) {
ll c = a - b;
if (c < 0)
c += mod;
return c;
}
inline ll add(ll a, ll b) {
ll c = a + b;
if (c > mod)
c -= mod;
return c;
}
inline ll divi(ll a, ll b) { return mul(a, modInverse(b)); }
//------------------------------------------------------------------------------------------
// const ll N = 1e5 + 1;
// vector<ll> adj[N];
// bool visited[N];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cout << fixed << setprecision(10);
ll n, d;
cin >> n >> d;
cout << (n + 2 * d) / (2 * d + 1);
return 0;
}
| [
"expression.operation.binary.remove"
] | 773,163 | 773,164 | u177497208 | cpp |
p02970 | #include <algorithm>
#include <iostream>
#include <math.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define Rep(i, s, n) for (int i = (int)s; i < (int)n; i++)
typedef long long ll;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n, d;
cin >> n >> d;
cout << ceil((double)n / (2 * d)) << endl;
} | #include <algorithm>
#include <iostream>
#include <math.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define Rep(i, s, n) for (int i = (int)s; i < (int)n; i++)
typedef long long ll;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n, d;
cin >> n >> d;
cout << ceil((double)n / (2 * d + 1)) << endl;
} | [
"expression.operation.binary.add"
] | 773,182 | 773,183 | u154465766 | cpp |
p02970 | #include <bits/stdc++.h>
#define lp(i, a, b) for (int i = a; i < b; i++)
#define ll long long
#define ff first
#define ss second
using namespace std;
void goldenApple() {
int n, d;
cin >> n >> d;
cout << ceil(n / (2 * d + 1));
}
int main() { goldenApple(); } | #include <bits/stdc++.h>
#define lp(i, a, b) for (int i = a; i < b; i++)
#define ll long long
#define ff first
#define ss second
using namespace std;
void goldenApple() {
double n, d;
cin >> n >> d;
cout << ceil(n / (2 * d + 1));
}
int main() { goldenApple(); } | [
"variable_declaration.type.primitive.change"
] | 773,186 | 773,187 | u018679195 | cpp |
p02970 | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
int n, d;
cin >> n >> d;
int now = 1;
int ans = 0;
while (now < n) {
now += 2 * d + 1;
ans++;
}
cout << ans << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
int n, d;
cin >> n >> d;
int now = 0;
int ans = 0;
while (now < n) {
now += 2 * d + 1;
ans++;
}
cout << ans << endl;
return 0;
}
| [
"literal.number.change",
"variable_declaration.value.change"
] | 773,211 | 773,212 | u008040394 | cpp |
p02970 | #include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i, n) for (int i = 0, i##_len = (int)(n); i < i##_len; i++)
#define reps(i, n) for (int i = 1, i##_len = (int)(n); i <= i##_len; i++)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define repi(i, x) \
for (auto i = (x).begin(), i##_fin = (x).end(); i != i##_fin; i++)
#define all(x) (x).begin(), (x).end()
#define input(array) \
repi(array##_itr, array) { cin >> *(array##_itr); }
#define F first
#define S second
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
string solve(bool a) { return ((a) ? "Yes" : "No"); }
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef pair<int, int> Pi;
typedef vector<Pi> VPi;
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long, long long> P;
typedef vector<P> VP;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
const long long INFLL = 1LL << 60;
const int INF = 1 << 30;
const double PI = acos(-1);
int main() {
int n, d;
int ans = 0;
cin >> n >> d;
cout << (n + 2 * d - 1) / (2 * d) << endl;
} | #include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i, n) for (int i = 0, i##_len = (int)(n); i < i##_len; i++)
#define reps(i, n) for (int i = 1, i##_len = (int)(n); i <= i##_len; i++)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define repi(i, x) \
for (auto i = (x).begin(), i##_fin = (x).end(); i != i##_fin; i++)
#define all(x) (x).begin(), (x).end()
#define input(array) \
repi(array##_itr, array) { cin >> *(array##_itr); }
#define F first
#define S second
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
string solve(bool a) { return ((a) ? "Yes" : "No"); }
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef pair<int, int> Pi;
typedef vector<Pi> VPi;
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long, long long> P;
typedef vector<P> VP;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
const long long INFLL = 1LL << 60;
const int INF = 1 << 30;
const double PI = acos(-1);
int main() {
int n, d;
int ans = 0;
cin >> n >> d;
cout << (n + 2 * d) / (2 * d + 1) << endl;
} | [
"expression.operation.binary.remove"
] | 773,216 | 773,217 | u179778090 | cpp |
p02970 | #pragma GCC target("avx")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <time.h>
#include <tuple>
#include <unordered_map>
#include <vector>
using namespace std;
using ll = long long;
using ld = long double;
#define int long long
#define all(a) (a).begin(), (a).end()
#define fs first
#define sc second
#define xx first
#define yy second.first
#define zz second.second
#define H pair<int, int>
#define P pair<int, pair<int, int>>
#define Q(i, j, k) mkp(i, mkp(j, k))
#define rng(i, s, n) for (int i = (s); i < (n); i++)
#define rep(i, n) rng(i, 0, (n))
#define mkp make_pair
#define vec vector
#define vi vec<int>
#define pb emplace_back
#define siz(a) (int)(a).size()
#define crdcomp(b) \
sort(all((b))); \
(b).erase(unique(all((b))), (b).end())
#define getidx(b, i) (lower_bound(all(b), (i)) - (b).begin())
#define ssp(i, n) (i == (int)(n)-1 ? "\n" : " ")
#define ctoi(c) (int)(c - '0')
#define itoc(c) (char)(c + '0')
#define cyes printf("Yes\n")
#define cno printf("No\n")
#define cdf(n) \
int quetimes_ = (n); \
rep(qq123_, quetimes_)
#define gcj printf("Case #%lld: ", qq123_ + 1)
#define readv(a, n) \
a.resize(n, 0); \
rep(i, (n)) a[i] = read()
#define found(a, x) (a.find(x) != a.end())
//#define endl "\n"
constexpr int mod = (ll)1e9 + 7;
constexpr int Mod = 998244353;
constexpr ld EPS = 1e-10;
constexpr ll inf = (ll)3 * 1e18;
constexpr int Inf = (ll)15 * 1e8;
constexpr int dx[] = {-1, 1, 0, 0}, dy[] = {0, 0, -1, 1};
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return 1;
}
return 0;
}
ll read() {
ll u, k = scanf("%lld", &u);
return u;
}
string reads() {
string s;
cin >> s;
return s;
}
H readh(short g = 0) {
H u;
int k = scanf("%lld %lld", &u.fs, &u.sc);
if (g == 1)
u.fs--, u.sc--;
if (g == 2)
u.fs--;
return u;
}
bool ina(H t, int h, int w) {
return 0 <= t.fs && t.fs < h && 0 <= t.sc && t.sc < w;
}
bool ina(int t, int l, int r) { return l <= t && t < r; }
ll gcd(ll i, ll j) { return j ? gcd(j, i % j) : i; }
ll popcount(ll x) {
int sum = 0;
for (int i = 0; i < 60; i++)
if ((1ll << i) & x)
sum++;
return sum;
}
template <typename T> class csum {
vec<T> v;
public:
csum(vec<T> &a) : v(a) { build(); }
csum() {}
void init(vec<T> &a) {
v = a;
build();
}
void build() {
for (int i = 1; i < v.size(); i++)
v[i] += v[i - 1];
}
T a(int l, int r) {
if (r < l)
return 0;
return v[r] - (l == 0 ? 0 : v[l - 1]);
} //[l,r]
T b(int l, int r) { return a(l, r - 1); } //[l,r)
T a(pair<int, int> t) { return a(t.first, t.second); }
T b(pair<int, int> t) { return b(t.first, t.second); }
};
class mint {
public:
ll v;
mint(ll v = 0) { s(v % mod + mod); }
constexpr static int mod = (ll)1e9 + 7;
constexpr static int fn_ = (ll)2e6 + 5;
static mint fact[fn_], comp[fn_];
mint pow(int x) const {
mint b(v), c(1);
while (x) {
if (x & 1)
c *= b;
b *= b;
x >>= 1;
}
return c;
}
inline mint &s(int vv) {
v = vv < mod ? vv : vv - mod;
return *this;
}
inline mint inv() const { return pow(mod - 2); }
inline mint operator-() const { return mint() - *this; }
inline mint &operator+=(const mint b) { return s(v + b.v); }
inline mint &operator-=(const mint b) { return s(v + mod - b.v); }
inline mint &operator*=(const mint b) {
v = v * b.v % mod;
return *this;
}
inline mint &operator/=(const mint b) {
v = v * b.inv().v % mod;
return *this;
}
inline mint operator+(const mint b) const { return mint(v) += b; }
inline mint operator-(const mint b) const { return mint(v) -= b; }
inline mint operator*(const mint b) const { return mint(v) *= b; }
inline mint operator/(const mint b) const { return mint(v) /= b; }
friend ostream &operator<<(ostream &os, const mint &m) { return os << m.v; }
friend istream &operator>>(istream &is, mint &m) {
int x;
is >> x;
m = mint(x);
return is;
}
bool operator<(const mint &r) const { return v < r.v; }
bool operator>(const mint &r) const { return v > r.v; }
bool operator<=(const mint &r) const { return v <= r.v; }
bool operator>=(const mint &r) const { return v >= r.v; }
bool operator==(const mint &r) const { return v == r.v; }
bool operator!=(const mint &r) const { return v != r.v; }
explicit operator bool() const { return v; }
explicit operator int() const { return v; }
mint comb(mint k) {
if (k > *this)
return mint();
if (!fact[0])
combinit();
if (v >= fn_) {
if (k > *this - k)
k = *this - k;
mint tmp(1);
for (int i = v; i >= v - k.v + 1; i--)
tmp *= mint(i);
return tmp * comp[k.v];
}
return fact[v] * comp[k.v] * comp[v - k.v];
} // nCk
mint perm(mint k) {
if (k > *this)
return mint();
if (!fact[0])
combinit();
if (v >= fn_) {
mint tmp(1);
for (int i = v; i >= v - k.v + 1; i--)
tmp *= mint(i);
return tmp;
}
return fact[v] * comp[v - k.v];
} // nPk
static void combinit() {
fact[0] = 1;
for (int i = 1; i < fn_; i++)
fact[i] = fact[i - 1] * mint(i);
comp[fn_ - 1] = fact[fn_ - 1].inv();
for (int i = fn_ - 2; i >= 0; i--)
comp[i] = comp[i + 1] * mint(i + 1);
}
};
mint mint::fact[fn_], mint::comp[fn_];
//--------------------------------------------------------------
//---------------------------------------------------------------------
signed main() {
int n, d;
cin >> n >> d;
cout << (n + 2 * d - 1) / (2 * d) << endl;
} | #pragma GCC target("avx")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <time.h>
#include <tuple>
#include <unordered_map>
#include <vector>
using namespace std;
using ll = long long;
using ld = long double;
#define int long long
#define all(a) (a).begin(), (a).end()
#define fs first
#define sc second
#define xx first
#define yy second.first
#define zz second.second
#define H pair<int, int>
#define P pair<int, pair<int, int>>
#define Q(i, j, k) mkp(i, mkp(j, k))
#define rng(i, s, n) for (int i = (s); i < (n); i++)
#define rep(i, n) rng(i, 0, (n))
#define mkp make_pair
#define vec vector
#define vi vec<int>
#define pb emplace_back
#define siz(a) (int)(a).size()
#define crdcomp(b) \
sort(all((b))); \
(b).erase(unique(all((b))), (b).end())
#define getidx(b, i) (lower_bound(all(b), (i)) - (b).begin())
#define ssp(i, n) (i == (int)(n)-1 ? "\n" : " ")
#define ctoi(c) (int)(c - '0')
#define itoc(c) (char)(c + '0')
#define cyes printf("Yes\n")
#define cno printf("No\n")
#define cdf(n) \
int quetimes_ = (n); \
rep(qq123_, quetimes_)
#define gcj printf("Case #%lld: ", qq123_ + 1)
#define readv(a, n) \
a.resize(n, 0); \
rep(i, (n)) a[i] = read()
#define found(a, x) (a.find(x) != a.end())
//#define endl "\n"
constexpr int mod = (ll)1e9 + 7;
constexpr int Mod = 998244353;
constexpr ld EPS = 1e-10;
constexpr ll inf = (ll)3 * 1e18;
constexpr int Inf = (ll)15 * 1e8;
constexpr int dx[] = {-1, 1, 0, 0}, dy[] = {0, 0, -1, 1};
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return 1;
}
return 0;
}
ll read() {
ll u, k = scanf("%lld", &u);
return u;
}
string reads() {
string s;
cin >> s;
return s;
}
H readh(short g = 0) {
H u;
int k = scanf("%lld %lld", &u.fs, &u.sc);
if (g == 1)
u.fs--, u.sc--;
if (g == 2)
u.fs--;
return u;
}
bool ina(H t, int h, int w) {
return 0 <= t.fs && t.fs < h && 0 <= t.sc && t.sc < w;
}
bool ina(int t, int l, int r) { return l <= t && t < r; }
ll gcd(ll i, ll j) { return j ? gcd(j, i % j) : i; }
ll popcount(ll x) {
int sum = 0;
for (int i = 0; i < 60; i++)
if ((1ll << i) & x)
sum++;
return sum;
}
template <typename T> class csum {
vec<T> v;
public:
csum(vec<T> &a) : v(a) { build(); }
csum() {}
void init(vec<T> &a) {
v = a;
build();
}
void build() {
for (int i = 1; i < v.size(); i++)
v[i] += v[i - 1];
}
T a(int l, int r) {
if (r < l)
return 0;
return v[r] - (l == 0 ? 0 : v[l - 1]);
} //[l,r]
T b(int l, int r) { return a(l, r - 1); } //[l,r)
T a(pair<int, int> t) { return a(t.first, t.second); }
T b(pair<int, int> t) { return b(t.first, t.second); }
};
class mint {
public:
ll v;
mint(ll v = 0) { s(v % mod + mod); }
constexpr static int mod = (ll)1e9 + 7;
constexpr static int fn_ = (ll)2e6 + 5;
static mint fact[fn_], comp[fn_];
mint pow(int x) const {
mint b(v), c(1);
while (x) {
if (x & 1)
c *= b;
b *= b;
x >>= 1;
}
return c;
}
inline mint &s(int vv) {
v = vv < mod ? vv : vv - mod;
return *this;
}
inline mint inv() const { return pow(mod - 2); }
inline mint operator-() const { return mint() - *this; }
inline mint &operator+=(const mint b) { return s(v + b.v); }
inline mint &operator-=(const mint b) { return s(v + mod - b.v); }
inline mint &operator*=(const mint b) {
v = v * b.v % mod;
return *this;
}
inline mint &operator/=(const mint b) {
v = v * b.inv().v % mod;
return *this;
}
inline mint operator+(const mint b) const { return mint(v) += b; }
inline mint operator-(const mint b) const { return mint(v) -= b; }
inline mint operator*(const mint b) const { return mint(v) *= b; }
inline mint operator/(const mint b) const { return mint(v) /= b; }
friend ostream &operator<<(ostream &os, const mint &m) { return os << m.v; }
friend istream &operator>>(istream &is, mint &m) {
int x;
is >> x;
m = mint(x);
return is;
}
bool operator<(const mint &r) const { return v < r.v; }
bool operator>(const mint &r) const { return v > r.v; }
bool operator<=(const mint &r) const { return v <= r.v; }
bool operator>=(const mint &r) const { return v >= r.v; }
bool operator==(const mint &r) const { return v == r.v; }
bool operator!=(const mint &r) const { return v != r.v; }
explicit operator bool() const { return v; }
explicit operator int() const { return v; }
mint comb(mint k) {
if (k > *this)
return mint();
if (!fact[0])
combinit();
if (v >= fn_) {
if (k > *this - k)
k = *this - k;
mint tmp(1);
for (int i = v; i >= v - k.v + 1; i--)
tmp *= mint(i);
return tmp * comp[k.v];
}
return fact[v] * comp[k.v] * comp[v - k.v];
} // nCk
mint perm(mint k) {
if (k > *this)
return mint();
if (!fact[0])
combinit();
if (v >= fn_) {
mint tmp(1);
for (int i = v; i >= v - k.v + 1; i--)
tmp *= mint(i);
return tmp;
}
return fact[v] * comp[v - k.v];
} // nPk
static void combinit() {
fact[0] = 1;
for (int i = 1; i < fn_; i++)
fact[i] = fact[i - 1] * mint(i);
comp[fn_ - 1] = fact[fn_ - 1].inv();
for (int i = fn_ - 2; i >= 0; i--)
comp[i] = comp[i + 1] * mint(i + 1);
}
};
mint mint::fact[fn_], mint::comp[fn_];
//--------------------------------------------------------------
//---------------------------------------------------------------------
signed main() {
int n, d;
cin >> n >> d;
cout << (n + 2 * d) / (2 * d + 1) << endl;
} | [
"expression.operation.binary.remove"
] | 773,230 | 773,231 | u811004127 | cpp |
p02970 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, D;
cin >> N >> D;
cout << (N + (D * 2 + 1) - 1) / (D * 2 - 1) << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, D;
cin >> N >> D;
cout << (N + (D * 2 + 1) - 1) / (D * 2 + 1) << endl;
}
| [
"misc.opposites",
"expression.operator.arithmetic.change",
"io.output.change"
] | 773,286 | 773,287 | u237390401 | cpp |
p02970 | #include <iostream>
using namespace std;
int main(void) {
int n, d;
cin >> n >> d;
int range = 2 * d - 1;
cout << (n + range - 1) / range;
return 0;
} | #include <iostream>
using namespace std;
int main(void) {
int n, d;
cin >> n >> d;
int range = 2 * d + 1;
cout << (n + range - 1) / range;
return 0;
} | [
"misc.opposites",
"expression.operator.arithmetic.change",
"expression.operation.binary.change"
] | 773,325 | 773,326 | u349165865 | cpp |
p02970 | #include <iostream>
#include <math.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
using namespace std;
int main(void) {
int n, d, count = 0;
cin >> n >> d;
for (int i = n; i > 0; i -= i * 2 + 1) {
count++;
}
cout << count << endl;
}
| #include <iostream>
#include <math.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
using namespace std;
int main(void) {
int n, d, count = 0;
cin >> n >> d;
for (int i = n; i > 0; i -= d * 2 + 1) {
count++;
}
cout << count << endl;
}
| [
"assignment.value.change",
"identifier.change",
"expression.operation.binary.change"
] | 773,327 | 773,328 | u829243466 | cpp |
p02970 | #include <iostream>
#include <math.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
using namespace std;
int main(void) {
int n, d, count = 0;
cin >> n, d;
for (int i = n; i > 0; i -= i * 2 + 1) {
count++;
}
cout << count << endl;
}
| #include <iostream>
#include <math.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
using namespace std;
int main(void) {
int n, d, count = 0;
cin >> n >> d;
for (int i = n; i > 0; i -= d * 2 + 1) {
count++;
}
cout << count << endl;
}
| [
"assignment.value.change",
"identifier.change",
"expression.operation.binary.change"
] | 773,329 | 773,328 | u829243466 | cpp |
p02970 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, d;
cin >> n >> d;
cout << (n + (2 * d - 1) - 1) / (2 * d - 1) << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, d;
cin >> n >> d;
cout << (n + (2 * d + 1) - 1) / (2 * d + 1) << endl;
} | [
"misc.opposites",
"expression.operator.arithmetic.change",
"io.output.change"
] | 773,342 | 773,343 | u371149954 | cpp |
p02970 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define REP(i, n) for (int i = 1; i <= (n); i++)
using ll = long long;
using namespace std;
int main() {
double n, d;
cin >> n >> d;
double ans = ceil(n / (2 * d));
cout << ans << endl;
return 0;
} | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define REP(i, n) for (int i = 1; i <= (n); i++)
using ll = long long;
using namespace std;
int main() {
double n, d;
cin >> n >> d;
double ans = ceil(n / (2 * d + 1));
cout << ans << endl;
return 0;
} | [
"assignment.change"
] | 773,347 | 773,348 | u394244719 | cpp |
p02970 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define enld '\n'
#define rep(i, n) for (int i = 0; i < (n); i++)
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast")
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr ll mod = 1000000007;
constexpr ll mod2 = 998244353;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[6] = {1, 0, -1, 0, 1, -1};
const int dy[6] = {0, 1, 0, -1, 1, -1};
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
// ---------------------------------------------------------------------------
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N, D;
cin >> N >> D;
cout << (N + 2 * D - 1) / (2 * D) << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define enld '\n'
#define rep(i, n) for (int i = 0; i < (n); i++)
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast")
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr ll mod = 1000000007;
constexpr ll mod2 = 998244353;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[6] = {1, 0, -1, 0, 1, -1};
const int dy[6] = {0, 1, 0, -1, 1, -1};
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
// ---------------------------------------------------------------------------
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N, D;
cin >> N >> D;
cout << (N + 2 * D + 1 - 1) / (1 + 2 * D) << endl;
return 0;
} | [
"expression.operation.binary.add"
] | 773,349 | 773,350 | u550014122 | cpp |
p02970 | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
using ll = long long;
int main() {
int n, d, sum = 1, ans = 0;
cin >> n >> d;
while (sum < n) {
sum += 2 * d + 1;
ans++;
}
cout << ans << endl;
return 0;
} | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
using ll = long long;
int main() {
int n, d, sum = 0, ans = 0;
cin >> n >> d;
while (sum < n) {
sum += 2 * d + 1;
ans++;
}
cout << ans << endl;
return 0;
} | [
"literal.number.change",
"variable_declaration.value.change"
] | 773,351 | 773,352 | u155881803 | cpp |
p02964 | #ifdef LOCAL
//#define _GLIBCXX_DEBUG
#endif
//#pragma GCC target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<char> Vc;
typedef vector<P> VP;
typedef vector<vector<ll>> VV;
typedef vector<vector<int>> VVi;
typedef vector<vector<char>> VVc;
typedef vector<vector<vector<ll>>> VVV;
typedef vector<vector<vector<vector<ll>>>> VVVV;
#define REP(i, a, b) for (ll i = (a); i < (b); i++)
#define PER(i, a, b) for (ll i = (a); i >= (b); i--)
#define rep(i, n) REP(i, 0, n)
#define per(i, n) PER(i, n, 0)
const ll INF = 1e18 + 18;
const ll MOD = 1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;
#define ALL(v) v.begin(), v.end()
#define rALL(v) v.rbegin(), v.rend()
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a, b)
#define Each(a, b) for (auto &a : b)
#define rEach(i, mp) for (auto i = mp.rbegin(); i != mp.rend(); ++i)
#ifdef LOCAL
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbgmap(mp) \
cerr << #mp << ":" << endl; \
for (auto i = mp.begin(); i != mp.end(); ++i) { \
cerr << i->first << ":" << i->second << endl; \
}
#define dbgset(st) \
cerr << #st << ":" << endl; \
for (auto i = st.begin(); i != st.end(); ++i) { \
cerr << *i << " "; \
} \
cerr << endl;
#define dbgarr(n, m, arr) \
rep(i, n) { \
rep(j, m) { cerr << arr[i][j] << " "; } \
cerr << endl; \
}
#define dbgdp(n, arr) \
rep(i, n) { cerr << arr[i] << " "; } \
cerr << endl;
#else
#define dbg(...)
#define dbgmap(...)
#define dbgset(...)
#define dbgarr(...)
#define dbgdp(...)
#endif
#define out(a) cout << a << endl
#define out2(a, b) cout << a << " " << b << endl
#define vout(v) \
rep(i, v.size()) { cout << v[i] << " "; } \
cout << endl
#define Uniq(v) v.erase(unique(v.begin(), v.end()), v.end())
#define fi first
#define se second
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return true;
}
return false;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) {
return s << "(" << p.first << ", " << p.second << ")";
}
template <typename T> istream &operator>>(istream &i, vector<T> &v) {
rep(j, v.size()) i >> v[j];
return i;
}
// vector
template <typename T> ostream &operator<<(ostream &s, const vector<T> &v) {
int len = v.size();
for (int i = 0; i < len; ++i) {
s << v[i];
if (i < len - 1)
s << " ";
}
return s;
}
// 2 dimentional vector
template <typename T>
ostream &operator<<(ostream &s, const vector<vector<T>> &vv) {
int len = vv.size();
for (int i = 0; i < len; ++i) {
s << vv[i] << endl;
}
return s;
}
// mint
struct mint {
ll x; // typedef long long ll;
mint(ll x = 0) : x((x % MOD + MOD) % MOD) {}
mint operator-() const { return mint(-x); }
mint &operator+=(const mint a) {
if ((x += a.x) >= MOD)
x -= MOD;
return *this;
}
mint &operator-=(const mint a) {
if ((x += MOD - a.x) >= MOD)
x -= MOD;
return *this;
}
mint &operator*=(const mint a) {
(x *= a.x) %= MOD;
return *this;
}
mint operator+(const mint a) const { return mint(*this) += a; }
mint operator-(const mint a) const { return mint(*this) -= a; }
mint operator*(const mint a) const { return mint(*this) *= a; }
mint pow(ll t) const {
if (!t)
return 1;
mint a = pow(t >> 1);
a *= a;
if (t & 1)
a *= *this;
return a;
}
// for prime MOD
mint inv() const { return pow(MOD - 2); }
mint &operator/=(const mint a) { return *this *= a.inv(); }
mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream &operator>>(istream &is, const mint &a) { return is >> a.x; }
ostream &operator<<(ostream &os, const mint &a) { return os << a.x; }
typedef vector<mint> Vmint;
typedef vector<vector<mint>> VVmint;
typedef vector<vector<vector<mint>>> VVVmint;
struct combination {
vector<mint> fact, ifact;
combination(int n) : fact(n + 1), ifact(n + 1) {
assert(n < MOD);
fact[0] = 1;
for (int i = 1; i <= n; ++i)
fact[i] = fact[i - 1] * i;
ifact[n] = fact[n].inv();
for (int i = n; i >= 1; --i)
ifact[i - 1] = ifact[i] * i;
}
mint operator()(int n, int k) {
if (k < 0 || k > n)
return 0;
return fact[n] * ifact[k] * ifact[n - k];
}
};
int solve() {
ll n, k;
cin >> n >> k;
Vec a(n);
cin >> a;
ll mx = 200005;
mx = 10;
VV g(mx);
rep(i, n) { g[a[i]].pb(i); }
rep(i, n) { g[a[i]].pb(i + n); }
Vec pos(2 * n + 1, -1);
auto dfs = [&](auto dfs, ll x) -> ll {
if (pos[x] != -1)
return pos[x];
if (x == 2 * n)
return pos[x] = n;
auto itr = upper_bound(ALL(g[a[x % n]]), x);
if (itr == g[a[x % n]].end()) {
return pos[x] = x % n;
} else {
return pos[x] = dfs(dfs, *itr + 1);
}
};
rep(i, 2 * n + 1) { dfs(dfs, i); }
VV dp(45, Vec(n + 1));
rep(i, n + 1) { dp[0][i] = pos[i]; }
REP(j, 1, 45) {
rep(i, n + 1) { dp[j][i] = dp[j - 1][dp[j - 1][i]]; }
}
k--;
ll now = 0;
dbg(dp);
rep(bit, 45) {
if (k & (1LL << bit)) {
now = dp[bit][now];
}
}
set<ll> st;
Vec v;
REP(i, now, n) {
ll x = a[i];
if (st.count(x) > 0) {
while (v.back() != x) {
st.erase(v.back());
v.pop_back();
}
st.erase(x);
v.pop_back();
} else {
st.insert(x);
v.pb(x);
}
}
vout(v);
return 0;
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
cout << std::setprecision(10);
// ll T;
// cin>>T;
// while(T--)
solve();
}
| #ifdef LOCAL
//#define _GLIBCXX_DEBUG
#endif
//#pragma GCC target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<char> Vc;
typedef vector<P> VP;
typedef vector<vector<ll>> VV;
typedef vector<vector<int>> VVi;
typedef vector<vector<char>> VVc;
typedef vector<vector<vector<ll>>> VVV;
typedef vector<vector<vector<vector<ll>>>> VVVV;
#define REP(i, a, b) for (ll i = (a); i < (b); i++)
#define PER(i, a, b) for (ll i = (a); i >= (b); i--)
#define rep(i, n) REP(i, 0, n)
#define per(i, n) PER(i, n, 0)
const ll INF = 1e18 + 18;
const ll MOD = 1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;
#define ALL(v) v.begin(), v.end()
#define rALL(v) v.rbegin(), v.rend()
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a, b)
#define Each(a, b) for (auto &a : b)
#define rEach(i, mp) for (auto i = mp.rbegin(); i != mp.rend(); ++i)
#ifdef LOCAL
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbgmap(mp) \
cerr << #mp << ":" << endl; \
for (auto i = mp.begin(); i != mp.end(); ++i) { \
cerr << i->first << ":" << i->second << endl; \
}
#define dbgset(st) \
cerr << #st << ":" << endl; \
for (auto i = st.begin(); i != st.end(); ++i) { \
cerr << *i << " "; \
} \
cerr << endl;
#define dbgarr(n, m, arr) \
rep(i, n) { \
rep(j, m) { cerr << arr[i][j] << " "; } \
cerr << endl; \
}
#define dbgdp(n, arr) \
rep(i, n) { cerr << arr[i] << " "; } \
cerr << endl;
#else
#define dbg(...)
#define dbgmap(...)
#define dbgset(...)
#define dbgarr(...)
#define dbgdp(...)
#endif
#define out(a) cout << a << endl
#define out2(a, b) cout << a << " " << b << endl
#define vout(v) \
rep(i, v.size()) { cout << v[i] << " "; } \
cout << endl
#define Uniq(v) v.erase(unique(v.begin(), v.end()), v.end())
#define fi first
#define se second
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return true;
}
return false;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) {
return s << "(" << p.first << ", " << p.second << ")";
}
template <typename T> istream &operator>>(istream &i, vector<T> &v) {
rep(j, v.size()) i >> v[j];
return i;
}
// vector
template <typename T> ostream &operator<<(ostream &s, const vector<T> &v) {
int len = v.size();
for (int i = 0; i < len; ++i) {
s << v[i];
if (i < len - 1)
s << " ";
}
return s;
}
// 2 dimentional vector
template <typename T>
ostream &operator<<(ostream &s, const vector<vector<T>> &vv) {
int len = vv.size();
for (int i = 0; i < len; ++i) {
s << vv[i] << endl;
}
return s;
}
// mint
struct mint {
ll x; // typedef long long ll;
mint(ll x = 0) : x((x % MOD + MOD) % MOD) {}
mint operator-() const { return mint(-x); }
mint &operator+=(const mint a) {
if ((x += a.x) >= MOD)
x -= MOD;
return *this;
}
mint &operator-=(const mint a) {
if ((x += MOD - a.x) >= MOD)
x -= MOD;
return *this;
}
mint &operator*=(const mint a) {
(x *= a.x) %= MOD;
return *this;
}
mint operator+(const mint a) const { return mint(*this) += a; }
mint operator-(const mint a) const { return mint(*this) -= a; }
mint operator*(const mint a) const { return mint(*this) *= a; }
mint pow(ll t) const {
if (!t)
return 1;
mint a = pow(t >> 1);
a *= a;
if (t & 1)
a *= *this;
return a;
}
// for prime MOD
mint inv() const { return pow(MOD - 2); }
mint &operator/=(const mint a) { return *this *= a.inv(); }
mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream &operator>>(istream &is, const mint &a) { return is >> a.x; }
ostream &operator<<(ostream &os, const mint &a) { return os << a.x; }
typedef vector<mint> Vmint;
typedef vector<vector<mint>> VVmint;
typedef vector<vector<vector<mint>>> VVVmint;
struct combination {
vector<mint> fact, ifact;
combination(int n) : fact(n + 1), ifact(n + 1) {
assert(n < MOD);
fact[0] = 1;
for (int i = 1; i <= n; ++i)
fact[i] = fact[i - 1] * i;
ifact[n] = fact[n].inv();
for (int i = n; i >= 1; --i)
ifact[i - 1] = ifact[i] * i;
}
mint operator()(int n, int k) {
if (k < 0 || k > n)
return 0;
return fact[n] * ifact[k] * ifact[n - k];
}
};
int solve() {
ll n, k;
cin >> n >> k;
Vec a(n);
cin >> a;
ll mx = 200005;
// mx = 10;
VV g(mx);
rep(i, n) { g[a[i]].pb(i); }
rep(i, n) { g[a[i]].pb(i + n); }
Vec pos(2 * n + 1, -1);
auto dfs = [&](auto dfs, ll x) -> ll {
if (pos[x] != -1)
return pos[x];
if (x == 2 * n)
return pos[x] = n;
auto itr = upper_bound(ALL(g[a[x % n]]), x);
if (itr == g[a[x % n]].end()) {
return pos[x] = x % n;
} else {
return pos[x] = dfs(dfs, *itr + 1);
}
};
rep(i, 2 * n + 1) { dfs(dfs, i); }
VV dp(45, Vec(n + 1));
rep(i, n + 1) { dp[0][i] = pos[i]; }
REP(j, 1, 45) {
rep(i, n + 1) { dp[j][i] = dp[j - 1][dp[j - 1][i]]; }
}
k--;
ll now = 0;
dbg(dp);
rep(bit, 45) {
if (k & (1LL << bit)) {
now = dp[bit][now];
}
}
set<ll> st;
Vec v;
REP(i, now, n) {
ll x = a[i];
if (st.count(x) > 0) {
while (v.back() != x) {
st.erase(v.back());
v.pop_back();
}
st.erase(x);
v.pop_back();
} else {
st.insert(x);
v.pb(x);
}
}
vout(v);
return 0;
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
cout << std::setprecision(10);
// ll T;
// cin>>T;
// while(T--)
solve();
}
| [] | 773,376 | 773,377 | u592686932 | cpp |
p02964 | #include <bits/stdc++.h>
using namespace std;
const int maxa = 200005;
const long long inf = 300000000000000000;
const int too_many_bottles_of_this_wine_we_cant_pronounce = 35;
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long n, k;
cin >> n >> k;
k *= n;
vector<long long> a(n), w(n);
vector<vector<long long>> idx(maxa);
for (int i = 0; i < n; ++i) {
cin >> a[i];
idx[a[i]].push_back(i);
}
for (int i = 0; i < maxa; ++i) {
if (!idx[i].empty()) {
long long sz = idx[i].size();
idx[i].push_back(idx[i][0] + n);
for (int j = 0; j < sz; ++j)
w[idx[i][j]] = idx[i][j + 1] - idx[i][j] + 1;
}
}
vector<vector<long long>> nx{w};
for (int p = 0; p < too_many_bottles_of_this_wine_we_cant_pronounce; ++p) {
vector<long long> &x = nx.back();
vector<long long> y(n);
for (int i = 0; i < n; ++i)
y[i] = min(inf, x[i] + x[(i + x[i]) % n]);
nx.push_back(y);
}
long long pos = 0;
for (int i = too_many_bottles_of_this_wine_we_cant_pronounce; i >= 0; --i) {
if (pos + nx[i][pos % n] <= k)
pos += nx[i][pos % n];
}
vector<long long> ans;
set<long long> saw;
for (int i = pos % n; i < n; ++i) {
if (saw.find(a[i]) == saw.end()) {
ans.push_back(a[i]);
saw.insert(a[i]);
} else {
while (ans.back() != a[i]) {
saw.erase(ans.back());
ans.pop_back();
}
saw.erase(ans.back());
ans.pop_back();
}
}
for (long long x : ans)
cout << x << ' ';
cout << '\n';
}
| #include <bits/stdc++.h>
using namespace std;
const int maxa = 200005;
const long long inf = 1000000000000000000;
const int too_many_bottles_of_this_wine_we_cant_pronounce = 65;
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long n, k;
cin >> n >> k;
k *= n;
vector<long long> a(n), w(n);
vector<vector<long long>> idx(maxa);
for (int i = 0; i < n; ++i) {
cin >> a[i];
idx[a[i]].push_back(i);
}
for (int i = 0; i < maxa; ++i) {
if (!idx[i].empty()) {
long long sz = idx[i].size();
idx[i].push_back(idx[i][0] + n);
for (int j = 0; j < sz; ++j)
w[idx[i][j]] = idx[i][j + 1] - idx[i][j] + 1;
}
}
vector<vector<long long>> nx{w};
for (int p = 0; p < too_many_bottles_of_this_wine_we_cant_pronounce; ++p) {
vector<long long> &x = nx.back();
vector<long long> y(n);
for (int i = 0; i < n; ++i)
y[i] = min(inf, x[i] + x[(i + x[i]) % n]);
nx.push_back(y);
}
long long pos = 0;
for (int i = too_many_bottles_of_this_wine_we_cant_pronounce; i >= 0; --i) {
if (pos + nx[i][pos % n] <= k)
pos += nx[i][pos % n];
}
vector<long long> ans;
set<long long> saw;
for (int i = pos % n; i < n; ++i) {
if (saw.find(a[i]) == saw.end()) {
ans.push_back(a[i]);
saw.insert(a[i]);
} else {
while (ans.back() != a[i]) {
saw.erase(ans.back());
ans.pop_back();
}
saw.erase(ans.back());
ans.pop_back();
}
}
for (long long x : ans)
cout << x << ' ';
cout << '\n';
}
| [
"literal.number.change",
"variable_declaration.value.change"
] | 773,388 | 773,389 | u855677173 | cpp |
p02964 | #include <bits/stdc++.h>
using namespace std;
using LL = long long int;
#define incID(i, l, r) for (int i = (l); i < (r); ++i)
#define decID(i, l, r) for (int i = (r)-1; i >= (l); --i)
#define incII(i, l, r) for (int i = (l); i <= (r); ++i)
#define decII(i, l, r) for (int i = (r); i >= (l); --i)
#define inc(i, n) incID(i, 0, n)
#define dec(i, n) decID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define dec1(i, n) decII(i, 1, n)
#define inID(v, l, r) ((l) <= (v) && (v) < (r))
#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define FR front()
#define BA back()
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
auto setmin = [](auto &a, auto b) { return (b < a ? a = b, true : false); };
auto setmax = [](auto &a, auto b) { return (b > a ? a = b, true : false); };
auto setmineq = [](auto &a, auto b) { return (b <= a ? a = b, true : false); };
auto setmaxeq = [](auto &a, auto b) { return (b >= a ? a = b, true : false); };
#define SI(v) static_cast<int>(v.size())
#define RF(e, v) for (auto &e : v)
#define until(e) while (!(e))
#define if_not(e) if (!(e))
#define ef else if
#define UR assert(false)
#define IN(T, ...) \
T __VA_ARGS__; \
IN_(__VA_ARGS__);
void IN_(){};
template <typename T, typename... U> void IN_(T &a, U &...b) {
cin >> a;
IN_(b...);
};
template <typename T> void OUT(T &&a) { cout << a << endl; }
template <typename T, typename... U> void OUT(T &&a, U &&...b) {
cout << a << " ";
OUT(b...);
}
// ---- ----
template <typename T> istream &operator>>(istream &s, vector<T> &v) {
RF(e, v) { s >> e; }
return s;
}
template <typename T> ostream &operator<<(ostream &s, vector<T> const &v) {
inc(i, SI(v)) { s << (i == 0 ? "" : " ") << v[i]; }
return s;
}
template <typename T> T MV(T v) { return v; }
template <typename T, typename... U> auto MV(T v, int a, U... b) {
return vector<decltype(MV(v, b...))>(a, MV(v, b...));
}
#define bit(b, i) (((b) >> (i)) & 1)
#define PC __builtin_popcountll
#define BL(a) (a ? 64 - __builtin_clzll(a) : 0)
int main() {
IN(LL, n, k);
vector<int> a(n);
cin >> a;
map<int, int> nex;
dec(i, n) { nex[a[i]] = (n + 1) + i; }
auto dp = MV(0, 40, n + 1);
dp[0][n] = n + 1;
dec(i, n) {
int p = nex[a[i]] + 1;
if (p < n + 1) {
p = dp[0][p];
}
dp[0][i] = p;
nex[a[i]] = i;
}
inc(i, n + 1) { dp[0][i] %= (n + 1); }
inc(l, 40 - 1) {
inc(i, n) { dp[l + 1][i] = dp[l][dp[l][i]]; }
}
int p = 0;
inc(l, 40) {
if (bit(k - 1, l) == 1) {
p = dp[l][p];
}
}
vector<int> ans;
set<int> se;
incID(i, p, n) {
if (se.count(a[i]) == 0) {
ans.PB(a[i]);
se.insert(a[i]);
} else {
while (true) {
int x = ans.BA;
ans.pop_back();
se.erase(x);
if (x == a[i]) {
break;
}
}
}
}
OUT(ans);
}
| #include <bits/stdc++.h>
using namespace std;
using LL = long long int;
#define incID(i, l, r) for (int i = (l); i < (r); ++i)
#define decID(i, l, r) for (int i = (r)-1; i >= (l); --i)
#define incII(i, l, r) for (int i = (l); i <= (r); ++i)
#define decII(i, l, r) for (int i = (r); i >= (l); --i)
#define inc(i, n) incID(i, 0, n)
#define dec(i, n) decID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define dec1(i, n) decII(i, 1, n)
#define inID(v, l, r) ((l) <= (v) && (v) < (r))
#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define FR front()
#define BA back()
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
auto setmin = [](auto &a, auto b) { return (b < a ? a = b, true : false); };
auto setmax = [](auto &a, auto b) { return (b > a ? a = b, true : false); };
auto setmineq = [](auto &a, auto b) { return (b <= a ? a = b, true : false); };
auto setmaxeq = [](auto &a, auto b) { return (b >= a ? a = b, true : false); };
#define SI(v) static_cast<int>(v.size())
#define RF(e, v) for (auto &e : v)
#define until(e) while (!(e))
#define if_not(e) if (!(e))
#define ef else if
#define UR assert(false)
#define IN(T, ...) \
T __VA_ARGS__; \
IN_(__VA_ARGS__);
void IN_(){};
template <typename T, typename... U> void IN_(T &a, U &...b) {
cin >> a;
IN_(b...);
};
template <typename T> void OUT(T &&a) { cout << a << endl; }
template <typename T, typename... U> void OUT(T &&a, U &&...b) {
cout << a << " ";
OUT(b...);
}
// ---- ----
template <typename T> istream &operator>>(istream &s, vector<T> &v) {
RF(e, v) { s >> e; }
return s;
}
template <typename T> ostream &operator<<(ostream &s, vector<T> const &v) {
inc(i, SI(v)) { s << (i == 0 ? "" : " ") << v[i]; }
return s;
}
template <typename T> T MV(T v) { return v; }
template <typename T, typename... U> auto MV(T v, int a, U... b) {
return vector<decltype(MV(v, b...))>(a, MV(v, b...));
}
#define bit(b, i) (((b) >> (i)) & 1)
#define PC __builtin_popcountll
#define BL(a) (a ? 64 - __builtin_clzll(a) : 0)
int main() {
IN(LL, n, k);
vector<int> a(n);
cin >> a;
map<int, int> nex;
dec(i, n) { nex[a[i]] = (n + 1) + i; }
auto dp = MV(0, 40, n + 1);
dp[0][n] = n + 1;
dec(i, n) {
int p = nex[a[i]] + 1;
if (p < n + 1) {
p = dp[0][p];
}
dp[0][i] = p;
nex[a[i]] = i;
}
inc(i, n + 1) { dp[0][i] %= (n + 1); }
inc(l, 40 - 1) {
inc(i, n + 1) { dp[l + 1][i] = dp[l][dp[l][i]]; }
}
int p = 0;
inc(l, 40) {
if (bit(k - 1, l) == 1) {
p = dp[l][p];
}
}
vector<int> ans;
set<int> se;
incID(i, p, n) {
if (se.count(a[i]) == 0) {
ans.PB(a[i]);
se.insert(a[i]);
} else {
while (true) {
int x = ans.BA;
ans.pop_back();
se.erase(x);
if (x == a[i]) {
break;
}
}
}
}
OUT(ans);
}
| [
"expression.operation.binary.add"
] | 773,420 | 773,421 | u568652083 | cpp |
p02964 | #include <bits/stdc++.h>
using namespace std;
#define Rep(i, n) for (int i = 0; i < (int)(n); i++)
#define For(i, n1, n2) for (int i = (int)(n1); i < (int)(n2); i++)
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define RREP(i, n) for (ll i = ((ll)(n)-1); i >= 0; i--)
#define FOR(i, n1, n2) for (ll i = (ll)(n1); i < (ll)(n2); i++)
#define RFOR(i, n1, n2) for (ll i = ((ll)(n1)-1); i >= (ll)(n2); i--)
#define all(a) (a).begin(), (a).end()
#define SORT(a) sort((a).begin(), (a).end())
#define oorret 0
#define oor(x) \
[&]() { \
try { \
x; \
} catch (const out_of_range &oor) { \
return oorret; \
} \
return x; \
}()
#define IOS cin.tie(0), ios::sync_with_stdio(false)
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class Type> struct is_vector : std::false_type {};
template <class ValueType, class Alloc>
struct is_vector<std::vector<ValueType, Alloc>> : std::true_type {};
template <typename T>
inline ostream &operator<<(ostream &out, const vector<T> &v) {
if (v.empty())
return out;
constexpr bool is_vector_v = is_vector<T>::value;
if (is_vector_v)
for (auto itr = v.begin(); itr != v.end();)
out << (*itr), out << ((++itr != v.end()) ? "\n" : "");
else
for (auto itr = v.begin(); itr != v.end();)
out << (*itr), out << ((++itr != v.end()) ? " " : "");
return out;
}
inline void put() {}
template <class T> inline void put(const T &first) {
std::cout << first << "\n";
}
template <class T, class... N>
inline void put(const T &first, const N &...rest) {
std::cout << first << " ";
put(rest...);
}
inline void putn() {}
template <class T, class... N>
inline void putn(const T &first, const N &...rest) {
std::cout << first << "\n";
putn(rest...);
}
int main() {
IOS;
int n;
ll k;
cin >> n >> k;
vector<int> a(n);
vector<P> p(n * 2);
REP(i, n) {
cin >> a[i];
p[i].first = a[i];
p[i].second = i;
p[i + n].first = a[i];
p[i + n].second = i + n;
}
if (n == 1) {
if (k % 2 == 0) {
put("");
} else {
put(a[0]);
}
return 0;
}
sort(all(p));
vector<int> b(n);
REP(i, n * 2) {
if (p[i].second < n) {
int t = p[i].second;
b[t] = p[i + 1].second;
}
}
int t = 0; // n=1がやばい
int now = 0;
while (true) {
now = b[now] + 1;
if (now % n == 0) {
t += now / n;
break;
}
if (now > n) {
t += now / n;
now %= n;
}
}
k %= t;
vector<int> res;
ll cnt = k * n;
now = 0;
while (cnt) {
int pre = now;
now = b[now] + 1;
if (now - pre >= cnt) {
now = pre;
cnt--;
res.push_back(a[now]);
now++;
now %= n;
// break;
} else {
cnt -= now - pre;
now %= n;
}
}
put(res);
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define Rep(i, n) for (int i = 0; i < (int)(n); i++)
#define For(i, n1, n2) for (int i = (int)(n1); i < (int)(n2); i++)
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define RREP(i, n) for (ll i = ((ll)(n)-1); i >= 0; i--)
#define FOR(i, n1, n2) for (ll i = (ll)(n1); i < (ll)(n2); i++)
#define RFOR(i, n1, n2) for (ll i = ((ll)(n1)-1); i >= (ll)(n2); i--)
#define all(a) (a).begin(), (a).end()
#define SORT(a) sort((a).begin(), (a).end())
#define oorret 0
#define oor(x) \
[&]() { \
try { \
x; \
} catch (const out_of_range &oor) { \
return oorret; \
} \
return x; \
}()
#define IOS cin.tie(0), ios::sync_with_stdio(false)
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class Type> struct is_vector : std::false_type {};
template <class ValueType, class Alloc>
struct is_vector<std::vector<ValueType, Alloc>> : std::true_type {};
template <typename T>
inline ostream &operator<<(ostream &out, const vector<T> &v) {
if (v.empty())
return out;
constexpr bool is_vector_v = is_vector<T>::value;
if (is_vector_v)
for (auto itr = v.begin(); itr != v.end();)
out << (*itr), out << ((++itr != v.end()) ? "\n" : "");
else
for (auto itr = v.begin(); itr != v.end();)
out << (*itr), out << ((++itr != v.end()) ? " " : "");
return out;
}
inline void put() {}
template <class T> inline void put(const T &first) {
std::cout << first << "\n";
}
template <class T, class... N>
inline void put(const T &first, const N &...rest) {
std::cout << first << " ";
put(rest...);
}
inline void putn() {}
template <class T, class... N>
inline void putn(const T &first, const N &...rest) {
std::cout << first << "\n";
putn(rest...);
}
int main() {
IOS;
int n;
ll k;
cin >> n >> k;
vector<int> a(n);
vector<P> p(n * 2);
REP(i, n) {
cin >> a[i];
p[i].first = a[i];
p[i].second = i;
p[i + n].first = a[i];
p[i + n].second = i + n;
}
if (n == 1) {
if (k % 2 == 0) {
put("");
} else {
put(a[0]);
}
return 0;
}
sort(all(p));
vector<int> b(n);
REP(i, n * 2) {
if (p[i].second < n) {
int t = p[i].second;
b[t] = p[i + 1].second;
}
}
int t = 0; // n=1がやばい
int now = 0;
while (true) {
now = b[now] + 1;
if (now % n == 0) {
t += now / n;
break;
}
if (now > n) {
t += now / n;
now %= n;
}
}
k %= t;
vector<int> res;
ll cnt = k * n;
now = 0;
while (cnt) {
int pre = now;
now = b[now] + 1;
if (now - pre > cnt) {
now = pre;
cnt--;
res.push_back(a[now]);
now++;
now %= n;
// break;
} else {
cnt -= now - pre;
now %= n;
}
}
put(res);
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 773,438 | 773,439 | u030685402 | cpp |
p02964 | #include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = std::int_fast64_t;
using std::cerr;
using std::cin;
using std::cout;
using std::endl;
template <typename T> std::vector<T> make_v(size_t a) {
return std::vector<T>(a);
}
template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) {
return std::vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
std::vector<int> eval(std::vector<int> &x) {
std::vector<int> vec;
std::set<int> st;
for (auto v : x) {
if (st.count(v)) {
while (st.count(v)) {
int p = vec.back();
vec.pop_back();
st.erase(p);
}
} else {
st.insert(v);
vec.push_back(v);
}
}
return vec;
}
int main() {
int n;
i64 k;
scanf("%d%lld", &n, &k);
std::vector<int> a(n);
for (int i = 0; i < n; i++)
scanf("%d", &a[i]);
// solve
std::vector<int> nearest(n);
{ // construct nearest
std::vector<int> last(2e5 + 10, -1);
for (int i = 0; i < 2 * n; i++) {
int v = a[i % n];
if (~last[v] and last[v] < n) {
nearest[last[v]] = i;
last[v] = i;
} else {
last[v] = i;
}
}
}
// for(auto v: nearest) cout << v << " "; cout << endl;
int T = 0;
{ // 周期を求める(高々 N)
int now = 0;
while (true) {
T += (n - 1 <= nearest[now]);
now = (nearest[now] + 1) % n;
if (!now)
break;
}
}
k %= T;
int now = 0;
while (k > 1) {
k -= (n - 1 <= nearest[now]);
now = (nearest[now] + 1) % n;
}
std::vector<int> ans;
for (int i = now; i < n; i++)
ans.push_back(a[i]);
ans = eval(ans);
for (auto v : ans)
printf("%d ", v);
printf("\n");
return 0;
}
| #include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = std::int_fast64_t;
using std::cerr;
using std::cin;
using std::cout;
using std::endl;
template <typename T> std::vector<T> make_v(size_t a) {
return std::vector<T>(a);
}
template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) {
return std::vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
std::vector<int> eval(std::vector<int> &x) {
std::vector<int> vec;
std::set<int> st;
for (auto v : x) {
if (st.count(v)) {
while (st.count(v)) {
int p = vec.back();
vec.pop_back();
st.erase(p);
}
} else {
st.insert(v);
vec.push_back(v);
}
}
return vec;
}
int main() {
int n;
i64 k;
scanf("%d%lld", &n, &k);
std::vector<int> a(n);
for (int i = 0; i < n; i++)
scanf("%d", &a[i]);
// solve
std::vector<int> nearest(n);
{ // construct nearest
std::vector<int> last(2e5 + 10, -1);
for (int i = 0; i < 2 * n; i++) {
int v = a[i % n];
if (~last[v] and last[v] < n) {
nearest[last[v]] = i;
last[v] = i;
} else {
last[v] = i;
}
}
}
// for(auto v: nearest) cout << v << " "; cout << endl;
int T = 1;
{ // 周期を求める(高々 N)
int now = 0;
while (true) {
T += (n <= nearest[now]);
now = (nearest[now] + 1) % n;
if (!now)
break;
}
}
k %= T;
int now = 0;
while (k > 1) {
k -= (n <= nearest[now]);
now = (nearest[now] + 1) % n;
}
std::vector<int> ans;
for (int i = now; i < n; i++)
ans.push_back(a[i]);
ans = eval(ans);
for (auto v : ans)
printf("%d ", v);
printf("\n");
return 0;
}
| [
"literal.number.change",
"variable_declaration.value.change",
"expression.operation.binary.remove"
] | 773,442 | 773,443 | u424655672 | cpp |
p02964 | #include <bits/stdc++.h>
using namespace std;
#define debug(n) cerr << #n << ':' << n << endl;
#define dline cerr << __LINE__ << endl;
#define rep(i, s, e) for (int i = (int)(s); i < (int)(e); ++i)
#define per(i, s, e) for (int i = (int)(s)-1; i >= (int)(e); --i)
using ll = long long;
template <class T, class U> using P = pair<T, U>;
template <class T> using Heap = priority_queue<T>;
template <class T> using heaP = priority_queue<T, vector<T>, greater<T>>;
template <class T> bool ChangeMax(T &a, const T &b) {
if (a >= b)
return false;
a = b;
return true;
}
template <class T> bool ChangeMin(T &a, const T &b) {
if (a <= b)
return false;
a = b;
return true;
}
template <class T, size_t N, class U> void Fill(T (&a)[N], const U &v) {
fill((U *)a, (U *)(a + N), v);
}
template <class T> istream &operator>>(istream &is, vector<T> &v) {
for (auto &e : v)
is >> e;
return is;
}
int main() {
int n;
cin >> n;
ll k;
cin >> k;
vector<int> v(n);
cin >> v;
vector<set<int>> sv(n + 1);
rep(i, 0, n) sv[v[i]].insert(i);
int cnt = 1;
{
int p = n - 1;
while (1) {
int val = v[p];
auto it = lower_bound(sv[val].begin(), sv[val].end(), p);
if (it == sv[val].begin()) {
cnt++;
it = sv[val].end();
}
it--;
p = *it;
if (p == 0)
break;
p--;
}
}
int t = k % cnt;
cnt = 1;
int p = 0;
vector<int> ans;
while (1) {
int val = v[p];
auto it = upper_bound(sv[val].begin(), sv[val].end(), p);
if (it == sv[val].end()) {
if (cnt >= t) {
p++;
ans.push_back(val);
if (p >= n)
break;
continue;
} else {
cnt++;
it = sv[val].begin();
}
}
p = *it;
p++;
if (p >= n) {
if (cnt >= t) {
break;
}
cnt++;
p = 0;
}
}
rep(i, 0, ans.size()) {
if (i)
cout << ' ';
cout << ans[i];
}
cout << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define debug(n) cerr << #n << ':' << n << endl;
#define dline cerr << __LINE__ << endl;
#define rep(i, s, e) for (int i = (int)(s); i < (int)(e); ++i)
#define per(i, s, e) for (int i = (int)(s)-1; i >= (int)(e); --i)
using ll = long long;
template <class T, class U> using P = pair<T, U>;
template <class T> using Heap = priority_queue<T>;
template <class T> using heaP = priority_queue<T, vector<T>, greater<T>>;
template <class T> bool ChangeMax(T &a, const T &b) {
if (a >= b)
return false;
a = b;
return true;
}
template <class T> bool ChangeMin(T &a, const T &b) {
if (a <= b)
return false;
a = b;
return true;
}
template <class T, size_t N, class U> void Fill(T (&a)[N], const U &v) {
fill((U *)a, (U *)(a + N), v);
}
template <class T> istream &operator>>(istream &is, vector<T> &v) {
for (auto &e : v)
is >> e;
return is;
}
int main() {
int n;
cin >> n;
ll k;
cin >> k;
vector<int> v(n);
cin >> v;
vector<set<int>> sv(200001);
rep(i, 0, n) sv[v[i]].insert(i);
int cnt = 1;
{
int p = n - 1;
while (1) {
int val = v[p];
auto it = lower_bound(sv[val].begin(), sv[val].end(), p);
if (it == sv[val].begin()) {
cnt++;
it = sv[val].end();
}
it--;
p = *it;
if (p == 0)
break;
p--;
}
}
int t = k % cnt;
cnt = 1;
int p = 0;
vector<int> ans;
while (1) {
int val = v[p];
auto it = upper_bound(sv[val].begin(), sv[val].end(), p);
if (it == sv[val].end()) {
if (cnt >= t) {
p++;
ans.push_back(val);
if (p >= n)
break;
continue;
} else {
cnt++;
it = sv[val].begin();
}
}
p = *it;
p++;
if (p >= n) {
if (cnt >= t) {
break;
}
cnt++;
p = 0;
}
}
rep(i, 0, ans.size()) {
if (i)
cout << ' ';
cout << ans[i];
}
cout << endl;
return 0;
}
| [
"identifier.replace.remove",
"literal.replace.add",
"call.arguments.change",
"expression.operation.binary.change",
"expression.operation.binary.remove"
] | 773,454 | 773,455 | u691380397 | cpp |
p02964 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> VI;
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> bool chmin(T &a, const T &b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define all(x) (x).begin(), (x).end()
const int mod = 1e9 + 7;
int main() {
int n;
ll k;
cin >> n >> k;
int a[n];
map<int, vector<int>> m;
rep(i, n) {
cin >> a[i];
m[a[i]].push_back(i);
}
// cout<<a[0]<<endl;
ll db[62][n];
for (auto it = m.begin(); it != m.end(); ++it) {
auto v = it->second;
v.push_back(v.front() + n);
rep(i, v.size() - 1) { db[0][v[i]] = v[i + 1] - v[i] + 1; }
}
rep(i, 1, 62) {
rep(j, n) { db[i][j] = db[i - 1][j] + db[i - 1][(j + db[i - 1][j]) % n]; }
}
ll now = 0;
for (int i = 61; i >= 0; --i) {
if (now + db[i][now % n] >= n * k)
continue;
now += db[i][now % n];
}
stack<int> st;
set<int> e;
now %= n;
rep(i, now, n) {
if (e.find(a[i]) == e.end()) {
st.push(a[i]);
e.insert(a[i]);
} else {
while (e.find(a[i]) != e.end()) {
e.erase(st.top());
st.pop();
}
}
// cout<<st.top()<<endl;
}
vector<int> ans;
while (st.size()) {
ans.push_back(st.top());
st.pop();
}
reverse(all(ans));
rep(i, ans.size()) {
if (i)
cout << " ";
cout << ans[i];
}
cout << endl;
}
| #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> VI;
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> bool chmin(T &a, const T &b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define all(x) (x).begin(), (x).end()
const int mod = 1e9 + 7;
int main() {
int n;
ll k;
cin >> n >> k;
int a[n];
map<int, vector<int>> m;
rep(i, n) {
cin >> a[i];
m[a[i]].push_back(i);
}
// cout<<a[0]<<endl;
__int128 db[64][n];
for (auto it = m.begin(); it != m.end(); ++it) {
auto v = it->second;
v.push_back(v.front() + n);
rep(i, v.size() - 1) { db[0][v[i]] = v[i + 1] - v[i] + 1; }
}
rep(i, 1, 64) {
rep(j, n) { db[i][j] = db[i - 1][j] + db[i - 1][(j + db[i - 1][j]) % n]; }
}
ll now = 0;
for (int i = 63; i >= 0; --i) {
if (now + db[i][now % n] >= n * k)
continue;
now += db[i][now % n];
}
stack<int> st;
set<int> e;
now %= n;
rep(i, now, n) {
if (e.find(a[i]) == e.end()) {
st.push(a[i]);
e.insert(a[i]);
} else {
while (e.find(a[i]) != e.end()) {
e.erase(st.top());
st.pop();
}
}
// cout<<st.top()<<endl;
}
vector<int> ans;
while (st.size()) {
ans.push_back(st.top());
st.pop();
}
reverse(all(ans));
rep(i, ans.size()) {
if (i)
cout << " ";
cout << ans[i];
}
cout << endl;
}
| [
"variable_declaration.type.change",
"literal.number.change",
"variable_declaration.array_dimensions.change",
"call.arguments.change",
"variable_declaration.value.change",
"control_flow.loop.for.initializer.change"
] | 773,466 | 773,467 | u071692456 | cpp |
p02964 | #include <bits/stdc++.h>
#define F first
#define S second
#define mp make_pair
#define pb push_back
//#define ll __int128
#define ll long long
#define LEFT(a) ((a) << 1)
#define RIGHT(a) (LEFT(a) + 1)
#define MID(a, b) ((a + b) >> 1)
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define y1 y122
/*
#pragma GCC optimize ("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2,fma")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC target ("avx2")
#pragma GCC optimization ("unroll-loops")
#pragma comment(linker, "/STACK: 20000000005")
*/
using namespace std;
const ll N = 1000005;
ll n;
ll a[N];
ll ne[N], d[N];
ll K;
ll mas[N], M[N];
ll fix[N], D[N];
ll nn, A[N];
ll re[N];
void go() {
for (ll i = 0; i < N; i++)
mas[i] = 0;
ll num = 0;
for (ll i = 1; i <= nn; i++) {
if (mas[A[i]] == 0) {
re[++num] = A[i];
mas[A[i]] = num;
continue;
}
ll le = mas[A[i]];
while (num >= le) {
mas[re[num]] = 0;
num--;
}
}
for (ll i = 1; i <= num; i++)
cout << re[i] << " ";
cout << endl;
}
main() {
// freopen ("in.in", "r", stdin);freopen ("out.out", "w", stdout);
ios_base::sync_with_stdio(0);
cin >> n >> K;
for (ll i = 1; i <= n; i++)
cin >> a[i];
for (ll i = n; i >= 1; i--) {
M[a[i]] = i;
}
for (ll i = n; i >= 1; i--) {
ne[i] = mas[a[i]];
mas[a[i]] = i;
if (ne[i] == 0) {
ne[i] = M[a[i]];
d[i] = 1;
}
ne[i]++;
if (ne[i] > n) {
d[i]++;
ne[i] -= n;
}
}
ll t = 1;
D[1] = 1;
while (1) {
if (D[t] >= K)
break;
fix[t] = 1;
ll to = ne[t];
ll dist = D[t] + d[t];
if (fix[to]) {
ll dif = dist - D[to];
K %= dif;
while (K <= D[to])
K += dif;
break;
}
D[to] = dist;
t = to;
}
ll st = 0;
for (ll i = 1; i <= n; i++)
if (D[i] == K) {
st = i;
break;
}
if (st == 0) {
go();
return 0;
}
for (ll i = st; i <= n; i++)
A[++nn] = a[i];
go();
return 0;
}
| #include <bits/stdc++.h>
#define F first
#define S second
#define mp make_pair
#define pb push_back
//#define ll __int128
#define ll long long
#define LEFT(a) ((a) << 1)
#define RIGHT(a) (LEFT(a) + 1)
#define MID(a, b) ((a + b) >> 1)
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define y1 y122
/*
#pragma GCC optimize ("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2,fma")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC target ("avx2")
#pragma GCC optimization ("unroll-loops")
#pragma comment(linker, "/STACK: 20000000005")
*/
using namespace std;
const ll N = 1000005;
ll n;
ll a[N];
ll ne[N], d[N];
ll K;
ll mas[N], M[N];
ll fix[N], D[N];
ll nn, A[N];
ll re[N];
void go() {
for (ll i = 0; i < N; i++)
mas[i] = 0;
ll num = 0;
for (ll i = 1; i <= nn; i++) {
if (mas[A[i]] == 0) {
re[++num] = A[i];
mas[A[i]] = num;
continue;
}
ll le = mas[A[i]];
while (num >= le) {
mas[re[num]] = 0;
num--;
}
}
for (ll i = 1; i <= num; i++)
cout << re[i] << " ";
cout << endl;
}
main() {
// freopen ("in.in", "r", stdin);freopen ("out.out", "w", stdout);
ios_base::sync_with_stdio(0);
cin >> n >> K;
for (ll i = 1; i <= n; i++)
cin >> a[i];
for (ll i = n; i >= 1; i--) {
M[a[i]] = i;
}
for (ll i = n; i >= 1; i--) {
ne[i] = mas[a[i]];
mas[a[i]] = i;
if (ne[i] == 0) {
ne[i] = M[a[i]];
d[i] = 1;
}
ne[i]++;
if (ne[i] > n) {
d[i]++;
ne[i] -= n;
}
}
ll t = 1;
D[1] = 1;
while (1) {
if (D[t] >= K)
break;
fix[t] = 1;
ll to = ne[t];
ll dist = D[t] + d[t];
if (fix[to]) {
ll dif = dist - D[to];
K %= dif;
while (K < D[to])
K += dif;
break;
}
D[to] = dist;
t = to;
}
ll st = 0;
for (ll i = 1; i <= n; i++)
if (D[i] == K) {
st = i;
break;
}
if (st == 0) {
go();
return 0;
}
for (ll i = st; i <= n; i++)
A[++nn] = a[i];
go();
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.loop.condition.change"
] | 773,486 | 773,487 | u704324882 | cpp |
p02964 | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define x first
#define y second
typedef pair<int, int> pii;
typedef long long ll;
const int MOD = 1000000007;
const int N = 2 * 100000 + 1;
const ll oo = 2e18;
const int LOGN = 62;
int n, a[N];
ll k, dp[N][LOGN];
vector<int> g[N], ans;
int main() {
cin >> n >> k;
for (int i = 0; i < n; ++i)
scanf("%d", a + i);
for (int i = 0; i < n; ++i)
g[a[i]].push_back(i);
for (int i = 0; i < n; ++i) {
auto it = ++lower_bound(g[a[i]].begin(), g[a[i]].end(), i);
if (it == g[a[i]].end())
it = g[a[i]].begin();
int dist = (*it > i ? *it - i : n - 1 - i + *it + 1);
dp[i][0] = dist + 1;
// cout << i << " " << dp[i][0] << endl;
}
for (ll i = 1; i < LOGN; ++i)
for (int u = 0; u < n; ++u) {
ll ds = dp[u][i - 1];
int nxtIdx = (dp[u][i - 1] + u) % n;
dp[u][i] = min(oo, ds + dp[nxtIdx][i - 1]);
}
ll idx = 0;
while (idx < n * k) {
bool add = true;
for (ll i = LOGN - 1; i >= 0; --i) {
ll realIdx = idx % n;
ll nxt = dp[realIdx][i];
if (nxt + idx <= n * k) {
idx = nxt + idx;
add = false;
}
}
if (add && idx < n * k) {
ans.push_back(idx);
idx++;
}
}
for (int i = 0; i < ans.size(); ++i) {
if (i)
printf(" ");
printf("%d", a[ans[i] % n]);
}
puts("");
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define x first
#define y second
typedef pair<int, int> pii;
typedef long long ll;
const int MOD = 1000000007;
const int N = 2 * 100000 + 1;
const ll oo = 2e18;
const int LOGN = 62;
int n, a[N];
ll k, dp[N][LOGN];
vector<int> g[N];
vector<ll> ans;
int main() {
cin >> n >> k;
for (int i = 0; i < n; ++i)
scanf("%d", a + i);
for (int i = 0; i < n; ++i)
g[a[i]].push_back(i);
for (int i = 0; i < n; ++i) {
auto it = ++lower_bound(g[a[i]].begin(), g[a[i]].end(), i);
if (it == g[a[i]].end())
it = g[a[i]].begin();
int dist = (*it > i ? *it - i : n - 1 - i + *it + 1);
dp[i][0] = dist + 1;
// cout << i << " " << dp[i][0] << endl;
}
for (ll i = 1; i < LOGN; ++i)
for (int u = 0; u < n; ++u) {
ll ds = dp[u][i - 1];
int nxtIdx = (dp[u][i - 1] + u) % n;
dp[u][i] = min(oo, ds + dp[nxtIdx][i - 1]);
}
ll idx = 0;
while (idx < n * k) {
bool add = true;
for (ll i = LOGN - 1; i >= 0; --i) {
ll realIdx = idx % n;
ll nxt = dp[realIdx][i];
if (nxt + idx <= n * k) {
idx = nxt + idx;
add = false;
}
}
if (add && idx < n * k) {
ans.push_back(idx);
idx++;
}
}
for (int i = 0; i < ans.size(); ++i) {
if (i)
printf(" ");
printf("%d", a[ans[i] % n]);
}
puts("");
return 0;
} | [] | 773,488 | 773,489 | u417705043 | cpp |
p02970 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define rep11(i, n) for (int i = 1; i < (int)(n); ++i)
#define rep0(i, n) for (int i = 1; i <= (int)(n); ++i)
#define repo(i, o, n) for (int i = o; i < (int)(n); ++i)
#define repm(i, n) for (int i = (int)(n)-1; i >= 0; --i)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define pb(n) push_back(n)
#define mp make_pair
#define MOD 1002000007
#define INF LO
int main() {
int n;
int d;
cin >> n >> d;
cout << n / (d * 2 + 1) << endl;
}
| #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define rep11(i, n) for (int i = 1; i < (int)(n); ++i)
#define rep0(i, n) for (int i = 1; i <= (int)(n); ++i)
#define repo(i, o, n) for (int i = o; i < (int)(n); ++i)
#define repm(i, n) for (int i = (int)(n)-1; i >= 0; --i)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define pb(n) push_back(n)
#define mp make_pair
#define MOD 1002000007
#define INF LO
int main() {
double n;
double d;
cin >> n >> d;
cout << ceil(n / (d * 2 + 1)) << endl;
}
| [
"variable_declaration.type.primitive.change",
"call.add",
"call.arguments.change"
] | 773,514 | 773,515 | u338193317 | cpp |
p02970 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, D;
cin >> N >> D;
int sum = 0;
int count = 0;
for (int i = 0; sum <= N; i++) {
sum += 2 * D + 1;
count++;
}
cout << count << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, D;
cin >> N >> D;
int sum = 0;
int count = 0;
for (int i = 0; sum < N; i++) {
sum += 2 * D + 1;
count++;
}
cout << count << endl;
} | [
"expression.operator.compare.change",
"control_flow.loop.for.condition.change",
"expression.off_by_one",
"expression.operation.binary.change"
] | 773,520 | 773,521 | u262451272 | cpp |
p02970 | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef pair<int, int> P;
typedef pair<double, double> P_D;
#define PI 3.1415926535897932384626433832795
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define reprev(i, n) for (int i = (int)n - 1; i >= 0; i--)
#define ALL(a) (a).begin(), (a).end()
#define C_MAX(a, b) ((a) > (b) ? (a) : (b))
#define fi first
#define se second
#define MAX 100100 // 5
#define MAX_N 200100
#define MAX_B 1001001 // 6
#define MAX_S 10010010 // 7
#define SENTINEL 2000000000 // 9
#define NIL -1
#define MOD 1000000007
#define INF 1 << 29
#define INFTY 1000000000000000000LL
#define MAX_INT INT_MAX
int main() {
int n, d;
cin >> n >> d;
int x = 2 * d + 1;
cout << n / x << endl;
} | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef pair<int, int> P;
typedef pair<double, double> P_D;
#define PI 3.1415926535897932384626433832795
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define reprev(i, n) for (int i = (int)n - 1; i >= 0; i--)
#define ALL(a) (a).begin(), (a).end()
#define C_MAX(a, b) ((a) > (b) ? (a) : (b))
#define fi first
#define se second
#define MAX 100100 // 5
#define MAX_N 200100
#define MAX_B 1001001 // 6
#define MAX_S 10010010 // 7
#define SENTINEL 2000000000 // 9
#define NIL -1
#define MOD 1000000007
#define INF 1 << 29
#define INFTY 1000000000000000000LL
#define MAX_INT INT_MAX
int main() {
int n, d;
cin >> n >> d;
int x = 2 * d + 1;
cout << (n + x - 1) / x << endl;
} | [] | 773,541 | 773,542 | u000212387 | cpp |
p02970 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
vector<int> input(int N) {
vector<int> vec(N);
for (int i = 0; i < N; i++) {
cin >> vec.at(i);
}
return vec;
}
int main() {
int n, d;
cin >> n >> d;
cout << (d + 2 * n) / (2 * n + 1) << endl;
}
| #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
vector<int> input(int N) {
vector<int> vec(N);
for (int i = 0; i < N; i++) {
cin >> vec.at(i);
}
return vec;
}
int main() {
int n, d;
cin >> n >> d;
cout << (n + 2 * d) / (2 * d + 1) << endl;
} | [
"identifier.change",
"io.output.change"
] | 773,544 | 773,545 | u492660436 | cpp |
p02970 | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using BigInt = long long;
#define ALL(a) (a).begin(), (a).end()
int cld(int a, int b) { return (a + (b - 1)) / b; }
int main() {
int N, D;
cin >> N >> D;
cout << cld(N--, 2 * D) << endl;
} | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using BigInt = long long;
#define ALL(a) (a).begin(), (a).end()
int cld(int a, int b) { return (a + (b - 1)) / b; }
int main() {
int N, D;
cin >> N >> D;
cout << cld(N, 2 * D + 1) << endl;
} | [
"call.arguments.change"
] | 773,550 | 773,551 | u879294842 | cpp |
p02970 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, D;
cin >> N >> D;
int k = 2 * D + 1;
int i = 0;
while (N < i * k)
i++;
cout << i << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, D;
cin >> N >> D;
int k = 2 * D + 1;
int i = 0;
while (i * k < N)
i++;
cout << i << endl;
return 0;
} | [
"expression.operation.binary.remove",
"control_flow.loop.condition.change"
] | 773,554 | 773,555 | u101018317 | cpp |
p02970 | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, N) for (int i = 0; i < (int)(N); i++)
int main() {
int n, d;
cin >> n >> d;
cout << ceil(n / (2 * d + 1)) << endl;
} | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, N) for (int i = 0; i < (int)(N); i++)
int main() {
double n, d;
cin >> n >> d;
cout << ceil(n / (2 * d + 1)) << endl;
}
| [
"variable_declaration.type.primitive.change"
] | 773,566 | 773,567 | u485925545 | cpp |
p02970 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int d;
cin >> d;
cout << (n / ((2 * d) + 1)) << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
float n;
cin >> n;
float d;
cin >> d;
cout << ceil(n / ((2 * d) + 1)) << endl;
}
| [
"variable_declaration.type.primitive.change",
"call.add"
] | 773,574 | 773,575 | u879949614 | cpp |
p02970 | #include <bits/stdc++.h>
#define ALL(l) (l).begin(), (l).end()
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
using namespace std;
typedef long long ll;
// const ll mod = 1000000007;
// const ll maxn = 1000000000;
//---------------------------------------------------------------------------------------------------
using vi = vector<int>; // intの1次元の型に vi という別名をつける
using vll = vector<ll>; // intの1次元の型に vi という別名をつける
using vvll = vector<vll>; // intの2次元の型に vvi という別名をつける
using vs = vector<string>; // stringの1次元の型に vs という別名をつける
using pll =
pair<ll, ll>; // これ以降 pii という型名はpair<ll, ll> と同じ意味で使える
//---------------------------------------------------------------------------------------------------
int main() {
ll n, d;
cin >> n >> d;
cout << (n + (2 * d - 1)) / (2 * d) << endl;
}
| #include <bits/stdc++.h>
#define ALL(l) (l).begin(), (l).end()
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
using namespace std;
typedef long long ll;
// const ll mod = 1000000007;
// const ll maxn = 1000000000;
//---------------------------------------------------------------------------------------------------
using vi = vector<int>; // intの1次元の型に vi という別名をつける
using vll = vector<ll>; // intの1次元の型に vi という別名をつける
using vvll = vector<vll>; // intの2次元の型に vvi という別名をつける
using vs = vector<string>; // stringの1次元の型に vs という別名をつける
using pll =
pair<ll, ll>; // これ以降 pii という型名はpair<ll, ll> と同じ意味で使える
//---------------------------------------------------------------------------------------------------
int main() {
ll n, d;
cin >> n >> d;
cout << (n + (2 * d)) / (2 * d + 1) << endl;
}
| [
"expression.operation.binary.remove"
] | 773,600 | 773,601 | u195822478 | cpp |
p02970 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define PI 3.14159265359
#define INF 1000100100
#define all(x) (x).begin(), (x).end()
#define P pair<int, int>
typedef long long ll;
using namespace std;
int main() {
int n, d;
cin >> n >> d;
int ans = 0;
while (n >= 0) {
n -= d * 2 + 1;
ans++;
}
cout << ans << endl;
return 0;
}
| #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define PI 3.14159265359
#define INF 1000100100
#define all(x) (x).begin(), (x).end()
#define P pair<int, int>
typedef long long ll;
using namespace std;
int main() {
int n, d;
cin >> n >> d;
int ans = 0;
while (n > 0) {
n -= d * 2 + 1;
ans++;
}
cout << ans << endl;
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.loop.condition.change"
] | 773,606 | 773,607 | u437779154 | cpp |
p02970 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, d;
cin >> n, d;
cout << (n + 2 * d) / (2 * d + 1) << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n, d;
cin >> n >> d;
cout << (n + 2 * d) / (2 * d + 1) << endl;
}
| [] | 773,624 | 773,625 | u449123607 | cpp |
p02970 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define strall(v) (v).cbegin(), (v).cend()
using namespace std;
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;
template <class t, class u> void chmax(t &a, u b) {
if (a < b)
a = b;
}
template <class t, class u> void chmin(t &a, u b) {
if (b < a)
a = b;
}
// const long long INF = 1LL << 60;
int INF = 500000;
int MAX = 1e5 + 10;
ll mod = 1e9 + 7;
int main() {
int n, d;
cin >> n >> d;
int b = 2 * d;
int ans = (n + b - 1) / 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()
#define rall(v) (v).rbegin(), (v).rend()
#define strall(v) (v).cbegin(), (v).cend()
using namespace std;
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;
template <class t, class u> void chmax(t &a, u b) {
if (a < b)
a = b;
}
template <class t, class u> void chmin(t &a, u b) {
if (b < a)
a = b;
}
// const long long INF = 1LL << 60;
int INF = 500000;
int MAX = 1e5 + 10;
ll mod = 1e9 + 7;
int main() {
int n, d;
cin >> n >> d;
int b = 2 * d + 1;
int ans = (n + b - 1) / b;
cout << ans << endl;
} | [
"assignment.change"
] | 773,626 | 773,627 | u106635407 | cpp |
p02970 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, d, total = 0;
cin >> n >> d;
d *= 2;
total = (n + 2 * d) / (2 * d + 1);
cout << total << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n, d, total = 0;
cin >> n >> d;
total = (n + 2 * d) / (2 * d + 1);
cout << total << endl;
}
| [] | 773,628 | 773,629 | u106635407 | cpp |
p02970 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, d;
cin >> n >> d;
int h = 2 * d + 1;
int am = 0, sh = n / d;
if (n % d > 0) {
am = 1;
}
cout << sh + am << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n, d;
cin >> n >> d;
int h = 2 * d + 1;
int am = 0, sh = n / h;
if (n % h > 0) {
am = 1;
}
cout << sh + am << endl;
}
| [
"identifier.change",
"expression.operation.binary.change",
"control_flow.branch.if.condition.change"
] | 773,632 | 773,633 | u323864528 | cpp |
p02970 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;
int main() {
ll n, d;
in2(n, d);
d = 2 * d - 1;
out((n + d - 1) / d);
memi;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;
int main() {
ll n, d;
in2(n, d);
d = 2 * d + 1;
out((n + d - 1) / d);
memi;
} | [
"misc.opposites",
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 773,657 | 773,658 | u917049698 | cpp |
p02970 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int n, d;
cin >> n >> d;
int c = 0;
int ans = 0;
for (int i = 0; i < n; i++) {
if (c <= i - d) {
c = i + d + 1;
ans++;
}
}
if (c < n - 1)
ans++;
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int n, d;
cin >> n >> d;
int c = 0;
int ans = 0;
for (int i = 0; i < n; i++) {
if (c <= i - d) {
c = i + d + 1;
ans++;
}
}
if (c < n)
ans++;
cout << ans << endl;
} | [
"expression.operation.binary.remove"
] | 773,662 | 773,663 | u316226687 | cpp |
p02970 | #include "bits/stdc++.h"
using namespace std;
#define ll long long;
// Start Time: 11:41
int main() {
std::ios::sync_with_stdio(false);
int N, D;
cin >> N >> D;
int sum = 0;
int count = 0;
int temp = 0;
for (int x = D + 1; x <= N; x += 2 * D + 1) {
count++;
}
cout << count;
} | #include "bits/stdc++.h"
using namespace std;
#define ll long long;
// Start Time: 11:41
int main() {
std::ios::sync_with_stdio(false);
int N, D;
cin >> N >> D;
int sum = 0;
int count = 0;
int temp = 0;
for (int x = 1; x <= N; x += 2 * D + 1) {
count++;
}
cout << count;
} | [
"control_flow.loop.for.initializer.change",
"expression.operation.binary.remove"
] | 773,664 | 773,665 | u726771425 | cpp |
p02970 | #include <bits/stdc++.h>
using namespace std;
void solve(long long N, long long D) {
int count = 0;
while (N >= 0) {
N -= 2 * D + 1;
count++;
};
cout << count << endl;
}
// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools (tips: You
// use the default template now. You can remove this line by using your custom
// template)
int main() {
long long N;
scanf("%lld", &N);
long long D;
scanf("%lld", &D);
solve(N, D);
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
void solve(long long N, long long D) {
int count = 0;
while (N > 0) {
N -= 2 * D + 1;
count++;
};
cout << count << endl;
}
// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools (tips: You
// use the default template now. You can remove this line by using your custom
// template)
int main() {
long long N;
scanf("%lld", &N);
long long D;
scanf("%lld", &D);
solve(N, D);
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.loop.condition.change"
] | 773,668 | 773,669 | u777890016 | cpp |
p02970 | #include <bits/stdc++.h>
using namespace std;
int main() {
double n, d;
cin >> n >> d;
cout << ceil(n / 2 * d + 1) << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
double n, d;
cin >> n >> d;
cout << ceil(n / ((2 * d) + 1)) << endl;
} | [
"call.arguments.change"
] | 773,676 | 773,677 | u578871832 | cpp |
p02970 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, d;
cin >> n >> d;
cout << ceil(n / 2 * d + 1) << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
double n, d;
cin >> n >> d;
cout << ceil(n / ((2 * d) + 1)) << endl;
} | [
"variable_declaration.type.primitive.change",
"call.arguments.change"
] | 773,678 | 773,677 | u578871832 | cpp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.