submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s516664909 | p03732 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <math.h>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <limits.h>
using namespace std;
typedef long long ll;
#define INF LLONG_MAX/3
#define inf INT_MAX/3
#define MOD 1000000007
#define rep(... | a.cc:35:24: error: missing terminating > character
35 | #include <limits.a%MOD;
| ^
a.cc:35:10: fatal error: limits.a%1000000007;: No such file or directory
35 | #include <limits.a%MOD;
| ^
compilation terminated.
|
s525670274 | p03732 | C++ | #include <bits/stdc++.h>
using namespace std;
#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" <<... | a.cc:29:22: error: 'MAX_Nx' was not declared in this scope; did you mean 'MAX_N'?
29 | ll dp[MAX_N][MAX_N * MAX_Nx];
| ^~~~~~
| MAX_N
a.cc: In function 'int main()':
a.cc:56:9: error: 'dp' was not declared in this scope; did you mean 'dup'?
56 | dp[j +... |
s562396440 | p03732 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main() {
int n, W, v, w;
cin >> n >> W;
int *dp = new int[W+2];
memset(dp, 0, sizeof(int)*(W+2));
while(n--){
cin >> w >> v;
for (int i = W; i >= w; --i) {
if(i >= w) dp[i] = max(dp[i - w] + v, dp[i]);
else dp[i] = dp[i-1];
}
}
cout << ... | a.cc: In function 'int main()':
a.cc:8:9: error: 'memset' was not declared in this scope
8 | memset(dp, 0, sizeof(int)*(W+2));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<algorithm>
+++ |+#includ... |
s383964939 | p03732 | C++ | #include<stdio.h>
#include<algorithm>
using namespace std;
int main() {
memset(dp, 0, sizeof(int)*(W+2));
} | a.cc: In function 'int main()':
a.cc:6:16: error: 'dp' was not declared in this scope
6 | memset(dp, 0, sizeof(int)*(W+2));
| ^~
a.cc:6:36: error: 'W' was not declared in this scope
6 | memset(dp, 0, sizeof(int)*(W+2));
| ^
a.cc:6:9: ... |
s100760259 | p03732 | C++ | #include<stdio.h>
#include<algorithm>
using namespace std;
int main() {
memset(dp, 0, sizeof(int)*(W+2));
} | a.cc: In function 'int main()':
a.cc:5:16: error: 'dp' was not declared in this scope
5 | memset(dp, 0, sizeof(int)*(W+2));
| ^~
a.cc:5:36: error: 'W' was not declared in this scope
5 | memset(dp, 0, sizeof(int)*(W+2));
| ^
a.cc:5:9: ... |
s033706935 | p03732 | C++ | #include<stdio.h>
#include<algorithm>
using namespace std;
int main() {
int n, W, v, w;
scanf("%d %d", &n, &W);
int *dp = new int[W+2];
memset(dp, 0, sizeof(int)*(W+2));
while(n--){
scanf("%d %d", &w, &v);
for (int i = W; i >= w; --i) {
if(i >= w) dp[i] = max(dp[i - w] + v, dp[i]);
else dp[i] = dp[i-1];... | a.cc: In function 'int main()':
a.cc:8:9: error: 'memset' was not declared in this scope
8 | memset(dp, 0, sizeof(int)*(W+2));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<algorithm>
+++ |+#includ... |
s702583960 | p03732 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
long long N, W;
long long nap(long long, long long, vector <long long>, vector <long long>, vector <vector <long long> >&);
int main(){
cin>>N>>W;
vector <long long>w(N);
vector <long long>v(N);
vector <vector <long long> >d... | a.cc: In function 'long long int nap(long long int, long long int, std::vector<long long int>, std::vector<long long int>, std::vector<std::vector<long long int> >&)':
a.cc:33:19: error: expected ';' before 'return'
33 | dp[i][j] = ans
| ^
| ;
34 | return an... |
s219147988 | p03732 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long N, W; cin >> N >> W;
vector<long long> w(N);
vector<long long> v(N);
for(long long i = 0; i < N; i++) cin >> w[i] >> v[i];
vector<long long> a(1, 0LL);
vector<long long> b(1, 0LL);
vector<long long> c(1, 0LL);
v... | a.cc: In function 'int main()':
a.cc:22:52: error: expected primary-expression before ')' token
22 | sort(a.begin() + 1, a.end(), greater<long long>);
| ^
a.cc:23:52: error: expected primary-expression before ')' token
23 | sort(b.begin() + 1, b.end... |
s564527449 | p03732 | C++ | //Written by Zhu Zeqi
//Come on,baby
//Hack,please
#include<cmath>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#inc... | a.cc: In function 'int main()':
a.cc:231:40: error: 'LL' was not declared in this scope; did you mean 'll'?
231 | ans = max((LL)ans,sva[i]+svb[j]+svc[k]+svd[l]);
| ^~
| ll
|
s213644075 | p03732 | C++ | //Written by Zhu Zeqi
//Come on,baby
//Hack,please
#include<cmath>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#inc... | a.cc: In function 'int main()':
a.cc:228:25: error: 'LL' was not declared in this scope; did you mean 'll'?
228 | LL sum = swa[i] + swb[j] + swc[k] + swd[l];
| ^~
| ll
a.cc:229:28: error: 'sum' was not declared in this scope; did you ... |
s023311249 | p03732 | C++ | #include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<map>
#include<queue>
#include<vector>
#include<stack>
#include<set>
#include<cctype>
#define pa pair<int,int>
#define INF 0x3f3f3f3f
#define inf 0x3f
#define fi first
#de... | a.cc: In function 'int main()':
a.cc:74:2: error: expected '}' at end of input
74 | }
| ^
a.cc:39:1: note: to match this '{'
39 | {
| ^
|
s549040016 | p03732 | C++ | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#define LL long long
using namespace std;
int a[105],b[105];
LL f[105][305];
int main(void)
{
int i,j,k,n,m,a1;LL ans=0;
scanf("%d%d",&n,&m);
for(i=1;i<=n;++i)scanf("%d%d",&a[i],&b[i]);
a1=a[1];
for(i=1;i<=n;++i)a[i]-=a1;
for(i=0;i<=n;+... | a.cc: In function 'int main()':
a.cc:31:31: error: no matching function for call to 'min(int, long long int)'
31 | for(j=0;j<=min(300,m-1LL*i*a1);++j)ans=max(ans,f[i][j]);
| ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from... |
s623683189 | p03732 | C++ | /*
* UM.
* J@B@1 iO@1
* Y@@@B@BB. 7B@B@B@
* :@B@i,B@B@O ... | a.cc: In function 'int main()':
a.cc:236:60: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&)'
236 | for(int g=0;g<i;g++)gt+=max(0,v1[g]);
| ... |
s347649738 | p03732 | C++ | #include<cstdio>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<cstring>
#include<cctype>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<iomanip>
#include<sstream>
#include<cstdlib>
#include<ctime>
#include<list>
#include<deque>
#include<bitset>
#include<fstream>
... | a.cc: In function 'int main()':
a.cc:68:38: error: no matching function for call to 'min(long long int&, long long unsigned int)'
68 | l=min(l,1ll*cnt[3].size());
| ~~~^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
... |
s962475821 | p03732 | C++ | #include<bits/stdc++.h>
using namespace std;
int dp[100][1000000000];
int w[1000000000],v[10000000];
int main(){
int n,W;
cin>>n>>W;
for(int i=0;i<n;++i) cin>>w[i]>>v[i];
for(int i=1;i<=n;++i){
for(int j=1;j<=W;++j){
if(j-w[i-1]>=0) dp[i][j]=max(dp[i-1][j-w[i-1]]+v[i-1],dp[i-1][j]);
else dp[i]... | /tmp/ccy80oWN.o: in function `main':
a.cc:(.text+0x49): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccy80oWN.o
a.cc:(.text+0x75): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccy80oWN.o
a.cc:(.text+0xbe): relocation trunc... |
s295460930 | p03732 | C++ | #include <cstdio>
#include <algorithm>
using namespace std;
int N,W;
int w1;
vector<int> v[4];
void f(int a,int b,int c,int d,int ans){
ans = max(ans, v[0][a] + v[1][b] + v[2][c] + v[3][d]);
if(a==0 && b==0 && c==0){
printf("%d\n",ans);
return;
}
if(d==0){
}
}
int main(){
... | a.cc:7:1: error: 'vector' does not name a type
7 | vector<int> v[4];
| ^~~~~~
a.cc: In function 'void f(int, int, int, int, int)':
a.cc:10:20: error: 'v' was not declared in this scope
10 | ans = max(ans, v[0][a] + v[1][b] + v[2][c] + v[3][d]);
| ^
a.cc: In function 'int main()... |
s371099879 | p03732 | C++ | #include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
#define Nmax 200010
#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define RFOR(i,a,b) for(long long i = (b-1);i>=a;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ... | a.cc: In function 'int main()':
a.cc:23:14: error: request for member 'push_back' in 'v.std::vector<long long int>::operator[](0)', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'}
23 | v[0].push_back(vv);
| ... |
s786885254 | p03732 | C++ | 4 1
10 100
10 100
10 100
10 100 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 4 1
| ^
|
s969396291 | p03732 | C++ | #include <bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
typedef long long ll;
const int N = 110;
int vis[N][N];
int t[100000];
ll a,b,c,d,n,w,sumv,sumw,maxx;
ll wa[1000],wb[1000],wc[1000],wd[1000];
ll va[1000],vb[1000],vc[1000],vd[1000];
struct node
{
ll w,v;
}g[1000];
node aa[1000],bb[1000],cc[1000],... | a.cc: In function 'int main()':
a.cc:95:15: error: expected ';' before ':' token
95 | b++:
| ^
| ;
|
s921169070 | p03732 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<climits>
#include<set>
#include<utility>
using namespace std;
typedef long long int ll;
ll dp[101][101];
ll N, W, w[101], v[101];
int rec(int i, int j){
... | a.cc: In function 'int rec(int, int)':
a.cc:29:26: error: no matching function for call to 'max(int, ll)'
29 | res = max(rec(i + 1, j), rec(i + 1, j - w[i]) + v[i]);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
... |
s461189407 | p03732 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define SORT_INV(c) sort((c).begin(), (c).end(), greater<int>())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG true
// sort(a.begin(), a... | a.cc: In function 'int main()':
a.cc:77:72: error: no match for 'operator-' (operand types are 'int' and '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'})
77 | if (w - (bios - 1) * (dp[i - 1][j].second + 1) < 0 - j - items... |
s834694143 | p03732 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
#define pb push_back
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod (ll)(1e9+7)
__attribute__((constructor))
void initial()... | a.cc: In function 'int main()':
a.cc:31:33: error: no matching function for call to 'max(std::map<long long int, long long int>::mapped_type&, int)'
31 | dp[i + 1][it->first] = max(dp[i + 1][it->first], (int)it->second);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file in... |
s660791396 | p03732 | C | #include <bits/stdc++.h>
#define inf (1<<29)
#define sq(n) ((n)*(n))
#define rep(i,n) for(int i=0;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define MEMSET(a) memset(a,0,sizeof(a))
#define pb push_back
using namespace std;
int main(){
int N,W;
cin>>N>>W;
int w,v,w1;
vector<int> V[4];
cin>>w1>>v;
V[0].pb(v... | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s739249432 | p03732 | C++ | #include <iostream>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
using namespace std;
typedef long long ll;
ll N, W;
map<pair<ll, ll> , ll> dp; //<i番目まで見たときの重さに対する価値の最大値>
vector<ll> w, v;
ll func(ll, ll);
int main(){
cin >> N >> W;
ll wt, vt;
w.push_back(0); v.push_back(0);
for(int... | a.cc: In function 'int main()':
a.cc:32:16: error: no matching function for call to 'max(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type, int)'
32 | for(int i=max(w[0]-3, 0); i<=W; i++){
| ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
... |
s247809590 | p03732 | C++ | #include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define ll __int64
//#define ll long long
#define ... | a.cc:15:12: error: '__int64' does not name a type; did you mean '__int64_t'?
15 | #define ll __int64
| ^~~~~~~
a.cc:19:1: note: in expansion of macro 'll'
19 | ll k;
| ^~
a.cc: In function 'int main()':
a.cc:15:12: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
... |
s594529195 | p03732 | C++ | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<ll, ll> P;
#define MOD (1000000007ll)
#define l_ength size
void mul_mod(ll& a, ll b){
a *= b;
a %= MOD;
}
int main(void){
int n,i,j,a[4],m[4];
ll w,v,ans=0ll,W,c[4],wsum,vsum;
vector<ll> g... | a.cc: In function 'int main()':
a.cc:49:54: error: no match for 'operator+=' (operand types are 'll' {aka 'long long int'} and 'std::vector<long long int>')
49 | vsum += g[a[i]];
| ~~~~~^~~~~~~~~~
|
s519539727 | p03732 | C++ | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<ll, ll> P;
#define MOD (1000000007ll)
#define l_ength size
void mul_mod(ll& a, ll b){
a *= b;
a %= MOD;
}
int main(void){
int n,i,j,a[4],m[4];
ll w,v,ans=0ll,W,c[4],wsum,vsum;
vector<ll> g... | a.cc: In function 'int main()':
a.cc:32:30: error: no match for 'operator+=' (operand types are 'std::vector<long long int>' and 'std::vector<long long int>')
32 | g[i] += g[i-1];
| ~~~~~^~~~~~~~~
a.cc:49:54: error: no match for 'operator+=' (operand types are 'l... |
s674363325 | p03732 | C++ | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<ll, ll> P;
#define MOD (1000000007ll)
#define l_ength size
void mul_mod(ll& a, ll b){
a *= b;
a %= MOD;
}
int main(void){
int n,i,j,a[4],m[4];
ll w,v,ans=0ll,W,c[4],wsum,vsum;
vector<ll> g... | a.cc: In function 'int main()':
a.cc:21:14: error: 'class std::vector<long long int>' has no member named 'push'
21 | g[0].push(v);
| ^~~~
a.cc:24:27: error: 'class std::vector<long long int>' has no member named 'push'
24 | g[w-c[0]].push(v);
| ... |
s858477589 | p03732 | C++ | #include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
/*
//#if __cplusplus >= ... | a.cc: In function 'void solve()':
a.cc:138:9: error: expected ';' before '}' token
138 | }
| ^
|
s952419834 | p03732 | C++ | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<string>
#include<sstream>
#include<iomanip>
#include<utility>
#include<cmath>
#include<set>
#include<list>
#include<queue>
#include<stack>
#include<deque>
#include<map>
#include<set>
#include<cstring>
#include<iterator>
... | a.cc: In function 'int main()':
a.cc:81:22: error: no matching function for call to 'max(ll&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type)'
81 | ans = max(ans,w[0][i]+w[1][j]+w[2][k]+w[3][l]);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /us... |
s177217642 | p03732 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(void) {
int n, w;
cin >> n >> w;
vector<int> v1, v2, v3, v4;
int minw, iniv;
cin >> minw >> iniv;
v1.push_back(iniv);
for (int i = 1; i < n; i++) {
int a, b;
cin >> a >> b;
if (a == minw) {
v1.push_b... | a.cc: In function 'int main()':
a.cc:42:3: error: 'll' was not declared in this scope
42 | ll ans = 0;
| ^~
a.cc:53:53: error: 'ans' was not declared in this scope; did you mean 'abs'?
53 | if (sum1[l] + sum2[k] + sum3[j] + sum4[i] > ans) ans = sum1[l] + sum2[k] + sum3[j] + sum4[i];
| ... |
s036522797 | p03732 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <iomanip>
#include <cmath>
#include <functional>
using namespace std;
using ll = long long;
const ll INF = ((1LL << 60) - 1);
int N, W, u, v, w0, a, b, c, d;
vector<ll> w[4];
//ll memo[101][101][101][101];
// メモ化再帰
l... | a.cc: In function 'll solve(ll, ll, int, int, int, int)':
a.cc:33:10: error: 'memo' was not declared in this scope
33 | return memo[i][j][k][l] = ret;
| ^~~~
|
s867928774 | p03732 | C++ | #include<iostream>
#include<algorithm>
#include<functional>
#include <string>
#include<iomanip>
#include<cstdio>
#include<math.h>
#include<set>
#include<stack>
#include<queue>
#include<cstring>
#include<vector>
typedef long long int ll;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ERE... | a.cc: In function 'void calc_comb()':
a.cc:37:14: error: 'uint32_t' was not declared in this scope
37 | for (uint32_t i = 0; i <= MAX_NUM; i++) {
| ^~~~~~~~
a.cc:12:1: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
11 | #includ... |
s460243416 | p03732 | C++ |
#include <iostream>
using namespace std;
using ll = long long;
ll max(ll x,ll y){
if(x>y){
return x;
}else{
return y;
}
}
int main(){
ll dp[101][11];
ll N,W;
ll w[101]={},v[101]={};
ll w_1;
cin >> N >> W;
for(int i=1;i<=N;i++){
cin >> w[i] >> v[i];
if(i==1){ //w[i] 0<=...<=3
w_1=w[1]-1;
w[1]... | a.cc:65:5: error: redefinition of 'int main()'
65 | int main(){
| ^~~~
a.cc:14:5: note: 'int main()' previously defined here
14 | int main(){
| ^~~~
|
s968073200 | p03732 | C++ | #include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <functional>
using namespace std;
using ll = long long;
int main() {
int N;
ll W,w0,w,v,n0,n1,n2,n3,Wsum,Vsum;
cin >> N >... | In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from... |
s061010767 | p03732 | C++ | #include <iostream>
using namespace std;
typedef long long ll;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
ll v[4][101];
int c[4];
int main() {
int n,w;
cin>>n>>w;
int w0;
cin >> w0 >> v[0][++c[0]];
FOR(i,1,n){
int r;
cin >> r;
cin >> v[r-w0][++c[r-w0]];
}
REP(i,4){
sort(v[i... | a.cc: In function 'int main()':
a.cc:20:17: error: 'sort' was not declared in this scope; did you mean 'short'?
20 | sort(v[i] + 1, v[i] + 1 + c[i], greater<ll>());
| ^~~~
| short
|
s036907033 | p03732 | C++ | // knapsack.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//
#include "stdafx.h"
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
#define INF 1<<30... | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s239601897 | p03732 | C++ | #include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
#define INF 1<<30
#define mp make_pair
#define pb push_back
typedef vector<int> vi;
typedef ... | a.cc: In function 'int main()':
a.cc:49:9: error: 'memset' was not declared in this scope
49 | memset(dp, 0, sizeof(dp));
| ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
5 | #include <algorithm>
+++ |+#include <cs... |
s275129290 | p03732 | C++ | // knapsack.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//
#include "stdafx.h"
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
#define INF 1<<30... | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s001462924 | p03732 | C++ | #Simple Knapsack
N,W = list(map(int, input().split()))
w = []
v = []
for i in range(N):
wi,vi = list(map(int, input().split()))
w.append(wi)
v.append(vi)
#メモ化再帰
dp = [[-1]*(W+1) for i in range(N+1)]
def rec(i, j):
if dp[i][j] != -1:
return dp[i][j]
if i == N:
res = 0
elif j < ... | a.cc:1:2: error: invalid preprocessing directive #Simple
1 | #Simple Knapsack
| ^~~~~~
a.cc:12:2: error: invalid preprocessing directive #\U000030e1\U000030e2\U00005316\U0000518d\U00005e30
12 | #メモ化再帰
| ^~~~~~~~~~
a.cc:3:1: error: 'N' does not name a type
3 | N,W = list(map(int, input().split()... |
s260699261 | p03732 | C++ | #include <bits/stdc++.h>
// #include "ane.cpp"
const int INF = 1e9;
const long long INFLL = 1e18;
const int NMAX = 120;
const int MMAX = 100005;
const int KMAX = 1005;
const int MOD = 1e9 + 7;
using namespace std;
// comment to disable debug functions
// #define DEBUG
// frequently used macros
#if __cplusplus >= ... | a.cc:133:27: error: extended character ― is not valid in an identifier
133 | for (ll j = 0; j <= M ― A[0] * i; ++j)
| ^
a.cc: In function 'void solve()':
a.cc:133:26: error: expected ';' before '\U00002015'
133 | for (ll j = 0; j <= M ― A[0] * i; ++j)
| ... |
s686126118 | p03732 | C++ | 4 6
2 1
3 7
4 10
3 6 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 4 6
| ^
|
s611928011 | p03732 | Java | import java.util.ArrayList;
import java.util.Comparator;
import java.util.Scanner;
public class Main2 {
public static void main(String[] args) {
new Main2().solve();
}
static int N,W;
static int w0;
static ArrayList<Integer>[] v=new ArrayList[4];
static void solve(){
Scanner sc = new Scanner(System.in);
... | Main.java:5: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
|
s678063256 | p03732 | C | #include <stdio.h>
#define ll long long int
ll max(ll a, ll b){
return a > b ? a : b;
}
int main(){
llt N, W, i, j, w[101], v[101], C[101][10000000001];
scanf("%lld%lld", &N, &W);
for(i = 1; i <= N; i++){
scanf("%lld%lld", &w[i], &v[i]);
}
for(i = 1; i <= N; i++) C[i][0] = 0;
for(i = 1; i <= W; i++) C... | main.c: In function 'main':
main.c:9:9: error: unknown type name 'llt'; did you mean 'll'?
9 | llt N, W, i, j, w[101], v[101], C[101][10000000001];
| ^~~
| ll
|
s006944341 | p03732 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int N, W;
cin >> N >> W;
int w[N], v[N];
for(int i = 0; i < N; ++i){
cin >> w[i] >> v[i];
}
int dp[N + 100][N + 100];
for(int i = N - 1; i >= 0; --i){
for(int j = 0; j <= W; ++j){
if(i == N - 1){
dp[N - 1... | a.cc: In function 'int main()':
a.cc:16:40: error: expected ';' before '}' token
16 | dp[N - 1][j] = max(0, v[N - 1])
| ^
| ;
17 | }
| ~
|
s889043700 | p03732 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int N, W;
int w, w0, v;
vector<vector<int> > vv(4);
int value(int I, int J, int K, int L) {
int result = 0;
for (int i = 0; i < I; i++) result += -vv[0][i];
for (int j = 0; j < J; j++) result += -vv[1][j];
for (int k = 0; k < K; ... | a.cc: In function 'int main()':
a.cc:31:4: error: 'a' was not declared in this scope
31 | }a
| ^
a.cc:38:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
38 | ans = max(ans, value(i, j, k, l));
| ^~~
| abs
a.cc:44:11: error: 'ans' was not de... |
s689433986 | p03732 | Java | import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;
public ... | Main.java:35: error: cannot find symbol
int[][] dp = new int[W + 1][goods.length];
^
symbol: variable goods
location: class Main
Main.java:38: error: cannot find symbol
for (int j = 0; j < goods.length; j++) {
^
symbol: variable goods
location:... |
s969126692 | p03732 | C++ | #include<iostream>
#include<string>
#include<queue>
#include<vector>
using namespace std;
typedef struct data{
long long int w,v;
long long double p;
}Data;
void swap(Data *a,Data *b){
Data tmp=*a;*a=*b;*b=tmp;
}
int main(){
int N,ans=0;
long long int W;
cin>>N>>W;
vector<Data> d(N);
for(int i=0;i<N;i+... | a.cc:9:8: error: 'long long' specified with 'double'
9 | long long double p;
| ^~~~
|
s906018639 | p03732 | C++ | #include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <algorithm>
#define max(a,b) ((a)<(b)?(b):(a))
#define min(a,b) ((a)>(b)?(b):(a))
using namespace std;
#define int long
int main() {
int N, W;
cin >> N >> W;
int w0, v0;
int w[4] = {};
vector<int> v[4];
cin >> w0 >> v0;
w[0]++;
... | cc1plus: error: '::main' must return 'int'
|
s953822598 | p03732 | C++ | #include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <algorithm>
#define max(a,b) ((a)<(b)?(b):(a))
#define min(a,b) ((a)>(b)?(b):(a))
using namespace std;
#define int long
int main() {
int N, W;
cin >> N >> W;
int w0, v0;
int w[4] = {};
vector<int> v[4];
cin >> w0 >> v0;
w[0]++;
... | cc1plus: error: '::main' must return 'int'
|
s717579757 | p03732 | C++ | #include <iostream>
typedef long long LL;
using namespace std;
int main(int argc, char* argv[])
{
int N;
LL W;
cin>>N>>W;
LL **d = new LL*[N+1];
LL *v = new LL[N];
LL *w = new LL[N];
LL i,j;
for (i=0;i<N;i++){
cin>>w[i]>>v[i];
}
for (i=0;i<=N;i++){
d[i] = new LL[(LL)(W+1)];
memset(d[i],0,(W+1)*sizeof(LL... | a.cc: In function 'int main(int, char**)':
a.cc:18:17: error: 'memset' was not declared in this scope
18 | memset(d[i],0,(W+1)*sizeof(LL));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #includ... |
s365447061 | p03732 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using ll = long long;
// ABC060D Simple Knapsack
ll solve(int N, int W, vector<ll> &ws, vector<ll> &vs);
int main() {
ios::sync_with_stdio(false);
int N, W;
vector<ll> ws(100, 0);
vector<ll> vs(100, 0);
cin >> N >> W... | a.cc: In function 'll solve(int, int, std::vector<long long int>&, std::vector<long long int>&)':
a.cc:54:33: error: no matching function for call to 'max(long long int, int&)'
54 | record = max(cum_v0 + cum_v1 + cum_v2 + cum_v3, record);
| ~~~^~~~~~~~~~~~~~~~~~... |
s113407831 | p03732 | C++ | #include <cstdio>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;
const int MaxN = 1e5;
typedef long long LL;
?
int sum;
int n, V;
int w[105], v[105];
int a[105];
int dp[105][105][405];
//表示前i个物品中选j个容量为k
int main()
{
while(scanf("%d %d", &n, &V) != EOF... | a.cc:10:1: error: expected unqualified-id before '?' token
10 | ?
| ^
a.cc: In function 'int main()':
a.cc:21:17: error: 'sum' was not declared in this scope
21 | sum = 0;
| ^~~
|
s934301862 | p03732 | C++ | #include <cstdio>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;
const int MaxN = 1e5;
typedef long long LL;
?
int sum;
int n, V;
int w[105], v[105];
int a[105];
int dp[105][105][405];
//表示前i个物品中选j个容量为k
int main()
{
while(scanf("%d %d", &n, &V) != EOF... | a.cc:10:1: error: expected unqualified-id before '?' token
10 | ?
| ^
a.cc: In function 'int main()':
a.cc:21:17: error: 'sum' was not declared in this scope
21 | sum = 0;
| ^~~
|
s928107516 | p03732 | C++ | #include <cstdio>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;
const int MaxN = 1e5;
typedef long long LL;
?
int sum;
int n, V;
int w[105], v[105];
int a[105];
int dp[105][105][405];
//表示前i个物品中选j个容量为k
int main()
{
while(scanf("%d %d", &n, &V) != EOF... | a.cc:10:1: error: expected unqualified-id before '?' token
10 | ?
| ^
a.cc: In function 'int main()':
a.cc:21:17: error: 'sum' was not declared in this scope
21 | sum = 0;
| ^~~
|
s898405201 | p03732 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (ll (i)=(0);(i)<(ll)(n);++(i))
typedef pair<int, int> P;
typedef long long ll;
vector<int> v[4];
vector<int> w;
int N, W;
int main() {
cin >> N >> W;
rep(i, N) {
int wi, vi;
cin >> wi >> vi;
if (w.size() == 0) {
... | a.cc: In function 'int main()':
a.cc:40:9: error: 'res' was not declared in this scope; did you mean 'rep'?
40 | res = max(res, v[i].size());
| ^~~
| rep
a.cc:43:27: error: 'res' was not declared in this scope; did you mean 'rep'?
43 | if (v[i].size() < res) for (int j=... |
s674686869 | p03732 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include <array>
#include <iostream>
namespace Program
{
using namespace std;
class Solver
{
private:
// 荷物の個数 整数
int N;
// ナップサックの許容重量 整数
int W;
// 価値 v[i]
array<long long int, 100> v;
// 重さ w[i]
array<l... | a.cc: In function 'int main()':
a.cc:98:20: error: '_CRTDBG_ALLOC_MEM_DF' was not declared in this scope
98 | _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF
| ^~~~~~~~~~~~~~~~~~~~
a.cc:99:11: error: '_CRTDBG_DELAY_FREE_MEM_DF' was not declared in this scope
99 | | _CRTDBG_DELAY_FREE_MEM_... |
s308557403 | p03732 | Java | import java.util.HashMap;
import java.util.Scanner;
public class Main {
public static HashMap<Point,Integer> map = new HashMap<Point,Integer>();
static int N,W;
static int[] w,v;
// static int count =0;
public static void main(String[] args){
Scanner io = new Scanner(System.in);
N = io.nextInt();
W = io... | Main.java:39: error: cannot find symbol
count ++;
^
symbol: variable count
location: class Main
1 error
|
s185701683 | p03732 | C | #include<stdio.h>
int main(void){
int lop,lop2,lop3,n,w,ndata[100][2],ans[100],taihi,sakai[4],npr=0,kte=0,hanbun;
scanf("%d",&n);
scanf("%d",&w);
for(lop=0;lop<4;lop++){
sakai[lop]=0;
}
for(lop=0;lop<n;lop++){
scanf("%d",&ndata[lop][0]);
scanf("%d",&ndata[lop][1]);
}
for(lop=0;lop<n;lop++){
for(l... | main.c: In function 'main':
main.c:95:1: error: expected declaration or statement at end of input
95 | }
| ^
|
s338074654 | p03732 | C | #include<stdio.h>
int main(void){
int lop,lop2,lop3,n,w,ndata[100][2],ans[100],taihi,sakai[3],npr=0,kte=0,hanbun;
scanf("%d",&n);
scanf("%d",&w);
for(lop=0;lop<3;lop++){
sakai[lop]=0;
}
for(lop=0;lop<n;lop++){
scanf("%d",&ndata[lop][0]);
scanf("%d",&ndata[lop][1]);
}
for(lop=0;lop<n;lop++){
for(l... | main.c: In function 'main':
main.c:70:13: error: 'hanubn' undeclared (first use in this function); did you mean 'hanbun'?
70 | lop=hanubn;
| ^~~~~~
| hanbun
main.c:70:13: note: each undeclared identifier is reported only once for each function it appears in
|
s831943332 | p03732 | C | for(lop=0;lop<n;lop++){
npr=w;
ans[lop]=0;
for(lop2=lop;lop2<n;lop2++){
if(npr-ndata[lop2][0]>=0){
ans[lop]+=ndata[lop2][1];
npr-=ndata[lop2][0];
}
}
} | main.c:1:1: error: expected identifier or '(' before 'for'
1 | for(lop=0;lop<n;lop++){
| ^~~
main.c:1:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | for(lop=0;lop<n;lop++){
| ^
main.c:1:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before ... |
s898441382 | p03732 | C | for(lop=0;lop<n;lop++){
npr=w;
ans[lop]=0;
for(lop2=lop;lop2<n;lop2++){
if(npr-ndata[lop2][0]>=0){
ans[lop]+=ndata[lop2][1];
npr-=ndata[lop2][0];
}
}
} | main.c:1:1: error: expected identifier or '(' before 'for'
1 | for(lop=0;lop<n;lop++){
| ^~~
main.c:1:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | for(lop=0;lop<n;lop++){
| ^
main.c:1:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before ... |
s297284151 | p03732 | C++ | #include <iostream>
int N, W;
int w[100];
int v[100];
int dp[101][101];
int rec(int i, int j) {
if (dp[i][j] >= 0) {
return dp[i][j];
}
int val;
if (i == N) {
val = 0;
} else if (j < w[i]) {
val = rec(i+1, j);
} else {
val = std::max(rec(i+1, j), rec(i+1, j-w[i])+v[i]);
}
dp[i][j] = va... | a.cc: In function 'int main()':
a.cc:26:8: error: 'memset' is not a member of 'std'; did you mean 'wmemset'?
26 | std::memset(dp, -1, sizeof(dp));
| ^~~~~~
| wmemset
|
s449276950 | p03732 | C++ | #include <iostream>
int N, W;
int w[100];
int v[100];
int dp[101][101];
int rec(int i, int j) {
if (dp[i][j] >= 0) {
return dp[i][j];
}
int val;
if (i == N) {
val = 0;
} else if (j < w[i]) {
val = rec(i+1, j);
} else {
val = std::max(rec(i+1, j), rec(i+1, j-w[i])+v[i]);
}
dp[i][j] = va... | a.cc: In function 'int main()':
a.cc:26:3: error: 'memset' was not declared in this scope
26 | memset(dp, -1, sizeof(dp));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cstring>
2... |
s644967358 | p03732 | C++ | #include <iostream>
using namespace std;
int main(){
int N;
long long W;
cin >> N >> W;
long long w[N+1],v[N+1];
for(int i=1;i<=N;i++){
cin >> w[i] >> v[i];
}
long long dp[N+1][W+1];
memset(dp, -1, siz... | a.cc: In function 'int main()':
a.cc:14:5: error: 'memset' was not declared in this scope
14 | memset(dp, -1, sizeof(dp));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cstring>
... |
s417415996 | p03732 | C++ | #include <cstdio>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <map>
#include <bitset>
#include <unordered_set>
#include <set>
const INT_MIN = -0x7fffffff - 1;
using namespace std;
int n, wei;
int main() {
scanf("%d %d", &n, &wei);
vector<int> w(n);
vector<int> v(n);
for (int i = 0... | a.cc:9:7: error: 'INT_MIN' does not name a type
9 | const INT_MIN = -0x7fffffff - 1;
| ^~~~~~~
a.cc:9:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
8 | #include <set>
+++ |+#include <climits>
9 | const INT_MIN = -0x7fffffff - 1;
a.... |
s637271780 | p03732 | C++ | #include <cstdio>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <map>
#include <bitset>
#include <unordered_set>
#include <set>
using namespace std;
int n, wei;
int main() {
scanf("%d %d", &n, &wei);
vector<int> w(n);
vector<int> v(n);
for (int i = 0; i < n; i++) {
scanf("%d... | a.cc: In function 'int main()':
a.cc:18:58: error: 'INT_MIN' was not declared in this scope
18 | vector<vector<int>> dp(n + 1, vector<int>(3 * n + 1, INT_MIN));
| ^~~~~~~
a.cc:9:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fi... |
s434128777 | p03732 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;
int N, W, w1;
int values[4][101];
void Solve(int num[4]){
int best = 0;
int n[4];
for(n[0]=0; n[0]<=num[0]; n[0]++){
for(n[1]=0; n[1]<=num[1]; n[1]++){
for(n[2]=0; n[2]<=num[2]; n[2]++){
for(n[3]=0; n[3]<=nu... | a.cc: In function 'void Solve(int*)':
a.cc:19:24: error: 'i' was not declared in this scope
19 | for( i=0; i<=3; i++){
| ^
|
s527792375 | p03732 | C++ | #include "iostream"
#include "cstdio"
#include "cstring"
#include "string"
#include "map"
using namespace std;
const int maxn=;
map<long long,long long>dp;
int n,c;
int main()
{
scanf("%d%d",&n,&c);
for(int i=1;i<=n;i++){
int v,w;
scanf("%d%d",&w,&v);
for(int j=c;j>=0;j--){
if(j>=v)
dp[j]=max(dp[j],dp[j-... | a.cc:7:16: error: expected primary-expression before ';' token
7 | const int maxn=;
| ^
|
s056285183 | p03732 | C++ | #include <utility>
#include <vector>
using namespace std;
//重さの和j以下で最初からi個まで選べるときの最大の価値
long weights[100],values[100];
map<pair<int,int>,long> table;
int max_value(const pair<int,int> &p){
int i = p.first,j = p.second;
auto p1 = make_pair(i-1,j);
if(table.count(p1)==0) table[p1] = max_value(p1);
if(j-weights... | a.cc:8:1: error: 'map' does not name a type
8 | map<pair<int,int>,long> table;
| ^~~
a.cc: In function 'int max_value(const std::pair<int, int>&)':
a.cc:13:6: error: 'table' was not declared in this scope; did you mean 'mutable'?
13 | if(table.count(p1)==0) table[p1] = max_value(p1);
| ^~~~~
... |
s642048066 | p03732 | C++ | #include <iostream>
#include <vector>
#include <numeric>
using namespace std;
int main () {
long N, W;
cin >> N >> W;
long w[101], v[101];
for (int i = 0; i < N ; i++) {
cin >> w[i] >> v[i];
}
vector<long> v0, v1, v2, v3;
for (int i = 0; i < N; i++) {
if (w[i] == w[0]) {
... | a.cc: In function 'int main()':
a.cc:29:5: error: 'sort' was not declared in this scope; did you mean 'short'?
29 | sort(v0.begin(), v0.end(), greater<long>());
| ^~~~
| short
|
s855098109 | p03732 | C++ | #include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#define CH(N,A,B) (A<=N&&N<B)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define RREP(i,a,b) for(int i=(b-1);... | a.cc: In function 'int main()':
a.cc:39:7: error: expected ',' or ';' before 'int'
39 | int ind;
| ^~~
a.cc:41:34: error: 'ind' was not declared in this scope; did you mean 'int'?
41 | if(0 <= tmp && tmp < minw) ind = 0;
| ^~~
| ... |
s369098306 | p03732 | C++ | #include <iostream>
#include <vector>
#include <map>
using namespace std;
#define pii map<int,int>
int n,w;
//添え字p,残り容量qから最大の利益となる利益vを返す
int np(vector<pii> &item, int p, int q){
static vector<vector<int>> dp;
for(auto a : dp){
if(a[0]==p && a[1]==q){
return a[2];
}
}
in... | a.cc: In function 'int np(std::vector<std::map<int, int> >&, int, int)':
a.cc:21:24: error: '__gnu_cxx::__alloc_traits<std::allocator<std::map<int, int> >, std::map<int, int> >::value_type' {aka 'class std::map<int, int>'} has no member named 'first'
21 | }else if(q<item[p].first){
| ... |
s411152646 | p03732 | C++ | #include <iostream>
#include <list>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;
int n, w;
int maxv = 0;
size_t asize;
vector<cl> arr;
vector<int> vl;
class cl
{
public:
cl(int a, int b) : v(a), w(b) { vs = double(v) / w; }
int v, w;
double vs;
};
bool operator<(... | a.cc:13:8: error: 'cl' was not declared in this scope
13 | vector<cl> arr;
| ^~
a.cc:13:10: error: template argument 1 is invalid
13 | vector<cl> arr;
| ^
a.cc:13:10: error: template argument 2 is invalid
a.cc: In function 'void f(size_t, int, int, int)':
a.cc:41:23: error: invalid typ... |
s481075739 | p03732 | C++ | #include<iostream>
#include <algorithm>
#include<stdint>
using namespace std;
#define MAX 100
#define PATURN 4
int knapsack(int W, int w, int wm, int *ws, int wv[][MAX], int s[][MAX+1], int c, int v) {
int ret = v;
if (c >= PATURN) return 0;
for (int i = 0;i <= ws[c];i ++) {
if (w+(wm+c)*i<=W) ret = max(ret, knaps... | a.cc:3:9: fatal error: stdint: No such file or directory
3 | #include<stdint>
| ^~~~~~~~
compilation terminated.
|
s037375475 | p03732 | C++ | #include <iostream>
#include <cstdio>
using namespace std;
typedef long long ll;
ll dp[1000000100];
int v[100000010],w[100000010];
const ll INF=(ll)1<<62;
int main()
{
int T;
int n,b;
scanf("%d%d",&n,&b);
ll tot_w=0,tot_v=0;
for(int i=0 ; i<n ; ++i)
{
scanf("%d%d... | /tmp/ccnB2VFA.o: in function `main':
a.cc:(.text+0x53): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccnB2VFA.o
a.cc:(.text+0x6a): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccnB2VFA.o
a.cc:(.text+0x98): relocation trunc... |
s936211867 | p03732 | C++ | #include <iostream>
#include <string>
#define REP(i,k,n) for(int(i)=(k);(i)<(n);(i)++)
using namespace std;
const int MAX_N = 100;
const long MAX_W = (long)1e9;
int N;
long w[MAX_N], v[MAX_N];
// メモ化テーブル
long dp[MAX_N + 1][MAX_W + 1];
// i番目以降の品物から重さの総和が
// j以下となるように選ぶ
// 戻り値: その選び方をしたときの価値の総和
// j: 残りの容量 (重さ)
long ... | a.cc: In function 'int main()':
a.cc:42:3: error: 'memset' was not declared in this scope
42 | memset(dp, -1, sizeof(dp));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cstring>
2... |
s722527597 | p03732 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define reps(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
ll N;
ll W;
ll w[100];
ll v[100];
ll dp[100 + 1][100 + 1];
ll DP(ll i, ll j) { //i番目以降重さj以下
if (dp[i][j] != -1) {
return dp... | a.cc: In function 'int main()':
a.cc:53:2: error: expected '}' at end of input
53 | }
| ^
a.cc:32:12: note: to match this '{'
32 | int main() {
| ^
|
s641580957 | p03732 | C++ | #include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,b) FOR(i,0,b)
#define INF 1e9
int N,W,w[100],v[100],dp[100][10000];
int rec(int i,int j){
if (dp[i][j] >= 0) {
return dp[i][j];
}
int res;
if (i == N) {
res = 0;
} else if (j < w[i... | a.cc: In function 'void solve()':
a.cc:28:3: error: 'menset' was not declared in this scope; did you mean 'memset'?
28 | menset(dp,-1,sizeof(dp));
| ^~~~~~
| memset
|
s927607388 | p03732 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
#define MOD 1000000007
using lli = long long int;
using ulli = unsigned long long int;
//#define EVEL 1
#ifndef EVEL
#define dbug(X) std::cout << #X << ":" <<X<<" " ;
#define dbugf(s) std::cout << s << " ";
#define dbugln std::cout<<"\n";... | a.cc: In function 'int main()':
a.cc:82:11: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
82 | int main(){
| ^~
a.cc:82:11: note: remove parentheses to default-initialize a variable
82 | int main(){
| ^~
| --
a.cc:82:11... |
s376660124 | p03732 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <array>
#include <vector>
#include <functional>
#include <numeric>
#include <limits>
#include <utility>
using namespace std;
long long n, W;
vector<long long> w(100);
vector<long long> v(100);
vector< vector<long long> > dp(101, vector... | /usr/bin/ld: /tmp/ccu5IXZd.o: in function `main':
a.cc:(.text+0x326): undefined reference to `dpp(long long, long long)'
collect2: error: ld returned 1 exit status
|
s714808788 | p03732 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
#define MOD 1000000007
using lli = long long int;
using ulli = unsigned long long int;
//#define EVEL 1
#ifndef EVEL
#define dbug(X) std::cout << #X << ":" <<X<<" " ;
#define dbugf(s) std::cout << s << " ";
#define dbugln std::cout<<"\n";... | a.cc:69:11: warning: "dbug" redefined
69 | #define dbug(X) {}
| ^~~~
a.cc:15:9: note: this is the location of the previous definition
15 | #define dbug(X) std::cout << #X << ":" <<X<<" " ;
| ^~~~
a.cc:70:11: warning: "dbugf" redefined
70 | #define dbugf(s) {}
| ... |
s674035229 | p03732 | C++ | #include <iostream>
#include <algorithm>
#include <cstdio>
#define Max(a,b) a>b?a:b
#define INF 10000000000000000
using namespace std;
typedef long long LL;
const int MAX = 45;
LL weight[MAX], value[MAX];
LL W;
pair<LL, LL> ps[1 << (MAX / 2)];
int n;
void slove()
{
... | In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from... |
s987216766 | p03732 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,b) FOR(i,0,b)
#define INF 1e9
int N,W,w[100],v[100],dp[100][10000];
int rec(int i,int j){
if (dp[i][j] >= 0) {
return dp[i][j];
}
int res;
if (i == N) {
res = 0;
} else if (j < w[i]) {
res = rec(... | a.cc: In function 'void solve()':
a.cc:27:3: error: 'menset' was not declared in this scope; did you mean 'memset'?
27 | menset(dp,-1,sizeof(dp));
| ^~~~~~
| memset
|
s485574987 | p03732 | C | #include <stdio.h>
void max_value(const int N, const long weight, long w[], long v[], double*ans, double *box, double *rweight, int *a)
{
int i, b;
double bweight = 0;
for (i = 0; i + a < N; i++)
{
b = a;
if(rweight + w[i+b] <= weight)
{
bweight = w[i + b];
rweight += w[i+b];
box += v[i+ b];
a++... | main.c: In function 'max_value':
main.c:8:27: warning: comparison between pointer and integer
8 | for (i = 0; i + a < N; i++)
| ^
main.c:10:19: error: assignment to 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
10 | b = a;
... |
s802823736 | p03732 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for (int i=0;i<(n);i++)
int main(void) {
int N, W;
cin >> N >> W;
int w[N], v[N];
REP(i,N) cin >> w[i] >> v[i];
int dp[N+1][W];
for (int j = 0; j <= W; j++) {
dp[N][j] = 0;
}
for (int i = N - 1; i >= 0; i--) {
for (int j = 0; j <= ... | a.cc: In function 'int main()':
a.cc:25:3: error: 'solve_dp' was not declared in this scope
25 | solve_dp(N,W,w,v,dp);
| ^~~~~~~~
|
s654140303 | p03732 | C++ | #include<stdio.h>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<utility>
#include<memory>
#include<cmath>
#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#d... | a.cc: In function 'int main()':
a.cc:86:2: error: expected '}' at end of input
86 | }
| ^
a.cc:45:11: note: to match this '{'
45 | int main(){
| ^
|
s596347117 | p03732 | C++ | #pragma comment(linker, "/STACK:36777216")
#include <bits/stdc++.h>
using namespace std;
#define LSON id << 1 , l , mid
#define RSON id << 1 | 1 , mid + 1 , r
#define ROOT 1 , 1 , n
#define CLR(x , y) memset(x , y , sizeof(x))
#define LOWBIT(x) x & (-x)
#define FORN(i , a , ... | a.cc:39:9: error: '__int64' does not name a type; did you mean '__int64_t'?
39 | typedef __int64 LL;
| ^~~~~~~
| __int64_t
a.cc:53:1: error: 'LL' does not name a type; did you mean 'ALL'?
53 | LL t;
| ^~
| ALL
a.cc:55:1: error: 'LL' does not name a type; did you mean 'ALL'?... |
s000650368 | p03732 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,b) FOR(i,0,b)
#define INF 1e9
int N,W,w[100],v[100],dp[100][10000];
cin>>N>>W;
REP(i,N){
cin>>w[i]>>v[i];
}
int rec(int i,int j){
if (dp[i][j] >= 0) {
return dp[i][j];
}
int res;
if (i == N) {
res ... | a.cc:9:1: error: 'cin' does not name a type
9 | cin>>N>>W;
| ^~~
a.cc:3:20: error: expected unqualified-id before 'for'
3 | #define FOR(i,a,b) for(int i=a;i<b;i++)
| ^~~
a.cc:4:18: note: in expansion of macro 'FOR'
4 | #define REP(i,b) FOR(i,0,b)
| ^~~
a... |
s897766097 | p03732 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cctype>
#define rep(i,a,b) for(int (i)=(a);i<(b);i++)
#define MAX_N 105
#define MAX_V 10000000
#define INF 10000000
using namespace std;
bool debug=false;
long long dp[... | /tmp/ccPOoeko.o: in function `solve()':
a.cc:(.text+0x87): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccPOoeko.o
a.cc:(.text+0xb8): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccPOoeko.o
a.cc:(.text+0x137): relocation t... |
s918218640 | p03732 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define loop(i,a,b) for(i=a;i<b;i++)
#define rloop(i,a,b) for(i=a;i>=b;i--)
#define vi vector<int>
#define vs vector<string>
const int inf=1000000001;
const ll INF=1e16;
#define MOD 1000000007
#define mod 1000... | a.cc: In function 'int main()':
a.cc:27:39: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
27 | dp[j+w[i]]=min(dp[j+weight[i]],dp[j]+value[i]);
| ^
|
s783683870 | p03732 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define loop(i,a,b) for(i=a;i<b;i++)
#define rloop(i,a,b) for(i=a;i>=b;i--)
#define vi vector<int>
#define vs vector<string>
const int inf=1000000001;
const ll INF=1e16;
#define MOD 1000000007
#define mod 1000... | a.cc: In function 'int main()':
a.cc:27:39: error: invalid types 'int[int]' for array subscript
27 | dp[j+w[i]]=min(dp[j+weight[i]],dp[j]+value[i]);
| ^
|
s850762453 | p03732 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <string.h>
using namespace std;
int dp[101][1000000001];
int n,w;
vector<int> W(101),V(101);
int rec(int i, int j){
if(dp[i][j] >= 0){
return dp[i][j];
}
int res;
if(i == n){
res = 0;
} else if(j<... | /tmp/ccFxNfi9.o: in function `rec(int, int)':
a.cc:(.text+0x68): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccFxNfi9.o
a.cc:(.text+0x88): relocation truncated to fit: R_X86_64_PC32 against symbol `W' defined in .bss section in /tmp/ccFxNfi9.o
a.cc:(.text+0xc2): relocat... |
s186888935 | p03732 | C++ | #include <iostream>
#include <fstream>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;
struct obj{int val, g;} x,v1[105],a[9];
int l1,l2,b,c,n,T,d[50001],i,gmax,dif,maxi,poz,nrv,nr2,iok,jok,j;
long long sumg,sumval;
vector<obj> v[5];
bool cmp(obj a, obj b)
{
return a.g>b.g || (a.g==... | a.cc: In function 'int main()':
a.cc:48:9: error: expected primary-expression before 'else'
48 | else
| ^~~~
|
s266393922 | p03732 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int dp[101][101];
int n,w;
vector<int> W(101),V(101);
int rec(int i, int j){
if(dp[i][j] >= 0){
return dp[i][j];
}
int res;
if(i == n){
res = 0;
} else if(j< W[i]) {
res = rec(i+1, j);
} else... | a.cc: In function 'int main(int, const char**)':
a.cc:30:5: error: 'memset' was not declared in this scope
30 | memset(dp, -1, sizeof(dp));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <algorithm>
+++ |+#i... |
s176066170 | p03732 | C++ | #include <iostream>
#include <vector>
using namespace std;
//table[w][i]:重さw1以上w以下でi番目まで入れたときの最大の価値
int main(){
int N,W;
cin>>N>>W;
vector<int> weights(N),values(N);
for(int i=0;i<N;++i){
cin>>weights[i]>>values[i];
}
// int first_weight = weights[0];
// if(first_weight>W){
// cout<<0<<endl;
/... | a.cc: In function 'int main()':
a.cc:26:9: error: 'table' was not declared in this scope; did you mean 'mutable'?
26 | table[w][i] = table[w][i-1];
| ^~~~~
| mutable
a.cc:28:9: error: 'table' was not declared in this scope; did you mean 'mutable'?
28 | table[w][i] = max... |
s055819432 | p03732 | C++ | #include <iostream>
#include <vector>
using namespace std;
int dp[101][101];
int n,w;
vector<int> W(101),V(101);
int rec(int i, int j){
if(dp[i][j] >= 0){
return dp[i][j];
}
int res;
if(i == n){
res = 0;
} else if(j< W[i]) {
res = rec(i+1, j);
} else {
res = max... | a.cc: In function 'int main(int, const char**)':
a.cc:30:5: error: 'memset' was not declared in this scope
30 | memset(dp, -1, sizeof(dp));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <vector>
+++ |+#incl... |
s144618515 | p03732 | C++ | #include"bits/stdc++.h"
//#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define print(x) cout<<x<<endl;
typedef long long ll;
int N;
ll W;
ll w[105], v[105];
ll table[102][1000002];
ll dp(int now, ll mergin) {
ll sum = 0;
if (table[now][mergin] != -1) return table[now][mergin... | a.cc: In function 'int main()':
a.cc:25:16: error: invalid conversion from 'll (*)(int, ll)' {aka 'long long int (*)(int, long long int)'} to 'void*' [-fpermissive]
25 | memset(dp, -1, sizeof(table));
| ^~
| |
| ll (*)(int, ll) {aka long long int... |
s683534912 | p03732 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
using namespace std;
const int MAX_N = 1000; // nの最大値
const int MAX_W = 1000000007; // Wの最大値
// 入力
int n, W;
int w[MAX_N], v[MAX_N];
// i番目以降の品物から重さの和がj以下なるように選んだときの、
// 取りうる価値の総和の最大値を返す関数
int rec(int i, int j) {
int res;
if (i == n) ... | /tmp/cc9GIx6K.o: in function `solve_dp2()':
a.cc:(.text+0x317): relocation truncated to fit: R_X86_64_PC32 against symbol `dp2' defined in .bss section in /tmp/cc9GIx6K.o
a.cc:(.text+0x38d): relocation truncated to fit: R_X86_64_PC32 against symbol `dp2' defined in .bss section in /tmp/cc9GIx6K.o
a.cc:(.text+0x3b5): re... |
s850315626 | p03732 | C++ | #include <iostream>
#include <algorithm>
#include <cstdio>
#define Max(a,b) a>b?a:b
#define INF 10000000000000000
using namespace std;
typedef long long LL;
const int MAX = 110;
LL weight[MAX], value[MAX];
LL W;
pair<LL, LL> ps[1 << (MAX / 2)];
int n;
void slove()
{
//枚举前半部分
int n2 = n / 2;
for (int i = 0;... | a.cc:11:19: warning: left shift count >= width of type [-Wshift-count-overflow]
11 | pair<LL, LL> ps[1 << (MAX / 2)];
| ~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/string:51,
from /usr/include/c++/14... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.