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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int const inf = 1e9 + 7;
int n, W, v[101], w[101], dp[101][1100000];
// dp[i][j] = max(dp[i][j], dp[i-1][j-v[i-1]] + w[i-1])
int main() {
cin >> n >> W;
for (int i = 0; i < n; i++) {
cin >> w[i] >> v[i];
}
for (int i = 0; i < 101; i++)
f... | #include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int const inf = 1e9 + 7;
int n, W, v[101], w[101], dp[101][1100000];
// dp[i][j] = max(dp[i][j], dp[i-1][j-v[i-1]] + w[i-1])
int main() {
cin >> n >> W;
for (int i = 0; i < n; i++) {
cin >> w[i] >> v[i];
}
for (int i = 0; i < 101; i++)
f... | replace | 28 | 29 | 28 | 29 | -11 | |
p03164 | Python | Time Limit Exceeded | N, W = [int(_) for _ in input().split()]
WV = [[int(_) for _ in input().split()] for _ in range(N)]
dp = {}
dp[0] = 0
for w, v in WV:
dp_o = dp.copy()
for k in dp_o:
if k + w <= W:
dp[k + w] = max(dp_o.get(k + w, 0), dp_o[k] + v)
print(max([v for k, v in dp.items()]))
| N, W = [int(_) for _ in input().split()]
WV = [[int(_) for _ in input().split()] for _ in range(N)]
dp = {}
dp[0] = 0
for w, v in WV:
dp_o = dp.copy()
for k in dp_o:
dp[k + v] = min(dp_o.get(k + v, float("inf")), dp_o[k] + w)
print(max([k for k, v in dp.items() if v <= W]))
| replace | 7 | 10 | 7 | 9 | TLE | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define pii pair<int, int>
#define pll pair<long long, long long>
#define ll long long
#define lcm(a, b) (a) / __gcd((a), (b)) * (b)
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define maxn 10000000000000
#define endl '\n'
#define trace(x) cer... | #include <bits/stdc++.h>
using namespace std;
#define pii pair<int, int>
#define pll pair<long long, long long>
#define ll long long
#define lcm(a, b) (a) / __gcd((a), (b)) * (b)
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define maxn 10000000000000
#define endl '\n'
#define trace(x) cer... | replace | 31 | 32 | 31 | 32 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define ll long long int
typedef pair<int, int> pii;
vector<int> v;
map<int, int> op;
#define MAX 200005
bool visited[MAX];
vector<int> adj[MAX];
const int M = 1e9 + 7;
int n, m;
const ll INF = 1LL ... | #include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define ll long long int
typedef pair<int, int> pii;
vector<int> v;
map<int, int> op;
#define MAX 200005
bool visited[MAX];
vector<int> adj[MAX];
const int M = 1e9 + 7;
int n, m;
const ll INF = 1LL ... | replace | 21 | 22 | 21 | 22 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1000000000001
#define N 101
#define VALUE 10001
int n, weight;
ll w[N], v[N], dp[VALUE], mx;
signed main() {
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
cin >> n >> weight;
for (int i = 1; i <= n; i++) {
cin >> w[i]... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1000000000001
#define N 101
#define VALUE 100001
int n, weight;
ll w[N], v[N], dp[VALUE], mx;
signed main() {
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
cin >> n >> weight;
for (int i = 1; i <= n; i++) {
cin >> w[i... | replace | 7 | 8 | 7 | 8 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int64_t INF = 1e18L + 5;
const int MAX_W_V_SIZE = 105, M = 2e3 + 5;
int64_t W[105], V[105], dp[M];
int main() {
int n, w, max_val;
cin >> n >> w;
max_val = 0;
for (int i = 0; i < n; i++)
cin >> W[i] >> V[i], max_val += V[i];
for (int i = 0; i <= M; i... | #include <bits/stdc++.h>
using namespace std;
const int64_t INF = 1e18L + 5;
const int MAX_W_V_SIZE = 105, M = 2e5 + 5;
int64_t W[105], V[105], dp[M];
int main() {
int n, w, max_val;
cin >> n >> w;
max_val = 0;
for (int i = 0; i < n; i++)
cin >> W[i] >> V[i], max_val += V[i];
for (int i = 0; i <= M; i... | replace | 5 | 6 | 5 | 6 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(), A.end()
#define RALL(A) A.rbegin(), A.rend()
typedef long long ll;
typedef pair<ll, ll> P;
const ll mod = 1000000007;
const ll LINF = 1LL << 60;
co... | #include <bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(), A.end()
#define RALL(A) A.rbegin(), A.rend()
typedef long long ll;
typedef pair<ll, ll> P;
const ll mod = 1000000007;
const ll LINF = 1LL << 60;
co... | replace | 27 | 28 | 27 | 32 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
/*### FAST-IO ###*/
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout... | #include <bits/stdc++.h>
using namespace std;
/*### FAST-IO ###*/
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout... | delete | 237 | 241 | 237 | 237 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long long c[105], v[105];
long long dp[105][1005];
#define inf 1e9 + 5
int main() {
long long n, w;
cin >> n >> w;
long long v_sum = 0;
for (int i = 1; i <= n; i++) {
cin >> c[i] >> v[i];
v_sum += v[i];
}
for (int i = 0; i <= n; i++) {
for (int j = 0... | #include <bits/stdc++.h>
using namespace std;
long long c[105], v[105];
long long dp[105][100005];
#define inf 1e9 + 5
int main() {
long long n, w;
cin >> n >> w;
long long v_sum = 0;
for (int i = 1; i <= n; i++) {
cin >> c[i] >> v[i];
v_sum += v[i];
}
for (int i = 0; i <= n; i++) {
for (int j =... | replace | 3 | 4 | 3 | 4 | 0 | |
p03164 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <unordered_map>
using namespace std;
const int w_max = 1e9 + 1;
const int v_max = 1e5 + 10;
const int size = 1e2 + 1;
int memo[v_max][size];
bool vis[v_max][size];
int v[size];
int w[size];
int n, w_tot;
int dp(int vtmp, int i) {
if... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <unordered_map>
using namespace std;
const int w_max = 1e9 + 1;
const int v_max = 1e5 + 10;
const int size = 1e2 + 1;
int memo[v_max][size];
bool vis[v_max][size];
int v[size];
int w[size];
int n, w_tot;
int dp(int vtmp, int i) {
if... | insert | 26 | 26 | 26 | 28 | TLE | |
p03164 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
const ll INF = 1e+12;
int main() {
int N, W, sval = 0, ans = 0;
static ll dp[110][1010];
cin >> N >> W;
vector<int> w(N), v(N);
for (int i = 0; i < N; ++i) {
cin >> w[i] >> v[i];
sv... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
const ll INF = 1e+12;
int main() {
int N, W, sval = 0, ans = 0;
static ll dp[110][100010];
cin >> N >> W;
vector<int> w(N), v(N);
for (int i = 0; i < N; ++i) {
cin >> w[i] >> v[i];
... | replace | 11 | 12 | 11 | 12 | 0 | |
p03164 | C++ | Runtime Error | ///*بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيم*///
// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define ln '\n'
#define inp(x) scanf("%lld", &x)
#define inp2(a, b) scanf("%lld %lld", &a, &b)
#define f0(i, b... | ///*بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيم*///
// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define ln '\n'
#define inp(x) scanf("%lld", &x)
#define inp2(a, b) scanf("%lld %lld", &a, &b)
#define f0(i, b... | replace | 210 | 211 | 210 | 211 | 0 | |
p03164 | C++ | Runtime Error | #include <iostream>
using namespace std;
typedef long long int ll;
ll N, K;
ll DP[100005][102];
ll W[102], V[102];
ll INF = 1e18;
int main() {
cin >> N >> K;
for (int i = 0; i < N; i++)
cin >> W[i + 1] >> V[i + 1];
for (int i = 1; i < 1003 * N; i++)
DP[i][0] = INF;
for (int i = 0; i < N * 1003; i++... | #include <iostream>
using namespace std;
typedef long long int ll;
ll N, K;
ll DP[110005][102];
ll W[102], V[102];
ll INF = 1e18;
int main() {
cin >> N >> K;
for (int i = 0; i < N; i++)
cin >> W[i + 1] >> V[i + 1];
for (int i = 1; i < 1003 * N; i++)
DP[i][0] = INF;
for (int i = 0; i < N * 1003; i++... | replace | 5 | 6 | 5 | 6 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
#define MX 100000
using namespace std;
typedef long long lnt;
template <class T> inline void read(T &x) {
x = 0;
int c = getchar(), f = 1;
for (; !isdigit(c); c = getchar())
if (c == 45)
f = -1;
for (; isdigit(c); c = getchar())
(x *= 10) += f * (c - '0');
}
int n, w[105],... | #include <bits/stdc++.h>
#define MX 100000
using namespace std;
typedef long long lnt;
template <class T> inline void read(T &x) {
x = 0;
int c = getchar(), f = 1;
for (; !isdigit(c); c = getchar())
if (c == 45)
f = -1;
for (; isdigit(c); c = getchar())
(x *= 10) += f * (c - '0');
}
int n, w[105],... | replace | 21 | 22 | 21 | 22 | 0 | |
p03164 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define MOD 1000000007
#define ll long long
#define mp make_pair
#define pb push_back
#define N 110
#define W 100010
using namespace std;
ll dp[N][W], A[N], B[N], n;
ll fun(int a, int b) {
if (b < 0)
return 2 * 1e9;
if (a == n) {
if (b == 0)
return 0;
return 2 * 1e9;
}
... | #include <bits/stdc++.h>
#define MOD 1000000007
#define ll long long
#define mp make_pair
#define pb push_back
#define N 110
#define W 100010
using namespace std;
ll dp[N][W], A[N], B[N], n;
ll fun(int a, int b) {
if (b < 0)
return 2 * 1e9;
if (a == n) {
if (b == 0)
return 0;
return 2 * 1e9;
}
... | insert | 17 | 17 | 17 | 19 | TLE | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
void Main() {
int N, W;
cin >> N >> W;
vector<int> w(N), v(N);
long total_val = 0;
for (int i = 0; i < N; i++) {
cin >> w[i] >> v[i];
total_val += v[i];
}
long max_value = 0;
vector<vector<long>> nap(N, vector<long>(total_val + 1, 1e18));
for (i... | #include <bits/stdc++.h>
using namespace std;
void Main() {
int N, W;
cin >> N >> W;
vector<int> w(N), v(N);
long total_val = 0;
for (int i = 0; i < N; i++) {
cin >> w[i] >> v[i];
total_val += v[i];
}
long max_value = 0;
vector<vector<long>> nap(N, vector<long>(total_val + 1, 1e18));
for (i... | replace | 26 | 27 | 26 | 27 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
#define int long long
using namespace std;
signed main() {
int N, W;
cin >> N >> W;
vector<int> w(N);
vector<int> v(N);
for (int i = 0; i < N; i++)
cin >> w[i] >> v[i];
vector<vector<int>> dp(100, vector<int>(100000 + 100, 1e16));
int V = *max_element(v.begin(), v.end());
i... | #include <bits/stdc++.h>
#define int long long
using namespace std;
signed main() {
int N, W;
cin >> N >> W;
vector<int> w(N);
vector<int> v(N);
for (int i = 0; i < N; i++)
cin >> w[i] >> v[i];
vector<vector<int>> dp(110, vector<int>(1000000 + 100, 1e16));
int V = *max_element(v.begin(), v.end());
... | replace | 11 | 12 | 11 | 12 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define prior priority_queue
#define MOD 1000000007
#define INF64 (long long int)1e18
#define INF (int)1e9
#define PI 3.1415926535897932384626433832795
#define ll long long int
#define ld long double
#define ret return
#define NUM ... | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define prior priority_queue
#define MOD 1000000007
#define INF64 (long long int)1e18
#define INF (int)1e9
#define PI 3.1415926535897932384626433832795
#define ll long long int
#define ld long double
#define ret return
#define NUM ... | replace | 33 | 34 | 33 | 34 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long int ull;
#define endl "\n"
#define pb push_back
#define sq(a) (a) * (a)
#define debug(x) cerr << #x << '=' << (x) << endl;
#define debugv(v) \
cerr << #v << " : ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long int ull;
#define endl "\n"
#define pb push_back
#define sq(a) (a) * (a)
#define debug(x) cerr << #x << '=' << (x) << endl;
#define debugv(v) \
cerr << #v << " : ... | delete | 38 | 42 | 38 | 38 | -11 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define repl(i, l, r) for (ll i = (l); i < (r); i++)
#define per(i, n) for (ll i = n - 1; i >= 0; i--)
#define perl(i, r, l) for (ll i = r - 1; i >= l; i--)
#define fi first
#define se second
#define pb push_back
#define ins inse... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define repl(i, l, r) for (ll i = (l); i < (r); i++)
#define per(i, n) for (ll i = n - 1; i >= 0; i--)
#define perl(i, r, l) for (ll i = r - 1; i >= l; i--)
#define fi first
#define se second
#define pb push_back
#define ins inse... | replace | 49 | 50 | 49 | 51 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
#define repp(i, l, r) for (long long i = (l); i < (r); i++)
#define rep(i, n) for (long long i = 0; i < (n); ++i)
#define per(i, n) for (long long i = (n); i >= 0; --i)
const int INF = 1 << 30; // int max
const long long int MOD = 1000000007;
using namespace std;
using ll = long long;
using P =... | #include <bits/stdc++.h>
#define repp(i, l, r) for (long long i = (l); i < (r); i++)
#define rep(i, n) for (long long i = 0; i < (n); ++i)
#define per(i, n) for (long long i = (n); i >= 0; --i)
const int INF = 1 << 30; // int max
const long long int MOD = 1000000007;
using namespace std;
using ll = long long;
using P =... | replace | 24 | 25 | 24 | 25 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
int dp[10005][1005];
int solve(int r, int i, int wt[], int val[], int n) {
if (r <= 0)
return 0;
if (i == n)
return INT_MAX;
if (dp[r][i] != -1)
return dp[r][i];
return dp[r][i] = min(solve(r, i + 1, wt, val, n),
... | #include <bits/stdc++.h>
using namespace std;
#define int long long
int dp[100005][105];
int solve(int r, int i, int wt[], int val[], int n) {
if (r <= 0)
return 0;
if (i == n)
return INT_MAX;
if (dp[r][i] != -1)
return dp[r][i];
return dp[r][i] = min(solve(r, i + 1, wt, val, n),
... | replace | 3 | 4 | 3 | 4 | 0 | |
p03164 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <ctype.h>
#include <iostream>
#define mp make_pair
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
typedef pair<int, LL> pil;
const int MAXN = 100;
const int MAXV = 1e5;
const int INF = 0x3f3f3f3f;
template <typename T> inline... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <ctype.h>
#include <iostream>
#define mp make_pair
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
typedef pair<int, LL> pil;
const int MAXN = 100;
const int MAXV = 1e5;
const int INF = 0x3f3f3f3f;
template <typename T> inline... | delete | 64 | 68 | 64 | 64 | TLE | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
using namespace std;
template <typename T> using vec = std::vector<T>;
int main() {
int N, W;
cin >> N >> W;
vec<ll> w(N), v(N);
rep(i, N) cin >> w[i] >> v[i];
ll MAX_VAL = 10... | #include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
using namespace std;
template <typename T> using vec = std::vector<T>;
int main() {
int N, W;
cin >> N >> W;
vec<ll> w(N), v(N);
rep(i, N) cin >> w[i] >> v[i];
ll MAX_VAL = 10... | replace | 14 | 15 | 14 | 15 | 0 | |
p03164 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i, a, b) for (int i = a; i <= b; ++i)
#define nl '\n'
#define repd(i, a, b) for (int i = a; i >= b; --i)
#define pb push_back
#define all(a) a.begin(), a.end()
#define F first
#define S second
const ll N = 1e6 + 9;
const ll mod = 1e9 + ... | #include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i, a, b) for (int i = a; i <= b; ++i)
#define nl '\n'
#define repd(i, a, b) for (int i = a; i >= b; --i)
#define pb push_back
#define all(a) a.begin(), a.end()
#define F first
#define S second
const ll N = 1e6 + 9;
const ll mod = 1e9 + ... | replace | 14 | 15 | 14 | 15 | -11 | |
p03164 | C++ | Runtime Error | // recurive code hai 0/1 knapsack ka
#include <bits/stdc++.h>
#include <cstdlib>
using namespace std;
#define int long long
#define fastIO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define ip(a, n)... | // recurive code hai 0/1 knapsack ka
#include <bits/stdc++.h>
#include <cstdlib>
using namespace std;
#define int long long
#define fastIO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define ip(a, n)... | replace | 56 | 57 | 56 | 57 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll dp[110][100100];
void chmin(ll &a, ll b) {
if (a > b) {
a = b;
}
return;
}
const ll inf = 1LL << 60;
int main() {
ll max_v = 0;
for (ll i = 0; i < 110; i++) {
for (ll j = 0; j < 100100; j++) {
dp[i][j] = inf;
}
}
ll... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll dp[110][100100];
void chmin(ll &a, ll b) {
if (a > b) {
a = b;
}
return;
}
const ll inf = 1LL << 60;
int main() {
ll max_v = 0;
for (ll i = 0; i < 110; i++) {
for (ll j = 0; j < 100100; j++) {
dp[i][j] = inf;
}
}
ll... | replace | 38 | 39 | 38 | 39 | -11 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long long w[105], v[105];
long long dp[105][100005];
int main() {
int N;
long long W;
cin >> N >> W;
for (int i = 1; i <= N; i++)
cin >> w[i] >> v[i];
for (int i = 0; i <= N; i++)
for (int j = 1; j <= 100000; j++)
dp[i][j] = 1e18;
dp[0][0] = 0;
f... | #include <bits/stdc++.h>
using namespace std;
long long w[105], v[105];
long long dp[105][100005];
int main() {
int N;
long long W;
cin >> N >> W;
for (int i = 1; i <= N; i++)
cin >> w[i] >> v[i];
for (int i = 0; i <= N; i++)
for (int j = 1; j <= 100000; j++)
dp[i][j] = 1e18;
dp[0][0] = 0;
f... | replace | 18 | 19 | 18 | 20 | 0 | |
p03164 | C++ | Runtime Error | #include <algorithm>
#include <climits>
#include <cmath>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long int
#define rep(i, n) fo... | #include <algorithm>
#include <climits>
#include <cmath>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long int
#define rep(i, n) fo... | replace | 38 | 39 | 38 | 40 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// Type alias
using ll = long long;
using ld = double;
using pi = pair<int, int>;
using pll = pair<ll, ll>;
using pld = pair<ld, ld>;
using ti3 = tuple<int, int, int>;
using vi = vector<int>;
using vll = vector<ll>;
using vld = vector<ld>;
using vpi = vector<pi>;
using v... | #include <bits/stdc++.h>
using namespace std;
// Type alias
using ll = long long;
using ld = double;
using pi = pair<int, int>;
using pll = pair<ll, ll>;
using pld = pair<ld, ld>;
using ti3 = tuple<int, int, int>;
using vi = vector<int>;
using vll = vector<ll>;
using vld = vector<ld>;
using vpi = vector<pi>;
using v... | replace | 76 | 77 | 76 | 77 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
#define pb push_back
#define rep(a, b, c) for (int a = (int)b; a < (int)c; a++)
#define repk(a, b, c, k) for (int a = (int)b; a < (int)c; a += (int)k)
#define comeback \
std::ios_base::sync_with_stdio(false); ... | #include <bits/stdc++.h>
#define pb push_back
#define rep(a, b, c) for (int a = (int)b; a < (int)c; a++)
#define repk(a, b, c, k) for (int a = (int)b; a < (int)c; a += (int)k)
#define comeback \
std::ios_base::sync_with_stdio(false); ... | replace | 28 | 33 | 28 | 34 | -11 | |
p03164 | C++ | Runtime Error |
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse2")
/*
||||||||||||||||||||||||||||||||||||||||||||||||
| ||| | |||| |||| | |
| | | | | | | | | | |
| | | | | | | | | | |
... |
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse2")
/*
||||||||||||||||||||||||||||||||||||||||||||||||
| ||| | |||| |||| | |
| | | | | | | | | | |
| | | | | | | | | | |
... | replace | 105 | 106 | 105 | 108 | -6 | terminate called after throwing an instance of 'std::length_error'
what(): cannot create std::vector larger than max_size()
|
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
#define REP(i, a, n) for (ll i = ((ll)a); i < ((ll)n); i++)
using namespace std;
typedef long long ll;
int main(void) {
ll N, W;
cin >> N >> W;
vector<ll> w(N), v(N);
REP(i, 0, N) cin >> w[i] >> v[i];
const ll INF = 1LL << 60;
vector<vector<ll>> dp(N + 1, vector<ll>(100001, INF));... | #include <bits/stdc++.h>
#define REP(i, a, n) for (ll i = ((ll)a); i < ((ll)n); i++)
using namespace std;
typedef long long ll;
int main(void) {
ll N, W;
cin >> N >> W;
vector<ll> w(N), v(N);
REP(i, 0, N) cin >> w[i] >> v[i];
const ll INF = 1LL << 60;
vector<vector<ll>> dp(N + 1, vector<ll>(100001, INF));... | replace | 18 | 19 | 18 | 21 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using ll = long long;
using namespace std;
const int INFint = 2e9 + 1;
const ll INFll = 2e18 + 1;
ll MOD = 1e9 + 7;
int main() {
int N, W;
cin >> N >> W;
vector<int> wi(N + 1), vi(N + 1);
for (int i(1); i <= N; i++) {
cin >> wi[i] >> vi[i];
}
ll dp[101][10001] = {0};
for (in... | #include <bits/stdc++.h>
using ll = long long;
using namespace std;
const int INFint = 2e9 + 1;
const ll INFll = 2e18 + 1;
ll MOD = 1e9 + 7;
int main() {
int N, W;
cin >> N >> W;
vector<int> wi(N + 1), vi(N + 1);
for (int i(1); i <= N; i++) {
cin >> wi[i] >> vi[i];
}
ll dp[101][100001] = {0};
for (i... | replace | 15 | 16 | 15 | 16 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define var auto
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
i... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define var auto
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
i... | replace | 21 | 23 | 21 | 23 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <iostream>
#define ll long long int
#define lld long double
#define F first
#define S second
#define f(i, a, b) for (int i = a; i <= b; i++)
#define g(i, a, b) for (int i = a; i >= b; i--)
#define mp make_pair
#define pb push_back
#define mh make_heap
#define ph push_heap
#define pq pr... | #include <bits/stdc++.h>
#include <iostream>
#define ll long long int
#define lld long double
#define F first
#define S second
#define f(i, a, b) for (int i = a; i <= b; i++)
#define g(i, a, b) for (int i = a; i >= b; i--)
#define mp make_pair
#define pb push_back
#define mh make_heap
#define ph push_heap
#define pq pr... | delete | 79 | 83 | 79 | 79 | 0 | |
p03164 | Python | Runtime Error | n, w = map(int, input().split())
item = [list(map(int, input().split())) for i in range(n)]
max_v = 100005
dp = [[float("inf") * max_v] for j in range(n + 1)]
dp[0][0] = 0
for i in range(n):
for sum_v in range(max_v):
if sum_v - item[i][1] >= 0:
dp[i + 1][sum_v] = min(
dp[i + ... | n, w = map(int, input().split())
item = [list(map(int, input().split())) for i in range(n)]
max_v = 100005
dp = [[float("inf")] * max_v for j in range(n + 1)]
dp[0][0] = 0
for i in range(n):
for sum_v in range(max_v):
if sum_v - item[i][1] >= 0:
dp[i + 1][sum_v] = min(
dp[i + ... | replace | 5 | 6 | 5 | 6 | IndexError: list index out of range | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03164/Python/s800712672.py", line 13, in <module>
dp[i + 1][sum_v] = min((dp[i + 1][sum_v], dp[i][sum_v]))
IndexError: list index out of range
|
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
// DEEP
using namespace std;
#define boost \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)... | #include <bits/stdc++.h>
// DEEP
using namespace std;
#define boost \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)... | replace | 148 | 149 | 148 | 149 | -11 | |
p03164 | Python | Runtime Error | N, W = map(int, input().split())
items = [list(map(int, input().split())) for _ in range(N)]
v_sum = sum([item[1] for item in items])
inf = float("inf")
dp = [inf for _ in range(v_sum + 1)]
dp[0] = 0
for i in range(N):
for j in range(v_sum, -1, -1):
if dp[j] >= dp[j - items[i][1] + items[i][0]]:
... | N, W = map(int, input().split())
items = [list(map(int, input().split())) for _ in range(N)]
v_sum = sum([item[1] for item in items])
inf = float("inf")
dp = [inf for _ in range(v_sum + 1)]
dp[0] = 0
for i in range(N):
for j in range(v_sum, -1, -1):
if dp[j] > dp[j - items[i][1]] + items[i][0]:
... | replace | 11 | 12 | 11 | 12 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long int
#define F(i, j, k, in) for (int i = j; i < k; i += in)
#define DF(i, j, k, in) for (int i = j; i >= k; i -= in)
#define feach(it, l) for (auto it = l.begin(); it != l.end(); ++it)
#define fitr(it, it1, itr2) for (auto it = itr1; it != itr2; ++it)
#define fall(a) a.begin... | #include <bits/stdc++.h>
#define ll long long int
#define F(i, j, k, in) for (int i = j; i < k; i += in)
#define DF(i, j, k, in) for (int i = j; i >= k; i -= in)
#define feach(it, l) for (auto it = l.begin(); it != l.end(); ++it)
#define fitr(it, it1, itr2) for (auto it = itr1; it != itr2; ++it)
#define fall(a) a.begin... | replace | 52 | 53 | 52 | 53 | 0 | |
p03164 | Python | Time Limit Exceeded | N, W = map(int, input().split())
items = [None] * N
for n in range(N):
w, v = map(int, input().split())
items[n] = (w, v)
V = 10**6 + 1
dp = [[10**9 + 1] * V for _ in range(N + 1)]
dp[0][0] = 0
for i in range(N):
for j in range(V):
w, v = items[i]
if j >= v:
dp[i + 1][j] = min(... | N, W = map(int, input().split())
items = [None] * N
for n in range(N):
w, v = map(int, input().split())
items[n] = (w, v)
V = 10**5 + 1
dp = [[10**9 + 1] * V for _ in range(N + 1)]
dp[0][0] = 0
for i in range(N):
for j in range(V):
w, v = items[i]
if j >= v:
dp[i + 1][j] = min(... | replace | 5 | 6 | 5 | 6 | TLE | |
p03164 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector... | #include <algorithm>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector... | replace | 328 | 329 | 328 | 330 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
typedef pair<int, int> P;
const int INF = 1001001001;
const long double PI = (acos(-1));
const int mod = 1e9 + 7;
const int vx[4] = {0, 1, 0, -1};
const int vy[4] = {1, 0,... | #include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
typedef pair<int, int> P;
const int INF = 1001001001;
const long double PI = (acos(-1));
const int mod = 1e9 + 7;
const int vx[4] = {0, 1, 0, -1};
const int vy[4] = {1, 0,... | replace | 32 | 33 | 32 | 33 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long int
#define endl "\n"
int32_t main() {
int n, w;
cin >> n >> w;
vector<int> wt(n), val(n);
int sum_val = 0;
for (int i = 0; i < n; i++) {
cin >> wt[i] >> val[i];
sum_val += val[i];
}
vector<int> dp(sum_val + 1, INT_MAX);
dp... | #include <bits/stdc++.h>
using namespace std;
#define int long long int
#define endl "\n"
int32_t main() {
int n, w;
cin >> n >> w;
vector<int> wt(n), val(n);
int sum_val = 0;
for (int i = 0; i < n; i++) {
cin >> wt[i] >> val[i];
sum_val += val[i];
}
vector<int> dp(sum_val + 1, INT_MAX);
dp... | replace | 22 | 23 | 22 | 23 | 0 | |
p03164 | C++ | Runtime Error | /*
Author - linpaws07
*/
#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
#define mod 1000000007
#define mp make_pair
#define pb push_back
#define inf (int)1e9
#define f first
#define s second
#define eps 1e-9
#define PI 3.1415926535897932384626433832795
#define scd(t) scanf("%d", &t)
#def... | /*
Author - linpaws07
*/
#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
#define mod 1000000007
#define mp make_pair
#define pb push_back
#define inf (int)1e9
#define f first
#define s second
#define eps 1e-9
#define PI 3.1415926535897932384626433832795
#define scd(t) scanf("%d", &t)
#def... | replace | 58 | 59 | 58 | 59 | 0 | |
p03164 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
const int INF = 1e9 + 1;
int main() {
int N, W;
cin >> N >> W;
vector<ll> value(N), weight(N);
for (int i = 0; i < N; i++) {
cin >> weight[i] >> value[i];
}
vector<vector<ll>> dp(N + 1, vector<ll>(... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
const int INF = 1e9 + 1;
int main() {
int N, W;
cin >> N >> W;
vector<ll> value(N), weight(N);
for (int i = 0; i < N; i++) {
cin >> weight[i] >> value[i];
}
vector<vector<ll>> dp(N + 1, vector<ll>(... | replace | 18 | 19 | 18 | 19 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
ll n, limit;
cin >> n >> limit;
vector<pair<ll, ll>> luggage(n);
ll quota_max = 0;
for (int i = 0; i < n; ++i) {
cin >> luggage[i].first >> luggage[i].second;
quota_max += luggage[i].second;
}
vector<vector<ll>> dp(1... | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
ll n, limit;
cin >> n >> limit;
vector<pair<ll, ll>> luggage(n);
ll quota_max = 0;
for (int i = 0; i < n; ++i) {
cin >> luggage[i].first >> luggage[i].second;
quota_max += luggage[i].second;
}
vector<vector<ll>> dp(1... | replace | 13 | 14 | 13 | 14 | 0 | |
p03164 | C++ | Runtime Error | // https://atcoder.jp/contests/dp/tasks/dp_e
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <limits.h>
using namespace std;
struct object {
int weight, value;
};
object arr[107];
long long dp[1007][107];
long long res(int value, int n) {
if (value <= 0)
return 0;
if (n == 0)
retu... | // https://atcoder.jp/contests/dp/tasks/dp_e
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <limits.h>
using namespace std;
struct object {
int weight, value;
};
object arr[107];
long long dp[100007][107];
long long res(int value, int n) {
if (value <= 0)
return 0;
if (n == 0)
re... | replace | 13 | 14 | 13 | 14 | 0 | |
p03164 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
long long inf = 1e18L + 5;
long long dp[100001];
int main() {
int n, w;
cin >> n >> w;
pair<long long, long long> arr[n + 1];
arr[0] = make_pair(0, 0);
int sum = 0;
for (int i = 1; i <= n; ++i) {
long long a, ... | #include <algorithm>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
long long inf = 1e18L + 5;
long long dp[100001];
int main() {
int n, w;
cin >> n >> w;
pair<long long, long long> arr[n + 1];
arr[0] = make_pair(0, 0);
int sum = 0;
for (int i = 1; i <= n; ++i) {
long long a, ... | replace | 26 | 27 | 26 | 31 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int INF = 1e9 + 5;
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int n, W;
cin >> n >> W;
vector<int... | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int INF = 1e9 + 5;
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
/*#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif*/
int n, W;
cin >> n >> W;
vector... | replace | 9 | 13 | 9 | 13 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 105, W = 1e9 + 5, V = 1e3 + 5, INF = 1e9 + 5;
ll dp[N][N * V];
int main() {
ios_base::sync_with_stdio(0);
cin.tie();
int n, w;
cin >> n >> w;
fill(dp[0], dp[0] + N * V, INF);
dp[0][0] = 0;
for (int i = 1; i <= n; i++) {... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 105, W = 1e9 + 5, V = 1e3 + 5, INF = 1e9 + 5;
ll dp[N][N * V];
int main() {
ios_base::sync_with_stdio(0);
cin.tie();
int n, w;
cin >> n >> w;
fill(dp[0], dp[0] + N * V, INF);
dp[0][0] = 0;
for (int i = 1; i <= n; i++) {... | replace | 20 | 21 | 20 | 21 | 0 | |
p03164 | C++ | Time Limit Exceeded | // 22
/****************************************************
https://searleser97.gitlab.io/algorithms/template.cpp
****************************************************/
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define fors(_, x, n, s) for (int _ = x; _ < n; _ += s)
#define forn(_, x, n) fors(_, x... | // 22
/****************************************************
https://searleser97.gitlab.io/algorithms/template.cpp
****************************************************/
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define fors(_, x, n, s) for (int _ = x; _ < n; _ += s)
#define forn(_, x, n) fors(_, x... | replace | 43 | 49 | 43 | 47 | TLE | |
p03164 | C++ | Runtime Error |
#include <bits/stdc++.h>
using namespace std;
#define int long long int
int v[100], w[100];
int dp[100][100005];
int f(int i, int value) {
if (value == 0)
return 0;
if (i < 0)
return 1000000000;
if (dp[i][value] != -1)
return dp[i][value];
return dp[i][value] = min(f(i - 1, value), f(i - 1, value -... |
#include <bits/stdc++.h>
using namespace std;
#define int long long int
int v[100], w[100];
int dp[100][100005];
int f(int i, int value) {
if (value < 0)
return 1000000000;
if (value == 0)
return 0;
if (i < 0)
return 1000000000;
if (dp[i][value] != -1)
return dp[i][value];
return dp[i][value]... | insert | 7 | 7 | 7 | 9 | 0 | |
p03164 | C++ | Runtime Error | #include <climits>
#include <iostream>
#include <vector>
using namespace std;
#define ll long long
int main() {
ll N = 0;
cin >> N;
ll VAL = 0;
cin >> VAL;
ll V = 0;
vector<vector<ll>> inp(N, vector<ll>(2));
for (ll i = 0; i < N; i++) {
cin >> inp[i][0] >> inp[i][1];
V += inp[i][1];
}
vector<l... | #include <climits>
#include <iostream>
#include <vector>
using namespace std;
#define ll long long
int main() {
ll N = 0;
cin >> N;
ll VAL = 0;
cin >> VAL;
ll V = 0;
vector<vector<ll>> inp(N, vector<ll>(2));
for (ll i = 0; i < N; i++) {
cin >> inp[i][0] >> inp[i][1];
V += inp[i][1];
}
vector<l... | replace | 24 | 27 | 24 | 29 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#if !ONLINE_JUDGE
#define debug
#endif
using namespace std;
/******* All Required define Pre-Processors and typedef Constants *******/... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#if !ONLINE_JUDGE
#define debug
#endif
using namespace std;
/******* All Required define Pre-Processors and typedef Constants *******/... | replace | 146 | 147 | 146 | 147 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll N;
scanf("%lld", &N);
ll W;
scanf("%lld", &W);
vector<ll> w(N);
vector<ll> v(N);
for (int i = 0; i < N; i++) {
scanf("%lld", &w[i]);
scanf("%lld", &v[i]);
}
vector<vector<ll>> dp(N + 1, vector<ll>(N * 1000 + ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll N;
scanf("%lld", &N);
ll W;
scanf("%lld", &W);
vector<ll> w(N);
vector<ll> v(N);
for (int i = 0; i < N; i++) {
scanf("%lld", &w[i]);
scanf("%lld", &v[i]);
}
vector<vector<ll>> dp(N + 1, vector<ll>(N * 1000 + ... | replace | 20 | 21 | 20 | 21 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int n, w;
int vi[105];
long long wi[105];
long long dp[100][100005];
void solve() {
for (int i = 0; i <= n; i++)
for (int j = 0; j <= 100000; j++)
dp[i][j] = 1e15;
dp[0][0] = 0;
for (int i = 1; i <= n; i++) {
dp[i][0] = 0;
for (int j = 1; j <= 1000... | #include <bits/stdc++.h>
using namespace std;
int n, w;
int vi[105];
long long wi[105];
long long dp[105][100005];
void solve() {
for (int i = 0; i <= n; i++)
for (int j = 0; j <= 100000; j++)
dp[i][j] = 1e15;
dp[0][0] = 0;
for (int i = 1; i <= n; i++) {
dp[i][0] = 0;
for (int j = 1; j <= 1000... | replace | 6 | 7 | 6 | 7 | 0 | |
p03164 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <ios>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#inclu... | #include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <ios>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#inclu... | replace | 125 | 126 | 125 | 128 | 0 | |
p03164 | C++ | Time Limit Exceeded | /*
ID: seekho
PROG: friday
LANG: C++14
*/
/* LANG can be C++11 or C++14 for those more recent releases */
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds... | /*
ID: seekho
PROG: friday
LANG: C++14
*/
/* LANG can be C++11 or C++14 for those more recent releases */
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds... | replace | 69 | 76 | 69 | 76 | TLE | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const long long int INF = 1e18L + 5;
int main() {
int n, W;
cin >> n >> W;
vector<vector<int>> v(n + 1, vector<int>(2));
int sum = 0;
for (int i = 1; i <= n; i++) {
cin >> v[i][0] >> v[i][1];
sum += v[i][1];
}
vector<long long int> dp(sum + 1, INF);
... | #include <bits/stdc++.h>
using namespace std;
const long long int INF = 1e18L + 5;
int main() {
int n, W;
cin >> n >> W;
vector<vector<int>> v(n + 1, vector<int>(2));
int sum = 0;
for (int i = 1; i <= n; i++) {
cin >> v[i][0] >> v[i][1];
sum += v[i][1];
}
vector<long long int> dp(sum + 1, INF);
... | replace | 18 | 19 | 18 | 21 | 0 | |
p03164 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
#define int lo... | #include <algorithm>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
#define int lo... | insert | 41 | 41 | 41 | 43 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> Pii;
typedef pair<ll, ll> Pll;
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rep2(i, a, b) for (ll i = a; i < b; ++i)
const ll MOD = 1000003;
const ll INF = 1e9;
const ll IINF = 1e18;
const double EPS = 1e-8;
const double ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> Pii;
typedef pair<ll, ll> Pll;
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rep2(i, a, b) for (ll i = a; i < b; ++i)
const ll MOD = 1000003;
const ll INF = 1e9;
const ll IINF = 1e18;
const double EPS = 1e-8;
const double ... | replace | 40 | 41 | 40 | 42 | 0 | |
p03164 | C++ | Runtime Error | #include <iostream>
using namespace std;
#define INF 100000000000
int N;
long long W, w[101], v[101];
long long dp[101][1000000];
int main(void) {
cin >> N >> W;
for (int i = 0; i < N; i++) {
cin >> w[i] >> v[i];
}
for (int i = 0; i < N; i++) {
for (long long j = 0; j < 1000000; j++) {
dp[i][... | #include <iostream>
using namespace std;
#define INF 100000000000
int N;
long long W, w[102], v[102];
long long dp[102][1000000];
int main(void) {
cin >> N >> W;
for (int i = 0; i < N; i++) {
cin >> w[i] >> v[i];
}
for (int i = 0; i < N; i++) {
for (long long j = 0; j < 1000000; j++) {
dp[i][... | replace | 7 | 9 | 7 | 9 | -11 | |
p03164 | C++ | Runtime Error | /*
@author: sharrad99
*/
#include <bits/stdc++.h>
using namespace std;
const long long oo = 1000000000000000;
int main() {
#ifndef ONLINE_JUDGE
freopen("C:\\Users\\sharr\\Documents\\Input.txt", "r", stdin);
freopen("C:\\Users\\sharr\\Documents\\Output.txt", "w", stdout);
#endif
ios_base::sync_with_stdio(false);... | /*
@author: sharrad99
*/
#include <bits/stdc++.h>
using namespace std;
const long long oo = 1000000000000000;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
long long n, W;
cin >> n >> W;
vector<long long> w(n), v(n);
for (long long i = 0; i < n; i++) {
cin >> w[i] >>... | delete | 7 | 12 | 7 | 7 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p03164 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <time.h>
#include <vector>
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define REP(i, a, b) for (int i = a; i... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <time.h>
#include <vector>
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define REP(i, a, b) for (int i = a; i... | replace | 29 | 30 | 29 | 30 | -11 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define Int long long
#define N 102
#define N2 100100
Int a[N];
Int dp[N][N2];
Int sum[N];
Int w[N], v[N];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, W;
for (int i = 0; i <= n; i++)
for (int j = 1; j <= 100000; j++)
dp[i... | #include <bits/stdc++.h>
using namespace std;
#define Int long long
#define N 102
#define N2 100100
Int a[N];
Int dp[N][N2];
Int sum[N];
Int w[N], v[N];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, W;
for (int i = 0; i <= n; i++)
for (int j = 1; j <= 100000; j++)
dp[i... | replace | 24 | 25 | 24 | 28 | -11 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, N) for (ll(i) = 0; (i) < (N); (i)++)
const int mod = 1000000007;
const int INF = 1100000000;
int main() {
int n, W;
cin >> n >> W;
vector<ll> w(n), v(n);
rep(i, n) { cin >> w[i] >> v[i]; }
vector<vecto... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, N) for (ll(i) = 0; (i) < (N); (i)++)
const int mod = 1000000007;
const int INF = 1100000000;
int main() {
int n, W;
cin >> n >> W;
vector<ll> w(n), v(n);
rep(i, n) { cin >> w[i] >> v[i]; }
vector<vecto... | replace | 12 | 13 | 12 | 13 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 10010;
int n;
long long f[N], W, w[N], v[N], s = 0;
int main() {
scanf("%d%lld", &n, &W);
for (int i = 1; i <= n; i++) {
scanf("%lld%lld", &w[i], &v[i]);
s += v[i];
}
for (long long i = 0; i <= s; i++)
f[i] = 1e15;
f[0] = 0;
for (int i... | #include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n;
long long f[N], W, w[N], v[N], s = 0;
int main() {
scanf("%d%lld", &n, &W);
for (int i = 1; i <= n; i++) {
scanf("%lld%lld", &w[i], &v[i]);
s += v[i];
}
for (long long i = 0; i <= s; i++)
f[i] = 1e15;
f[0] = 0;
for (int ... | replace | 2 | 3 | 2 | 3 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
#define rer(i, a, b) for (int i = int(a) - 1; i >= int(b); i--)
#define sz(v) (int)(v).size()
#define pb push_back
#define sc second
#define fr first
#define sor(v) sort(v.begin(), v.end())
#define rev(s) reverse(s.begin(), s.end())
#de... | #include <bits/stdc++.h>
#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
#define rer(i, a, b) for (int i = int(a) - 1; i >= int(b); i--)
#define sz(v) (int)(v).size()
#define pb push_back
#define sc second
#define fr first
#define sor(v) sort(v.begin(), v.end())
#define rev(s) reverse(s.begin(), s.end())
#de... | replace | 17 | 18 | 17 | 18 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
#ifdef _debug
#define dout(i) cout << #i << ' ' << i << ' '
#else
#define dout(i) //
#endif
using ll = long long;
using ull = unsigned long long;
using ul = unsigned;
using db = double;
const int maxn = 101;
const int maxw = 100001;
const int inf ... | #include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
#ifdef _debug
#define dout(i) cout << #i << ' ' << i << ' '
#else
#define dout(i) //
#endif
using ll = long long;
using ull = unsigned long long;
using ul = unsigned;
using db = double;
const int maxn = 101;
const int maxw = 100001;
const int inf ... | replace | 21 | 22 | 21 | 22 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)((x).size())
#define debug(x) cout << #x << ":" << x << ' ';
#define debugg(x) cout << #x << ":" << x << ' ' << "\n";
#define endl "\n"
#define L(X) ((X) << 1)
#define R(X) (((X) << 1) | 1)
#define... | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)((x).size())
#define debug(x) cout << #x << ":" << x << ' ';
#define debugg(x) cout << #x << ":" << x << ' ' << "\n";
#define endl "\n"
#define L(X) ((X) << 1)
#define R(X) (((X) << 1) | 1)
#define... | replace | 62 | 63 | 62 | 63 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll N, W;
ll dp[100 * 1000 + 5];
ll max(ll a, ll b) {
if (a > b)
return a;
return b;
}
// dp[w][i] = max(dp[w-wt[i]][i-1]+v[i], dp[w][i-1])
// dp[v] = min(wt[i] + dp[v-V[i]], dp[v])
ll wt[100 + 5], V[100 + 5];
ll MAXV = 100;
int main() {
ci... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll N, W;
ll dp[100 * 1000 + 5];
ll max(ll a, ll b) {
if (a > b)
return a;
return b;
}
// dp[w][i] = max(dp[w-wt[i]][i-1]+v[i], dp[w][i-1])
// dp[v] = min(wt[i] + dp[v-V[i]], dp[v])
ll wt[100 + 5], V[100 + 5];
ll MAXV = 1;
int main() {
cin ... | replace | 16 | 17 | 16 | 17 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int n;
long long w[110], v[110];
long long dp[110][100010];
#define INF 10000000000000
#define VMAX 100010
int main() {
long long W;
cin >> n >> W;
for (int i = 0; i < n; i++) {
cin >> w[i] >> v[i];
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < ... | #include <bits/stdc++.h>
using namespace std;
int n;
long long w[110], v[110];
long long dp[110][100010];
#define INF 10000000000000
#define VMAX 100010
int main() {
long long W;
cin >> n >> W;
for (int i = 0; i < n; i++) {
cin >> w[i] >> v[i];
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < ... | replace | 28 | 29 | 28 | 29 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 1e9 + 5;
int main() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
ios_base::sync_with_stdio(0);
cin.tie(NULL);
int n;
cin >> n;
ll W;
cin >> W;
vector<int> w(n + 1);
vector<int> v(n + 1);
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 1e9 + 5;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(NULL);
int n;
cin >> n;
ll W;
cin >> W;
vector<int> w(n + 1);
vector<int> v(n + 1);
for (int i = 1; i <= n; i++) {
cin >> w[i];
cin >> v[i];
}
ll... | replace | 5 | 7 | 5 | 6 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, W;
cin >> n >> W;
vector<int> w(n), v(n);
for (int i = 0; i < n; i++) {
cin >> w[i] >> v[i];
}
const int maxn = n * n * 1000 + 1;
vector<vector<long long>> dp(n + 1, vector<long long>(maxn, 1e15));
dp[0][0] = 0;
for (int i = 0; i... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, W;
cin >> n >> W;
vector<int> w(n), v(n);
for (int i = 0; i < n; i++) {
cin >> w[i] >> v[i];
}
const int maxn = n * 1000 + 1;
vector<vector<long long>> dp(n + 1, vector<long long>(maxn, 1e15));
dp[0][0] = 0;
for (int i = 0; i < n... | replace | 11 | 12 | 11 | 12 | 0 | |
p03164 | C++ | Runtime Error | #include <algorithm>
#include <fstream>
#include <iostream>
using namespace std;
long long N, G, i, j, mx;
long long p[1005], P, w[1005], a[1005], b[1005];
int main() {
// ifstream cin("rucsac.in");
cin >> N >> G;
for (i = 1; i <= N; i++) {
cin >> w[i] >> p[i];
P += p[i];
}
for (i = 1; i <= P; i++)... | #include <algorithm>
#include <fstream>
#include <iostream>
using namespace std;
long long N, G, i, j, mx;
long long p[105], P, w[105], a[100005], b[100005];
int main() {
// ifstream cin("rucsac.in");
cin >> N >> G;
for (i = 1; i <= N; i++) {
cin >> w[i] >> p[i];
P += p[i];
}
for (i = 1; i <= P; i+... | replace | 7 | 8 | 7 | 8 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int const maxsize = 100005;
int weight[maxsize], cost[maxsize];
long long int dp[103][maxsize];
int main() {
int n, w;
cin >> n >> w;
for (int x = 1; x <= n; x++)
cin >> weight[x] >> cost[x];
memset(dp, 63, sizeof(dp));
int ans = 0;
// for(int x=0;x<=100... | #include <bits/stdc++.h>
using namespace std;
int const maxsize = 100005;
int weight[maxsize], cost[maxsize];
long long int dp[103][maxsize];
int main() {
int n, w;
cin >> n >> w;
for (int x = 1; x <= n; x++)
cin >> weight[x] >> cost[x];
memset(dp, 63, sizeof(dp));
int ans = 0;
// for(int x=0;x<=100... | replace | 22 | 24 | 22 | 24 | 0 | |
p03164 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
int n, all, w[105], v[105];
long long dp[100105];
int main() {
memset(dp, 0x3f, sizeof(dp));
dp[0] = 0;
scanf("%d%d", &n, &all);
for (int i = 1; i <= n; ++i)
scanf("%d%d", &w[i], &v[i]);
for (int i = 1; i <= n; ++i) {
for (... | #include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
int n, all, w[10000005], v[10000005];
long long dp[50010005];
int main() {
memset(dp, 0x3f, sizeof(dp));
dp[0] = 0;
scanf("%d%d", &n, &all);
for (int i = 1; i <= n; ++i)
scanf("%d%d", &w[i], &v[i]);
for (int i = 1; i <= n; ++i)... | replace | 4 | 6 | 4 | 6 | 0 | |
p03164 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const ll MOD = (ll)(1e9 + 7);
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int(i) = 0; (i) < (int)(n); (i)++)
int N;
ll W, w[200], v[200];
ll memo[200][200 * 2000 + 1];
ll solve(int n, int V) ... | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const ll MOD = (ll)(1e9 + 7);
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int(i) = 0; (i) < (int)(n); (i)++)
int N;
ll W, w[200], v[200];
ll memo[200][200 * 2000 + 1];
ll solve(int n, int V) ... | replace | 28 | 29 | 28 | 29 | -11 | |
p03164 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int n, m, V;
int w[110];
int v[110];
int f[1010]; // f[i]表示达到i价值的最优w
int main() {
cin >> n >> m;
for (int i = 1; i <= n; i++) {
cin >> w[i] >> v[i];
V += v[i];
}
memset(f, 0x3f, sizeof(f));
f[0] = 0;
... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int n, m, V;
int w[1100];
int v[1100];
int f[1010000]; // f[i]表示达到i价值的最优w
int main() {
cin >> n >> m;
for (int i = 1; i <= n; i++) {
cin >> w[i] >> v[i];
V += v[i];
}
memset(f, 0x3f, sizeof(f));
f[0] ... | replace | 8 | 11 | 8 | 11 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const long long maxv = 100000;
const long long oo = LLONG_MAX;
long long N, W;
unsigned long long w[101], v[101];
unsigned long long F[101][maxv + 1];
void Enter() {
// freopen("INPUT.TXT","r",stdin);
// freopen("OUTPUT.TXT","w",stdout);
ios_base::sync_with_stdio(... | #include <bits/stdc++.h>
using namespace std;
const long long maxv = 100000;
const long long oo = LLONG_MAX;
long long N, W;
unsigned long long w[103], v[103];
unsigned long long F[103][maxv + 1];
void Enter() {
// freopen("INPUT.TXT","r",stdin);
// freopen("OUTPUT.TXT","w",stdout);
ios_base::sync_with_stdio(... | replace | 7 | 9 | 7 | 9 | 0 | |
p03164 | C++ | Time Limit Exceeded | #pragma gcc optimize(o3)
#include <bits/stdc++.h>
#define IO \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define S se... | #pragma gcc optimize(o3)
#include <bits/stdc++.h>
#define IO \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define S se... | insert | 26 | 26 | 26 | 27 | TLE | |
p03164 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;
using ll = lon... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;
using ll = lon... | replace | 22 | 25 | 22 | 26 | -11 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int n, C;
long long w[101];
int v[101];
long long dp[101][1003];
long long solve(int i, int value) {
if (value <= 0)
return 0;
if (i == n)
return 1000000000;
if (dp[i][value] != -1)
return dp[i][value];
dp[i][value] = solve(i + 1, value);
dp[i][valu... | #include <bits/stdc++.h>
using namespace std;
int n, C;
long long w[101];
int v[101];
long long dp[101][1000001];
long long solve(int i, int value) {
if (value <= 0)
return 0;
if (i == n)
return 1000000000;
if (dp[i][value] != -1)
return dp[i][value];
dp[i][value] = solve(i + 1, value);
dp[i][v... | replace | 6 | 7 | 6 | 7 | 0 | |
p03164 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <vector>
using namespace std;
typedef unsigned int uint;
typedef long long llong;
typedef unsigned long long ullong;
typedef long ... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <vector>
using namespace std;
typedef unsigned int uint;
typedef long long llong;
typedef unsigned long long ullong;
typedef long ... | replace | 58 | 59 | 58 | 59 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long int
const int N = 1e3 + 1;
#define debug(x) cerr << "[(" << __LINE__ << ") " << (#x) << "]: " << x << endl;
const int inf = 1e15 + 7;
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, w;
cin >> n >> w;
int wt[... | #include <bits/stdc++.h>
using namespace std;
#define int long long int
const int N = 1e3 + 1;
#define debug(x) cerr << "[(" << __LINE__ << ") " << (#x) << "]: " << x << endl;
const int inf = 1e15 + 7;
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, w;
cin >> n >> w;
int wt[... | replace | 34 | 35 | 34 | 35 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i, n) for (int i = 0; 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(a) a.begin(), a.end()
#define maxs(x, y) (x = max(x, y))
#define mins(x, y) (x = min(x, y))
#defin... | #include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i, n) for (int i = 0; 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(a) a.begin(), a.end()
#define maxs(x, y) (x = max(x, y))
#define mins(x, y) (x = min(x, y))
#defin... | replace | 54 | 55 | 54 | 55 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p03164 | C++ | Runtime Error | #include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;
#define MAX_N 110
#define MAX_V 100010
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return ... | #include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;
#define MAX_N 110
#define MAX_V 100010
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return ... | replace | 46 | 47 | 46 | 48 | 0 | |
p03164 | C++ | Runtime Error | #include "bits/stdc++.h"
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
using namespace std;
int N, V;
long long W, w[110], v[110];
lo... | #include "bits/stdc++.h"
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
using namespace std;
int N, V;
long long W, w[110], v[110];
lo... | replace | 21 | 22 | 21 | 22 | 0 | |
p03164 | C++ | Time Limit Exceeded | #include <cstdio>
#include <cstring>
#include <iostream>
#define ll long long int
#define ii int
#define jmp cout << "\n"
#define vl vector<ll>
#define pb push_back
#define printv(v) \
for (auto x : v) ... | #include <cstdio>
#include <cstring>
#include <iostream>
#define ll long long int
#define ii int
#define jmp cout << "\n"
#define vl vector<ll>
#define pb push_back
#define printv(v) \
for (auto x : v) ... | replace | 51 | 58 | 51 | 52 | TLE | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long int
#define M 1000000007
#define pb push_back
#define boost \
ios::sync_with_stdio(false); \
cin.tie(0); ... | #include <bits/stdc++.h>
using namespace std;
#define int long long int
#define M 1000000007
#define pb push_back
#define boost \
ios::sync_with_stdio(false); \
cin.tie(0); ... | replace | 13 | 14 | 13 | 14 | 0 | |
p03164 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
#define ll long l... | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
#define ll long l... | replace | 44 | 46 | 44 | 48 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, a, b) for (int(i) = (a); (i) < (b); (i)++)
#define drep(i, a, b) for (int(i) = (a); (i) >= (b); (i)--)
#define MAGICLINE ios_base::sync_with_stdio(0)
#define pb push_back
#define mp make_pair
#define se second
#define fs first
using namespace std;
typedef long long LL;
typedef lo... | #include <bits/stdc++.h>
#define rep(i, a, b) for (int(i) = (a); (i) < (b); (i)++)
#define drep(i, a, b) for (int(i) = (a); (i) >= (b); (i)--)
#define MAGICLINE ios_base::sync_with_stdio(0)
#define pb push_back
#define mp make_pair
#define se second
#define fs first
using namespace std;
typedef long long LL;
typedef lo... | replace | 17 | 18 | 17 | 18 | 0 | |
p03164 | C++ | Runtime Error | // {{{
#include <algorithm>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using n... | // {{{
#include <algorithm>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using n... | replace | 55 | 61 | 55 | 56 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define MOD 1000000007
using namespace std;
int main() {
// fastio
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
ll n, W;
cin >> n >> W;
ll weg[n];
ll ... | #include <bits/stdc++.h>
#define ll long long
#define MOD 1000000007
using namespace std;
int main() {
// fastio
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll n, W;
cin >> n >> W;
ll weg[n];
ll val[n];
ll sum = 0;
for (ll i = 0; i < n; i++) {
cin >> weg[i] >> val[i];
sum += val[i];
... | delete | 10 | 15 | 10 | 10 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
#define mp make_pair
#define fi first
#define se second
#define VAL 100000
#define ll long long
#define INF 10000000000000000LL
#define pll pair<long long, long long>
const int MAX = 1e5 + 10;
const int MOD = 1e9 + 7;
const int TOT_PRIMES = 19;
const int MAX_A = 70;
using namespace std;
int mai... | #include <bits/stdc++.h>
#define mp make_pair
#define fi first
#define se second
#define VAL 100000
#define ll long long
#define INF 10000000000000000LL
#define pll pair<long long, long long>
const int MAX = 1e5 + 10;
const int MOD = 1e9 + 7;
const int TOT_PRIMES = 19;
const int MAX_A = 70;
using namespace std;
int mai... | replace | 16 | 20 | 16 | 20 | -11 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define llt long long int
#define pb push_back
#define pii pair<int, int>
#define mk make_pair
#define ff first
#define ss second
#define mod 1000000007
int dp[101][100001];
bool cmp(pii a, pii b) {
if (a.ss < b.ss)
return false;
else if (a.ss == b.ss) {
if (a.f... | #include <bits/stdc++.h>
using namespace std;
#define int long long int
#define pb push_back
#define pii pair<int, int>
#define mk make_pair
#define ff first
#define ss second
#define mod 1000000007
int dp[101][100001];
bool cmp(pii a, pii b) {
if (a.ss < b.ss)
return false;
else if (a.ss == b.ss) {
if (a.f... | replace | 2 | 3 | 2 | 3 | 0 | |
p03164 | C++ | Runtime Error | // template {{{
#include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(), (c).end()
#define sz(c) (static_cast<int>(c.size()))
#define endl "\n"
using ld = long double;
using ll = long long;
inline ll addm(ll __a, ll __b, ll __m);
inline ll subm(ll __a, ll __b, ll __m);
inline ll mulm(ll __a, ll __b... | // template {{{
#include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(), (c).end()
#define sz(c) (static_cast<int>(c.size()))
#define endl "\n"
using ld = long double;
using ll = long long;
inline ll addm(ll __a, ll __b, ll __m);
inline ll subm(ll __a, ll __b, ll __m);
inline ll mulm(ll __a, ll __b... | replace | 32 | 33 | 32 | 33 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
const int mnx = 1e6 + 9;
const int mod = 1e9 + 7;
ll n, w;
ll a[mnx];
ll b[mnx];
ll dp[mnx];
int main() {
cin >> n >> w;
for (int i = 1; i <= n; i++) {
cin >> a[i] >> b[i];
}
fill(dp, dp + mnx, mod);
dp[0] = 0;
... | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
const int mnx = 1e6 + 9;
const int mod = 1e9 + 7;
ll n, w;
ll a[mnx];
ll b[mnx];
ll dp[mnx];
int main() {
cin >> n >> w;
for (int i = 1; i <= n; i++) {
cin >> a[i] >> b[i];
}
fill(dp, dp + mnx, mod);
dp[0] = 0;
... | replace | 26 | 28 | 26 | 28 | 0 | |
p03164 | C++ | Runtime Error | #include <bits/stdc++.h>
#pragma comment(linker, "/STACK:2000000")
#pragma comment(linker, "/HEAP:2000000")
#define ll long long
#define ld long double
#define ull unsigned long long
#define pb push_back
#define f(n) for (ll i = 0; i < n; i++)
#define fn(a, n) for (ll a = 0; a < n; a++)
#define flr(a, l, r) for (ll a... | #include <bits/stdc++.h>
#pragma comment(linker, "/STACK:2000000")
#pragma comment(linker, "/HEAP:2000000")
#define ll long long
#define ld long double
#define ull unsigned long long
#define pb push_back
#define f(n) for (ll i = 0; i < n; i++)
#define fn(a, n) for (ll a = 0; a < n; a++)
#define flr(a, l, r) for (ll a... | delete | 154 | 160 | 154 | 154 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.