submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s850923974 | p03732 | C++ | #include <bits/stdc++.h>
using namespace std;
#define MAX_N 100
#define MAX_W 1000
long long n;
long long dp[MAX_N+1][MAX_W+1];
long long weight[MAX_N+1];
long long cost[MAX_N+1];
long long CAP;
long long func(long long i,long long w)
{
if(i==n+1) return 0;
if(dp[i][w]!=-1) return dp[i][w];
long long prof... | a.cc:24:1: error: '::main' must return 'int'
24 | void main()
| ^~~~
|
s176174595 | p03732 | C++ | #include<iostream>
//#define int long long int
using namespace std;
int dp[105][105];
int n,tw,v[105],w[105],i,j;
knap(int n,int tw)
{
int i,j;
for(i=0; i<n; i++)
{
for(j=0; j<=tw; j++)
{
if(j==0) dp[i][j]=0;
else if(j<w[i])dp[i][j]=dp[i-1][j];
else dp[i]... | a.cc:6:1: error: ISO C++ forbids declaration of 'knap' with no type [-fpermissive]
6 | knap(int n,int tw)
| ^~~~
|
s428168641 | 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... |
s309361825 | p03732 | C++ | #include<bits/stdc++.h>
//#define int long long int
using namespace std;
int dp[105][105];
int n,tw,v[105],w[105],i,j;
knap(int n,int tw)
{
int i,j;
for(i=0; i<n; i++)
{
for(j=0; j<=tw; j++)
{
if(j==0) dp[i][j]=0;
else if(j<w[i])dp[i][j]=dp[i-1][j];
else ... | a.cc:6:1: error: ISO C++ forbids declaration of 'knap' with no type [-fpermissive]
6 | knap(int n,int tw)
| ^~~~
|
s407631096 | p03732 | C++ | #include<bits/stdc++.h>
using namespace std;
int dp[105][105];
int n,tw,v[105],w[105],i,j;
knap(int n,int tw)
{
int i,j;
for(i=0; i<n; i++)
{
for(j=0; j<=tw; j++)
{
if(j==0) dp[i][j]=0;
else if(j<w[i])dp[i][j]=dp[i-1][j];
else dp[i][j]=max(v[i]+dp[i-1][j-... | a.cc:5:1: error: ISO C++ forbids declaration of 'knap' with no type [-fpermissive]
5 | knap(int n,int tw)
| ^~~~
|
s231866709 | p03732 | C++ | #include<bits/stdc++.h>
using namespace std;
int dp[105][105];
int n,tw,v[105],w[105],i,j;
knap(int n,int tw)
{
int i,j;
for(i=0; i<n; i++)
{
for(j=0; j<=tw; j++)
{
if(j==0) dp[i][j]=0;
else if(j<w[i])dp[i][j]=dp[i-1][j];
else dp[i][j]=max(v[i]+dp[i-1][j-... | a.cc:5:1: error: ISO C++ forbids declaration of 'knap' with no type [-fpermissive]
5 | knap(int n,int tw)
| ^~~~
|
s213014973 | p03732 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
const int MAX_N = 100; // nの最大値
const int MAX_W = 810; // Wの最大値
int N, W;
int w[810], v[810];
int standard[1];
// メモ化テーブル。
// dp[i][j]はi番目以降の品物から重さの和がj以下なるように選んだときの価値の和の最大値を表す。
// -1なら値が未決定であることを表す
int dp[MAX_N + 1][MAX_W + 1];
// i番目以降の品物から重さの和がj以下なるように... | a.cc: In function 'int solve_dp(int)':
a.cc:45:9: error: 'memset' was not declared in this scope
45 | memset(dp, -1, sizeof(dp)); // メモ化テーブルを-1で初期化 以下のforループと等価
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #i... |
s033019574 | p03732 | C++ | #include <cstdio>
#include <vector>
#include <algorithm>
#define NMAX 105
#define WMAX 1000000005
#define DIAGONAL 1
#define TOP 0
using namespace std;
struct Item {
int value, weight;
};
int N, W;
Item items[NMAX + 1];
int C[NMAX + 1][WMAX + 1], G[NMAX + 1][WMAX + 1];
void compute(int &maxValue, vector<int> &s... | /tmp/cc8CH3D0.o: in function `compute(int&, std::vector<int, std::allocator<int> >&)':
a.cc:(.text+0x11d): relocation truncated to fit: R_X86_64_PC32 against symbol `G' defined in .bss section in /tmp/cc8CH3D0.o
a.cc:(.text+0x27d): relocation truncated to fit: R_X86_64_PC32 against symbol `G' defined in .bss section in... |
s772349561 | p03732 | C++ | #include <iostream>
using namespace std;
long* w;
long* v;
long dp[1000000000 + 1][100 + 1];
long solve(long weight, int select) {
if (dp[weight][select] >= 0) {
return dp[weight][select];
}
if (weight < 0 || select < 0) {
return 0;
} else if (weight - w[select] >= 0){
return max(solve(weight - w[... | a.cc: In function 'int main()':
a.cc:33:3: error: 'memset' was not declared in this scope
33 | 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... |
s574787868 | p03732 | C++ | #include <bits/stdc++.h>
//#define DEBUG
#define INF ll_MAX
#define BEAMMAX 10
typedef long long ll;
using namespace std;
int main() {
ll N, W;
cin >> N >> W;
vector<ll> v(N), w(N);
for(int i=0; i<N; ++i) {
cin >> v[i] >> w[i];
}
if(N <= 30) {
int s = N/2;
vector< p... | a.cc: In function 'int main()':
a.cc:5:13: error: 'll_MAX' was not declared in this scope
5 | #define INF ll_MAX
| ^~~~~~
a.cc:49:80: note: in expansion of macro 'INF'
49 | ll tv = (lower_bound(dp.begin(), dp.begin()+m, make_pair(W-sw, INF)) - 1)->second;
| ... |
s412786516 | p03732 | C++ | #include <bits/stdc++.h>
//#define DEBUG
#define INF ll_MAX
#define BEAMMAX 10
typedef long long ll;
using namespace std;
int main() {
ll N, W;
cin >> N >> W;
vector<ll> v(N), w(N);
for(int i=0; i<N; ++i) {
cin >> v[i] >> w[i];
}
if(N <= 30) {
int s = N/2;
vector<P>... | a.cc: In function 'int main()':
a.cc:21:16: error: 'P' was not declared in this scope
21 | vector<P> dp(1 << s);
| ^
a.cc:21:17: error: template argument 1 is invalid
21 | vector<P> dp(1 << s);
| ^
a.cc:21:17: error: template argument 2 is invalid
a.cc:30... |
s991302404 | p03732 | C++ | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<cctype>
#define itn int
#define pritnf printf
#define xlm mylove
#define maxt 1000000010
#define maxm 110
using namespace std;
int w[maxm],c[maxm];int t,m... | /tmp/ccDT2N82.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x30): relocation truncated to fit: R_X86_64_PC32 against symbol `mylove' defined in .bss section in /tmp/ccDT2N82.o
collect2: error: ld returned 1 exit status
|
s780325487 | p03732 | Java | public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
final int N = sc.nextInt();
final int W = sc.nextInt();
int[] w = new int[N];
int[] v = new int[N];
for(int i=0; i<N; i++){
w[i] = sc.nextInt();
v[i] = sc.nextInt();
}
sc.close();
int[][] dp... | Main.java:5: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:5: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s173672673 | p03732 | C++ | #include<iostream>
using namespace std;
#define V 1000000000
unsigned int f[100][V];
unsigned int weight[100];
unsigned int value[100];
#define max(x,y) (x)>(y)?(x):(y)
int main()
{
int N,M;
cin>>N;
cin>>M;
for (int i=1;i<=N; i++)
{
cin>>weight[i]>>value[i];
} ... | /tmp/ccC7vP70.o: in function `main':
a.cc:(.text+0x4d): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/ccC7vP70.o
a.cc:(.text+0x79): relocation truncated to fit: R_X86_64_PC32 against symbol `value' defined in .bss section in /tmp/ccC7vP70.o
a.cc:(.text+0xbf): relocat... |
s647453945 | p03732 | C++ | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
#define scii(x, y) int x,y;scanf("%d%d",&x,&y);
#define REP(i, y) for(int i=0;i<y;i++)
const int MAX_N = 110;
const int MAX_W = 1000000010;
int dp[MAX_N][MAX_W];
int w[MAX_N];
int v[MAX_N];
int main() {
scii(N, W)
REP(i,N) {
scanf(... | /tmp/ccBXviCp.o: in function `main':
a.cc:(.text+0x40): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccBXviCp.o
a.cc:(.text+0x57): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccBXviCp.o
a.cc:(.text+0xe8): relocation trunc... |
s281136898 | p03732 | C++ | #include<bits/stdc++.h>
#include <corecrt_memcpy_s.h>
const long long INF = INT_MAX / 2;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define REP1(i,n) FOR(i,1,n+1... | a.cc:2:10: fatal error: corecrt_memcpy_s.h: No such file or directory
2 | #include <corecrt_memcpy_s.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
|
s388505148 | p03732 | C++ | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
#define DEBUG(X) cerr<<__LINE__<<" "<<#X<<": "<<X<<endl;
#define sci(x) int x;scanf("%d",&x);
#define scii(x, y) int x,y;scanf("%d%d",&x,&y);
#define REP(i, y) for(int i=0;i<y;i++)
const int MAX_N = 110;
const int MAX_W = 1e9+10;
int dp[MAX... | /tmp/cclEJStv.o: in function `main':
a.cc:(.text+0x40): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/cclEJStv.o
a.cc:(.text+0x57): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/cclEJStv.o
a.cc:(.text+0xe8): relocation trunc... |
s840797441 | p03733 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int T = sc.nextInt();
int t[] = new int[N];
int total = 0;
for(int i = 0; i <t.length; ++i){
t[i] = sc.nextI... | Main.java:16: error: cannot find symbol
total = Math.min(T, num1);
^
symbol: variable num1
location: class Main
1 error
|
s634904314 | p03733 | Java | public class Main {
public static void main(String[] args) throws Exception {
//値の取得
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
long T = sc.nextLong();
long[] t = new long[N];
for (int i = 0; i < N; ++i){
t[i] = sc.nextLong();
}
... | Main.java:4: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:4: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s046172204 | p03733 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n,t;
cin>>n>>t;
vector<long long>a(n);
for(int i=0;i<n;i++) cin>>a[i];
long long ans=t;
for(int i=0;i<n-1;i++){
if(a[i+1]-a[i]>k) ans+=k;
else ans+=a[i+1]-a[i];
}
cout<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:11:20: error: 'k' was not declared in this scope
11 | if(a[i+1]-a[i]>k) ans+=k;
| ^
|
s593675393 | p03733 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n,t;
cin >> n >> t;
vector<int> ti(i);
for (int i = 0; i < n; i++)
{
cin >> ti[i];
}
int ans = t;
for (int i = 1; i < n - 1; i++)
{
ans += min(ti[i] - ti[i - 1],t);
}
cout << ans << ... | a.cc: In function 'int main()':
a.cc:8:20: error: 'i' was not declared in this scope; did you mean 'ti'?
8 | vector<int> ti(i);
| ^
| ti
|
s645492198 | p03733 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++)
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 100000... | a.cc: In function 'int main()':
a.cc:63:25: error: request for member 'at' in 't', which is of non-class type 'll' {aka 'long long int'}
63 | if(tim.at(i)<=t+t.at(i-1)){
| ^~
a.cc:64:18: error: request for member 'at' in 't', which is of non-class type 'll' {aka 'long long int'}
... |
s708638544 | p03733 | C++ | #include<bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define... | a.cc: In function 'int main()':
a.cc:39:7: error: expected primary-expression before 'int'
39 | fpr(int i=1;i<n;i++){
| ^~~
a.cc:39:15: error: 'i' was not declared in this scope
39 | fpr(int i=1;i<n;i++){
| ^
|
s325707908 | p03733 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N=sc.nextInt();
int T=sc.nextInt();
int[] t=new int[N];
int ans = 0;
for(int i=0;i<N;i++){
t[i]=sc.nextInt();
}
if(N > 1){
ans = t[1] - t[0];
... | Main.java:20: error: break outside switch or loop
break;
^
1 error
|
s594998029 | p03733 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N=sc.nextInt();
int T=sc.nextInt();
int[] t=new int[N];
int ans = T;
for(int i=0;i<N;i++){
t[i]=sc.nextInt();
}
for(int j=1;j<n;j++){
if(T <(t[... | Main.java:15: error: cannot find symbol
for(int j=1;j<n;j++){
^
symbol: variable n
location: class Main
1 error
|
s594612617 | p03733 | C++ | #include <iostream>
#include "cstdio"
using namespace std;
const int maxn = 200005;
int n, tx[maxn];
int clk, cur;
int sum, u, t;
int main()
{
scanf("%d %d", &n, &t);
clk = 0;cur = 0;
for(int i = 1; i <= n; i++)
{
scanf("%d", &tx[i]);
}
sort(tx+1, tx+1+n);
long long ans = 0;
for(int i = 1; i <= n; i++)
{
... | a.cc: In function 'int main()':
a.cc:16:9: error: 'sort' was not declared in this scope; did you mean 'short'?
16 | sort(tx+1, tx+1+n);
| ^~~~
| short
|
s997002413 | p03733 | C++ | #include<cstdio>
#include<algorithm>
using namespace std;
const int maxn=2e6+5;
long long a[maxn];
int main()
{
int n;
long long m;
scanf("%d %lld",&n,&t);
for(int i=1;i<=n;i++){
scanf("%lld",&a[i]);
}
long long x=0;
for(int i=2;i<=n;i++){
if(a[i]-a[i-1]<t)
x=x+a[i]-a[i-1];
else
x=x+t;
}
x=x+t;
pr... | a.cc: In function 'int main()':
a.cc:10:29: error: 't' was not declared in this scope
10 | scanf("%d %lld",&n,&t);
| ^
|
s028042892 | p03733 | C++ | #include<bits/stdc++.h>
using namespace std;
int n,w;
int arr[100][2];
int dp[100][101][300];
int w1;
int get(int cur,int num,int a){
if(cur==n)return 0;
if(dp[cur][num][a]>=0) return dp[cur][num][a];
int remain=w-w1*num-a;
int res=get(cur+1,num,a);
if(remain>=arr[cur][0])
res=max(res,arr[cur][1]+get(cur+1,num+1,a+... | a.cc: In function 'int main()':
a.cc:20:9: error: 'i' was not declared in this scope
20 | w1=arr[i][0];
| ^
|
s340382897 | p03733 | C++ | a,b = map(int,input().split())
ls = list(map(int, input().split()))
duration = 0
max = 0
for i in ls :
if i <= max and max <= i+b :
duration += i + b - max
max = i + b
elif max < i :
duration += b
max = i + b
print(duration) | a.cc:1:1: error: 'a' does not name a type
1 | a,b = map(int,input().split())
| ^
|
s545725149 | p03733 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
using namespace std;
// int INT_MAX = 2000000000;
namespace __output {
template<class T1, class T2> void pr(const pair<T1,T2>& x);
template<class T, size_t SZ> void pr(const array<T,SZ>& x);
template<class T> void pr(... | a.cc: In function 'int main()':
a.cc:87:22: error: 'INT_MAX' was not declared in this scope
87 | int global_min = INT_MAX;
| ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
5 | #include <set>
+++ |+#inclu... |
s356956137 | p03733 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
using namespace std;
INT_MAX = 2000000000;
namespace __output {
template<class T1, class T2> void pr(const pair<T1,T2>& x);
template<class T, size_t SZ> void pr(const array<T,SZ>& x);
template<class T> void pr(const v... | a.cc:8:1: error: 'INT_MAX' does not name a type
8 | INT_MAX = 2000000000;
| ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
5 | #include <set>
+++ |+#include <climits>
6 | using namespace std;
a.cc: In function 'int main()':... |
s389301401 | p03733 | C | s,t,p,T;main(i){for(;~scanf("%d",&t);i--?(s+=t-p>T?T:t-p,p=t):T=t);printf("%d",s+T);} | main.c:1:1: warning: data definition has no type or storage class
1 | s,t,p,T;main(i){for(;~scanf("%d",&t);i--?(s+=t-p>T?T:t-p,p=t):T=t);printf("%d",s+T);}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 't' [-Wim... |
s006192515 | p03733 | C | s,t,p,T;main(i){for(;~scanf("%d",&t);i--?s+=t-p>T?T:t-p,p=t:T=t);printf("%d",s+T);} | main.c:1:1: warning: data definition has no type or storage class
1 | s,t,p,T;main(i){for(;~scanf("%d",&t);i--?s+=t-p>T?T:t-p,p=t:T=t);printf("%d",s+T);}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 't' [-Wimpl... |
s147461987 | p03733 | C++ | #include<iostream>
#include<vector>
using namespace std;
int main(){
int N,T,sum=0;
cin >> N >> T;
vector<int> t(N);
for(int i=0;i<N;i++){
cin << t[i];
}
for(int j=1;j<N;j++){
if(t[j]-t[j-1]<T){
sum += t[j]-t[j-1];
}else{
sum += T;
}
}
} | a.cc: In function 'int main()':
a.cc:11:9: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'})
11 | cin << t[i];
a.cc:11:9: note: candidate: 'operator<<(int, __gnu_cxx::__alloc_trait... |
s162952958 | p03733 | C++ | #include<iostream>
#include<vector>
using namespace std;
int main(){
int N,T,sum=0;
cin >> N >> T;
vector(int) t(N);
for(int i=0;i<N;i++){
cin << t[i];
}
for(int j=1;j<N;j++){
if(t[j]-t[j-1]<T){
sum += t[j]-t[j-1];
}else{
sum += T;
}
}
}
| a.cc: In function 'int main()':
a.cc:9:9: error: missing template arguments before '(' token
9 | vector(int) t(N);
| ^
a.cc:9:10: error: expected primary-expression before 'int'
9 | vector(int) t(N);
| ^~~
a.cc:11:12: error: 't' was not declared in this scope
11 | cin << ... |
s785337229 | p03733 | C++ | #pragma region includes, macros
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <map>
#include <set>
#include <list>
#include <unordered_set>
#include <unordered_map>
using ... | a.cc:24:15: error: 'numeric_limits' was not declared in this scope
24 | const T INF = numeric_limits<T>::max();
| ^~~~~~~~~~~~~~
a.cc:24:31: error: expected primary-expression before '>' token
24 | const T INF = numeric_limits<T>::max();
| ^
a.cc:24:37: erro... |
s957631430 | p03733 | C++ | #pragma region includes, macros
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <map>
#include <set>
#include <list>
#include <unordered_set>
#include <unordered_map>
using ... | a.cc:24:15: error: 'numeric_limits' was not declared in this scope
24 | const T INF = numeric_limits<T>::max();
| ^~~~~~~~~~~~~~
a.cc:24:31: error: expected primary-expression before '>' token
24 | const T INF = numeric_limits<T>::max();
| ^
a.cc:24:37: erro... |
s778375302 | p03733 | C++ | #pragma region includes, macros
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <map>
#include <set>
#include <list>
#include <unordered_set>
#include <unordered_map>
using ... | a.cc:24:15: error: 'numeric_limits' was not declared in this scope
24 | const T INF = numeric_limits<T>::max();
| ^~~~~~~~~~~~~~
a.cc:24:31: error: expected primary-expression before '>' token
24 | const T INF = numeric_limits<T>::max();
| ^
a.cc:24:37: erro... |
s222978392 | p03733 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
int main(){
ll N,T;
cin>>N>>T;
vll t(N);
for (ll i=0;i<N;i++) cin>>t[i];
ans=T;
for (ll i=0;i<N-1;i++) {
ll x=t[i]+T-t[i+1];
ans += T-max((ll)0,x);
}
cout<<ans;
} | a.cc: In function 'int main()':
a.cc:10:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
10 | ans=T;
| ^~~
| abs
|
s603501064 | p03733 | Java | public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n=sc.nextInt();
long t=sc.nextInt();
long[] nums=new long[n+1];
for(int i=0;i<n;i++){
nums[i]=sc.nextInt();
}
nums[n]=Long.MAX_VALUE;
lon... | Main.java:4: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:4: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s213012363 | p03733 | C++ | #include <tuple>
#include <random>
#include <map>
#include <set>
#include <complex>
#include <algorithm>
#include <cassert>
#include <iterator>
#include <numeric>
#include <cmath>
#include <stdio.h>
#include <functional>
#define REP(i,a) for(int (i)=0;(i)<(a);i++)
#define RREP(i,a,b) for(int (i)=(a);(i)<(b);i++)
#defi... | a.cc: In function 'int main()':
a.cc:27:5: error: 'cin' was not declared in this scope
27 | cin>>N>>T;
| ^~~
a.cc:13:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
12 | #include <functional>
+++ |+#include <iostream>
13 |
a.cc:40... |
s115876099 | p03733 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(void) {
int num, t, ans = 0, i = 1, a, b;
cin >> num >> t >> b;
for (; i < num; i++) {
scanf_s("%d", &a);
ans += min(t, a - b);
b = a;
}
cout << ans + t << "\n";
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
10 | scanf_s("%d", &a);
| ^~~~~~~
| scanf
|
s636665660 | p03733 | C++ | #include <vector>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <cstdlib>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define REP(i,n) for(int i=0;i<n;i++)
#define SORT(... | a.cc: In function 'int main()':
a.cc:35:24: error: 'T' was not declared in this scope
35 | if(a[i+1] - a[i] < T) ans -= t-(a[i+1] - a[i]);
| ^
|
s897110683 | p03733 | C++ | 1 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 1
| ^
|
s064462440 | p03733 | C++ | // ------------------------------------
// Date:2018/ 3/ 9
// Problem:ARC 073 Sentou c.cpp
//
// ------------------------------------
#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;-... | a.cc:23:19: error: 'int time [101010101]' redeclared as different kind of entity
23 | int time[101010101];
| ^
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gn... |
s142632105 | p03733 | C | #include<cstdio>
#include<cstring>
#include<iostream>
#include<map>
#include<queue>
using namespace std;
int main(){
int a[1000];
int n,t,i,T=0;
scanf("%d%d",&n,&t);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
for(i=1;i<n;i++){
if((a[i]-a[i-1])>=t) T=T+t;
if((a[i]-a[i-1])<t) T=T+(a[i]-a[i-1]);
}
T=T+t;... | main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s885945980 | p03733 | C++ | #include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int N,i,T,X = 0,m,t[200005];
int a = 0,dex[200005];
scanf("%d %d",&N,&T);
for(i = 0;i < N; i++)
scanf("%d",&t[i]);
dex[0] = t[0];
for(i = 1;i < N; i++)
{
if(t[i] >= T... | a.cc: In function 'int main()':
a.cc:34:37: error: expected primary-expression before '=' token
34 | X + = T;
| ^
|
s334661923 | p03733 | C++ | #include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int N,i,T,X = 0,m,t[200005];
int a = 0,dex[200005];
scanf("%d %d",&N,&T);
for(i = 0;i < N; i++)
scanf("%d",&t[i]);
dex[0] = t[0];
for(i = 1;i < N; i++)
{
if(t[i] >= T... | a.cc: In function 'int main()':
a.cc:34:37: error: expected primary-expression before '=' token
34 | X + = T;
| ^
|
s583315687 | p03733 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN=2e5+10;
int ti[MAXN];
int main(){
ll n,t;
while(cin>>n>>t){
for(int i=1;i<=n;i++) cin>>t[i];
ll sum=0;
sum+=t;
for(int i=2;i<=n;i++){
if (sum>ti[i])
sum=ti[i]+t;
else
sum+=t;
}
cout<<sum<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:45: error: invalid types 'll {aka long long int}[int]' for array subscript
9 | for(int i=1;i<=n;i++) cin>>t[i];
| ^
|
s896649558 | p03733 | C++ | #include<bits/stdc++.h>
using namespace std;
const int MAXN=2e5+10;
int ti[MAXN];
int main(){
int n,t;
scanf("%d%d",&n,&t);
for(int i=1;i<=n;i++) scanf("%d",&ti[i]);
ll sum=0;
sum+=t;
for(int i=2;i<=n;i++){
if (sum>ti[i])
sum=ti[i]+t;
else
sum+=t;
}
printf("%lld\n",sum);
return 0;
} | a.cc: In function 'int main()':
a.cc:9:9: error: 'll' was not declared in this scope
9 | ll sum=0;
| ^~
a.cc:10:9: error: 'sum' was not declared in this scope
10 | sum+=t;
| ^~~
|
s020145710 | p03733 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
long long prev = 0;
long long now = 0;
long long sum = 0;
for(int i = 0; i < N; ++i) {
prev = now;
cin >> now;
sum += min(now - prev, K);
}
cout << sum + K << endl;
} | a.cc: In function 'int main()':
a.cc:13:15: error: no matching function for call to 'min(long long int, int&)'
13 | sum += min(now - prev, K);
| ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
... |
s223760808 | p03733 | C++ |
#include <set>
#include <map>
#include <cstdio>
#include <algorithm>
using namespace std;
void Get_Val(int &Ret)
{
Ret = 0;
char ch;
while (ch = getchar(), ch > '9' || ch < '0')
;
do
{
(Ret *= 10) += ch - '0';
}
while (ch = getchar(), ch >= '0' && ch <= '9');
}
const int Max_N(200050);
typedef long long ... | a.cc:69:11: error: 'vector' was not declared in this scope
69 | map< int, vector<qwq> > M;
| ^~~~~~
a.cc:6:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
5 | #include <algorithm>
+++ |+#include <vector>
6 |
a.cc:69:21: error: ... |
s751418903 | p03733 | C | #include <stdio.h>
#include <limits.h>
#define MAXN 200010
int t[MAXN], N, T;
int solve(void) {
int s = 0;
for(int i = 0; i < N; i++) s += min(t[i + 1] - t[i], T);
return s;
}
int main(void) {
scanf("%d%d", &N, &T);
for(int i = 0; i < N; i++) scanf("%d", &t[i]);
t[N] = INT_MAX;
printf("%d", ... | main.c: In function 'solve':
main.c:7:37: error: implicit declaration of function 'min' [-Wimplicit-function-declaration]
7 | for(int i = 0; i < N; i++) s += min(t[i + 1] - t[i], T);
| ^~~
|
s070417262 | p03733 | C++ | #include<bits/stdc++.h>
int main(int argc, const char * argv[])
{
long long pNum, baseTime, tmp, total = 0, preTmp = -1;
cin>>pNum>>baseTime;
while(pNum > 0)
{
cin>>tmp;
pNum --;
if(preTmp == -1)
{
preTmp = tmp;
continue;
}
if((preT... | a.cc: In function 'int main(int, const char**)':
a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin>>pNum>>baseTime;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/... |
s510683948 | p03733 | Java |
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.util.zip.ZipFile;
// class name example: practice_1__2017_04_16
/*
-------------------------
Summary:
Total : 4
Correct... | Main.java:163: error: cannot find symbol
new Practice1__2017_05_05().run();
^
symbol: class Practice1__2017_05_05
location: class Main
1 error
|
s459674044 | p03733 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <cstdint>
using namespace std;
int main()
{
int32_t n, t;
cin >> n >> t;
vector<int32_t> v{ n };
for(auto& x : v) {
cin >> x;
}
int64_t sum{ 0 };
for(auto i = 1U; i < v.size(); ++i) {
sum += min(t, v[i) -... | a.cc: In function 'int main()':
a.cc:20:26: error: expected ']' before ')' token
20 | sum += min(t, v[i) - v[i - 1]);
| ^
| ]
a.cc:20:38: error: expected ';' before ')' token
20 | sum += min(t, v[i) - v[i - 1]);
| ... |
s053146662 | p03733 | C++ | N, T = map(int, input().split())
t = list(map(int, input().split()))
_all = N * T
sabun = 0
for i in range(1, N):
if T < t[i]:
sabun += 0
elif i == 1:
sabun += T - t[i]
else:
sabun += T - (t[i] - t[i - 1])
print(_all - sabun) | a.cc:1:1: error: 'N' does not name a type
1 | N, T = map(int, input().split())
| ^
|
s755766805 | p03733 | C++ | ////////////////////////////////////////////////////////////////////
// This source code is for Visual C++ 2010 Express
////////////////////////////////////////////////////////////////////
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <map>
#include <set>
#include <al... | a.cc:21:10: fatal error: UnionFind.h: No such file or directory
21 | #include "UnionFind.h"
| ^~~~~~~~~~~~~
compilation terminated.
|
s557526989 | p03733 | C | #include <stdio.h>
int main(){
int i, N;
double sum, sa, T;
double t[1000000001];
scanf("%d %lf", &N, &T);
for(i = 1; i <= N; i++) {
scanf("%lf", &t[i]);
}
for(i = 1; i <= N; i++) {
sa = t[i + 1] - t[i];
if(sa => T) {
sum += T;
}
if(sa < T) {
sum += sa;
}
}
printf("%f", sum);
} | main.c: In function 'main':
main.c:16:24: error: expected expression before '>' token
16 | if(sa => T) {
| ^
|
s119504446 | p03733 | C | #include <stdio.h>
int main(){
int i, N;
double sum, sa, T;
double t[1000000001];
scanf("%d %lf", &N, &T);
for(i = 1; i <= N; i++) {
scanf("%lf", &t[i]);
}
for(i = 1; i <= N; i++) {
sa = t[i + 1] - t[i]
if(sa => T) {
sum += T;
}
if(sa < T) {
sum += sa;
}
}
printf("%f", sum);
} | main.c: In function 'main':
main.c:15:37: error: expected ';' before 'if'
15 | sa = t[i + 1] - t[i]
| ^
| ;
16 | if(sa => T) {
| ~~
|
s204582807 | p03733 | C | #include <stdio.h>
int main(){
double i, sum, sa, N, T;
double t[1000000001];
scanf("%lf %lf", &N, &T);
for(i = 1; i <= N; i++) {
scanf("%lf", &t[i]);
}
for(i = 1; i <= N; i++) {
sa = t[i + 1] - t[i]
if(sa => T) {
sum += T;
}
if(sa < T) {
sum += sa;
}
}
printf("%f", sum);
} | main.c: In function 'main':
main.c:10:32: error: array subscript is not an integer
10 | scanf("%lf", &t[i]);
| ^
main.c:14:23: error: array subscript is not an integer
14 | sa = t[i + 1] - t[i]
| ^
main.c:14:34: error... |
s824909357 | p03733 | C | #include <stdio.h>
int main(){
double i, sum, N, T;
double t[1000000001];
scanf("%lf %lf", &N, &T);
for(i = 1; i <= N; i++) {
scanf("%lf", &t[i]);
}
for(i = 1; i <= N; i++) {
if((t[i + 1] - t[i]) => T) {
sum += T;
}
if((t[i + 1] - t[i]) < T) {
sum += (t[i + 1] - t[i]);
}
}
printf("%f", sum... | main.c: In function 'main':
main.c:10:32: error: array subscript is not an integer
10 | scanf("%lf", &t[i]);
| ^
main.c:14:22: error: array subscript is not an integer
14 | if((t[i + 1] - t[i]) => T) {
| ^
main.c:14:33... |
s858035942 | p03733 | C++ | import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int T = sc.nextInt();
final int INF = 2000000000;
int[] start = new int[N+1];
int[] end = new int[N+1];... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.io.*;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: ... |
s814184585 | p03733 | C | #include <stdio.h>
int main(){
double i, sum, N, T;
double t[1000000001];
scanf("%lf %lf", N, T);
for(i = 1; i <= N; i++) {
scanf("%lf", t[i]);
}
for(i = 1; i <= N; i++) {
if((t[i + 1] - t[i]) => T) {
sum += T;
}
if((t[i + 1] - t[i]) < T) {
sum += (t[i + 1] - t[i]);
}
}
printf("%f", sum);
... | main.c: In function 'main':
main.c:10:31: error: array subscript is not an integer
10 | scanf("%lf", t[i]);
| ^
main.c:14:22: error: array subscript is not an integer
14 | if((t[i + 1] - t[i]) => T) {
| ^
main.c:14:33: ... |
s187526037 | p03733 | C++ | #include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;
int main(){
int N,
long long W,v,w;
scanf("%d %lld",&N,&W);
//制限の重さWまでのdpテーブルを用意して0埋めする
vector<int> dp(W+1);
fill(dp.begin(), dp.end(), 0);
//入力を受け取りながら受け取った荷物の重さのとこを確認
... | a.cc: In function 'int main()':
a.cc:11:5: error: expected unqualified-id before 'long'
11 | long long W,v,w;
| ^~~~
a.cc:12:25: error: 'W' was not declared in this scope
12 | scanf("%d %lld",&N,&W);
| ^
a.cc:18:28: error: 'v' was not declared in this scope
18 | ... |
s970765722 | p03733 | C++ | import java.util.*;
public class Main {
//-------------------------------------------------------------//
public static final void main(String[] args) { new Main().solve(); }
//-------------------------------------------------------------//
Scanner sc = new Scanner(System.in);
void solve() {
... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s531437710 | p03733 | Java | import java.io.BufferedInputStream;
import java.util.Scanner;
public class C {
// 14:02-
public static void main(String[] args) {
Scanner sc = new Scanner(new BufferedInputStream(System.in));
int n = sc.nextInt();
int t = sc.nextInt();
long sum = 0L;
long until = 0L;
for (int i = 0; i < n; i++) {
int... | Main.java:4: error: class C is public, should be declared in a file named C.java
public class C {
^
1 error
|
s052853163 | p03733 | C++ | #include <bits/stdc++.h>
using namespace std;
#define times(n, i) uptil(0, n, i)
#define rtimes(n, i) downto((n) - 1, 0, i)
#define upto(f, t, i) for(int _##i = (t), i = (f); i <= _##i; i++)
#define uptil(f, t, i) for(int _##i = (t), i = (f); i < _##i; i++)
#define downto(f, t, i) for(int _##i = (t), i... | a.cc: In function 'int main()':
a.cc:38:19: error: no matching function for call to 'max(int, long long int)'
38 | ans -= max(0, before + T - t);
| ~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bi... |
s888539535 | p03734 | C++ | #include <bits/stdc++.h>
typedef long long ll;
//B
using namespace std;
inline ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b);}
inline ll lcm(ll a, ll b) { return a * b / gcd(a, b);}
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n, w;
cin>>n>>w;
map<int,int> mp;
... | a.cc: In function 'int main()':
a.cc:23:18: error: base operand of '->' has non-pointer type 'std::pair<const int, int>'
23 | if(it->first+ weight<=w){
| ^~
a.cc:24:30: error: base operand of '->' has non-pointer type 'std::pair<const int, int>'
24 | if(mp.find(i... |
s707032495 | p03734 | C++ | #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 insert
#define all(x) (x).begin(),(x).end()... | a.cc: In function 'int main()':
a.cc:177:5: error: 'r' was not declared in this scope
177 | ww+=r*i;
| ^
|
s252546681 | p03734 | C++ | #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 insert
#define all(x) (x).begin(),(x).end()... | a.cc: In function 'int main()':
a.cc:9:12: error: request for member 'push_back' in 'w0', which is of non-class type 'vl [105]' {aka 'std::vector<long long int> [105]'}
9 | #define pb push_back
| ^~~~~~~~~
a.cc:151:4: note: in expansion of macro 'pb'
151 | w0.pb(b);
| ^~
a.cc:9:12: error... |
s962888187 | p03734 | C++ | #include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <string>
#include <string.h>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <map>
#include <set>
#include <iostream>
#include <sstream>
#include <numeric>
#include <cctype>
#include <bitse... | a.cc: In function 'int main()':
a.cc:85:9: error: 'chmax' was not declared in this scope
85 | chmax(dp[j+1][k+a], dp[j][k]+b);
| ^~~~~
|
s873709626 | p03734 | C++ | #include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <string>
#include <string.h>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <map>
#include <set>
#include <iostream>
#include <sstream>
#include <numeric>
#include <cctype>
#include <bitse... | a.cc: In function 'int main()':
a.cc:85:9: error: 'chmax' was not declared in this scope
85 | chmax(dp[j+1][k+a], dp[j][k]+b);
| ^~~~~
a.cc:93:23: error: 'swm' was not declared in this scope; did you mean 'sum'?
93 | for ( int j=0; j<=swm; j++ ) {
| ^~~
... |
s196251216 | p03734 | C++ | #include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
string to_string(pair<A, B> p);
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
string to_string(const st... | cc1plus: error: '::main' must return 'int'
|
s487148268 | p03734 | C++ | #include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define MAX 510000
#define rrep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep(i, n) for(ll i = 1; i <= (ll)(n); i++)
#define dcout cout<<fixed<<setprecision(15);
#define mp make_pair
#define pb push_back
using namespace std;
typedef long long int ll;
type... | a.cc:149:1: error: 'cout' does not name a type; did you mean 'dcout'?
149 | cout<<ans<<endl;
| ^~~~
| dcout
a.cc:150:1: error: expected declaration before '}' token
150 | }
| ^
|
s147183341 | p03734 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll MOD = 1e9+7;
// const ll MOD = 998244353;
const ll INF = 1ll<<60;
#define FOR(i,a,b) for (ll i=(a);i<(ll)(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
template<class T>
bool chmin(T &a, T... | a.cc: In function 'll solve(ll, ll, ll, std::vector<long long int>&)':
a.cc:62:36: error: request for member 'size' in '(& vec)->std::vector<long long int>::operator[](((std::vector<long long int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value... |
s936686987 | p03734 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
using namespace std;
int main(void){
int n;
... | a.cc: In function 'int main()':
a.cc:34:17: error: 'sv' was not declared in this scope; did you mean 'sw'?
34 | ll sw=0;sv=0;
| ^~
| sw
a.cc:42:55: error: 'INF' was not declared in this scope
42 | ll tv=(lower_bound(ps,ps+m,make_pair(W-sw,INF))-1)->s... |
s929270986 | p03734 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n,W;cin>>n>>W;
vector<int> dp(w),a[4];
rep(i,n){
int w,v,w1;cin>>w>>v;
if(i==0)w1=w;
a[w-w1].push_back(v);
}
rep(i,4){
... | a.cc: In function 'int main()':
a.cc:11:18: error: 'w' was not declared in this scope
11 | vector<int> dp(w),a[4];
| ^
a.cc:28:22: error: 'w1' was not declared in this scope; did you mean 'y1'?
28 | int fact=i*w1+j*(w1+1)+k*(w1+2)+l*(w1+3);
| ^~
... |
s690624287 | p03734 | C++ | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define cinf(n,x) for(int i=0;i<(n);i++)cin>>x[i];
#define ft first
#define sc second
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(),(v).end()
#define LB(a,x) lb(all(a),x)-a.begin(... | a.cc: In function 'int main()':
a.cc:48:81: error: expected ')' before 'c'
48 | ll l=min((W-(i*w[0]+j*(w[0]+1)+k*(w[0]+2)))/(w[0]+3),(LLONG_MAX)c[3].size());
| ~ ^
| ... |
s331048186 | p03734 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<deque>
#include<cmath>
#include<map>
#include<cstring>
using namespace std;
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LLINF = 1LL<<60;
#define P pair<int, int>
#define rep(i, n) for (int i = 0; i < (int)... | a.cc: In function 'int main()':
a.cc:90:83: error: expected ';' before 'if'
90 | dp[i + 1][j + 1][ww] = max(dp[i][j + 1][ww], dp[i + 1][j + 1][ww])
| ^
| ... |
s656605857 | p03734 | Java |
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int W = sc.nextInt();
int[] w = new int[n];
int[] v = new int[n];
ArrayList<Integer> arr0 = new Ar... | Main.java:7: error: illegal character: '\u3000'
public class?Main {
^
1 error
|
s560630816 | p03734 | C++ | a | a.cc:1:1: error: 'a' does not name a type
1 | a
| ^
|
s253480513 | p03734 | C++ | #include<bits/stdc++.h>
using namespace std;
const int MAX_N = 100;
const int MAX_W = INF;
int n, W;
int w[MAX_N], v[MAX_N];
int dp[MAX_N + 1][MAX_W + 1];
int rec_dp(int i, int j) {
if (dp[i][j] != -1) {
return dp[i][j];
}
int res;
if (i == n) {
res = 0;
} else if (j < w[i]) {
res ... | a.cc:5:19: error: 'INF' was not declared in this scope
5 | const int MAX_W = INF;
| ^~~
a.cc:10:25: error: size of array 'dp' is not an integral constant-expression
10 | int dp[MAX_N + 1][MAX_W + 1];
| ~~~~~~^~~
|
s331212278 | p03734 | C++ | #include<bits/stdc++.h>
using namespace std;
const int MAX_N = 100;
const int MAX_W = INF;
int n, W;
int w[MAX_N], v[MAX_N];
int dp[MAX_N + 1][MAX_W + 1];
int rec_dp(int i, int j) {
if (dp[i][j] != -1) {
return dp[i][j];
}
int res;
if (i == n) {
res = 0;
} else if (j < w[i]) {
res ... | a.cc:5:19: error: 'INF' was not declared in this scope
5 | const int MAX_W = INF;
| ^~~
a.cc:10:25: error: size of array 'dp' is not an integral constant-expression
10 | int dp[MAX_N + 1][MAX_W + 1];
| ~~~~~~^~~
a.cc: In function 'int rec_dp(int, int)':
a.cc:32:4: ... |
s725505503 | p03734 | C++ | 100 990000000
10000000 7584766
10000000 7535949
10000000 7434002
10000000 6224567
10000000 6343925
10000000 6491532
10000000 6704808
10000000 7747279
10000000 7689345
10000000 6003017
10000000 6725907
10000000 7702215
10000000 7686168
10000000 7558917
10000000 6776247
10000000 6545406
10000000 7449047
10000000 7992266
... | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 100 990000000
| ^~~
|
s224252290 | p03734 | C++ | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
long long int a[110],b[110],dp[110][110][330];
int main()
{
int n,m;
cin >> n >> m;
for(int i=1;i<=n;i++)
{
cin >> a[i] >> b[i];
}
for(int i=1;i<=n;i++)
{
for(int j=0;j<=i;j++)
{
for(int k=... | a.cc: In function 'int main()':
a.cc:30:13: error: 'll' was not declared in this scope
30 | ll w = a[1]*i + j;
| ^~
a.cc:31:16: error: 'w' was not declared in this scope
31 | if(w <= m)
| ^
|
s145816621 | p03734 | C++ | #include <bits/stdc++.h>
using namespace std;
int knapsack(int max_weight, vector<int> weight, vector<int> profit) {
int items_quantity = profit.size();
int knap[items_quantity+1][max_weight+1];
memset(knapsack, 0, sizeof knapsack);
for(int i = 0; i <= items_quantity; i++) {
for(int w = 0; w <... | a.cc: In function 'int knapsack(int, std::vector<int>, std::vector<int>)':
a.cc:7:32: error: ISO C++ forbids applying 'sizeof' to an expression of function type [-fpermissive]
7 | memset(knapsack, 0, sizeof knapsack);
| ^~~~~~~~
a.cc:7:12: error: invalid conversion from 'int... |
s932075592 | p03734 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i... | a.cc: In function 'int main()':
a.cc:33:11: error: 'sum' was not declared in this scope
33 | rep(i,n)sum+=w[i];
| ^~~
|
s407682875 | p03734 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i... | a.cc: In function 'int main()':
a.cc:33:11: error: 'sum' was not declared in this scope
33 | rep(i,n)sum+=w[i];
| ^~~
|
s421518412 | p03734 | C++ | #include<bits/stdc++.h>
#define rep(i,n,m) for(int i = (n); i <(m); i++)
#define rrep(i,n,m) for(int i = (n) - 1; i >=(m); i--)
using namespace std;
using ll = long long;
vector<ll> cum_value[5];
ll weights[5];
ll n, w;
int dfs(int index, ll weight, ll value)
{
if (weight > w) return 0;
if (index > 4 or cum_v... | a.cc: In function 'int main()':
a.cc:41:33: error: conversion from 'vector<int>' to non-scalar type 'vector<long long int>' requested
41 | vector<ll> values = w_v.second;
| ~~~~^~~~~~
|
s606449749 | p03734 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;
int main() {
ios::sync_with_stdio(false);
int n, w, a0, a, b, z = 0;
vector<ll> c[4] = {};
cin >> n >> w >> a >> b; a0 = a;
c[0].push_back(b);
for (int i = 1; i < n; i++) ... | a.cc: In function 'int main()':
a.cc:16:226: error: no matching function for call to 'max(int&, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)'
16 | for (int i = 0; i < c[0].size(); i++) for (int j = 0; j < c[1].size(); j++) for (int k = 0; k < c[2].size(); k++) for (int l =... |
s648342961 | p03734 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
#include <queue>
#include <ctime>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
#define f... | a.cc: In function 'int main()':
a.cc:47:42: error: no matching function for call to 'max(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&, ll&)'
47 | if(k + w1 * j <= D) ans = max(dp[N][j][k] , ans);
| ~~~^~~~~~~~~~~~~~~~~~~
In file included fro... |
s475740442 | p03734 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<(n);i++)
signed main(){
int N,W;cin>>N>>W;
vector<int>w(N),v(N);
rep(i,N)cin>>w[i]>>v[i];
vector<vector<int>>v4(4),sm(4,vector<int>(101,0));
int w0=w[0];
rep(i,n){int x=w[i]-w0;v4[x].push_back(v[i]);}
rep(i,4){sort... | a.cc: In function 'int main()':
a.cc:12:15: error: 'n' was not declared in this scope
12 | rep(i,n){int x=w[i]-w0;v4[x].push_back(v[i]);}
| ^
a.cc:4:33: note: in definition of macro 'rep'
4 | #define rep(i,n) for(int i=0;i<(n);i++)
| ^
|
s950181806 | p03734 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<(n);i++)
signed main(){
int N,W;cin>>N>>W;
vector<int>w(N),v(N);
rep(i,N)cin>>w[i]>>v[i];
vector<vector<int>>v4(4),sm(4,vector<int>(101,0));
int w0=w[0];
rep(i,n){int x=w[i]-w0;v4[x].push_back(v[i]);}
rep(i,4){sort... | a.cc: In function 'int main()':
a.cc:12:15: error: 'n' was not declared in this scope
12 | rep(i,n){int x=w[i]-w0;v4[x].push_back(v[i]);}
| ^
a.cc:4:33: note: in definition of macro 'rep'
4 | #define rep(i,n) for(int i=0;i<(n);i++)
| ^
a.cc: At gl... |
s385493071 | p03734 | C++ | /*************************************************************************
> File Name: test.cpp
> Author: Akira
> Mail: qaq.febr2.qaq@gmail.com
************************************************************************/
#include<bits/stdc++.h>
typedef long long LL;
const int MaxN = 101;
LL N,W;
LL w[Max... | a.cc: In function 'void solve()':
a.cc:28:35: error: 'max' was not declared in this scope; did you mean 'std::max'?
28 | DP[i][j][k] = max( DP[i-1][j][k], DP[i-1][j-w[i]][k-1]+v[i]);
| ^~~
| std::max
In file included ... |
s247399222 | p03734 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define REP(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, a, b) for(int i=(a); i<(b); ++i)
#define FORR(i, a, b) for... | a.cc: In function 'int main()':
a.cc:48:14: error: no matching function for call to 'CHMIN(ll&, int)'
48 | CHMIN(mi, n*m);
| ~~~~~^~~~~~~~~
a.cc:21:34: note: candidate: 'template<class T> void CHMIN(T&, T)'
21 | template<typename T> inline void CHMIN(T& a, const T b) {if(a>b) a=b;}
| ... |
s236349869 | p03734 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
typedef long long ll;
const ll inf=1e14;
ll dp[105][105][105]={0};
int main(){
ll n,w;
cin>>n>>w;
ll w1,v1;
cin>>w1>>v1;
for(int i=0;i<105;i++){
for(int j=0;j<105;j++){
for(int k=0;k<105;k++) dp[i][j][k]=0;
... | a.cc: In function 'int main()':
a.cc:39:34: error: no matching function for call to 'min(ll&, int)'
39 | if(w2>=0){ for(int k=0;k<=min(w2,104);k++) ans=max(ans,dp[n][i][k]);}
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/... |
s566634074 | p03734 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long N,W;
cin >> N >> W;
long long DP[N+1][W]={};
list<long long> maxw={0};
for (int i=1;i<N;i++){
long long w,v;
cin >> w >> v;
for(long long x:maxw){
if (x+w<=W) DP[i][x+w]=max(DP[i-1][x+w],DP[i-1][x]+v);
}
}
long long ... | a.cc: In function 'int main()':
a.cc:17:12: error: no matching function for call to 'max(long long int&, <unresolved overloaded function type>)'
17 | ans=max(DP[N][y],max);
| ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gn... |
s462737366 | p03734 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <list>
#include <queue>
using namespace std;
int inf = (1 << 30);
int mod = 1e9 + 7;
int64_t inf64 = (1LL << 60);
template <typename T>
T gcd(T a, T b) {
if(b == 0) return a;
else return gcd(b, ... | a.cc: In function 'int main()':
a.cc:49:87: error: no matching function for call to 'std::vector<int>::vector(int, std::vector<int>)'
49 | vector<vector<vector<int>>> dp(N + 1, vector<int>(N + 1, vector<int>(3 * N + 1, 0)));
| ... |
s013937114 | p03734 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(void){
int n, W, w_0, w_, v_;
cin >> n >> W;
vector<int> v[4];
for(int i = 0; i < 4; ++i){
v[i].resize(n+10);
}
cin >> w_0 >> v[0][0];
for(int i = 1; i < n; ++i){
cin >> w_ >> v_;
v[w_-w_0].push_back(v_);
}
for(int i = 0; i < 4; ++i){
sort(v[i].r... | a.cc: In function 'int main()':
a.cc:32:52: error: no matching function for call to 'max(long long int&, int)'
32 | value = max(value,
| ~~~^~~~~~~
33 | (i==0?0:v[0][i-1]) ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.