problem_id stringlengths 6 6 | buggy_code stringlengths 8 526k | fixed_code stringlengths 12 526k | labels listlengths 0 15 ⌀ | buggy_submission_id int64 1 1.54M | fixed_submission_id int64 2 1.54M | user_id stringlengths 10 10 | language stringclasses 8
values |
|---|---|---|---|---|---|---|---|
p02584 | #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD = 1000000007;
#ifndef ONLINE_JUDGE
template <class T, class U>
ostream &operator<<(ostream &o, const map<T, U> &obj) {
o << "{";
for (auto &x : obj)
o << " (" << x.first << " : " << x.second << ")... | #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD = 1000000007;
#ifndef ONLINE_JUDGE
template <class T, class U>
ostream &operator<<(ostream &o, const map<T, U> &obj) {
o << "{";
for (auto &x : obj)
o << " (" << x.first << " : " << x.second << ")... | null | 286,339 | 286,340 | u006785216 | cpp |
p02584 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define printInt(a) printf("%d\n", a)
#define printll(a) printf("%lld\n", a)
#define printdbl(a) printf("%lf\n", a)
#define printYes() printf("Yes\n")
#define printNo() printf("No\n")
#define scanll(a) scanf("%lld", &a)
#define scanInt(a) scanf("%... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define printInt(a) printf("%d\n", a)
#define printll(a) printf("%lld\n", a)
#define printdbl(a) printf("%lf\n", a)
#define printYes() printf("Yes\n")
#define printNo() printf("No\n")
#define scanll(a) scanf("%lld", &a)
#define scanInt(a) scanf("%... | null | 286,345 | 286,346 | u393845791 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(V) V.begin(), V.end()
const ll MOD = 1000000007;
int main() {
ll X, K, D;
cin >> X >> K >> D;
if (X < 0)
X = -X;
if (X >= K * D) {
cout << X - K * D << endl;
} else {
K -= X / D;
X %= D;
if (K % 2) {
cou... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(V) V.begin(), V.end()
const ll MOD = 1000000007;
int main() {
ll X, K, D;
cin >> X >> K >> D;
if (X < 0)
X = -X;
if (X / D >= K) {
cout << X - K * D << endl;
} else {
K -= X / D;
X %= D;
if (K % 2) {
cou... | null | 286,369 | 286,370 | u045811375 | cpp |
p02584 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll x, k, d;
cin >> x >> k >> d;
if (x >= 0) {
ll pos_ans = x % d;
ll neg_ans = abs(pos_ans - d);
ll pos_ans_move_cnt = x / d;
ll neg_ans_move_... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll x, k, d;
cin >> x >> k >> d;
if (x >= 0) {
ll pos_ans = x % d;
ll neg_ans = abs(pos_ans - d);
ll pos_ans_move_cnt = x / d;
ll neg_ans_move_... | null | 286,405 | 286,406 | u665038048 | cpp |
p02584 | #include <bits/stdc++.h>
#define REP(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for (int(i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << "\n"
using namespace std;
using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
const long ... | #include <bits/stdc++.h>
#define REP(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for (int(i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << "\n"
using namespace std;
using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
const long ... | null | 286,423 | 286,424 | u569690172 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, k, d;
cin >> n >> k >> d;
if (n < 0)
n = -n;
if (double(n / d) < k) {
// cout << "w";
if (k % 2 == 1) {
cout << min((n + d) % (2 * d), -((n - d) % (2 * d) - 2 * d));
} else {
cout << min(n % (2 * d), -(n % (2 * ... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, k, d;
cin >> n >> k >> d;
if (n < 0)
n = -n;
if (double(n / d) < k) {
// cout << 'w';
if (k % 2 == 1) {
cout << min((n + d) % (2 * d), -((n + d) % (2 * d) - 2 * d));
} else {
cout << min(n % (2 * d), -(n % (2 * ... | null | 286,448 | 286,449 | u965787387 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, k, d;
cin >> n >> k >> d;
if (n < 0)
n = -n;
if (double(n / d) < k) {
if (d % 2 == 1) {
cout << min((n + d) % (2 * d), -((n - d) % (2 * d) - 2 * d));
} else {
cout << min(n % (2 * d), -(n % (2 * d) - 2 * d));
}
... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, k, d;
cin >> n >> k >> d;
if (n < 0)
n = -n;
if (double(n / d) < k) {
// cout << 'w';
if (k % 2 == 1) {
cout << min((n + d) % (2 * d), -((n + d) % (2 * d) - 2 * d));
} else {
cout << min(n % (2 * d), -(n % (2 * ... | null | 286,450 | 286,449 | u965787387 | cpp |
p02584 |
//
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// const int INF = 2147483647;
// const ll INF = 9223372036854775807;
// const ll MOD = 1e9 + 7;
int main() {
ll X, K, D;
cin >> X >> K >> D;
X = abs(X);
ll ans;
if (D * K <= X) {
ans = X - D * K;
} else {
ll k = X / D;
... |
//
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// const int INF = 2147483647;
// const ll INF = 9223372036854775807;
// const ll MOD = 1e9 + 7;
int main() {
ll X, K, D;
cin >> X >> K >> D;
X = abs(X);
ll ans;
if (K <= X / D) {
ans = X - D * K;
} else {
ll k = X / D;
... | null | 286,174 | 286,175 | u790272146 | cpp |
p02584 | // In the name of Allah :)
#include <bits/stdc++.h>
using namespace std;
string to_string(char c) { return string(1, c); }
string to_string(bool b) { return b ? "true" : "false"; }
string to_string(const char *s) { return (string)s; }
string to_string(string s) { return s; }
template <class A> string to_string(complex<... | // In the name of Allah :)
#include <bits/stdc++.h>
using namespace std;
string to_string(char c) { return string(1, c); }
string to_string(bool b) { return b ? "true" : "false"; }
string to_string(const char *s) { return (string)s; }
string to_string(string s) { return s; }
template <class A> string to_string(complex<... | null | 286,282 | 286,283 | u375827135 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
if (x < 0)
x *= -1;
if (x >= k * d) {
cout << (x - k * d) << endl;
} else {
cout << abs((x % d) - d * ((k - (x / d)) % 2)) << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long x, k, d;
cin >> x >> k >> d;
if (x < 0)
x *= -1;
if (x / d >= k) {
cout << (x - k * d) << endl;
} else {
cout << abs((x % d) - d * ((k - (x / d)) % 2)) << endl;
}
} | null | 286,313 | 286,314 | u879391720 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
const int INF = 1 << 29;
const int MOD = 1000000007;
long long ruizyou(long long m, long long n) {
if (m == 0)
return 0;
if (m == 1)
return 1;
long long ans = 1;
long long tmp = m;
for (i... | #include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
const int INF = 1 << 29;
const int MOD = 1000000007;
long long ruizyou(long long m, long long n) {
if (m == 0)
return 0;
if (m == 1)
return 1;
long long ans = 1;
long long tmp = m;
for (i... | null | 286,504 | 286,505 | u953499988 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FOR(i, a, b) for (int i = a; i < (b); i++)
#define For(i, a) for (int i = 0; i < (a); i++)
#define FORR(i, a, b) for (int i = (b)-1; i >= a; i--)
#define Forr(i, a) for (int i = (a)-1; i >= 0; i--)
#define deb(...) cerr << "[" << #__VA_AR... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FOR(i, a, b) for (int i = a; i < (b); i++)
#define For(i, a) for (int i = 0; i < (a); i++)
#define FORR(i, a, b) for (int i = (b)-1; i >= a; i--)
#define Forr(i, a) for (int i = (a)-1; i >= 0; i--)
#define deb(...) cerr << "[" << #__VA_AR... | null | 286,556 | 286,557 | u372601756 | cpp |
p02584 | //#define local
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define rep(i, n) \
; \
for (long long i = 0; i < (n); i++)
using ll = long long;
using P = pair<lon... | //#define local
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define rep(i, n) \
; \
for (long long i = 0; i < (n); i++)
using ll = long long;
using P = pair<lon... | null | 286,558 | 286,559 | u583628727 | cpp |
p02584 | //#define local
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define rep(i, n) \
; \
for (long long i = 0; i < (n); i++)
using ll = long long;
using P = pair<lon... | //#define local
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define rep(i, n) \
; \
for (long long i = 0; i < (n); i++)
using ll = long long;
using P = pair<lon... | null | 286,560 | 286,559 | u583628727 | cpp |
p02584 | /*
author : nishi5451
created : 15.08.2020 21:12:16
*/
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
int main() {
ll x, k, d;
cin >> x >> k >> d;
ll ans;
if (x < 0) {
ll res = abs(x) / d;
if (k > res) {
if (k - res ... | /*
author : nishi5451
created : 15.08.2020 21:12:16
*/
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
int main() {
ll x, k, d;
cin >> x >> k >> d;
ll ans;
if (x < 0) {
ll res = abs(x) / d;
if (k > res) {
if ((k - res... | null | 286,571 | 286,572 | u033937898 | cpp |
p02584 | #include <bits/stdc++.h>
#define pb push_back
#define ll int
#define mp make_pair
#define int long long
#define ff first
#define ss second
const int p = 1e9 + 7;
const int mod = 1e9 + 7;
const int Mod = 1e9 + 7;
const int INF = 1e9 + 7;
const int Maxn = 1000000;
using namespace std;
void solve() {
int x, k, d;
cin... | #include <bits/stdc++.h>
#define pb push_back
#define ll int
#define mp make_pair
#define int long long
#define ff first
#define ss second
const int p = 1e9 + 7;
const int mod = 1e9 + 7;
const int Mod = 1e9 + 7;
const int INF = 1e9 + 7;
const int Maxn = 1000000;
using namespace std;
void solve() {
int x, k, d;
cin... | null | 286,595 | 286,596 | u663454707 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long X, K, D, num, m, n, num1;
cin >> X >> K >> D;
num = X / D;
m = X - num * D;
if (K <= num) {
if (X <= 0)
K = -K;
cout << abs(X - K * D) << endl;
} else {
if (X <= 0)
n = m + D;
else
n = m - D;
num1 = ... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long X, K, D, num, m, n, num1;
cin >> X >> K >> D;
num = X / D;
m = X - num * D;
if (K <= abs(num)) {
if (X <= 0)
K = -K;
cout << abs(X - K * D) << endl;
} else {
if (X <= 0)
n = m + D;
else
n = m - D;
nu... | null | 288,231 | 288,232 | u021116955 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
long long int Exp(long long int exp_n, long long int exp_e, long long exp_mod);
int main() {
long long int X, K, D, O, N;
cin >> X >> K >> D;
X = llabs(X);
if (X > K * D) {
O = X - K * D;
} else {
N = X / D;
X = X - N * D;
K = K - N;
if (K % ... | #include <bits/stdc++.h>
using namespace std;
long long int Exp(long long int exp_n, long long int exp_e, long long exp_mod);
int main() {
long long int X, K, D, O, N;
cin >> X >> K >> D;
X = llabs(X);
if (X / D > K) {
O = X - K * D;
} else {
N = X / D;
X = X - N * D;
K = K - N;
if (K % ... | null | 288,266 | 288,267 | u839962817 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
// -----------------<fast IO>------------------
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); ... | #include <bits/stdc++.h>
using namespace std;
// -----------------<fast IO>------------------
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); ... | null | 288,294 | 288,295 | u244646835 | cpp |
p02584 | #pragma region header
#include <bits/stdc++.h>
using namespace std;
#define int long long
#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 rev(i, n) for (int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for (int i = (int)(n); i > 0; i--)
#define pb... | #pragma region header
#include <bits/stdc++.h>
using namespace std;
#define int long long
#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 rev(i, n) for (int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for (int i = (int)(n); i > 0; i--)
#define pb... | null | 288,296 | 288,297 | u608773191 | cpp |
p02584 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
#include <bits/stdc++.h>
using namespace std;
int main() {
ll x, k, d;
cin >> x >> k >> d;
if (k * d <= abs(x))
cout << abs(abs(x) - k * d) << endl;
else if ((abs(x) / d) % 2 == 0) {
if (k % 2... | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
#include <bits/stdc++.h>
using namespace std;
int main() {
ll x, k, d;
cin >> x >> k >> d;
if (k <= abs(x) / d)
cout << abs(abs(x) - k * d) << endl;
else if ((abs(x) / d) % 2 == 0) {
if (k % 2... | null | 288,332 | 288,333 | u135957438 | cpp |
p02584 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll X, K, D;
cin >> X >> K >> D;
ll first = abs(X / D);
if (K < first) {
if (X > 0)
cout << X - K * D << endl;
else
cout << X + K * D << endl;
return 0;
}
K -= first;
ll now;
if (X < 0) {
now = X... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll X, K, D;
cin >> X >> K >> D;
ll first = abs(X / D);
if (K < first) {
if (X > 0)
cout << abs(X - K * D) << endl;
else
cout << abs(X + K * D) << endl;
return 0;
}
K -= first;
ll now;
if (X < 0) {
... | null | 287,270 | 287,271 | u404794295 | cpp |
p02574 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define reps(i, n) for (int i = 1, i##_len = (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 rep2(i, s, n) for (int i = (s); i <... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define reps(i, n) for (int i = 1, i##_len = (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 rep2(i, s, n) for (int i = (s); i <... | null | 271,976 | 271,977 | u016444909 | cpp |
p02574 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int gcd(int a, int b) {
if (b == 0) {
return a;
} else {
return gcd(b, a % b);
}
}
int main() {
int x[1000010], n, b[1000010], a[1000010], i, j;
cin >> n;
int res = 0;
for (i = 0; i < n; i++) {
scanf(... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int gcd(int a, int b) {
if (b == 0) {
return a;
} else {
return gcd(b, a % b);
}
}
int main() {
int n, b[1000010], a[1000010], i, j;
cin >> n;
int res = 0;
for (i = 0; i < n; i++) {
scanf("%d", &a[i])... | null | 270,023 | 270,024 | u265187423 | cpp |
p02574 | #include <bits/stdc++.h>
using namespace std;
#define int long long
int my_gcd(int n, int m) {
if (n < m)
swap(n, m);
if (m == 0)
return n;
return my_gcd(m, n % m);
}
signed main() {
// cout << fixed << setprecision(10) << flush;
int n;
cin >> n;
vector<int> a(n);
int maxa = 0;
for (int i =... | #include <bits/stdc++.h>
using namespace std;
#define int long long
int my_gcd(int n, int m) {
if (n < m)
swap(n, m);
if (m == 0)
return n;
return my_gcd(m, n % m);
}
signed main() {
// cout << fixed << setprecision(10) << flush;
int n;
cin >> n;
vector<int> a(n);
int maxa = 0;
for (int i =... | null | 271,866 | 271,867 | u658401995 | cpp |
p02574 | #include <bits/stdc++.h>
#define fi first
#define se second
#define eb emplace_back
#define all(v) (v).begin(), (v).end()
#define rmin(r, x) r = min(r, x);
#define rmax(r, x) r = max(r, x);
#define ends ' '
#define endl '\n'
#define fastio ios_base::sync_with_stdio(0), cin.tie(0)
using namespace std;
typedef long long ... | #include <bits/stdc++.h>
#define fi first
#define se second
#define eb emplace_back
#define all(v) (v).begin(), (v).end()
#define rmin(r, x) r = min(r, x);
#define rmax(r, x) r = max(r, x);
#define ends ' '
#define endl '\n'
#define fastio ios_base::sync_with_stdio(0), cin.tie(0)
using namespace std;
typedef long long ... | null | 271,551 | 271,552 | u365928829 | cpp |
p02574 | #include <bits/stdc++.h>
#define DAU \
ios::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
#define PLEC exit(0);
using namespace... | #include <bits/stdc++.h>
#define DAU \
ios::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
#define PLEC exit(0);
using namespace... | null | 271,574 | 271,575 | u722036092 | cpp |
p02574 | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define mod 1000000007
#define inf 9000000000000000000
typedef pair<ll, ll> pll;
typedef pair<int, int> pint;
#define PI 3.14159265359
#define endl '\n'
#define itn int
#define cout1(a) cout << a << endl
#define cout2(a, b) cout << a << ' ' << b <<... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define mod 1000000007
#define inf 9000000000000000000
typedef pair<ll, ll> pll;
typedef pair<int, int> pint;
#define PI 3.14159265359
#define endl '\n'
#define itn int
#define cout1(a) cout << a << endl
#define cout2(a, b) cout << a << ' ' << b <<... | null | 271,610 | 271,611 | u920271139 | cpp |
p02575 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, m, n) for (int(i) = (int)(m); i < (int)(n); ++i)
#define rep2(i, m, n) for (int(i) = (int)(n)-1; i >= (int)(m); --i)
#define REP(i, n) rep(i, 0, n)
#define REP2(i, n) rep2(i, 0, n)
#define all(hoge) (hoge).begin(), (hoge).end()
#define en '\n'
using ll = lon... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, m, n) for (int(i) = (int)(m); i < (int)(n); ++i)
#define rep2(i, m, n) for (int(i) = (int)(n)-1; i >= (int)(m); --i)
#define REP(i, n) rep(i, 0, n)
#define REP2(i, n) rep2(i, 0, n)
#define all(hoge) (hoge).begin(), (hoge).end()
#define en '\n'
using ll = lon... | null | 271,716 | 271,717 | u712993629 | cpp |
p02575 | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
#define all(v) v.begin(), v.end()
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int64_t h, w;
cin >> h >> w;
vector<vector<int64_t>> A(h, vector<int64_t>(2, 0));
i... | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
#define all(v) v.begin(), v.end()
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int64_t h, w;
cin >> h >> w;
vector<vector<int64_t>> A(h, vector<int64_t>(2, 0));
i... | null | 283,415 | 283,416 | u325227960 | cpp |
p02575 | /*
Author: Nguyen Tan Bao
Status:
Idea:
*/
#include <bits/stdc++.h>
#define FI first
#define SE second
#define EPS 1e-9
#define ALL(a) a.begin(), a.end()
#define SZ(a) int((a).size())
#define MS(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORE(i, a, b) for (i... | /*
Author: Nguyen Tan Bao
Status:
Idea:
*/
#include <bits/stdc++.h>
#define FI first
#define SE second
#define EPS 1e-9
#define ALL(a) a.begin(), a.end()
#define SZ(a) int((a).size())
#define MS(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORE(i, a, b) for (i... | null | 283,468 | 283,469 | u131020584 | cpp |
p02575 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define RFOR(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
#define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++)
#define RITR(x, c) for (__typeof(c.... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define RFOR(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
#define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++)
#define RITR(x, c) for (__typeof(c.... | null | 283,472 | 283,473 | u682686221 | cpp |
p02575 | #include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int h, w;
cin >> h >> w;
map<int, int> mp; // mp[now] = start
multiset<int> ms; // multiset of (now - start)
for (int i = 0; i < w; i++) {
mp[i] = i;
ms.insert(0);
}
mp[2e8] = 1e8; // sentin... | #include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int h, w;
cin >> h >> w;
map<int, int> mp; // mp[now] = start
multiset<int> ms; // multiset of (now - start)
for (int i = 0; i < w; i++) {
mp[i] = i;
ms.insert(0);
}
mp[2e8] = 1e8; // sentin... | null | 283,482 | 283,483 | u979163294 | cpp |
p02575 |
#include <algorithm>
#include <functional>
#include <iomanip> //! for setprecision(10)
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#include <cstring>
#include <map>
#include <queue>
#include <set>
#include <utility>
using namespace std;
typedef long long LL;
#define dump(c) ... |
#include <algorithm>
#include <functional>
#include <iomanip> //! for setprecision(10)
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#include <cstring>
#include <map>
#include <queue>
#include <set>
#include <utility>
using namespace std;
typedef long long LL;
#define dump(c) ... | null | 283,484 | 283,485 | u851470173 | cpp |
p02576 | /*
submission # - User: herp_sy
https://atcoder.jp/contests/
coding: utf-8
lang: C++ (GCC 9.2.1)
*/
#include <bits/stdc++.h>
using namespace std;
// utility of stdin,stdout
#define _CRT_SECURE_NO_WARNINGS
#define OUT cout <<
#define BR << endl
#define RET return 0
#define TLong long l... | /*
submission # - User: herp_sy
https://atcoder.jp/contests/
coding: utf-8
lang: C++ (GCC 9.2.1)
*/
#include <bits/stdc++.h>
using namespace std;
// utility of stdin,stdout
#define _CRT_SECURE_NO_WARNINGS
#define OUT cout <<
#define BR << endl
#define RET return 0
#define TLong long l... | null | 272,016 | 272,017 | u185464141 | cpp |
p02576 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
const ll INF = 1e18;
int main() {
double n, x, t;
cin >> n >> x >> t;
x = ceil(n / x);
cout << x * t << endl;
} | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
const ll INF = 1e18;
int main() {
double n, x, t;
cin >> n >> x >> t;
x = ceil(n / x);
cout << int(x * t) << endl;
} | null | 272,020 | 272,021 | u183407347 | cpp |
p02576 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, a, t;
cin >> n >> a >> t;
int l = n / a;
if ((n / a) % t != 0)
l = l + 1;
cout << l * t;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, a, t;
cin >> n >> a >> t;
int l = n / a;
if (n % a != 0)
l = l + 1;
cout << l * t;
return 0;
} | null | 272,061 | 272,062 | u671879184 | cpp |
p02576 | #include <iostream>
using namespace std;
int main() {
int N, X, T;
cin >> N >> X >> T;
int count = T;
for (int i = X; i < N; i += X) {
count += T;
}
cout << T << endl;
} | #include <iostream>
using namespace std;
int main() {
int N, X, T;
cin >> N >> X >> T;
int count = T;
for (int i = X; i < N; i += X) {
count += T;
}
cout << count << endl;
return 0;
} | null | 272,076 | 272,077 | u054820639 | cpp |
p02576 | #include <iostream>
#include <vector>
using namespace std;
int main() {
int N, X, T;
cin >> N >> X >> T;
cout << (N / X + 1) * T << endl;
} | #include <iostream>
#include <vector>
using namespace std;
int main() {
int N, X, T;
cin >> N >> X >> T;
cout << ((N - 1) / X + 1) * T << endl;
} | null | 272,098 | 272,099 | u716537187 | cpp |
p02576 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, x, t;
cin >> n >> x >> t;
cout << (n / x + 1) * t << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, x, t;
cin >> n >> x >> t;
cout << (n + x - 1) / x * t << endl;
} | null | 272,122 | 272,123 | u402209208 | cpp |
p02576 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, x, t;
cin >> n >> x >> t;
cout << ceil(n / (double)x) * t << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, x, t;
cin >> n >> x >> t;
cout << (int)ceil(n / (double)x) * t << endl;
} | null | 272,135 | 272,136 | u798086274 | cpp |
p02576 | #include <iostream>
using namespace std;
int main() {
int X, N, T, count = 0;
cin >> X >> N >> T;
while (true) {
N -= X;
count++;
if (N <= 0) {
break;
}
}
cout << count * T;
} | #include <iostream>
using namespace std;
int main() {
int X, N, T, count = 0;
cin >> N >> X >> T;
while (true) {
N -= X;
count++;
if (N <= 0) {
break;
}
}
cout << count * T;
} | null | 272,263 | 272,264 | u358613059 | cpp |
p02576 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, x, t;
cin >> n >> x >> t;
if (!n % x)
cout << n / x * t << endl;
else
cout << (n / x + 1) * t << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, x, t;
cin >> n >> x >> t;
if (n % x == 0)
cout << n / x * t << endl;
else
cout << (n / x + 1) * t << endl;
return 0;
} | null | 272,290 | 272,291 | u688795994 | cpp |
p02576 | #include <bits/stdc++.h>
using namespace std;
// in-short-use macros
#define all(c) (c).begin(), (c).end()
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mod 1000000007
#define PI 3.14159265
#define sizes 1000010
// main function h... | #include <bits/stdc++.h>
using namespace std;
// in-short-use macros
#define all(c) (c).begin(), (c).end()
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mod 1000000007
#define PI 3.14159265
#define sizes 1000010
// main function h... | null | 272,332 | 272,333 | u760859588 | cpp |
p02576 | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
//#include<bits/stdc++.h>
#define... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
//#include<bits/stdc++.h>
#define... | null | 272,749 | 272,750 | u331213700 | cpp |
p02576 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int a(int n, int x, int t) {
int ans = (n / x) * t;
if (n % x == 0) {
return ans;
}
return ans + 1;
}
int main() {
int n, x, t;
cin >> n >> x >> t;
cout << a(n, x, t);
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int a(int n, int x, int t) {
int ans = (n / x) * t;
if (n % x == 0) {
return ans;
}
return ans + t;
}
int main() {
int n, x, t;
cin >> n >> x >> t;
cout << a(n, x, t);
} | null | 272,807 | 272,808 | u570229212 | cpp |
p02576 | #include <iostream>
using namespace std;
int main() {
int n, x, t = 0;
int times = 0;
cin >> n >> x >> t;
times = n / x;
if (n % x > 0) {
times += 1;
}
cout << times;
} | #include <iostream>
using namespace std;
int main() {
int n, x, t = 0;
int times = 0;
cin >> n >> x >> t;
times = n / x;
if (n % x > 0) {
times += 1;
}
cout << times * t;
}
| null | 272,607 | 272,608 | u032125729 | cpp |
p02576 | #include <iostream>
using namespace std;
int main() {
int n, x, t, a;
cin >> n >> x >> t;
if (n % x == 0)
a = (n / x) * t;
else
a = ((n / x) + 1) * t;
return 0;
} | #include <iostream>
using namespace std;
int main() {
int n, x, t, a;
cin >> n >> x >> t;
if (n % x == 0)
a = (n / x) * t;
else
a = ((n / x) + 1) * t;
cout << a;
return 0;
} | null | 272,663 | 272,664 | u027778523 | cpp |
p02576 | #include <bits/stdc++.h>
#define int long long
#define rep(i, a, b) for (int i = a; i < b; i += 1)
#define reps(i, a, b) for (int i = a; i >= b; i -= 1)
#define vi vector<int>
#define vvi vector<vector<int>>
#define pb push_back
#define pi pair<int, int>
#define mp make_pair
#define ff first
#define ss second
#define i... | #include <bits/stdc++.h>
#define int long long
#define rep(i, a, b) for (int i = a; i < b; i += 1)
#define reps(i, a, b) for (int i = a; i >= b; i -= 1)
#define vi vector<int>
#define vvi vector<vector<int>>
#define pb push_back
#define pi pair<int, int>
#define mp make_pair
#define ff first
#define ss second
#define i... | null | 272,429 | 272,430 | u547231875 | cpp |
p02576 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using st = string;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define chmax(x, y) \
{ x = max(x, y); }
#define chmin(x, y) ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using st = string;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define chmax(x, y) \
{ x = max(x, y); }
#define chmin(x, y) ... | null | 272,147 | 272,148 | u074141555 | cpp |
p02576 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, x, t;
cin >> n >> x >> t;
cout << (n * 2 - 1) / x * t;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, x, t;
cin >> n >> x >> t;
cout << (n + x - 1) / x * t;
return 0;
} | null | 273,038 | 273,039 | u006783139 | cpp |
p02576 | #include <bits/stdc++.h>
using namespace std;
#define SPEED \
ios::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0)
#define fileio ... | #include <bits/stdc++.h>
using namespace std;
#define SPEED \
ios::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0)
#define fileio ... | null | 273,042 | 273,043 | u621912640 | cpp |
p02576 | #include <iostream>
typedef long long ll;
using namespace std;
int main(void) {
int X, T, N;
cin >> N >> X >> T;
if (N <= X) {
cout << T;
} else {
if (N % T == 0) {
cout << (N / X) * T;
} else
cout << (N / X) * T + T;
}
return 0;
} | #include <iostream>
typedef long long ll;
using namespace std;
int main(void) {
int X, T, N;
cin >> N >> X >> T;
if (N <= X) {
cout << T;
} else {
if (N % X == 0) {
cout << (N / X) * T;
} else
cout << (N / X) * T + T;
}
return 0;
}
| null | 272,880 | 272,881 | u894134667 | cpp |
p02576 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, x, t;
cin >> n >> x >> t;
int ans;
ans = 20 / 12;
if (20 % 12 > 0)
ans++;
cout << ans * t;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, x, t;
cin >> n >> x >> t;
int ans;
ans = n / x;
if (n % x > 0)
ans++;
cout << ans * t;
} | null | 272,823 | 272,824 | u271651326 | cpp |
p02576 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, T, X;
cin >> N >> T >> X;
if (N % X == 0)
cout << (N / X) * T << endl;
else
cout << (N / X + 1) * T << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int N, T, X;
cin >> N >> X >> T;
if (N % X == 0)
cout << (N / X) * T << endl;
else
cout << (N / X + 1) * T << endl;
}
| null | 272,847 | 272,848 | u756273400 | cpp |
p02576 | #include <bits/stdc++.h>
using namespace std;
int main() {
float n, x, t;
cin >> n >> x >> t;
cout << ceil(n / x) * t;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
float n, x, t;
cin >> n >> x >> t;
cout << int(ceil(n / x) * t);
return 0;
} | null | 272,855 | 272,856 | u941794834 | cpp |
p02576 | #include <bits/stdc++.h>
using namespace std;
int main() {
double n, x, t;
cin >> n >> x >> t;
double ans = ceil(n / x) * t;
cout << ans << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
double n, x, t;
cin >> n >> x >> t;
int ans = ceil(n / x) * t;
cout << ans << endl;
return 0;
} | null | 272,857 | 272,858 | u939030820 | cpp |
p02576 | #include <bits/stdc++.h>
using namespace std;
// #include <bits/stdtr1c++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// #pragma GCC optimize("Ofast,no-stack-protector")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=nat... | #include <bits/stdc++.h>
using namespace std;
// #include <bits/stdtr1c++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// #pragma GCC optimize("Ofast,no-stack-protector")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=nat... | null | 273,282 | 273,283 | u570582659 | cpp |
p02576 | #include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const double eps = 1e-8;
const int NINF = 0xc0c0c0c0;
const int INF = 0x3f3f3f3f;
const ll mod = 1e9 + 7;
const ll N = 1e6 + 5;
int main() {
ios::sync_with_stdio(fa... | #include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const double eps = 1e-8;
const int NINF = 0xc0c0c0c0;
const int INF = 0x3f3f3f3f;
const ll mod = 1e9 + 7;
const ll N = 1e6 + 5;
int main() {
ios::sync_with_stdio(fa... | null | 273,260 | 273,261 | u375212600 | cpp |
p02576 | #include <bits/stdc++.h>
#define vc vector<int>
#define um unordered_map<int, int>
#define ll long long
#define rep(i, a, b) for (__typeof(a) i = a; i < b; i++)
#define si(a) a.size()
#define all(a) a.begin(), a.end()
#define ss(a) a.second
#define ff(a) a.first
#define M 1000000
#define pb push_back
#define repit(i, a... | #include <bits/stdc++.h>
#define vc vector<int>
#define um unordered_map<int, int>
#define ll long long
#define rep(i, a, b) for (__typeof(a) i = a; i < b; i++)
#define si(a) a.size()
#define all(a) a.begin(), a.end()
#define ss(a) a.second
#define ff(a) a.first
#define M 1000000
#define pb push_back
#define repit(i, a... | null | 273,268 | 273,269 | u219476246 | cpp |
p02576 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, x, t;
cin >> n >> x >> t;
long long sum = 0, sol = 0;
while (sum <= n) {
sum += x;
sol += t;
}
cout << sol;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, x, t;
cin >> n >> x >> t;
long long sum = 0, sol = 0;
while (sum < n) {
sum += x;
sol += t;
}
cout << sol;
return 0;
} | null | 273,469 | 273,470 | u644497121 | cpp |
p02577 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int len = s.size();
int sum = 0;
for (int i = 0; i < len; i++) {
sum += s.at(i);
}
if (sum % 9 == 0) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int len = s.size();
int sum = 0;
for (int i = 0; i < len; i++) {
sum += s.at(i) - '0'; //-"0"数字から数値へ変換
}
if (sum % 9 == 0) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| null | 273,655 | 273,656 | u549758406 | cpp |
p02577 | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
int main() {
std::string N;
cin >> N;
size_t size = N.length();
int sum;
for (int i = 0; i < size; i++) {
sum += N[i] - '0';
if (sum % 9 == 0) {
cout << "Yes";
} else {
... | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
int main() {
std::string N;
cin >> N;
size_t size = N.length();
int sum = 0;
for (int i = 0; i < size; i++) {
sum += N[i] - '0';
}
if (sum % 9 == 0) {
cout << "Yes";
} else {... | null | 273,724 | 273,725 | u497701996 | cpp |
p02577 | #include <iostream>
#include <string>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
string s;
long long sum = 0;
cin >> s;
for (int i = 0; i < s.length(); i++) {
sum = s[i] - '0';
sum %= 9;
}
if (sum == 0)
cout << "Yes\n";
else
cout << "No\n";
retur... | #include <iostream>
#include <string>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
string s;
int sum = 0;
cin >> s;
for (int i = 0; i < s.length(); i++) {
sum += s[i] - '0';
sum %= 9;
}
if (sum == 0)
cout << "Yes\n";
else
cout << "No\n";
return 0;
... | null | 273,778 | 273,779 | u528036644 | cpp |
p02577 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n'
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
string s;
cin >> s;
ll sum = 0;
for (int i = 0; s[i]; i++) {
sum += (s[i] - '0');
}
cout << (sum % 9 == 0 ? "YES" : "NO") << endl;
retur... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n'
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
string s;
cin >> s;
ll sum = 0;
for (int i = 0; s[i]; i++) {
sum += (s[i] - '0');
}
cout << (sum % 9 == 0 ? "Yes" : "No") << endl;
retur... | null | 273,482 | 273,483 | u510314977 | cpp |
p02577 | #include <bits/stdc++.h>
using namespace std;
typedef unsigned int INT;
typedef unsigned long long LONG;
typedef long long LL;
typedef pair<int, int> PII;
const int N = 1e5 + 10;
const int mod = 1e9 + 7;
#define FW freopen("data2.txt", "w", stdout);
//读入输出外挂,只适用于整数,使用时流同步打开,C语言不准关流
// getchar()<<cin(关流)<<scanf()<<cin
t... | #include <bits/stdc++.h>
using namespace std;
typedef unsigned int INT;
typedef unsigned long long LONG;
typedef long long LL;
typedef pair<int, int> PII;
const int N = 1e5 + 10;
const int mod = 1e9 + 7;
#define FW freopen("data2.txt", "w", stdout);
//读入输出外挂,只适用于整数,使用时流同步打开,C语言不准关流
// getchar()<<cin(关流)<<scanf()<<cin
t... | null | 273,529 | 273,530 | u703460662 | cpp |
p02577 | /*Rabbi Zidni Ilma*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define sct(tc) scanf("%lld", &tc)
#define scl(n) scanf("%lld", &n)
#define scll(n, m) scanf("%lld%lld", &n, &m)
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define read freopen("input.txt", "r", st... | /*Rabbi Zidni Ilma*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define sct(tc) scanf("%lld", &tc)
#define scl(n) scanf("%lld", &n)
#define scll(n, m) scanf("%lld%lld", &n, &m)
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define read freopen("input.txt", "r", st... | null | 273,836 | 273,837 | u563355813 | cpp |
p02577 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
long int a = 0;
for (int i = 0; i < s.size(); ++i) {
a += (s[i] - '0') % 9;
}
if (a == 0) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
long int a = 0;
for (int i = 0; i < s.size(); ++i) {
a = (a + s[i] - '0') % 9;
}
if (a == 0) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
} | null | 273,953 | 273,954 | u798665594 | cpp |
p02577 | #include <bits/stdc++.h>
using namespace std;
char s[1000000];
int main() {
scanf("%s", s + 1);
int len = strlen(s + 1);
int ans = 0;
for (int i = 1; i <= len; i++)
ans += s[i] - '0';
if (ans % 9)
puts("NO");
else
puts("YES");
return 0;
} | #include <bits/stdc++.h>
using namespace std;
char s[1000000];
int main() {
scanf("%s", s + 1);
int len = strlen(s + 1);
int ans = 0;
for (int i = 1; i <= len; i++)
ans += s[i] - '0';
if (ans % 9)
puts("No");
else
puts("Yes");
return 0;
} | null | 273,996 | 273,997 | u020611671 | cpp |
p02577 | #include <bits/stdc++.h>
using namespace std;
int main() {
string t;
cin >> t;
int x = 0, i;
for (i = 0; i < t.size(); i++) {
x += t[i] - '0';
}
// cout<<x<<endl;
if (x % 9 == 0)
cout << "YES\n";
else
cout << "NO\n";
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string t;
cin >> t;
int x = 0, i;
for (i = 0; i < t.size(); i++) {
x += t[i] - '0';
}
// cout<<x<<endl;
if (x % 9 == 0)
cout << "Yes\n";
else
cout << "No\n";
return 0;
}
| null | 274,260 | 274,261 | u795342657 | cpp |
p02577 | #include <algorithm>
#include <iostream>
#include <queue>
#include <stack>
#include <utility>
#include <vector>
#define lli long long int
#define pb pushback
#define vec vector
using namespace std;
void dfs(vector<vector<int>> &adjList, vector<bool> &explored, int src);
void bfs(vector<vector<int>> &adjList, vector<b... | #include <algorithm>
#include <iostream>
#include <queue>
#include <stack>
#include <utility>
#include <vector>
#define lli long long int
#define pb pushback
#define vec vector
using namespace std;
void dfs(vector<vector<int>> &adjList, vector<bool> &explored, int src);
void bfs(vector<vector<int>> &adjList, vector<b... | null | 274,321 | 274,322 | u597807601 | cpp |
p02577 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
int main() {
string s;
cin >> s;
int sum = 0;
for (int i = 0; i < s.size(); i++) {
sum += s.at(i);
}
if (sum % 9 == 0) {
cout << "Yes" << endl;
} else {
cout << "No" << end... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
int main() {
string s;
cin >> s;
int sum = 0;
for (int i = 0; i < s.size(); i++) {
sum += s.at(i) - '0';
}
if (sum % 9 == 0) {
cout << "Yes" << endl;
} else {
cout << "No" ... | null | 274,400 | 274,401 | u028862479 | cpp |
p02577 | #include <bits/stdc++.h>
using namespace std;
int main() {
string n;
cin >> n;
int sum = 0;
for (int i = 0; i < n.size(); i++) {
sum += n.at(i);
}
if (sum % 9 == 0) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string n;
cin >> n;
int sum = 0;
for (int i = 0; i < n.size(); i++) {
sum += n.at(i) - '0';
}
if (sum % 9 == 0) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| null | 274,551 | 274,552 | u821882713 | cpp |
p02577 | #include <bits/stdc++.h>
using namespace std;
int main() {
string n;
cin >> n;
int sum = 0;
for (auto i : n) {
sum += i;
}
if (sum % 9 == 0) {
cout << "Yes";
} else {
cout << "No";
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string n;
cin >> n;
int sum = 0;
for (auto i : n) {
sum += i - '0';
}
if (sum % 9 == 0) {
cout << "Yes";
} else {
cout << "No";
}
return 0;
} | null | 274,566 | 274,567 | u093466556 | cpp |
p02577 | #include <bits/stdc++.h>
using namespace std;
int main() {
string n;
cin >> n;
int sum = 0;
for (int i = 0; i < n.length(); i++) {
sum += (n[i] - '0');
}
if (sum % 9 == 0)
cout << "Yes";
else
cout << "No";
cout << sum;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string n;
cin >> n;
int sum = 0;
for (int i = 0; i < n.length(); i++) {
sum += (n[i] - '0');
}
if (sum % 9 == 0)
cout << "Yes";
else
cout << "No";
return 0;
}
| null | 274,615 | 274,616 | u055765743 | cpp |
p02577 | #include <bits/stdc++.h>
#define loop(n) for (ll i = 0; i < n; i++)
#define loop4(i, n) for (ll i = 0; i < n; i++)
#define rng(i, a, b, c) for (ll i = a; i < b; i += c)
#define loop2(i, a, b) for (long long i = a; i >= b; i--)
#define loop3(j, a, b) for (int j = a; j < b; j++)
#define fast ios_base::sync_with_stdio(fal... | #include <bits/stdc++.h>
#define loop(n) for (ll i = 0; i < n; i++)
#define loop4(i, n) for (ll i = 0; i < n; i++)
#define rng(i, a, b, c) for (ll i = a; i < b; i += c)
#define loop2(i, a, b) for (long long i = a; i >= b; i--)
#define loop3(j, a, b) for (int j = a; j < b; j++)
#define fast ios_base::sync_with_stdio(fal... | null | 274,502 | 274,503 | u674843891 | cpp |
p02577 | #include <bits/stdc++.h>
//#include<iostream>
#define ll long long
#define uint unsigned int
#define ld long double
#define SAM \
ios::sync_with_stdio(0); \
cin.tie(0); ... | #include <bits/stdc++.h>
//#include<iostream>
#define ll long long
#define uint unsigned int
#define ld long double
#define SAM \
ios::sync_with_stdio(0); \
cin.tie(0); ... | null | 274,504 | 274,505 | u707523837 | cpp |
p02577 | #include <iostream>
#include <math.h>
#include <string.h>
using namespace std;
int main() {
string s;
cin >> s;
int i, cn = 0;
for (i = 0; i < s.size(); i++) {
cn += (s[i] - '0');
}
if (cn % 9 == 0)
cout << "YES" << endl;
else
cout << "NO" << endl;
} | #include <iostream>
#include <math.h>
#include <string.h>
using namespace std;
int main() {
string s;
cin >> s;
int i, cn = 0;
for (i = 0; i < s.size(); i++) {
cn += (s[i] - '0');
}
if (cn % 9 == 0)
cout << "Yes" << endl;
else
cout << "No" << endl;
} | null | 274,510 | 274,511 | u282754783 | cpp |
p02577 | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base ::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int sum = 0, i;
vector<string> v;
string s;
cin >> s;
v.push_back(s);
for (i = 0; i < s.size(); i++) {
sum += s[i] - 48;
}
if (sum % 9 == 0)
cout << "YES";
else
cout ... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base ::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int sum = 0, i;
vector<string> v;
string s;
cin >> s;
v.push_back(s);
for (i = 0; i < s.size(); i++) {
sum += s[i] - 48;
}
if (sum % 9 == 0)
cout << "Yes";
else
cout ... | null | 274,681 | 274,682 | u057230062 | cpp |
p02577 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
long long int sum = 0, len;
len = s.size();
for (long long int i = 0; i < len; i++) {
sum = sum + (s[i] - '0');
}
if (sum % 9 == 0)
cout << "yes" << endl;
else
cout << "No" << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
long long int sum = 0, len;
len = s.size();
for (long long int i = 0; i < len; i++) {
sum = sum + (s[i] - '0');
}
if (sum % 9 == 0)
cout << "Yes" << endl;
else
cout << "No" << endl;
} | null | 274,753 | 274,754 | u115919391 | cpp |
p02577 | #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
getline(cin, str);
int n = str.size();
int s = 0;
for (int i = 0; i < n; i++) {
s += str[i] - '0';
}
if (s % 9 == 0) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
getline(cin, str);
int n = str.size();
int s = 0;
for (int i = 0; i < n; i++) {
s += str[i] - '0';
}
if (s % 9 == 0) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
} | null | 274,804 | 274,805 | u237259239 | cpp |
p02577 | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define REP1(i, n) for (int i = 1; i <= (n); i++)
#define REPD(i, a, b) for (int i = (a); i <= (b); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef v... | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define REP1(i, n) for (int i = 1; i <= (n); i++)
#define REPD(i, a, b) for (int i = (a); i <= (b); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef v... | null | 274,834 | 274,835 | u281876921 | cpp |
p02577 | #include <bits/stdc++.h>
#include <sstream>
#include <string>
using namespace std;
#define FAST \
ios_base::sync_with_stdio(0); \
cin.tie(0); ... | #include <bits/stdc++.h>
#include <sstream>
#include <string>
using namespace std;
#define FAST \
ios_base::sync_with_stdio(0); \
cin.tie(0); ... | null | 274,862 | 274,863 | u096513236 | cpp |
p02577 | #include <bits/stdc++.h>
using namespace std;
int main() {
char X[200001], *p;
long ans = 0;
cin >> X;
for (p = X; *p; p++)
ans += *p;
cout << ((ans % 9) ? "No" : "Yes");
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
char X[200001], *p;
long ans = 0;
cin >> X;
for (p = X; *p; p++)
ans += *p - '0';
cout << ((ans % 9) ? "No" : "Yes");
}
| null | 274,895 | 274,896 | u032223540 | cpp |
p02577 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL << 60;
int main() {
string s;
cin >> s;
int count = 0;
for (int i = 0; i < s.size(); i++) {
count += (int)(s[0] - 48);
count %= 9;
}
if (count % 9 == 0) {
cout << "Yes" << endl;
return 0;
} else... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL << 60;
int main() {
string s;
cin >> s;
int count = 0;
for (int i = 0; i < s.size(); i++) {
count += (int)(s[i] - 48);
count %= 9;
}
if (count % 9 == 0) {
cout << "Yes" << endl;
return 0;
} else... | null | 274,951 | 274,952 | u418892821 | cpp |
p02577 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL << 60;
int main() {
string s;
cin >> s;
int count = 0;
for (int i = 0; i < s.size(); i++) {
count += (int)(s[0] - 48);
}
if (count % 9 == 0) {
cout << "Yes" << endl;
return 0;
} else {
cout << "... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL << 60;
int main() {
string s;
cin >> s;
int count = 0;
for (int i = 0; i < s.size(); i++) {
count += (int)(s[i] - 48);
count %= 9;
}
if (count % 9 == 0) {
cout << "Yes" << endl;
return 0;
} else... | null | 274,953 | 274,952 | u418892821 | cpp |
p02577 | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
int main() {
string S;
cin >> S;
ll sum = 0;
rep(i, S.size()) { sum += (int)(S.at(i)); }
if (sum % 9 == 0)
cout <<... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
int main() {
string S;
cin >> S;
ll sum = 0;
rep(i, S.size()) { sum += (int)(S.at(i) - '0'); }
if (sum % 9 == 0)
c... | null | 274,954 | 274,955 | u611239490 | cpp |
p02577 | #include <bits/stdc++.h>
using namespace std;
char s[200005];
int main() {
scanf("%s", s);
int sum = 0;
for (int i = 0; s[i]; i++) {
sum += s[i] - '1';
}
if (sum % 9 == 0)
printf("Yes\n");
else
printf("No\n");
}
| #include <bits/stdc++.h>
using namespace std;
char s[200005];
int main() {
scanf("%s", s);
int sum = 0;
for (int i = 0; s[i]; i++) {
sum += s[i] - '0';
}
if (sum % 9 == 0)
printf("Yes\n");
else
printf("No\n");
}
| null | 275,349 | 275,350 | u818518063 | cpp |
p02577 | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
long long sum = 0;
for (int i = 0; i < s.size(); i++) {
sum += s.at(i);
}
if (sum % 9 == 0)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
long long sum = 0;
for (int i = 0; i < s.size(); i++) {
sum += s.at(i) - '0';
}
if (sum % 9 == 0)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
} | null | 275,145 | 275,146 | u079952022 | cpp |
p02577 | #include <bits/stdc++.h>
using namespace std;
#define sim template <class c
#define ris return *this
#define dor > debug &operator<<
#define eni(x) \
sim > typename enable_if<sizeof dud<c>(0) x 1, debug &>::type operator<<( \
c i) {
sim >... | #include <bits/stdc++.h>
using namespace std;
#define sim template <class c
#define ris return *this
#define dor > debug &operator<<
#define eni(x) \
sim > typename enable_if<sizeof dud<c>(0) x 1, debug &>::type operator<<( \
c i) {
sim >... | null | 275,154 | 275,155 | u248069860 | cpp |
p02577 | #include "bits/stdc++.h"
#define int long long int
#define pb push_back
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define vvi vector<vector<int>>
#define vi vector<int>
#define f firs... | #include "bits/stdc++.h"
#define int long long int
#define pb push_back
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define vvi vector<vector<int>>
#define vi vector<int>
#define f firs... | null | 275,224 | 275,225 | u847675043 | cpp |
p02577 | #include <bits/stdc++.h>
using namespace std;
#define LL long long int
#define FAST ios_base::sync_with_stdio(false);
#define INPT cin.tie(NULL);
#define OUTPT cout.tie(NULL);
#define fori(i, a, b) for (i = a; i < b; i++)
#define forireverse(i, a, b) for (i = a; i >= b; i--)
#define full(x) x.begin(), x.end()
#define s... | #include <bits/stdc++.h>
using namespace std;
#define LL long long int
#define FAST ios_base::sync_with_stdio(false);
#define INPT cin.tie(NULL);
#define OUTPT cout.tie(NULL);
#define fori(i, a, b) for (i = a; i < b; i++)
#define forireverse(i, a, b) for (i = a; i >= b; i--)
#define full(x) x.begin(), x.end()
#define s... | null | 275,056 | 275,057 | u493134034 | cpp |
p02577 | /*WELCOME TO AYUSH RANJAN CODE'S*/
/*EVERY PROBLEM HAS A SOLUTION SOMETIMES ELEGENT OTHERWISE COMPLEX ELEGENCE*/
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
const int mod = 1e9 + 7;
int chkpower2(int x) { return (x && !(x & x - 1)); }
void solve() {
int ans = 0;
string s1;
cin >> s1... | /*WELCOME TO AYUSH RANJAN CODE'S*/
/*EVERY PROBLEM HAS A SOLUTION SOMETIMES ELEGENT OTHERWISE COMPLEX ELEGENCE*/
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
const int mod = 1e9 + 7;
int chkpower2(int x) { return (x && !(x & x - 1)); }
void solve() {
ll ans = 0;
string s1;
cin >> s1;... | null | 275,076 | 275,077 | u007624220 | cpp |
p02577 | #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
cin >> str;
int n = str.size();
int sum = 0;
for (int i = 0; i < n; i++) {
sum = sum + str[i] - '0';
}
if (sum % 9 == 0)
cout << "YES"
<< "\n";
else
cout << "NO"
<< "\n";
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
cin >> str;
int n = str.size();
int sum = 0;
for (int i = 0; i < n; i++) {
sum = sum + str[i] - '0';
}
if (sum % 9 == 0)
cout << "Yes"
<< "\n";
else
cout << "No"
<< "\n";
} | null | 275,044 | 275,045 | u221666951 | cpp |
p02577 | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <ctime>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#inc... | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <ctime>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#inc... | null | 275,608 | 275,609 | u048588980 | cpp |
p02577 | // _
// ___ _ __ ___ (_) __ ___ ___ _ _ __ ___ _ __
// / __| '_ ` _ \| |/ _` \ \ /\ / / | | | '_ ` _ \| '_ \
// \__ \ | | | | | | (_| |\ V V /| |_| | | | | | | |_) |
// |___/_| |_| |_|_|\__, | \_/\_/ \__,_|_| |_| |_| .__/
// |___/ |_|
// code by smigwu... | // _
// ___ _ __ ___ (_) __ ___ ___ _ _ __ ___ _ __
// / __| '_ ` _ \| |/ _` \ \ /\ / / | | | '_ ` _ \| '_ \
// \__ \ | | | | | | (_| |\ V V /| |_| | | | | | | |_) |
// |___/_| |_| |_|_|\__, | \_/\_/ \__,_|_| |_| |_| .__/
// |___/ |_|
// code by smigwu... | null | 275,405 | 275,406 | u488106242 | cpp |
p02577 | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
#define int long long int
#define pp pair<int, int>
#define endl "\n"
#define PI 3.14159265
int MAX = INT_MAX;
const int mod = 1e9 + 7;
const int INF = INT_MAX;
inline int gcd(int a, int b) {
if (a == 0)
return b;
return gcd(b % a, a);
}
inline int... | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
#define int long long int
#define pp pair<int, int>
#define endl "\n"
#define PI 3.14159265
int MAX = INT_MAX;
const int mod = 1e9 + 7;
const int INF = INT_MAX;
inline int gcd(int a, int b) {
if (a == 0)
return b;
return gcd(b % a, a);
}
inline int... | null | 275,260 | 275,261 | u452103000 | cpp |
p02577 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
int t = 1;
// cin>>t;
while (t--) {
string a;
cin >> a;
ll sum = 0;
for (ll i = 0; i < a.size(); i++) {
sum += (a[i] - '0');
}
if (sum % 9 == 0) {
cout << "YES";
} else
cout << "NO";
}
}... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
int t = 1;
// cin>>t;
while (t--) {
string a;
cin >> a;
ll sum = 0;
for (ll i = 0; i < a.size(); i++) {
sum += (a[i] - '0');
}
if (sum % 9 == 0) {
cout << "Yes";
} else
cout << "No";
}
}... | null | 275,428 | 275,429 | u100092704 | cpp |
p02578 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vll vector<ll>
#define print(x) \
for (auto it = x.begin(); it != x.end(); it++) ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vll vector<ll>
#define print(x) \
for (auto it = x.begin(); it != x.end(); it++) ... | null | 275,578 | 275,579 | u753604864 | cpp |
p02578 | #include <bits/stdc++.h>
using namespace std;
#define pi acos(-1.0)
// cout << fixed << setprecision(8) << a << endl;
#define Fast_Input \
ios_base ::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
#define pb push_back
#define mem(a, b) memset(a, b, s... | #include <bits/stdc++.h>
using namespace std;
#define pi acos(-1.0)
// cout << fixed << setprecision(8) << a << endl;
#define Fast_Input \
ios_base ::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
#define pb push_back
#define mem(a, b) memset(a, b, s... | null | 275,580 | 275,581 | u421893566 | cpp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.