problem_id stringlengths 6 6 | language stringclasses 2
values | original_status stringclasses 3
values | original_src stringlengths 19 243k | changed_src stringlengths 19 243k | change stringclasses 3
values | i1 int64 0 8.44k | i2 int64 0 8.44k | j1 int64 0 8.44k | j2 int64 0 8.44k | error stringclasses 270
values | stderr stringlengths 0 226k |
|---|---|---|---|---|---|---|---|---|---|---|---|
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
const int nax = 1e5 + 10;
ll d[nax];
ll maxi(int k) {
ll s = 0;
while (k > 0) {
s = max(d[k], s);
k -= k & -k;
}
return s;
}
void add(int k, ll x) {
while (k <= n) {
d[k] = max(d[k], x);
k += k & -k;
}
}
int main... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
const int nax = 2e5 + 10;
ll d[nax];
ll maxi(int k) {
ll s = 0;
while (k > 0) {
s = max(d[k], s);
k -= k & -k;
}
return s;
}
void add(int k, ll x) {
while (k <= n) {
d[k] = max(d[k], x);
k += k & -k;
}
}
int main... | replace | 6 | 7 | 6 | 7 | 0 | |
p03176 | C++ | Runtime Error | #include <algorithm>
#include <cstdlib>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <unordered_map>
using namespace std;
#define fs first
#define sc second
typedef long long ll;
typedef pair<int, int> P;
const ll mod = 1e9 + 7;
ll fact[200200];
ll... | #include <algorithm>
#include <cstdlib>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <unordered_map>
using namespace std;
#define fs first
#define sc second
typedef long long ll;
typedef pair<int, int> P;
const ll mod = 1e9 + 7;
ll fact[200200];
ll... | replace | 66 | 67 | 66 | 67 | 0 | |
p03176 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
#define F first
#define S second
#define show(x) cout << #x << " " << x << " ";
#define f(i, j, k) for (int i = j; i <= k; i++)
#define fr(i, j, k) for (int i = j; i >= k; i--)
#define ll long long
#define all(A) A.begin(), A.end()
#define FIO ... | #include "bits/stdc++.h"
using namespace std;
#define F first
#define S second
#define show(x) cout << #x << " " << x << " ";
#define f(i, j, k) for (int i = j; i <= k; i++)
#define fr(i, j, k) for (int i = j; i >= k; i--)
#define ll long long
#define all(A) A.begin(), A.end()
#define FIO ... | replace | 12 | 13 | 12 | 13 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = (0); i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define rng(x) (x).begin(), (x).end()
#define rrng(x) (x).rbegin(), (x)... | #include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = (0); i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define rng(x) (x).begin(), (x).end()
#define rrng(x) (x).rbegin(), (x)... | replace | 91 | 92 | 91 | 92 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = (0); i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define rng(x) (x).begin(), (x).end()
#define rrng(x) (x).rbegin(), (x)... | #include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = (0); i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define rng(x) (x).begin(), (x).end()
#define rrng(x) (x).rbegin(), (x)... | replace | 91 | 92 | 91 | 92 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set =
tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define sz(a) a.size()
#define all(a) a.begi... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set =
tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define sz(a) a.size()
#define all(a) a.begi... | replace | 114 | 115 | 114 | 115 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = a; i < b; i++)
typedef long long ll;
const int MAX_N = 2e5 + 1010;
const int def = 0;
// セグメント木を持つグローバル配列
ll n, dat[2 * MAX_N - 1];
// 初期化
void init(ll n_) {
// 簡単のため、要素数を2のべき乗に
n = 1;
while (n < n_)
n *= 2;
// 全ての値をINT_MAXに... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = a; i < b; i++)
typedef long long ll;
const int MAX_N = 1 << 18;
const int def = 0;
// セグメント木を持つグローバル配列
ll n, dat[2 * MAX_N - 1];
// 初期化
void init(ll n_) {
// 簡単のため、要素数を2のべき乗に
n = 1;
while (n < n_)
n *= 2;
// 全ての値をINT_MAXに
... | replace | 5 | 6 | 5 | 6 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-ffloat-store") // to restrict undesirable precision
#pragma GCC optimize( \
"-fno-defer-pop") // to pop argument of functio... | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-ffloat-store") // to restrict undesirable precision
#pragma GCC optimize( \
"-fno-defer-pop") // to pop argument of functio... | replace | 27 | 28 | 27 | 28 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
template <typename X> ostream &operator<<(ostream &x, const vector<X> &v) {
for (ll i = 0; i < v.size(); ++i)
x << v[i] << " ";
return x;
}
template <typename X> ostream &operator<<(ostream &x, const set<X> &v) {
for (... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
template <typename X> ostream &operator<<(ostream &x, const vector<X> &v) {
for (ll i = 0; i < v.size(); ++i)
x << v[i] << " ";
return x;
}
template <typename X> ostream &operator<<(ostream &x, const set<X> &v) {
for (... | replace | 71 | 72 | 71 | 72 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
#define PB emplace_back
#define mid ((be + en) / 2)
#define cl c * 2
#define cr cl + 1
using namespace std;
const int N = 1e5 + 100;
long long int mx[N], dp[N], h[N], a[N], n;
long long int que(int l, int r, int be = 0, int en = n, int c = 1) {
if (r <= be || en <= l)
return 0;
if ... | #include <bits/stdc++.h>
#define PB emplace_back
#define mid ((be + en) / 2)
#define cl c * 2
#define cr cl + 1
using namespace std;
const int N = (1e5 + 100) * 16;
long long int mx[N], dp[N], h[N], a[N], n;
long long int que(int l, int r, int be = 0, int en = n, int c = 1) {
if (r <= be || en <= l)
return 0... | replace | 9 | 10 | 9 | 10 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long int
#define M 1000000007
#define mod 998244353
#define mp(x, y) make_pair(x, y)
#define pb(x) push_back(x)
#define pi pair<ll, ll>
using namespace std;
const ll N = 100010;
ll h[N], a[N];
ll sgt[4 * N];
void build(ll st, ll en, ll pos) {
if (st == en) {
sgt[pos] = ... | #include <bits/stdc++.h>
#define ll long long int
#define M 1000000007
#define mod 998244353
#define mp(x, y) make_pair(x, y)
#define pb(x) push_back(x)
#define pi pair<ll, ll>
using namespace std;
const ll N = 200010;
ll h[N], a[N];
ll sgt[4 * N];
void build(ll st, ll en, ll pos) {
if (st == en) {
sgt[pos] = ... | replace | 8 | 9 | 8 | 9 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pii pair<ll, ll>
#define sorted(a_1) sort(a_1.begin(), a_1.end())
#define rsorted(a_1) sort(a_1.rbegin(), a_1.rend())
#define t1(a_1) cout << a_1 << endl;
#define t2(a_1) ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pii pair<ll, ll>
#define sorted(a_1) sort(a_1.begin(), a_1.end())
#define rsorted(a_1) sort(a_1.rbegin(), a_1.rend())
#define t1(a_1) cout << a_1 << endl;
#define t2(a_1) ... | replace | 12 | 13 | 12 | 13 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 100001;
int d[N], n;
struct BIT {
long long f[N];
void update(int pos, long long x) {
for (; pos <= n; pos += pos & -pos)
f[pos] = max(f[pos], x);
}
long long get(int pos) {
if (!pos)
return 0;
long long res = -1;
for ... | #include <bits/stdc++.h>
using namespace std;
const int N = 400001;
int d[N], n;
struct BIT {
long long f[N];
void update(int pos, long long x) {
for (; pos <= n; pos += pos & -pos)
f[pos] = max(f[pos], x);
}
long long get(int pos) {
if (!pos)
return 0;
long long res = -1;
for ... | replace | 4 | 5 | 4 | 5 | 0 | |
p03176 | C++ | Runtime Error | //
// ROIGold.cpp
// Main calisma
//
// Created by Rakhman on 05/02/2019.
// Copyright © 2019 Rakhman. All rights reserved.
//
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#... | //
// ROIGold.cpp
// Main calisma
//
// Created by Rakhman on 05/02/2019.
// Copyright © 2019 Rakhman. All rights reserved.
//
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#... | replace | 42 | 43 | 42 | 43 | 0 | |
p03176 | C++ | Time Limit Exceeded | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#define ll long long
#define MAX 25 * 1e13
#define N 200010
using namespace std;
int MOD = 1000000007;
vector<ll> bitree(N);
int n;
int lowbit(int t) { return t & (-t); }
ll query(int h)... | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#define ll long long
#define MAX 25 * 1e13
#define N 200010
using namespace std;
int MOD = 1000000007;
vector<ll> bitree(N);
int n;
int lowbit(int t) { return t & (-t); }
ll query(int h)... | replace | 27 | 28 | 27 | 28 | TLE | |
p03176 | C++ | Runtime Error | // In the name of Allah
#include <bits/stdc++.h>
using namespace std;
#define MAX 200011
#define mod 1000000007
#define inf 1000000000000000
#define ll long long
#define endl '\n'
ll dp[2 * MAX];
int h[MAX], w[MAX];
void update(int node, int l, int r, int i, ll v) {
if (l == r) {
dp[node] = v;
} else {
int... | // In the name of Allah
#include <bits/stdc++.h>
using namespace std;
#define MAX 200011
#define mod 1000000007
#define inf 1000000000000000
#define ll long long
#define endl '\n'
ll dp[4 * MAX];
int h[MAX], w[MAX];
void update(int node, int l, int r, int i, ll v) {
if (l == r) {
dp[node] = v;
} else {
int... | replace | 8 | 9 | 8 | 9 | 0 | |
p03176 | C++ | Runtime Error | #include <stdio.h>
#include <vector>
using namespace std;
const int Cv = 1 << 17, C = 100001;
typedef long long ll;
int n, a[C];
ll val[2 * Cv], x, v, am;
void insert(int a, ll w) {
for (a += Cv; a > 0; a /= 2)
val[a] = max(val[a], w);
}
ll query(int l) {
ll ww = 0;
for (l += Cv; l > 1; l /= 2)
if (l %... | #include <stdio.h>
#include <vector>
using namespace std;
const int Cv = 1 << 18, C = 210001;
typedef long long ll;
int n, a[C];
ll val[2 * Cv], x, v, am;
void insert(int a, ll w) {
for (a += Cv; a > 0; a /= 2)
val[a] = max(val[a], w);
}
ll query(int l) {
ll ww = 0;
for (l += Cv; l > 1; l /= 2)
if (l %... | replace | 3 | 4 | 3 | 4 | 0 | |
p03176 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int n;
int h[200055], a[200055];
typedef pair<int, long long> P;
#define ft first
#define sd second
int main() {
cin >> n;
for (int i = 0; i < n; i++) {
scanf("%d", &h[i]);
}
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
set<P> dp;
dp.inse... | #include <bits/stdc++.h>
using namespace std;
int n;
int h[200055], a[200055];
typedef pair<int, long long> P;
#define ft first
#define sd second
int main() {
cin >> n;
for (int i = 0; i < n; i++) {
scanf("%d", &h[i]);
}
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
set<P> dp;
dp.inse... | replace | 35 | 36 | 35 | 36 | TLE | |
p03176 | C++ | Runtime Error | #pragma GCC optimize("Ofast", "unroll-loops")
#include <bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define MP make_pair
#define F first
#define S second
#define MEM(a, b) memset(a, b, sizeof a)
#define Tie ios::sync_with_stdio(0), cin.tie(0);
using namespace std;
typedef long long ll;
typedef pair<int,... | #pragma GCC optimize("Ofast", "unroll-loops")
#include <bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define MP make_pair
#define F first
#define S second
#define MEM(a, b) memset(a, b, sizeof a)
#define Tie ios::sync_with_stdio(0), cin.tie(0);
using namespace std;
typedef long long ll;
typedef pair<int,... | replace | 14 | 15 | 14 | 15 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define N 1009
#define INF 1000000009
#define MOD 1000000007
typedef long long int ll;
#define sd(x) scanf("%d", &x)
#define sd2(x, y) scanf("%lld%lld", &x, &y)
#define sd3(x, y, z) scanf("%d%d%d", &x, &y, &z)
#define pf(x) prllf("%d", x);
#define pf2(x, y) prllf("%d %d\n",... | #include <bits/stdc++.h>
using namespace std;
#define N 200009
#define INF 1000000009
#define MOD 1000000007
typedef long long int ll;
#define sd(x) scanf("%d", &x)
#define sd2(x, y) scanf("%lld%lld", &x, &y)
#define sd3(x, y, z) scanf("%d%d%d", &x, &y, &z)
#define pf(x) prllf("%d", x);
#define pf2(x, y) prllf("%d %d\n... | replace | 2 | 3 | 2 | 3 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long long MOD = (long long)(1e9 + 7);
vector<int> graph[(int)(1e5 + 7)];
int main() {
int n;
cin >> n;
vector<long long> h(n), a(n);
int base = 1;
while (base <= n)
base *= 2;
for (int i = 0; i < n; i++) {
cin >> h[i];
}
for (int i = 0; i < n; i++)... | #include <bits/stdc++.h>
using namespace std;
long long MOD = (long long)(1e9 + 7);
vector<int> graph[(int)(1e5 + 7)];
int main() {
int n;
cin >> n;
vector<long long> h(n), a(n);
int base = 1;
while (base <= n)
base *= 2;
for (int i = 0; i < n; i++) {
cin >> h[i];
}
for (int i = 0; i < n; i++)... | replace | 20 | 21 | 20 | 21 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll n, h[200005], b[200005], dp[200005];
int main() {
cin >> n;
int base = 1;
while (base <= n)
base *= 2;
vector<ll> tree(n * 2, 0);
for (int i = 0; i < n; i++)
cin >> h[i];
for (int i = 0; i < n; i++)
cin >> b[i];
for (i... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll n, h[200005], b[200005], dp[200005];
int main() {
cin >> n;
int base = 1;
while (base <= n)
base *= 2;
vector<ll> tree(base * 2, 0);
for (int i = 0; i < n; i++)
cin >> h[i];
for (int i = 0; i < n; i++)
cin >> b[i];
for... | replace | 10 | 11 | 10 | 11 | 0 | |
p03176 | C++ | Runtime Error | #define taskname ""
#include <algorithm>
#include <iostream>
using namespace std;
#define long long long
const int N = 1e5 + 10;
int n, h[N], a[N];
long f[N];
#define mid ((l + r) >> 1)
#define lc (id << 1)
#define rc (lc + 1)
struct segmentTree {
long tree[N << 2];
void update(int id, int l, int r, int x, lo... | #define taskname ""
#include <algorithm>
#include <iostream>
using namespace std;
#define long long long
const int N = 2e5 + 10;
int n, h[N], a[N];
long f[N];
#define mid ((l + r) >> 1)
#define lc (id << 1)
#define rc (lc + 1)
struct segmentTree {
long tree[N << 2];
void update(int id, int l, int r, int x, lo... | replace | 8 | 9 | 8 | 9 | 0 | |
p03176 | C++ | Runtime Error | /*
if you can't see the repay
Why not just work step by step
rubbish is relaxed
to ljq
*/
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdlib.h>
#include <vector... | /*
if you can't see the repay
Why not just work step by step
rubbish is relaxed
to ljq
*/
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdlib.h>
#include <vector... | replace | 62 | 63 | 62 | 63 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 100050;
typedef long long ll;
ll H[N];
ll B[N];
ll tree[4 * N];
int n;
void update(int nd, int s, int e, int i, ll v) {
if (s > i || e < i)
return;
if (s >= i && e <= i) {
tree[nd] = max(tree[nd], v);
return;
}
int mid = (s + e) / 2, l =... | #include <bits/stdc++.h>
using namespace std;
const int N = 200050;
typedef long long ll;
ll H[N];
ll B[N];
ll tree[4 * N];
int n;
void update(int nd, int s, int e, int i, ll v) {
if (s > i || e < i)
return;
if (s >= i && e <= i) {
tree[nd] = max(tree[nd], v);
return;
}
int mid = (s + e) / 2, l =... | replace | 3 | 4 | 3 | 4 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define nt _int128
#define mod 1000000007
ll n, arr[200005], brr[200005];
ll dp[200005];
void update(ll i, ll val) {
while (i <= n) {
dp[i] = max(dp[i], val);
i += (i & -i);
}
}
ll query(ll i) {
... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define nt _int128
#define mod 1000000007
ll n, arr[200005], brr[200005];
ll dp[200005];
void update(ll i, ll val) {
while (i <= n) {
dp[i] = max(dp[i], val);
i += (i & -i);
}
}
ll query(ll i) {
... | replace | 33 | 37 | 33 | 37 | 0 | |
p03176 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <tuple>
#include <vector>
using namespace std;
#define INF 1LL << 62
#define MAX 1100000
#define MOD 1000000007
typedef long lon... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <tuple>
#include <vector>
using namespace std;
#define INF 1LL << 62
#define MAX 1100000
#define MOD 1000000007
typedef long lon... | replace | 26 | 27 | 26 | 27 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 1e5 + 5;
struct SegmentTree {
ll t[N << 2];
void init(int u, int b, int e) {
if (b == e) {
t[u] = 0;
return;
}
int mid = (b + e) >> 1;
init(u << 1, b, mid);
init(u << 1 | 1, mid + 1, e);
t[u] = ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 2e5 + 5;
struct SegmentTree {
ll t[N << 2];
void init(int u, int b, int e) {
if (b == e) {
t[u] = 0;
return;
}
int mid = (b + e) >> 1;
init(u << 1, b, mid);
init(u << 1 | 1, mid + 1, e);
t[u] = ... | replace | 5 | 6 | 5 | 6 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int max_n = 100500;
int d = 1;
ll t[max_n << 2];
void update(int i, ll x, int tl = 0, int tr = d - 1, int v = 1) {
if (tl == tr) {
t[v] = x;
return;
}
int tm = (tl + tr) >> 1;
if (i <= tm)
update(i,... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int max_n = 200500;
int d = 1;
ll t[max_n << 2];
void update(int i, ll x, int tl = 0, int tr = d - 1, int v = 1) {
if (tl == tr) {
t[v] = x;
return;
}
int tm = (tl + tr) >> 1;
if (i <= tm)
update(i,... | replace | 6 | 7 | 6 | 7 | 0 | |
p03176 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
#define ls(x) x << 1
#define rs(x) x << 1 | 1
#define ll long long
#define tree ans
#define rep(i, a, b) for (int i = a; i <= b; i++)
void read(int &x) {
x = 0;
int flag = 1;
char ch = ' ';
while (ch < '0' || ch > '9... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
#define ls(x) x << 1
#define rs(x) x << 1 | 1
#define ll long long
#define tree ans
#define rep(i, a, b) for (int i = a; i <= b; i++)
void read(int &x) {
x = 0;
int flag = 1;
char ch = ' ';
while (ch < '0' || ch > '9... | replace | 37 | 38 | 37 | 38 | 0 | |
p03176 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> P;
#define mod 1000000007
#define INF (1LL << 60)
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++)
#define YES puts("YES")
#define Yes ... | #include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> P;
#define mod 1000000007
#define INF (1LL << 60)
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++)
#define YES puts("YES")
#define Yes ... | replace | 152 | 156 | 152 | 154 | TLE | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set \
tree<int, null_type, less<int>, rb_tree_tag, \
... | #include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set \
tree<int, null_type, less<int>, rb_tree_tag, \
... | replace | 39 | 40 | 39 | 40 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const static ll MOD = 1e9 + 7;
const static ll INF = 1e14;
#include <bits/stdc++.h>
using namespace std;
// このSegmentTreeは最小値を扱う仕様になっている
struct SegmentTree {
private:
ll n;
vector<ll> node;
ll INF = 1e18;
public:
// 元配列 v をセグメント木で表現する
Segm... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const static ll MOD = 1e9 + 7;
const static ll INF = 1e14;
#include <bits/stdc++.h>
using namespace std;
// このSegmentTreeは最小値を扱う仕様になっている
struct SegmentTree {
private:
ll n;
vector<ll> node;
ll INF = 1e18;
public:
// 元配列 v をセグメント木で表現する
Segm... | replace | 114 | 115 | 114 | 117 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
#define fi first
#define se second
const int N = 100100;
const long long mod = 1e9 + 7;
using namespace std;
int n;
int a[N];
int b[N];
long long d[N];
void upd(int x, long long y) {
while (x < N) {
d[x] = max(d[x], y);
x += x & -x;
}
}
long long get(int x) {
long long res =... | #include <bits/stdc++.h>
#define fi first
#define se second
const int N = 200200;
const long long mod = 1e9 + 7;
using namespace std;
int n;
int a[N];
int b[N];
long long d[N];
void upd(int x, long long y) {
while (x < N) {
d[x] = max(d[x], y);
x += x & -x;
}
}
long long get(int x) {
long long res =... | replace | 5 | 6 | 5 | 6 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pull;
typedef pair<ll, ll> pii;
typedef pair<ld, ld> pld;
ll n;
ll h[1... | #include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pull;
typedef pair<ll, ll> pii;
typedef pair<ld, ld> pld;
ll n;
ll h[2... | replace | 14 | 17 | 14 | 17 | 0 | |
p03176 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll n;
cin >> n;
vector<ll> h(n);
for (int i = 0; i < n; ++i)
cin >> h[i];
vector<ll> a(n);
for (int i = 0; i < n; ++i)
cin >> a[i];
ll res = 0;
set<pair<ll, ll>> st;
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll n;
cin >> n;
vector<ll> h(n);
for (int i = 0; i < n; ++i)
cin >> h[i];
vector<ll> a(n);
for (int i = 0; i < n; ++i)
cin >> a[i];
ll res = 0;
set<pair<ll, ll>> st;
... | insert | 27 | 27 | 27 | 29 | TLE | |
p03176 | C++ | Runtime Error | // --------------------<optimizations>--------------------
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC tar... | // --------------------<optimizations>--------------------
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC tar... | replace | 74 | 75 | 74 | 75 | -11 | Line:82 x : 0
|
p03176 | C++ | Runtime Error | #pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstring>
#include <deque>
#include <forward_list>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include ... | #pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstring>
#include <deque>
#include <forward_list>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include ... | replace | 28 | 29 | 28 | 29 | 0 | |
p03176 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N;
scanf("%d", &N);
vector<int> H(N), A(N);
vector<long long> dp(N, 0);
int base = 1;
while (base <= N) {
base <<= 1;
}
vector<long long> tree(2 * base, 0);
for (int i = 0; i < N; +... | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N;
scanf("%d", &N);
vector<int> H(N), A(N);
vector<long long> dp(2 * N, 0);
int base = 1;
while (base <= N) {
base <<= 1;
}
vector<long long> tree(2 * base, 0);
for (int i = 0; i < ... | replace | 11 | 12 | 11 | 12 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 100001;
ll dp[N];
ll getMid(ll s, ll e) { return s + (e - s) / 2; }
ll MaxUtil(ll *st, ll ss, ll se, ll l, ll r, ll node) {
if (l <= ss && r >= se)
return st[node];
if (se < l || ss > r)
return -1;
ll mid = getMid(ss, se);
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 200001;
ll dp[N];
ll getMid(ll s, ll e) { return s + (e - s) / 2; }
ll MaxUtil(ll *st, ll ss, ll se, ll l, ll r, ll node) {
if (l <= ss && r >= se)
return st[node];
if (se < l || ss > r)
return -1;
ll mid = getMid(ss, se);
... | replace | 3 | 4 | 3 | 4 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> VI;
typedef pair<int, int> ii;
typedef long long LL;
#define pb push_back
const int INF = 2147483647;
const int N = 100005;
const int MOD = 1000000007;
int h[N], a[N], i, n, M;
LL w[3 * N];
void insert(int v, LL b) {
int s = M + v;
while (s) {
... | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> VI;
typedef pair<int, int> ii;
typedef long long LL;
#define pb push_back
const int INF = 2147483647;
const int N = 200005;
const int MOD = 1000000007;
int h[N], a[N], i, n, M;
LL w[3 * N];
void insert(int v, LL b) {
int s = M + v;
while (s) {
... | replace | 7 | 8 | 7 | 8 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
#define pb emplace_back
#define fi first
#define se second
#define int long long
using namespace std;
mt19937_64
rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int l) {
uniform_int_distribution<int> uid(0, l - 1);
return uid(rang);
}
const int MAXN = 3e5;... | #include <bits/stdc++.h>
#define pb emplace_back
#define fi first
#define se second
#define int long long
using namespace std;
mt19937_64
rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int l) {
uniform_int_distribution<int> uid(0, l - 1);
return uid(rang);
}
const int MAXN = 5e5;... | replace | 12 | 13 | 12 | 13 | 0 | |
p03176 | Python | Runtime Error | def get(i):
mx = 0
while i > 0:
if bit[i] > mx:
mx = bit[i]
i -= i & -i
return mx
def update(i, x):
while i < n + 1:
if x > bit[i]:
bit[i] = x
i += i & -i
def f(hs, a_s):
for h, a in zip(hs, a_s):
update(h, get(h - 1) + a)
print... | def get(i):
mx = 0
while i > 0:
if bit[i] > mx:
mx = bit[i]
i -= i & -i
return mx
def update(i, x):
while i < n + 1:
if x > bit[i]:
bit[i] = x
i += i & -i
def f(hs, a_s):
for h, a in zip(hs, a_s):
update(h, get(h - 1) + a)
print... | replace | 26 | 27 | 26 | 27 | TypeError: f() takes 2 positional arguments but 3 were given | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03176/Python/s612498010.py", line 27, in <module>
f(n, hs, a_s)
TypeError: f() takes 2 positional arguments but 3 were given
|
p03176 | C++ | Runtime Error | #pragma GCC optimize "03"
#include "bits/stdc++.h"
using namespace std;
#define int long long int
#define ld long double
#define pi pair<int, int>
#define pb push_back
#define fi first
#define se second
#define IOS \
ios::sync_with_stdio(false); ... | #pragma GCC optimize "03"
#include "bits/stdc++.h"
using namespace std;
#define int long long int
#define ld long double
#define pi pair<int, int>
#define pb push_back
#define fi first
#define se second
#define IOS \
ios::sync_with_stdio(false); ... | replace | 18 | 19 | 18 | 19 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005;
vector<long long> st(MAXN);
long long update(int l, int r, int v, int i, long long val) {
if (l > i || r < i)
return st[v];
if (l == r)
return st[v] = max(val, st[v]);
int m = l + r >> 1;
return st[v] = max(update(l, m, v << 1, i... | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005;
vector<long long> st(MAXN << 2);
long long update(int l, int r, int v, int i, long long val) {
if (l > i || r < i)
return st[v];
if (l == r)
return st[v] = max(val, st[v]);
int m = l + r >> 1;
return st[v] = max(update(l, m, v <<... | replace | 6 | 7 | 6 | 7 | 0 | |
p03176 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
using ll = long long;
using ld = long double;
#define st first
#define nd se... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
using ll = long long;
using ld = long double;
#define st first
#define nd se... | replace | 20 | 21 | 20 | 21 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mod 1000000007;
#define inf (1LL << 60)
using namespace std;
struct flower {
ll hi;
ll bty;
};
ll solve(vector<flower> &v, int n) {
vector<ll> dp(n + 1);
map<ll, ll> m;
dp[1] = v[1].bty;
m[v[1].hi] = dp[1];
ll ans = dp[1];
for ... | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mod 1000000007;
#define inf (1LL << 60)
using namespace std;
struct flower {
ll hi;
ll bty;
};
ll solve(vector<flower> &v, int n) {
vector<ll> dp(n + 1);
map<ll, ll> m;
dp[1] = v[1].bty;
m[v[1].hi] = dp[1];
ll ans = dp[1];
for ... | replace | 27 | 28 | 27 | 28 | 0 | |
p03176 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n; i >= 0; i--)
#define REP(i, s, t) for (int i = s; i <= t; i++)
#define RREP(i, s, t) for (int i = s; i >= t; i--)
#define dump(x) cerr << #x << " = " << (x) << endl;
#d... | #include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n; i >= 0; i--)
#define REP(i, s, t) for (int i = s; i <= t; i++)
#define RREP(i, s, t) for (int i = s; i >= t; i--)
#define dump(x) cerr << #x << " = " << (x) << endl;
#d... | replace | 12 | 13 | 12 | 13 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
using namespace std;
const ll N = 100006;
struct flower {
ll hi;
ll bt;
};
ll n;
vector<flower> v(N);
ll lis() {
vector<ll> dp(n + 1);
dp[0] = 0;
dp[1] = v[1].bt;
map<ll, ll> m;
m[v[1].hi] = dp[1];
ll ans = dp[1];
for (ll i = 2; i <= n; i++) {
dp[... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
const ll N = 200006;
struct flower {
ll hi;
ll bt;
};
ll n;
vector<flower> v(N);
ll lis() {
vector<ll> dp(n + 1);
dp[0] = 0;
dp[1] = v[1].bt;
map<ll, ll> m;
m[v[1].hi] = dp[1];
ll ans = dp[1];
for (ll i = 2; i <= n; i++) {
dp[... | replace | 3 | 4 | 3 | 4 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long long st[400005] = {};
int h[100005], w[100005];
void update(int x, int l, int r, int z, long long int zz) {
if (l > z || r < z)
return;
if (l == r) {
st[x] = zz;
return;
}
int mid = (l + r) / 2;
update(x * 2, l, mid, z, zz);
update(x * 2 + 1, mi... | #include <bits/stdc++.h>
using namespace std;
long long st[800005] = {};
long long h[200005], w[200005];
void update(int x, int l, int r, int z, long long int zz) {
if (l > z || r < z)
return;
if (l == r) {
st[x] = zz;
return;
}
int mid = (l + r) / 2;
update(x * 2, l, mid, z, zz);
update(x * 2 +... | replace | 2 | 4 | 2 | 4 | 0 | |
p03176 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); i++)
#define NFOR(i, a, b) for (ll i = (ll)(a); i >= (ll)(b); --i)
#define rep(i, a) for (ll i = 0; i < a; i++)
#define endl "\n"
#define fi first
#define se second
#define MOD 1000000007
#define inf 1e18
#define pb pu... | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); i++)
#define NFOR(i, a, b) for (ll i = (ll)(a); i >= (ll)(b); --i)
#define rep(i, a) for (ll i = 0; i < a; i++)
#define endl "\n"
#define fi first
#define se second
#define MOD 1000000007
#define inf 1e18
#define pb pu... | replace | 65 | 66 | 65 | 66 | 0 | |
p03176 | C++ | Runtime Error | /*
$$$$$$$\ $$\ $$$$$$$\
$$ __$$\ \__| $$ __$$\
$$ | $$ | $$$$$$\ $$$$$$\ $$\ $$$$$$$\ $$ | $$ | $$$$$$\ $$$$$$\
$$$$$$$\ $$$$$$\
$$$$$$$\ |$$ __$$\ $$ __$$\ $$ |$$ _____|$$$$$$$\ | \____$$\ $$
__$$\ $$ _____... | /*
$$$$$$$\ $$\ $$$$$$$\
$$ __$$\ \__| $$ __$$\
$$ | $$ | $$$$$$\ $$$$$$\ $$\ $$$$$$$\ $$ | $$ | $$$$$$\ $$$$$$\
$$$$$$$\ $$$$$$\
$$$$$$$\ |$$ __$$\ $$ __$$\ $$ |$$ _____|$$$$$$$\ | \____$$\ $$
__$$\ $$ _____... | replace | 146 | 147 | 146 | 147 | 0 | |
p03177 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define SPEED \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define FOR(i, a, b) for (ll i = a; i ... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define SPEED \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define FOR(i, a, b) for (ll i = a; i ... | insert | 108 | 108 | 108 | 111 | TLE | |
p03177 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/numeric>
using namespace std;
using namespace __gnu_cxx;
#define ll long long
const long double EPS = 1e-8;
const long double PI = acos(-1);
const int N = 1e5 + 9;
const ll inf = (ll)-1e18;
const int mod = 1e9 + 7;
typedef vector<vector<ll>> Mat;
vector<pair<int, int>> dir = {{... | #include <bits/stdc++.h>
#include <ext/numeric>
using namespace std;
using namespace __gnu_cxx;
#define ll long long
const long double EPS = 1e-8;
const long double PI = acos(-1);
const int N = 1e5 + 9;
const ll inf = (ll)-1e18;
const int mod = 1e9 + 7;
typedef vector<vector<ll>> Mat;
vector<pair<int, int>> dir = {{... | replace | 41 | 42 | 41 | 42 | -6 | terminate called after throwing an instance of 'std::length_error'
what(): cannot create std::vector larger than max_size()
|
p03177 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
#define REP(i, m, n) for (int i = (m); i < (n); i++)
#define rep(i, n) REP(i, 0, n)
#define pb push_back
#define all(a) a.begin(), a.end()
#define rall(c) (c).rbegin(), (c).rend()
#define mp make_pair
#define double long dou... | #include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
#define REP(i, m, n) for (int i = (m); i < (n); i++)
#define rep(i, n) REP(i, 0, n)
#define pb push_back
#define all(a) a.begin(), a.end()
#define rall(c) (c).rbegin(), (c).rend()
#define mp make_pair
#define double long dou... | replace | 38 | 39 | 38 | 39 | -6 | free(): invalid pointer
|
p03177 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef struct matrix {
long long int m[55][55];
} M;
const int MOD = 1000000007;
long long int N, K;
M g;
M mul(M a, M b) {
M c;
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
c.m[i][j] = 0;
for (int k = 0; k < N; k++) {
c.m[i][... | #include <bits/stdc++.h>
using namespace std;
typedef struct matrix {
long long int m[55][55];
} M;
const int MOD = 1000000007;
long long int N, K;
M g;
M mul(M a, M b) {
M c;
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
c.m[i][j] = 0;
for (int k = 0; k < N; k++) {
c.m[i][... | replace | 24 | 25 | 24 | 25 | 0 | |
p03177 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(0); ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(0); ... | replace | 44 | 45 | 44 | 45 | 0 | |
p03177 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
typedef long long ll;
using namespace std;
const ll MOD = 1e9 + 7;
class Matrix {
public:
int m, n;
vector<vector<ll>>... | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
typedef long long ll;
using namespace std;
const ll MOD = 1e9 + 7;
class Matrix {
public:
int m, n;
vector<vector<ll>>... | replace | 55 | 56 | 55 | 56 | 0 | |
p03177 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define forn(i, n) for (ll i = 0; i < n; i++)
#define fore(i, a, b) for (ll i = a; i <= b; i++)
#define ford(i, n) for (ll i = n - 1; i >= 0; i--)
#define fi first
#define se second
#defi... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define forn(i, n) for (ll i = 0; i < n; i++)
#define fore(i, a, b) for (ll i = a; i <= b; i++)
#define ford(i, n) for (ll i = n - 1; i >= 0; i--)
#define fi first
#define se second
#defi... | replace | 60 | 62 | 60 | 63 | 0 | |
p03177 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define M 1000000007
ll walk(vector<vector<ll>> &adj, ll n, ll K) {
ll dp[K + 1][n][n];
memset(dp, 0, sizeof(dp));
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
dp[1][i][j] = adj[i][j];
for (int k = 2; k <= K; k++) {
... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define M 1000000007
ll walk(vector<vector<ll>> &adj, ll n, ll K) {
ll dp[K + 1][n][n];
memset(dp, 0, sizeof(dp));
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
dp[1][i][j] = adj[i][j];
for (int k = 2; k <= K; k++) {
... | replace | 94 | 96 | 94 | 96 | 0 | |
p03177 | C++ | Runtime Error | // #include <boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define f first
#define s second
#define pb push_back
#define REP(i, a, b) for (long long int i = a; i < b; i++)
#define mp make_pair
#define... | // #include <boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define f first
#define s second
#define pb push_back
#define REP(i, a, b) for (long long int i = a; i < b; i++)
#define mp make_pair
#define... | delete | 140 | 144 | 140 | 140 | -6 | terminate called after throwing an instance of 'std::length_error'
what(): cannot create std::vector larger than max_size()
|
p03177 | C++ | Runtime Error | #include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <str... | #include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <str... | replace | 80 | 81 | 80 | 81 | 0 | |
p03177 | C++ | Runtime Error | #pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,sse2,sse3,sse4,mmx,tune=native")
#include <cstring>
#include <iostream>
const int MAX_N = 50;
using ull = unsigned long long;
const int MOD = 1e9 + 7;
int n;
struct Matrix {
int a[MAX_N][MAX_N];
Matrix() : a() {}
inline Matrix &operator*=(const Matrix b)... | #pragma GCC optimize("Ofast")
#pragma GCC target("avx,sse2,sse3,sse4,mmx,tune=native")
#include <cstring>
#include <iostream>
const int MAX_N = 50;
using ull = unsigned long long;
const int MOD = 1e9 + 7;
int n;
struct Matrix {
int a[MAX_N][MAX_N];
Matrix() : a() {}
inline Matrix &operator*=(const Matrix b) {
... | replace | 1 | 2 | 1 | 2 | 0 | |
p03177 | C++ | Runtime Error | #include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// #include <ext/pb_ds/detail/standard_policies.hpp>
// using namespace __gnu_pbds;
using namespace std;
// template <typename T>
// using ordered_set = tree<T, null_type, less<T>, rb_tree_tag,
// tree_order... | #include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// #include <ext/pb_ds/detail/standard_policies.hpp>
// using namespace __gnu_pbds;
using namespace std;
// template <typename T>
// using ordered_set = tree<T, null_type, less<T>, rb_tree_tag,
// tree_order... | delete | 79 | 84 | 79 | 79 | -6 | |
p03178 | C++ | Runtime Error | #include <iostream>
using namespace std;
#define in(v) \
v; \
cin >> v;
#define rep(i, n) for (int i = 0, _i = (n); i < _i; ++i)
#define rrep(i, n) for (long long i = (n); i >= ... | #include <iostream>
using namespace std;
#define in(v) \
v; \
cin >> v;
#define rep(i, n) for (int i = 0, _i = (n); i < _i; ++i)
#define rrep(i, n) for (long long i = (n); i >= ... | replace | 40 | 41 | 40 | 41 | 0 | |
p03178 | C++ | Runtime Error | #include <bits/stdc++.h>
#define endl '\n'
#define left aba
#define right abc
#define oo if (LOG)
#define pb push_back
#define FIO \
ios_base::sync_with_stdio(0); \
cin.tie(0)
#ifdef LOCAL
#define LOG... | #include <bits/stdc++.h>
#define endl '\n'
#define left aba
#define right abc
#define oo if (LOG)
#define pb push_back
#define FIO \
ios_base::sync_with_stdio(0); \
cin.tie(0)
#ifdef LOCAL
#define LOG... | replace | 57 | 58 | 57 | 59 | 0 | |
p03178 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
string k;
ll n, d;
const ll mod = 1e9 + 7;
ll memo[100001][2][101];
ll go(ll pos, ll par, ll val) {
if (pos == n) {
if (val % d == 0)
return 1;
return 0;
}
if (memo[pos][par][val] != -1)
return memo[pos][par][val];
ll ans = 0;
... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
string k;
ll n, d;
const ll mod = 1e9 + 7;
ll memo[100001][2][101];
ll go(ll pos, ll par, ll val) {
if (pos == n) {
if (val % d == 0)
return 1;
return 0;
}
if (memo[pos][par][val] != -1)
return memo[pos][par][val];
ll ans = 0;
... | replace | 33 | 39 | 33 | 34 | -11 | |
p03178 | C++ | Runtime Error | #include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define FOR(i, x, y) for (ll i = x; i < y; i++)
#define MOD 1000000007
typedef long long ll;
using namespace std;
ll dp[1001][101];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s;
ll d;
cin >> s >> d;
dp[0][0] = 1;
FOR(i, 1, s.s... | #include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define FOR(i, x, y) for (ll i = x; i < y; i++)
#define MOD 1000000007
typedef long long ll;
using namespace std;
ll dp[10001][101];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s;
ll d;
cin >> s >> d;
dp[0][0] = 1;
FOR(i, 1, s.... | replace | 7 | 8 | 7 | 8 | 0 | |
p03178 | C++ | Runtime Error | #pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define M 1000000007
#define M2 998244353
#define ll long long
#define pll pair<long, long>
#define REP(i, a,... | #pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define M 1000000007
#define M2 998244353
#define ll long long
#define pll pair<long, long>
#define REP(i, a,... | replace | 134 | 135 | 134 | 135 | 0 | |
p03178 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
typedef long long ll;
typedef pair<ll, ll> pr;
typedef vector<ll> vc;
typedef unordered_map<ll, ll> umap;
#define pb emplace_back
#define rep(i, a, b) for (ll i = a; i <= b; i++)
#defi... | #include <bits/stdc++.h>
using namespace std;
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
typedef long long ll;
typedef pair<ll, ll> pr;
typedef vector<ll> vc;
typedef unordered_map<ll, ll> umap;
#define pb emplace_back
#define rep(i, a, b) for (ll i = a; i <= b; i++)
#defi... | replace | 20 | 21 | 20 | 21 | 0 | |
p03178 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define lsb(x) (x & -x)
using namespace std;
const int MOD = 1000000007;
inline void mod(int &x) {
if (x >= MOD)
x -= MOD;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
freopen("a.in", "r", stdin);
string s;
int d;
cin >> s >... | #include <bits/stdc++.h>
#define ll long long
#define lsb(x) (x & -x)
using namespace std;
const int MOD = 1000000007;
inline void mod(int &x) {
if (x >= MOD)
x -= MOD;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
// freopen("a.in", "r", stdin);
string s;
int d;
cin >> ... | replace | 18 | 19 | 18 | 19 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p03178 | C++ | Runtime Error | #include <iostream>
#include <string>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
string K;
int D;
ll dp[10001][2][101];
// dp[i][j][k] := i - 1桁目(1-idx)まで決定済みで、これからi番目を決定する
// jが1ならばKとスレスレの状態、0ならばそうでない
// kはその時の各桁の和のmod D
int main() {
cin >> K >> D;
dp[0][1][0] = 1;
for (int i = 0;... | #include <iostream>
#include <string>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
string K;
int D;
ll dp[10002][2][101];
// dp[i][j][k] := i - 1桁目(1-idx)まで決定済みで、これからi番目を決定する
// jが1ならばKとスレスレの状態、0ならばそうでない
// kはその時の各桁の和のmod D
int main() {
cin >> K >> D;
dp[0][1][0] = 1;
for (int i = 0;... | replace | 11 | 12 | 11 | 12 | 0 | |
p03178 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long int
#define double /*long*/ double
#define endl '\n'
#define vll vector<ll>
#define pll pair<ll, ll>
#define vpll vector<pll>
#define vppll vector<pair<pll, pll>>
#define mp make_pair
#define pb push_back
#define mapll map<ll, ll>
#define fir first
#define sec second
#defin... | #include <bits/stdc++.h>
#define ll long long int
#define double /*long*/ double
#define endl '\n'
#define vll vector<ll>
#define pll pair<ll, ll>
#define vpll vector<pll>
#define vppll vector<pair<pll, pll>>
#define mp make_pair
#define pb push_back
#define mapll map<ll, ll>
#define fir first
#define sec second
#defin... | replace | 85 | 90 | 85 | 86 | 0 | |
p03178 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
ll d, dp[2002][2002][2][2], mod = 1e9 + 7;
string a, b;
ll rec(ll pos, ll rem, bool flag1, bool flag2) {
if (dp[pos][rem][flag1][flag2] != -1)
return dp[pos][rem][flag1][flag2];
if (pos == a.length())
return !rem;
ll ans = 0, start1... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
const int MAXK = 10005;
const int MAXD = 105;
ll d, dp[MAXK][MAXD][2][2], mod = 1e9 + 7;
string a, b;
ll rec(ll pos, ll rem, bool flag1, bool flag2) {
if (dp[pos][rem][flag1][flag2] != -1)
return dp[pos][rem][flag1][flag2];
if (pos == a.... | replace | 5 | 6 | 5 | 9 | -11 | |
p03178 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
void fastio() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
}
void input() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
ll mod = 1000000007;
string k;
ll d;
ll dp[... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
void fastio() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
}
void input() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
ll mod = 1000000007;
string k;
ll d;
ll dp[... | delete | 51 | 52 | 51 | 51 | 0 | |
p03178 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i, x, n) for (int i = x; i < (int)(n); ++i)
const int N = 1e4, M = 7 + 1e9;
int n, d, a[N], dp[N][101][2];
string s;
vector<vector<int>> moves;
int cal(int i, int sum, bool clicked) {
if (i == n)
return sum % d == 0;
int &ret = dp[i][s... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i, x, n) for (int i = x; i < (int)(n); ++i)
const int N = 1e4, M = 7 + 1e9;
int n, d, a[N], dp[N][101][2];
string s;
vector<vector<int>> moves;
int cal(int i, int sum, bool clicked) {
if (i == n)
return sum % d == 0;
int &ret = dp[i][s... | delete | 25 | 28 | 25 | 25 | -8 | |
p03178 | C++ | Runtime Error | //============================================================================
// Name : s
// Date : Tue Mar 5 16:14:07 CST 2019
// Author : landcold7
// Description : Actions speak louder more than words
//============================================================================
#include "bits/s... | //============================================================================
// Name : s
// Date : Tue Mar 5 16:14:07 CST 2019
// Author : landcold7
// Description : Actions speak louder more than words
//============================================================================
#include "bits/s... | replace | 76 | 80 | 76 | 77 | 0 | |
p03178 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define IOS \
cin.sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define rep(i, ... | #include <bits/stdc++.h>
using namespace std;
#define IOS \
cin.sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define rep(i, ... | replace | 41 | 42 | 41 | 42 | TLE | |
p03178 | C++ | Runtime Error | #include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
const LL INF = 0x3f3f3f3f3f3f3f3fLL;
const LL MOD = 1e9 + 7;
LL dp[1005][105][2], D;
vector<int> arr;
LL solve(int i, int d, int op) {
if (i == -1)
return d == 0;
if (~dp[i][d][op])
... | #include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
const LL INF = 0x3f3f3f3f3f3f3f3fLL;
const LL MOD = 1e9 + 7;
LL dp[10005][105][2], D;
vector<int> arr;
LL solve(int i, int d, int op) {
if (i == -1)
return d == 0;
if (~dp[i][d][op])
... | replace | 8 | 9 | 8 | 9 | 0 | |
p03178 | C++ | Runtime Error | #include "bits/stdc++.h"
#define all(x) (x).begin(), (x).end()
using namespace std;
const int MSIZE = 101;
const long long mod = 1e9 + 7;
long long dp[MSIZE][101];
void Precalc(int d) {
memset(dp, 0, sizeof dp);
dp[0][0] = 1;
for (int i = 1; i < MSIZE; i++) {
for (int c = 0; c < 10; c++) {
for (int ... | #include "bits/stdc++.h"
#define all(x) (x).begin(), (x).end()
using namespace std;
const int MSIZE = 10101;
const long long mod = 1e9 + 7;
long long dp[MSIZE][101];
void Precalc(int d) {
memset(dp, 0, sizeof dp);
dp[0][0] = 1;
for (int i = 1; i < MSIZE; i++) {
for (int c = 0; c < 10; c++) {
for (in... | replace | 5 | 6 | 5 | 6 | 0 | |
p03178 | C++ | Runtime Error | #include <iostream>
#include <string.h>
using namespace std;
const int mod = 1000000007;
int dp[12345][123];
string k;
int a[123];
int l, d;
long long ans;
long long dfs(int pos, int site, bool flag) {
// cout<<"POS:"<<pos<<" SITE:"<<site<<" FLAG:"<<flag<<endl;
if (pos == l + 1)
return dp[pos][site] = (sit... | #include <iostream>
#include <string.h>
using namespace std;
const int mod = 1000000007;
int dp[12345][123];
string k;
int a[12345];
int l, d;
long long ans;
long long dfs(int pos, int site, bool flag) {
// cout<<"POS:"<<pos<<" SITE:"<<site<<" FLAG:"<<flag<<endl;
if (pos == l + 1)
return dp[pos][site] = (s... | replace | 7 | 8 | 7 | 8 | 0 | |
p03178 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define int long long int
#define mod 1000000007
#define inf 1e18
#define fo(i, y, n, inc) for (int i = y; i < n + y; i += inc)
#define cin(t) \
int t; \
cin... | #include <bits/stdc++.h>
#define int long long int
#define mod 1000000007
#define inf 1e18
#define fo(i, y, n, inc) for (int i = y; i < n + y; i += inc)
#define cin(t) \
int t; \
cin... | replace | 60 | 61 | 60 | 61 | TLE | |
p03178 | C++ | Time Limit Exceeded | //
//
// Codeforces: ganariya
// AtCoder: ganariya2525
// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM... | //
//
// Codeforces: ganariya
// AtCoder: ganariya2525
// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM... | replace | 130 | 131 | 130 | 131 | TLE | |
p03178 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
int main() {
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
string K;
cin >> K;
int n = K.size(... | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
int main() {
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
string K;
cin >> K;
int n = K.size(... | replace | 41 | 42 | 41 | 42 | 0 | |
p03178 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll mod = 1000000007;
string k;
ll d;
ll dp[10000][100][2];
ll solve(ll n, ll md, ll s) {
if ((n == k.length()) && (md == 0))
return 1;
if (n == k.length())
return 0;
if (dp[n][md][s] != -1)
return dp[n][md][s];
dp[n][md][s] = 0;
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll mod = 1000000007;
string k;
ll d;
ll dp[20000][500][2];
ll solve(ll n, ll md, ll s) {
if ((n == k.length()) && (md == 0))
return 1;
if (n == k.length())
return 0;
if (dp[n][md][s] != -1)
return dp[n][md][s];
dp[n][md][s] = 0;
... | replace | 6 | 7 | 6 | 7 | 0 | |
p03178 | C++ | Runtime Error | #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 > ... | replace | 51 | 53 | 51 | 53 | -6 | double free or corruption (out)
|
p03178 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int mod = 1e9 + 7;
int dp[10001][10][2];
int solve(string &K, int &D, int pos, int d, bool tight) {
if (dp[pos][d][tight] != -1)
return dp[pos][d][tight];
int ub = (tight) ? (K[pos] - '0') : 9;
int len = K.length() - 1;
if (pos == l... | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int mod = 1e9 + 7;
int dp[10001][101][2];
int solve(string &K, int &D, int pos, int d, bool tight) {
if (dp[pos][d][tight] != -1)
return dp[pos][d][tight];
int ub = (tight) ? (K[pos] - '0') : 9;
int len = K.length() - 1;
if (pos == ... | replace | 4 | 5 | 4 | 5 | 0 | |
p03178 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include ... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include ... | replace | 141 | 142 | 141 | 142 | 0 | |
p03178 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define TemplateVersion "3.7.1"
// Useful Marcos
//====================START=====================
// Compile use C++11 and above
#ifdef LOCAL
#define debug(args...) \
do { ... | #include <bits/stdc++.h>
using namespace std;
#define TemplateVersion "3.7.1"
// Useful Marcos
//====================START=====================
// Compile use C++11 and above
#ifdef LOCAL
#define debug(args...) \
do { ... | delete | 153 | 154 | 153 | 153 | 0 | |
p03178 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, x, n) for (int i = x; i < (n); i++)
#define all(n) begin(n), end(n)
struct cww {
cww() {
ios::sync_with_stdio(false);
cin.tie(0);
}
} star;
const long long INF = numeric_limits<long long>::max();
ty... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, x, n) for (int i = x; i < (n); i++)
#define all(n) begin(n), end(n)
struct cww {
cww() {
ios::sync_with_stdio(false);
cin.tie(0);
}
} star;
const long long INF = numeric_limits<long long>::max();
ty... | replace | 138 | 139 | 138 | 140 | 0 | |
p03178 | C++ | Runtime Error | /*alurquiza*/
// S:Digit Sum
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7, SIZE = 1e4 + 1, MAXR = 100, CANTD = 10;
int DP[SIZE][CANTD][MAXR];
void sum(int &a, int b) {
a += b;
if (a >= MOD)
a -= MOD;
if (a < 0)
a += MOD;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie... | /*alurquiza*/
// S:Digit Sum
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7, SIZE = 1e4 + 1, MAXR = 100, CANTD = 10;
int DP[SIZE][CANTD][MAXR];
void sum(int &a, int b) {
a += b;
if (a >= MOD)
a -= MOD;
if (a < 0)
a += MOD;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie... | replace | 21 | 22 | 21 | 22 | 0 | |
p03178 | C++ | Runtime Error | /*
これを入れて実行
g++ code.cpp
./a.out
*/
#include <algorithm>
#include <bitset>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdio.h>
#include <string>
#include <tuple>
#include <unordered_map>
#include <utility>
#includ... | /*
これを入れて実行
g++ code.cpp
./a.out
*/
#include <algorithm>
#include <bitset>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdio.h>
#include <string>
#include <tuple>
#include <unordered_map>
#include <utility>
#includ... | replace | 97 | 98 | 97 | 98 | 0 | |
p03178 | C++ | Runtime Error | // Author : Sarthak Kapoor
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define repa(i, a, n) for (int i = a; i < n; ++i)
#define repr(i, n) for (int i = n - 1; i >= 0; --i)
#define repba(i, b, a) for (in... | // Author : Sarthak Kapoor
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define repa(i, a, n) for (int i = a; i < n; ++i)
#define repr(i, n) for (int i = n - 1; i >= 0; --i)
#define repba(i, b, a) for (in... | replace | 62 | 66 | 62 | 66 | 0 | |
p03178 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define mod 1000000007
int dp[3001][102][2];
int countdigitsum(int pos, int d, bool tight, string k, int D) {
int ub = tight ? k[pos] - '0' : 9;
if (dp[pos][d][tight] != -1) {
return dp[pos][d][tight];
}
if (pos == k.length() - 1) {
int... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define mod 1000000007
int dp[30001][1002][2];
int countdigitsum(int pos, int d, bool tight, string k, int D) {
int ub = tight ? k[pos] - '0' : 9;
if (dp[pos][d][tight] != -1) {
return dp[pos][d][tight];
}
if (pos == k.length() - 1) {
i... | replace | 4 | 5 | 4 | 5 | 0 | |
p03178 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define ll long long
#define dd double
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define vll vector<long long>
#define vdd vector<double>
#define vpii vector<pair<int, int>>
#define vpll v... | #include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define ll long long
#define dd double
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define vll vector<long long>
#define vdd vector<double>
#define vpii vector<pair<int, int>>
#define vpll v... | replace | 94 | 96 | 94 | 98 | 0 | |
p03178 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define fio \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0)
#define int lon... | #include <bits/stdc++.h>
using namespace std;
#define fio \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0)
#define int lon... | replace | 46 | 47 | 46 | 49 | 0 | |
p03178 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 2;
const int mod = 1e9 + 7;
int d, n, ans, dp[105][N], pref[N];
string s;
int main() {
cin >> s >> d;
n = s.size();
s = ' ' + s;
for (int i = 1; i <= n; i++) {
pref[i] = pref[i - 1] + s[i] - '0';
}
dp[0][0] = 1;
for (int i = 1; ... | #include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 2;
const int mod = 1e9 + 7;
int d, n, ans, dp[N][105], pref[N];
string s;
int main() {
cin >> s >> d;
n = s.size();
s = ' ' + s;
for (int i = 1; i <= n; i++) {
pref[i] = pref[i - 1] + s[i] - '0';
}
dp[0][0] = 1;
for (int i = 1; ... | replace | 7 | 8 | 7 | 8 | 0 | |
p03178 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<ll>
#define fi first
#define se second
#define pb push_back
#define all(x) x.begin(), x.end()
#define vll vector<ll>
#define M 100011
#define MOD 1000000007
ll md = MOD;
string s1;
ll a[1011];
ll dp[1011][110][2];
ll f(ll x, ll mod, ll... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<ll>
#define fi first
#define se second
#define pb push_back
#define all(x) x.begin(), x.end()
#define vll vector<ll>
#define M 100011
#define MOD 1000000007
ll md = MOD;
string s1;
ll a[10110];
ll dp[10110][110][2];
ll f(ll x, ll mod, ... | replace | 14 | 16 | 14 | 16 | 0 | |
p03178 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
ll dp[105][101][2];
const ll mod = 1e9 + 7;
int main() {
string s;
cin >> s;
int n = s.size();
int D;
... | #include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
ll dp[10001][101][2];
const ll mod = 1e9 + 7;
int main() {
string s;
cin >> s;
int n = s.size();
int D;... | replace | 10 | 11 | 10 | 11 | 0 | |
p03178 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < (b); i++)
#define rrep(i, a, b) for (int i = a; i >= b; i--)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int inf = 1 << 20;
const int mod = 1e9 + 7;
ll dp[1005][2][105];
int ctoi(char ... | #include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < (b); i++)
#define rrep(i, a, b) for (int i = a; i >= b; i--)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int inf = 1 << 20;
const int mod = 1e9 + 7;
ll dp[100005][2][105];
int ctoi(cha... | replace | 10 | 11 | 10 | 11 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.