submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s209611482
p00439
C
#include <stdio.h> int main(){ int n,k,i,max=0; int x[100001]; scanf("%d %d",&n,&k); for(i=0;i<n;i++)[ scanf("%d",&x[i]); } for(i=0;i<k;i++){ max+=x[i]; } for(i=0;i<n-k;i++){ if(x[i]<x[i+k]){ max-=x[i]; max+=x[i+k]; }} printf("%d\n",max); return 0; }
main.c: In function 'main': main.c:6:25: error: expected expression before '[' token 6 | for(i=0;i<n;i++)[ | ^ main.c:7:27: error: expected ';' before '}' token 7 | scanf("%d",&x[i]); | ^ | ; 8 | } ...
s975341864
p00439
C
#include <stdio.h> int main(void){ int c1,c2; int i,j,n; int ans; int max_index; int num[100000]; while(1){ scanf("%d %d",&c1,&c2); if(c1 == 0 && c2 == 0){ break; } ans = 0; max_index = c1 - c2; c1 -=1; for(i = 0;i <= c1;i++){ scanf("%d",num+i); } for(i ...
main.c: In function 'main': main.c:37:3: error: expected declaration or statement at end of input 37 | return 0; | ^~~~~~
s884540991
p00439
C
#include <stdio.h> int main(void){ int c1,c2; int i,j,n; int ans; int max_index; int num[100000]; while(1){ scanf("%d %d",&c1,&c2); if(c1 == 0 && c2 == 0){ break; } ans = 0; max_index = c1 - c2; c1 -=1; for(i = 0;i <= c1;i++){ scanf("%d",num+i); } for(...
main.c: In function 'main': main.c:39:1: error: expected declaration or statement at end of input 39 | } | ^
s876537022
p00439
C++
#include <iostream> #include <algorithm> #include <string> using namespace std; int a[100000 + 1]; int s[100000 + 1]; int main() { int n, k; int i, j, l; int sum = 0, asus = 0; while (true) { memset(s, 0, sizeof(s)); memset(a, 0, sizeof(a)); cin >> n >> k; if (n == 0 && k == 0) return 0; for (i = ...
a.cc: In function 'int main()': a.cc:18:17: error: 'memset' was not declared in this scope 18 | memset(s, 0, sizeof(s)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <algorithm> +++...
s437323407
p00439
C++
#include <iostream> #include <cstdio> #include <algorithm> #define ini 0 using namespace std; int rlay[100001]; int main (){ while (1){ memset(rlay, 0,sizeof(rlay)); int n,k,input,ansmax=0; cin>>n>>k; if (n==0&&k==0)break; rlay[0]=ini; for (int i=1;i<=n;i++){ cin>>input; rlay[i]=input+rlay[i-1]; }...
a.cc: In function 'int main()': a.cc:13:1: error: 'memset' was not declared in this scope 13 | memset(rlay, 0,sizeof(rlay)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <algorithm> +++ |+#include <cstring> 4 ...
s611892871
p00439
C++
#include <iostream> #include <cstdio> #include <algorithm> #define ini 0 using namespace std; int rlay[100001]; int main (){ while (1){ memset(rlay, 0,sizeof(rlay)); int n,k,input,ansmax=0; cin>>n>>k; if (n==0&&k==0)break; rlay[0]=ini; for (int i=1;i<=n;i++){ cin>>input; rlay[i]=input+rlay[i-1]; }...
a.cc: In function 'int main()': a.cc:13:1: error: 'memset' was not declared in this scope 13 | memset(rlay, 0,sizeof(rlay)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <algorithm> +++ |+#include <cstring> 4 ...
s109836903
p00439
C++
#include <iostream> #include <cstdio> #include <algorithm> #define ini 0 using namespace std; int rlay[100001]; int main (){ while (1){ memset(rlay ,0 ,sizeof(rlay)); int n,k,input,ansmax=0; cin>>n>>k; if (n==0 && k==0)break; rlay[0]=ini; for (int i=1;i<=n;i++){ cin>>input; rlay[i]=input+rlay[i-1]...
a.cc: In function 'int main()': a.cc:14:1: error: 'memset' was not declared in this scope 14 | memset(rlay ,0 ,sizeof(rlay)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <algorithm> +++ |+#include <cstring> 4...
s087954964
p00439
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ long long n,k; while(1) { ans=-1000000000; cin>>n>>k; if(n == 0 and k == 0) break; long long a[n];for(int i=0;i<n;i++)cin>>a[i]; for(int i=0;i<n-k+1;i++){ long long temp=0; for(int j=i;j<i+k;j++){ temp...
a.cc: In function 'int main()': a.cc:9:5: error: 'ans' was not declared in this scope; did you mean 'abs'? 9 | ans=-1000000000; | ^~~ | abs
s698226530
p00439
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N, k; cin >> N >> k; vector<int> a(N); for(int i = 0; i < N; i++){ cin >> a.at(i); } int ans = 0; for(int i = 0; i < N; i++){ if(i < 3) total += a[i]; else total = total + a[i] - a[i-3]; if(ans < total) ans ...
a.cc: In function 'int main()': a.cc:12:19: error: 'total' was not declared in this scope 12 | if(i < 3) total += a[i]; | ^~~~~ a.cc:13:18: error: 'total' was not declared in this scope 13 | else total = total + a[i] - a[i-3]; | ^~~~~ a.cc:14:22: ...
s826069969
p00439
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N, k; cin >> N >> k; vector<int> a(N); for(int i = 0; i < N; i++){ cin >> a.at(i); } int ans = 0; for(int i = 0; i < N; i++){ if(i < 3){ total += a[i]; }else{ total = total + a[i] - a[i-3]; ...
a.cc: In function 'int main()': a.cc:13:13: error: 'total' was not declared in this scope 13 | total += a[i]; | ^~~~~ a.cc:15:13: error: 'total' was not declared in this scope 15 | total = total + a[i] - a[i-3]; | ^~~~~ a.cc:17:22: error: 'total' was not...
s326550300
p00439
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,k; vector<int> ans(0);x while(1){ cin>>n>>k; if(n==0&&k==0){ break; } vector<int> vec(n); for(int i=0;i<n;i++){ cin>>vec.at(i); } vector<int> rsw(n+1); rsw.a...
a.cc: In function 'int main()': a.cc:5:24: error: 'x' was not declared in this scope 5 | vector<int> ans(0);x | ^
s739513374
p00439
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,k; vector<int> ans(0);x while(1){ cin>>n>>k; if(n==0&&k==0){ break; } vector<int> vec(n); for(int i=0;i<n;i++){ cin>>vec.at(i); } vector<int> rsw(n+1); rsw.a...
a.cc: In function 'int main()': a.cc:5:24: error: 'x' was not declared in this scope 5 | vector<int> ans(0);x | ^
s984740855
p00439
C++
#include <bits/stdc++.h> using namespace std; int main(){ for(int count = 0; count < 5; count++){ int none(2); int N, k; cin >> N >> k; vector<int> a(N); for(int i = 0; i < N; i++){ cin >> a.at(i); } int ans = 0; int total = 0; for(int i = 0; i < N; i++){ if(i <...
a.cc:21:1: error: extended character   is not valid in an identifier 21 |   } | ^ a.cc:21:1: error: extended character   is not valid in an identifier a.cc: In function 'int main()': a.cc:20:25: error: request for member 'at' in 'none', which is of non-class type 'int' 20 | cin >> none.at(0) >> ...
s541511776
p00439
C++
#include <bits/stdc++.h> using namespace std; int main(){ for(int count = 0; count < 5; count++){ int none(2); int N, k; cin >> N >> k; vector<int> a(N); for(int i = 0; i < N; i++){ cin >> a.at(i); } int ans = 0; int total = 0; for(int i = 0; i < N; i++){ if(i <...
a.cc:21:1: error: extended character   is not valid in an identifier 21 |   } | ^ a.cc:21:1: error: extended character   is not valid in an identifier a.cc: In function 'int main()': a.cc:20:24: error: invalid types 'int[int]' for array subscript 20 | cin >> none[0] >> none[1]; | ...
s792899619
p00439
C++
#include <bits/stdc++.h> using namespace std; int main(){ for(int count = 0; count < 5; count++){ int none(2); int N, k; cin >> N >> k; vector<int> a(N); for(int i = 0; i < N; i++){ cin >> a.at(i); } int ans = 0; int total = 0; for(int i = 0; i < N; i++){ if(i <...
a.cc:23:1: error: extended character   is not valid in an identifier 23 |   } | ^ a.cc:23:1: error: extended character   is not valid in an identifier a.cc: In function 'int main()': a.cc:21:25: error: request for member 'at' in 'none', which is of non-class type 'int' 21 | cin >> none.at(i); ...
s648170741
p00439
C++
#include<iostream> using namespace std; int main() { int n,k; cin >> n >> k; while(n!=0||k!=0){ vector<int> a(N); cin >> a; S[0]=0; for(int i=1;i==n;i++){ S[i]=S[i-1]+a.at(i-1); } int x=S[k] for(int l=1;l==n-k;l++){ if(x<S[k+l]-S...
a.cc: In function 'int main()': a.cc:8:8: error: 'vector' was not declared in this scope 8 | vector<int> a(N); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include<iostream> +++ |+#include <vector> 2...
s392610689
p00439
C++
#include <bits/stdc++.h> using namespace std; int main(){ for(int count = 0; count < 5; count++){ vecotor<int> none(2); int N, k; cin >> N >> k; vector<int> a(N); for(int i = 0; i < N; i++){ cin >> a.at(i); } int ans = 0; int total = 0; for(int i = 0; i < N; i++){ ...
a.cc:23:1: error: extended character   is not valid in an identifier 23 |   } | ^ a.cc:23:1: error: extended character   is not valid in an identifier a.cc: In function 'int main()': a.cc:5:13: error: 'vecotor' was not declared in this scope 5 | vecotor<int> none(2); | ^~~~~~~...
s811328077
p00439
C++
#include <bits/stdc++.h> using namespace std; int main(){ for(int count = 0; count < 5; count++){ vector<int> none(2); int N, k; cin >> N >> k; vector<int> a(N); for(int i = 0; i < N; i++){ cin >> a.at(i); } int ans = 0; int total = 0; for(int i = 0; i < N; i++){ ...
a.cc:23:1: error: extended character   is not valid in an identifier 23 |   } | ^ a.cc:23:1: error: extended character   is not valid in an identifier a.cc: In function 'int main()': a.cc:23:1: error: '\U00003000\U00003000' was not declared in this scope 23 |   } | ^~~~
s693367315
p00439
C++
#include<iostream> using namespace std; int main() { int n,k; cin >> n >> k; while(n!=0||k!=0){ vector<int> a(N); cin >> a; S[0]=0; for(int i=1;i==n;i++){ S[i]=S[i-1]+a.at(i-1); } int x=S[k]; for(int l=1;l==n-k;l++){ if(x<S[k+l]-...
a.cc: In function 'int main()': a.cc:8:8: error: 'vector' was not declared in this scope 8 | vector<int> a(N); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include<iostream> +++ |+#include <vector> 2...
s203934603
p00439
C++
#include<iostream> using namespace std; int main() { int n,k; cin >> n >> k; while(n!=0||k!=0){ vector<int> a(n); cin >> a; S[0]=0; for(int i=1;i==n;i++){ S[i]=S[i-1]+a.at(i-1); } int x=S[k]; for(int l=1;l==n-k;l++){ if(x<S[k+l]-...
a.cc: In function 'int main()': a.cc:8:8: error: 'vector' was not declared in this scope 8 | vector<int> a(n); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include<iostream> +++ |+#include <vector> 2...
s562854058
p00439
C++
#include<iostream> using namespace std; int main() { int n,k; cin >> n >> k; while(n!=0||k!=0){ vector<int> a(n); cin >> a; S[0]=0; for(int i=1;i==n;i++){ S[i]=S[i-1]+a.at(i-1); } int x=S[k]; for(int l=1;l==n-k;l++){ if(x<S[k+l]-...
a.cc: In function 'int main()': a.cc:8:8: error: 'vector' was not declared in this scope 8 | vector<int> a(n); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include<iostream> +++ |+#include <vector> 2...
s315629753
p00439
C++
#include <bits/stdc++.h> using namespace std; int main(){ for(int count = 0; count < 5; count++){ vector<int> none(2); int N, k; cin >> N >> k; vector<int> a(N); for(int i = 0; i < N; i++){ cin >> a.at(i); } int ans = 0; int total = 0; ...
a.cc:26:1: error: extended character   is not valid in an identifier 26 |   } | ^ a.cc:26:1: error: extended character   is not valid in an identifier a.cc: In function 'int main()': a.cc:26:1: error: '\U00003000\U00003000' was not declared in this scope 26 |   } | ^~~~
s178210875
p00439
C++
#include<iostream> using namespace std; int main() { int n,k; cin >> n >> k; while(n!=0||k!=0){ vector<int> a(n); cin >> a; S[0]=0; for(int i=1;i==n;i++){ S[i]=S[i-1]+a.at(i-1); } int x=S[k]; for(int l=1;l==n-k;l++){ if(x<S[k+l]-...
a.cc: In function 'int main()': a.cc:8:8: error: 'vector' was not declared in this scope 8 | vector<int> a(n); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include<iostream> +++ |+#include <vector> 2...
s173068000
p00439
C++
#include<iostream> using namespace std; int main() { int n,k; cin >> n >> k; while(n!=0||k!=0){ vector<int> a(n); cin >> a; S[0]=0; for(int i=1;i<n;i++){ S[i]=S[i-1]+a.at(i-1); } int x=S[k]; for(int l=1;l<n-k;l++){ if(x<S[k+l]-S[...
a.cc: In function 'int main()': a.cc:8:8: error: 'vector' was not declared in this scope 8 | vector<int> a(n); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include<iostream> +++ |+#include <vector> 2...
s666396900
p00439
C++
#include<iostream> using namespace std; int main() { int n,k; cin >> n >> k; while(n!=0||k!=0){ vector<int> a(n); cin >> a; S[0]=0; for(int i=1;i<n;i++){ S[i]=S[i-1]+a.at(i-1); } int x=S[k]; for(int l=1;l<n-k;l++){ if(x<S[k+l]-S[...
a.cc: In function 'int main()': a.cc:8:8: error: 'vector' was not declared in this scope 8 | vector<int> a(n); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include<iostream> +++ |+#include <vector> 2...
s520824745
p00439
C++
#include<iostream> using namespace std; int main() { int n,k; cin >> n >> k; while(n!=0||k!=0){ vector<int> a(n); cin >> a; S[0]=0; for(int i=1;i<n;i++){ S[i]=S[i-1]+a.at(i-1); } int x=S[k]; for(int l=1;l<n-k;l++){ if(x<S[k+l]-S[...
a.cc: In function 'int main()': a.cc:8:8: error: 'vector' was not declared in this scope 8 | vector<int> a(n); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include<iostream> +++ |+#include <vector> 2...
s082858688
p00439
C++
#include<iostream> using namespace std; int main() { int n,k,x; cin >> n >> k; while(n!=0||k!=0){ vector<int> a(n); cin >> a; S[0]=0; for(int i=1;i<n;i++){ S[i]=S[i-1]+a.at(i-1); } x=S[k]; for(int l=1;l<n-k;l++){ if(x<S[k+l]-S[l]...
a.cc: In function 'int main()': a.cc:8:8: error: 'vector' was not declared in this scope 8 | vector<int> a(n); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include<iostream> +++ |+#include <vector> 2...
s960407520
p00439
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,k,i,ans=0; cin >> n >> k; while(n!=0 || k!=0){ int a,sum[1000000],S; sum[0]=0; for(i=0;i<n;++i){ cin >> a; sum[i+1] = sum[i] + a; } for(i=0;i<n-k;++i){ S=su...
a.cc: In function 'int main()': a.cc:18:28: error: invalid types 'int[int]' for array subscript 18 | ans = max(ans,S[i]); | ^
s365731991
p00439
C++
// This file is a "Hello, world!" in C++ language by GCC for wandbox. #include <iostream> #include <cstdlib> #include <vector> using namespace std; int main() { int n,k; cin >> n >> k; int max = 0; vector<int> a(100005, 0); vector<int> s(100005,0); while (n != 0 || k != 0) { int b; ...
a.cc: In function 'int main()': a.cc:15:17: error: expected ';' before 'for' 15 | s[0] = 0 | ^ | ; 16 | for(int i = 0; i < n; i++) { | ~~~ a.cc:16:24: error: 'i' was not declared in this scope 16 | for(int i = 0; i < n; i++...
s357789050
p00439
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <sstream> #include <queue> #include <deque> #include <bitset> #include <iterator> #include <list> #include <stack> #include <map> #include <set> #include <functional> #include <numeric> #include <utility> #include <limits> #include <t...
a.cc:55:19: warning: integer constant is so large that it is unsigned 55 | ll max = -9223372036854775808; | ^~~~~~~~~~~~~~~~~~~ a.cc: In function 'int main()': a.cc:59:13: error: 'amax' was not declared in this scope; did you mean 'max'? 59 | amax(max, temp); | ...
s012136182
p00439
C++
#include<map> #include<set> #include<list> #include<cmath> #include<queue> #include<stack> #include<cstdio> #include<string> #include<vector> #include<complex> #include<cstdlib> #include<cstring> #include<numeric> #include<sstream> #include<iostream> #include<algorithm> #include<functional> using namespace std; int mai...
a.cc: In function 'int main()': a.cc:28:22: error: 'S' was not declared in this scope 28 | cin>>S>>dat[i]; | ^
s661934077
p00439
C++
#include <iostream> #include <algorithm> using namespace std; int main () { int n, k, a[100000], i, S[100000],m; cin >> n >> k; for(I=0;i<n;i++) { cin >> a[i]; } for(i=0;i<n-k+1) { S[i]=S[i-1] - a[i-1] + a[i+k]; m = max(m,s[i]); } cout << m << endl; }
a.cc: In function 'int main()': a.cc:8:9: error: 'I' was not declared in this scope 8 | for(I=0;i<n;i++) { | ^ a.cc:11:20: error: expected ';' before ')' token 11 | for(i=0;i<n-k+1) { | ^ | ; a.cc:13:19: error: 's' was not declared in this s...
s113448125
p00439
C++
#include <iostream> #include <algorithm> using namespace std; int main () { int n, k, a[100000], i, S[100000],m; cin >> n >> k; for(i=0;i<n;i++) { cin >> a[i]; } for(i=0;i<n-k+1) { S[i]=S[i-1] - a[i-1] + a[i+k]; m = max(m,S[i]); } cout << m << endl; }
a.cc: In function 'int main()': a.cc:11:20: error: expected ';' before ')' token 11 | for(i=0;i<n-k+1) { | ^ | ;
s643880629
p00439
C++
#include<cstdio> int main() { int n,m,a[100008]; while(~scanf("%d%d",&n,&m)) { if(!n&&!m) break; for(int i=0;i<n;i++) scanf("%d",&a[i]); for(int i=0;i<m;i++) temp += a[i]; int sum = 0,cap = 0; for(int i=0;i<n;i++){ if(cap!=m){ sum += a[i]; cap++; } ...
a.cc: In function 'int main()': a.cc:10:30: error: 'temp' was not declared in this scope 10 | for(int i=0;i<m;i++) temp += a[i]; | ^~~~ a.cc:15:20: error: 'temp' was not declared in this scope 15 | if(sum>temp) temp=sum; | ^~~~ a.cc:1...
s855581972
p00439
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ int n, k; int a[100000]; int sum = 0; int Max = 0; while(true){ cin >> n >> k; if(n + k == 0){ for(int i = 0; i < n; i++){ cin >> a[i]; } for(int i = 0; i < n-k+1; i++){ sum = 0; for(int j = i; j < i+k; j++){ sum...
a.cc: In function 'int main()': a.cc:29:2: error: expected '}' at end of input 29 | } | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s348983790
p00439
C++
int main(){ int n,k; int sum1=0 , max = 0; int now = 0, nextdata, next; int* s; while(1){ sum1 = 0; max = 0; cin >>n >>k; if(n == 0) break; s = (int*)malloc(sizeof(int) * n); int data; for(int i = 0; i<k; i++){ cin >>data; s[i] = data; sum1 += data; } m...
a.cc: In function 'int main()': a.cc:9:5: error: 'cin' was not declared in this scope 9 | cin >>n >>k; | ^~~ a.cc:13:15: error: 'malloc' was not declared in this scope 13 | s = (int*)malloc(sizeof(int) * n); | ^~~~~~ a.cc:1:1: note: 'malloc' is defined in header '<cstdlib>';...
s848775065
p00439
C++
#include<iostream> using namespace std; int main(){ int n, k; double a[100001] = {}, b[100001] = {}, ans; cin >> n >> k; if (n == 0 || k == 0) break; for (int i = 1; i <= n; i++){ cin >> a[i]; } for (int i = 1; i <= n; i++){ for (int x = 0; x<k; x++){ if (a[i + k] == 0) break; b[i] = a[i + x...
a.cc: In function 'int main()': a.cc:7:41: error: break statement not within loop or switch 7 | if (n == 0 || k == 0) break; | ^~~~~
s288575177
p00439
C++
#include <iostream> using namespace std; int main() { int a[100000];int n,m;int b[100000];int p=0; cin >> n >> m; for(int i = 0;i<n;i++){ cin >> a[i]; } for(int i = 0;i<100000;i++){ b[i]=0; } for(int i = 0;i<n-m;i++){ if(a[i]>a[i+m]){ for(int k = i;k<i+m;k++){ b[p]+=a[k]; } p++; } } for(i...
a.cc: In function 'int main()': a.cc:28:18: error: expected '}' at end of input 28 | return 0; | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s863477213
p00439
C++
#include <stdio.h> int a[100000],e[100000]; int main(){ int b,c,d,f,g=-100000000; while(1){ scanf("%d %d",&c,&b); if(c==0){ return 0; } for(d=0;d<c;d++){ scanf("%d",a[i]); } for(d=0;d<c-b;d++){ for(f=0;f<b;f++){ e[d]+=a[f]; } } for(d=0;d<c-b;d++){ if(g<=e[d]){ g=e[d]; } } ...
a.cc: In function 'int main()': a.cc:12:38: error: 'i' was not declared in this scope 12 | scanf("%d",a[i]); | ^
s219326951
p00439
C++
#include <cstdio> #include <algorithm> #include <iostream> #include <vector> #include <string> #include <math.h> using namespace std; int main(){ cout >> "56\n788\n650404" ; return 0; }
a.cc: In function 'int main()': a.cc:11:14: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [14]') 11 | cout >> "56\n788\n650404" ; | ~~~~ ^~ ~~~~~~~~~~~~~~~~~ | | | | | const char [14] ...
s740581366
p00439
C++
#include<cstdio> int N,K; int a[100000]; int main() { scanf("%d%d",&N,&K); for(int i=0;i<N;i++)scanf("%d",&a[i]); int sum=0; for(int i=0;i<K;i++)sum+=a[i]; int ma=sum; for(int i=K;i<N;i++){ sum-=a[i-K]; sum+=a[i]; ma=max(ma,sum); } printf("%d\n",ma); ...
a.cc: In function 'int main()': a.cc:19:12: error: 'max' was not declared in this scope; did you mean 'ma'? 19 | ma=max(ma,sum); | ^~~ | ma
s552710904
p00439
C++
#include<iostream> using namespace std; int num[100100]; int main(){ int n,m; int ans=0; while(1){ for(int i=0;i<100100;i++)num[i]=0; cin>>n>>m; if(n==0&&m==0)break; for(int i=0;i<n;i++) cin>>num[i]; for(int i=0;i<m-n;i++){ int min=num[i]+num[i+1]+num[i+2]; ...
a.cc: In function 'int main()': a.cc:16:10: error: 'count' was not declared in this scope 16 | count<<ans<<endl; | ^~~~~
s844990817
p00439
C++
#include<iostream> using namespace std; int num[100100]; int main(){ int n,m; int ans=0; while(1){ for(int i=0;i<100001;i++){ num[i]=0; if(num[i+1]==0)braek; } cin>>n>>m; if(n==0&&m==0)break; for(int i=0;i<n;i++) cin>>num[i]; for(int i=0;...
a.cc: In function 'int main()': a.cc:10:30: error: 'braek' was not declared in this scope 10 | if(num[i+1]==0)braek; | ^~~~~
s795874981
p00439
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n, k; while(cin >> n >> k, n|k){ int ans, = 0, data[111111] = {}; for(int i=0;i<n;i++) cin >> data[i]; for(int i=1;i<n;i++) data[i] += data[i-1]; for(int i=0;i<n-k;i++) ans = max(ans, data[i+k] - data[i]); cout << a...
a.cc: In function 'int main()': a.cc:10:14: error: expected unqualified-id before '=' token 10 | int ans, = 0, data[111111] = {}; | ^ a.cc:11:37: error: invalid types '<unresolved overloaded function type>[int]' for array subscript 11 | for(int i=0;i<n;i++) cin >> data[i]; | ...
s783899589
p00439
C++
#include <iostream> #include <algorithm> int N = 1 << 17; int seg[N * 2]; void update(int x, int v) { x += N - 1; seg[x] = v; while (x) { x = (x - 1) / 2; seg[x] = seg[x + x + 1] + seg[x + x + 2]; } } int query(int a, int b, int x, int l, int r) { if (b <= l || r <= a) return 0; ...
a.cc:5:11: error: size of array 'seg' is not an integral constant-expression 5 | int seg[N * 2]; | ~~^~~ a.cc: In function 'int main()': a.cc:29:44: error: 'min' was not declared in this scope; did you mean 'std::min'? 29 | for (int i = 0; i < n - K; i++) mini = min(mini, Q(i, i + K)); | ...
s667948627
p00439
C++
include<iostream> #include<algorithm> using namespace std; int n, k ,i = 0, a[100000]; long long int b[100000]; long long int result[100][2]; int main() { for (;; i++) { cin >> n >> k; if (n == 0) { break; } for (int p = 0; p < n; p++) { cin >> a[p]; } for (int p = 0; p < n - k; p++) { ...
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __g...
s451365862
p00439
C++
#include <iostream> using namespace std; #define MAX_N 100010 int N, K; int S[MAX_N]; int main() { while (true) { cin >> N >> K; if (N == 0 && K == 0) break; int ans = INT_MIN; for (int i=0; i<N; i++) cin >> S[i]; for (int i=0; i<=N-K; i++) { int t = 0; for (int j=0; j<K; j++) t += S[i+j]; an...
a.cc: In function 'int main()': a.cc:12:13: error: 'INT_MIN' was not declared in this scope 12 | int ans = INT_MIN; | ^~~~~~~ a.cc:2:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #include <iostream> +++ |+#include <climits> ...
s252806169
p00439
C++
#include <iostream> #include <cstdlib> using namespace std; #define MAX_N 100010 int N, K; int S[MAX_N]; int main() { while (true) { cin >> N >> K; if (N == 0 && K == 0) break; int ans = INT_MIN; for (int i=0; i<N; i++) cin >> S[i]; for (int i=0; i<=N-K; i++) { int t = 0; for (int j=0; j<K; j++) ...
a.cc: In function 'int main()': a.cc:13:13: error: 'INT_MIN' was not declared in this scope 13 | int ans = INT_MIN; | ^~~~~~~ a.cc:3:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 2 | #include <cstdlib> +++ |+#include <climits> ...
s553823171
p00439
C++
#include <vector> #include <iostream> #include <utility> #include <algorithm> #include <string> #include <deque> #include <tuple> #include <queue> #include <functional> using namespace std; const int INF = 1 << 30; int main(){ int n, k; for (cin >> n >> k, n) { vector<int> a(n); for (int &x : a)cin >> x; int po...
a.cc: In function 'int main()': a.cc:14:30: error: expected ';' before ')' token 14 | for (cin >> n >> k, n) { | ^ | ; a.cc:29:9: error: expected primary-expression before 'return' 29 | return 0; | ^~~~~~ a.cc:28:1...
s291558117
p00439
C++
#include <iostream> using namespace std; int n; int a[100000]; int main() { cin >> n; static int ra[100001]; //ra[i] = a[0] + ??? + a[i-1] ra[0] = 0; for (int i = 0; i < n; i++) { ra[i+1] = ra[i] + a[i]; } int ans = -1000000001; for (int i = 0; i < n - k; i++) { //a[i] + ??? + a[i+k-1] ans = max(ans, r...
a.cc: In function 'int main()': a.cc:17:33: error: 'k' was not declared in this scope 17 | for (int i = 0; i < n - k; i++) { | ^
s492557011
p00439
C++
#include<cstdio> #include<utility> #include<algorithm> #define INF INT_MAX/2-1 #define rep(i,n) for(int i=0;i<n;i++) using namespace std; typedef long long ll; int a[100000]; int main(){ int n, k; while (scanf("%d%d", &n, &k), n){ rep(i, n) scanf("%d", &a[i]); int Max = -INF; rep(i, n - k + 1){ int sum =...
a.cc: In function 'int main()': a.cc:4:13: error: 'INT_MAX' was not declared in this scope 4 | #define INF INT_MAX/2-1 | ^~~~~~~ a.cc:15:28: note: in expansion of macro 'INF' 15 | int Max = -INF; | ^~~ a.cc:4:1: note: 'INT_MAX' is defined in head...
s966990613
p00439
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; int a[101010] = {0}; cin >> a[1]; for (int i = 2; i < n + 1; i++){ cin >> a[i]; a[i] += a[i - 1]; } int max_n = -1e9; for (int i = 0; i < n - k; i++){ max_n = max(max_n, a[k + i] - a[i]); } cout <<...
a.cc:27:5: error: redefinition of 'int main()' 27 | int main() | ^~~~ a.cc:4:5: note: 'int main()' previously defined here 4 | int main() | ^~~~
s109551160
p00439
C++
000 0 0 0
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 000 | ^~~
s831587368
p00439
C++
#include <iostream> #define r(i,n) for(int i=0;i<n;i++) using namespace std; int main(){ int a,b while(cin>>a>>b,a){ int c[a],w=0; r(i,a)cin>>c[i]; r(i,a-2)w=max(w,c[i]+c[i+2]+c[i+1]; cout<<w<<endl; } }
a.cc: In function 'int main()': a.cc:6:3: error: expected initializer before 'while' 6 | while(cin>>a>>b,a){ | ^~~~~
s673449815
p00439
C++
aaaaaaaaa
a.cc:1:1: error: 'aaaaaaaaa' does not name a type 1 | aaaaaaaaa | ^~~~~~~~~
s575891884
p00439
C++
aaaaaaaaa
a.cc:1:1: error: 'aaaaaaaaa' does not name a type 1 | aaaaaaaaa | ^~~~~~~~~
s797452188
p00439
C++
#include<iostream> using namespace std; int a[1000000] int main(){ int i,i2,n,k,a[5001],max=-100000000,sum; cin>>n>>k; while(n!=0){ for(i=1;i<=n;i++)cin>>a[i]; for(i=1;i<=n-k+1;i++){ sum=0; for(i2=i;i2<i+k;i2++)sum+=a[i2]; if(sum>max){ max=sum; } } cout<<max<<endl; cin>>n>>k; } } /*#includ...
a.cc:4:1: error: expected initializer before 'int' 4 | int main(){ | ^~~
s831183726
p00439
C++
#include<iostream> using namespace std; int a[1000000] int main(){ int i,i2,n,k,max=-100000000,sum; cin>>n>>k; while(n!=0){ for(i=1;i<=n;i++)cin>>a[i]; for(i=1;i<=n-k+1;i++){ sum=0; for(i2=i;i2<i+k;i2++)sum+=a[i2]; if(sum>max){ max=sum; } } cout<<max<<endl; cin>>n>>k; } } /*#include <stdio...
a.cc:4:1: error: expected initializer before 'int' 4 | int main(){ | ^~~
s408020795
p00439
C++
#include <string> #include <stdio.h> #include <queue> #include <stack> #include <math.h> using namespace std; int main(void) { for (;;) { int a,b,c,d,max=0; scanf("%d %d",&a,&b); int e[a]; if (a==0&&b==0) break; for (c=0;c<a;c++){ scanf("%d",&d); e[c]=d; } for (int f=0;f<=a-b;f++){ for (int g=1...
a.cc: In function 'int main()': a.cc:27:2: error: expected '}' at end of input 27 | } | ^ a.cc:8:1: note: to match this '{' 8 | { | ^
s082403343
p00439
C++
while 1: n,k = [int(i) for i in input().split()] if not n and k: break a = [int(input()) for i in range(n)] b = [0]*len(a) for i in range(n): b[i] = b[i-1] + a[i] b = b + [0] c = [b[i + k - 1] - b[i - 1] for i in range(n - k + 1)] print(max(c))
a.cc:1:1: error: expected unqualified-id before 'while' 1 | while 1: | ^~~~~
s236304606
p00439
C++
#include<iostream> using namespace std; int suretu[100000]; int cont = 0, max_sum = 0; int ret_maxsum(int n, int k, int wa ) { int temp = 0; int i; /* if(isBegin == 1){ for(i = 0; i < k; i++){ temp += suretu[cont+i]; } } */ else{temp += wa + suretu[cont+k-1];} wa = temp - suretu[cont]; cont++; if(max_...
a.cc: In function 'int ret_maxsum(int, int, int)': a.cc:17:9: error: 'else' without a previous 'if' 17 | else{temp += wa + suretu[cont+k-1];} | ^~~~ a.cc:22:31: error: too many arguments to function 'int ret_maxsum(int, int, int)' 22 | else{return ret_maxsum(n, k, wa, 0);} | ...
s819888402
p00439
C++
#include<iostream> using namespace std; int suretu[100000]; int cont = 0, max_sum = 0; int ret_maxsum(int n, int k, int wa ) { int temp = 0; int i; /* if(isBegin == 1){ for(i = 0; i < k; i++){ temp += suretu[cont+i]; } } */ else{temp += wa + suretu[cont+k-1];} wa = temp - suretu[cont]; cont++; if(max_...
a.cc: In function 'int ret_maxsum(int, int, int)': a.cc:17:9: error: 'else' without a previous 'if' 17 | else{temp += wa + suretu[cont+k-1];} | ^~~~ a.cc: At global scope: a.cc:24:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 24 | main() | ^~~~
s956998005
p00439
C++
#include<iostream> main(){for(intn,k,a[100000],s,M,i;std::cin>>n>>k,n;printf("%d\n",M))for(M=1<<31,i=s=0;i<n;s+=a[i++],k<i&&(s-=a[ik-1]),M<s&&(M=s))std::cin>>a[i];}
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 2 | main(){for(intn,k,a[100000],s,M,i;std::cin>>n>>k,n;printf("%d\n",M))for(M=1<<31,i=s=0;i<n;s+=a[i++],k<i&&(s-=a[ik-1]),M<s&&(M=s))std::cin>>a[i];} | ^~~~ a.cc: In function 'int main()': a.cc:2:12: error: 'intn' was not de...
s930963438
p00439
C++
#include <cstdio> #define MAX(x, y) (x < y) ? y : x int main(void) { int n, k; int data[100000] = {0}; while (1){ scanf("%d %d", &n, &k); if (n == 0 && k == 0) break; for (int i = 0; i < n; i++){ scanf("%d", &data[i]); } for (int i = 0; i < n - 1; i++){ if (data[j] < 0) data[j] *= 2; } ...
a.cc: In function 'int main()': a.cc:18:34: error: 'j' was not declared in this scope 18 | if (data[j] < 0) data[j] *= 2; | ^
s829145613
p00439
C++
#include <cstdio> #define MAX(x, y) (x < y) ? y : x int main(void) { int n, k; int data[100000] = {0}; while (1){ scanf("%d %d", &n, &k); if (n == 0 && k == 0) break; for (int i = 0; i < n; i++){ scanf("%d", &data[i]); } for (int i = 0; i < n - 1; i++){ if (data[j] < 0) data[j] *= 2; } ...
a.cc: In function 'int main()': a.cc:18:34: error: 'j' was not declared in this scope 18 | if (data[j] < 0) data[j] *= 2; | ^
s623208025
p00439
C++
#include <iostream> using namespace std; int main(){ int n,k,max,buf,*a; while(1){ cin >> n >> k; if(n || k){ max = 0; a = new int[n]; for(int i = 0; i < n; i++){ cin >> a[i]; } for(int i = 0; i <= n-k; i++){ buf = 0; for(int j = 0; j < k; j++){ buf += a[i+j]...
a.cc: In function 'int main()': a.cc:35:2: error: expected '}' at end of input 35 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s016990413
p00439
C++
import java.util.ArrayDeque; import java.util.Deque; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); while (in.hasNext()) { final int n = in.nextInt(); final int k = in.nextInt(); if (n == 0 && k == 0) { throw new RuntimeExceptio...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.ArrayDeque; | ^~~~~~ 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.util.Deque; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules...
s624148922
p00439
C++
#include <vector> #include <map> #include <set> #include <stack> #include <queue> #include <deque> #include <algorithm> #include <utility> #include <functional> #include <sstream> #include <iostream> #include <cstdio> #include <cmath> #include <cstdlib> #include <cctype> #include <string> #include <cstring> #include <c...
a.cc: In function 'int main()': a.cc:48:19: error: '_UI64_MAX' was not declared in this scope; did you mean 'UINT_MAX'? 48 | result = -_UI64_MAX; | ^~~~~~~~~ | UINT_MAX
s911340724
p00439
C++
#include <stdio.h> int main(){ while(1){ int k,n,i,x[100000]; long long int max,sum=0; scanf("%d%d",&n,&k); if(n==0 && k==0) break; for(i=0;<n;i++){ scanf("%d",&x[i]); } for(i=0;i<k;i++){ sum+=x[i]; } max=sum; for(i=1;i<=n-k;i++){ for(j=i;j<i+k;j++){ sum=0; sum+=x[j]; } if(max<sum) max=sum; } printf("%lld\n",max); retu...
a.cc: In function 'int main()': a.cc:8:9: error: expected primary-expression before '<' token 8 | for(i=0;<n;i++){ | ^ a.cc:16:5: error: 'j' was not declared in this scope 16 | for(j=i;j<i+k;j++){ | ^ a.cc:24:2: error: expected '}' at end of input 24 | } | ^ a.cc:2:11: note: to ...
s766249819
p00439
C++
#include <stdio.h> int main(){ int n,k,i,max=0; int x[100001]; scanf("%d %d",&n,&k); for(i=0;i<n;i++)[ scanf("%d",&x[i]); } for(i=0;i<k;i++){ max+=x[i]; } for(i=0;i<n-k;i++){ if(x[i]<x[i+k]){ max-=x[i]; max+=x[i+k]; }} printf("%d\n",max); return 0; }
a.cc: In function 'int main()': a.cc:7:25: error: expression list treated as compound expression in initializer [-fpermissive] 7 | scanf("%d",&x[i]); | ^ a.cc:7:26: error: expected ',' before ';' token 7 | scanf("%d",&x[i]); | ^ ...
s999369769
p00439
C++
#include<string> #include<vector> #include<algorithm> #include<queue> using namespace std; int main() { int n, k, num, ans, sam; while(cin >> n >> k) { queue<int> que; ans = 0; sam = 0; for(int i = 0; i < n; i++) { cin >> num; que.push(num); sam += num; if(que.size() == 3 ) { if(ans ...
a.cc: In function 'int main()': a.cc:12:15: error: 'cin' was not declared in this scope 12 | while(cin >> n >> k) | ^~~ a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 4 | #include<queue> +++ |+#include <iostream...
s434096182
p00439
C++
const int MAX_N = 1 << 17, INF = 1 << 24; class BIT{ public: BIT(int _n) :n(_n){ std::fill(bit, bit+n, 0); } int sum(int i){ int s = 0; while(i > 0){ s += bit[i]; i -= i & -i; } return s; } int add(int i, int x){ while(i <= n){ bit[i] += x; i += i & -i; } } private: int bit[MAX_N], n;...
a.cc: In constructor 'BIT::BIT(int)': a.cc:6:22: error: 'fill' is not a member of 'std' 6 | std::fill(bit, bit+n, 0); | ^~~~ a.cc: In member function 'int BIT::add(int, int)': a.cc:21:9: warning: no return statement in function returning non-void [-Wreturn-type] 21 | ...
s447660166
p00439
C++
#include <iostream> #include <queue> #include <cctype> #include <stdio.h> #include <map> #include <string.h> using namespace std; int main(int argc, char const* argv[]) { int n,k; while (cin >> n >> k) { if (n == 0 && k==0) { break; } vector<int> vec(n); ...
a.cc: In function 'int main(int, const char**)': a.cc:41:9: error: 'sort' was not declared in this scope; did you mean 'short'? 41 | sort(sum.begin(), sum.end() , greater<int>() ); | ^~~~ | short
s514453653
p00439
C++
#include <iostream> #include <queue> #include <cctype> #include <stdio.h> #include <map> #include <string.h> using namespace std; int main(int argc, char const* argv[]) { int n,k; while (cin >> n >> k) { if (n == 0 && k==0) { break; } vector<int> vec(n); ...
a.cc: In function 'int main(int, const char**)': a.cc:41:9: error: 'sort' was not declared in this scope; did you mean 'short'? 41 | sort(sum.begin(), sum.end() , greater<int>() ); | ^~~~ | short
s163336465
p00439
C++
#include <iostream> #include <algorithm> #include <string> #include <vector> #define rep(i, a, b) for(int i = (a); (i) < (b); i++) using namespace std; int main() { int n, k; while(cin >> n >> k, n) { vector<int> num; int tmp; rep(i, 0, n) { cin >> tmp; num.push_back(tmp); } int s = 0; rep(i, 1,...
a.cc: In function 'int main()': a.cc:31:17: error: 's' was not declared in this scope 31 | cout << s << endl; | ^
s899115961
p00439
C++
#include <iostream> #include <vector> #include <algorithm> #include <utility> #include <string> #include <sstream> #include <cstring> #include <cstdio> #include <cstdlib> #include <cmath> #include <cctype> #include <queue> #include <stack> #include <map> #include <set> #include <bitset> #define rep(i, n) for(int i = 0...
a.cc: In function 'int main()': a.cc:39:20: error: 'INT_MAX' was not declared in this scope 39 | int ans = -INT_MAX; | ^~~~~~~ a.cc:17:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 16 | #include <bitset> +++ |+#inclu...
s514284818
p00439
C++
import sys #fp = open("input.txt", "r") fp = sys.stdin while True: req = map(int, fp.readline()[:-1].split(" ")) if req[0] + req[1] == 0: break n = req[0] k = req[1] sum_max = 0 num_list = [] for i in xrange(n): num = int(fp.readline()[:-1]) num_list.append(n...
a.cc:3:2: error: invalid preprocessing directive #fp 3 | #fp = open("input.txt", "r") | ^~ a.cc:1:1: error: 'import' does not name a type 1 | import sys | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s871942963
p00440
Java
public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int flagN = in.nextInt(); int flagK = in.nextInt(); while ((flagN != 0) && (flagK != 0)) { final int k = flagK; boolean has0 = false; NumTree nums = null; for (int i = 0; i < k; i++) { int num = in...
Main.java:3: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s814686119
p00440
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); while (in.hasNext()) { int flagN = Integer.parseInt(in.next()); int flagK = Integer.parseInt(in.next()); if (flagN == 0) { break; } int k = flagK; int[] array = new int...
Main.java:77: error: reached end of file while parsing } ^ 1 error
s357903563
p00440
Java
public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); while (in.hasNext()) { int flagN = Integer.parseInt(in.next()); int flagK = Integer.parseInt(in.next()); if (flagN == 0) { break; } int k = flagK; int[] array = new int[flagK]; boolean has0 = ...
Main.java:3: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s862511661
p00440
Java
import java.util.Scanner; public class Main2 { /** * @param args */ public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner sc=new Scanner(System.in); for(;;){ int n = sc.nextInt(),k=sc.nextInt(); if(n+k==0)break; int[] a = new int[n+1]; int[] b = new int[n+2]; int[] ...
Main.java:3: error: class Main2 is public, should be declared in a file named Main2.java public class Main2 { ^ 1 error
s680665115
p00440
C
#include <cstdio> using namespace std; void CheckLongest(int& longest, int i, int j) { if (longest < j - i + 1){ longest = j - i + 1; //printf("length:%d\n\n", longest); } } int main() { int n; int k; while (scanf("%d %d", &n, &k) * n != 0){ char card[100005] = {0}; ...
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s296997108
p00440
C
#include <iostream> #include <algorithm> using namespace std; int main(){ while (1){ int n, k, a[100000] = {}, sam, b[1000] = {}, roop = 0, save[1000] = {0}, ans[1000] = {}, w = 0; cin >> n >> k; if (n == 0 || k == 0) break; for (int i = 0; i<k; i++){ cin >> a[i]; } sort(a, a + k); for (int i = 0;...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s557636552
p00440
C++
while(n,k=gets.split.map &:to_i)[0]>0 l=(1..k).map{gets.to_i}.sort d=l.each_cons(2).map{|i,j|"#{j-i}"}*"" r=l[0]>0?/1+/:/1+21*|1*21+|1+/ p d.scan(r).map(&:size).max+1 end
a.cc:2:4: error: too many decimal points in number 2 | l=(1..k).map{gets.to_i}.sort | ^~~~ a.cc:1:1: error: expected unqualified-id before 'while' 1 | while(n,k=gets.split.map &:to_i)[0]>0 | ^~~~~ a.cc:2:24: error: expected unqualified-id before '.' token 2 | l=(1..k).map{gets.to_i}.sort ...
s078513002
p00440
C++
#include<iostream> #include<algorithm> #include<functional> using namespace std; int main() { while(1){ int n,k; cin>>n>>k; if(!n&&!k){break;} else{ int *a; a=new int[k]; for(int i=0;i<k;i++){ cin>>a[i]; } sort(a,a+k); int lx=0,l=1; if(a[0]){ ...
a.cc: In function 'int main()': a.cc:56:12: error: expected '}' at end of input 56 | return 0; | ^ a.cc:8:1: note: to match this '{' 8 | { | ^
s093114651
p00440
C++
while True: n, k = map(int, raw_input().split()) if n==0: break t = [0]*(n+2) for i in xrange(k): t[input()] += 1 for i in xrange(2,n+1): if t[i] > 0: t[i] += t[i-1] ans = 0 if t[0]==0: for x in t: if ans < x: ans = x else: nt = [] ...
a.cc:1:1: error: expected unqualified-id before 'while' 1 | while True: | ^~~~~
s202030897
p00440
C++
#include<stdio.h>;main(){printf("7\n11\n53\n");}
a.cc:1:18: warning: extra tokens at end of #include directive 1 | #include<stdio.h>;main(){printf("7\n11\n53\n");} | ^ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returne...
s477601978
p00440
C++
#include <iostream> #include <cstring> using namespace std; #define rep1(i,x) for(int i=1;i<=(x);++i) int a[MAX_N + 1]; int memo[MAX_N + 1]; int start[MAX_N + 1]; int main() { int N, K; while (cin >> N >> K, N || K) { memset(a, 0, sizeof(a)); memset(memo, 0, sizeof(memo)); memset(start, 0, sizeof(start)); ...
a.cc:8:7: error: 'MAX_N' was not declared in this scope 8 | int a[MAX_N + 1]; | ^~~~~ a.cc:9:10: error: 'MAX_N' was not declared in this scope 9 | int memo[MAX_N + 1]; | ^~~~~ a.cc:10:11: error: 'MAX_N' was not declared in this scope 10 | int start[MAX_N + 1]; | ^~~...
s302706117
p00440
C++
#include <iostream> #include <algorithm> #include <vector> #include <cstdio> #include <cstdlib> #include <set> using namespace std; #define rep(i,n) for(int i=0;i<(n);i++) #define reps(i,f,n) for(int i=(f);i<(n);i++) int main(void){ while(1){ int n, k, ans = 0; cin >> n >> k; if(n == 0 && ...
a.cc: In function 'int main()': a.cc:39:33: error: expected primary-expression before '?' token 39 | if(flag == true???&& rennkekanouflag = true;){ | ^ a.cc:39:34: error: expected primary-expression before '?' token 39 | if(flag == true???&& re...
s221135452
p00440
C++
#include <iostream> #include <algorithm> #include <vector> #include <cstdio> #include <cstdlib> #include <set> using namespace std; #define rep(i,n) for(int i=0;i<(n);i++) #define reps(i,f,n) for(int i=(f);i<(n);i++) int main(void){ while(1){ int n, k, ans = 0; cin >> n >> k; if(n == 0 && ...
a.cc: In function 'int main()': a.cc:40:33: error: expected primary-expression before '?' token 40 | if(flag == true???&& rennketukanouseiflag == true){ | ^ a.cc:40:34: error: expected primary-expression before '?' token 40 | if(flag == true???...
s876991756
p00440
C++
7 5 6 2 4 7 1 7 5 6 2 0 4 7 0 0
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 7 5 | ^
s304171494
p00440
C++
888B 48B #include <bits/stdc++.h> using namespace std; #define loop(i,n) for(int i=0;i<n;i++) struct R {int from,to,len;}; vector<int> c; vector<R> s; int main(){ int n,k,t; bool b; while(cin>>n>>k,n){ b=0; c.clear(); loop(_,k){ cin>>t; if(!t)b=1; else c.push_back(t); } sort...
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 888B 48B | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc...
s235193553
p00440
C++
#include<iostream> #include<stdio.h> #include<string> #include<math.h> #include<iomanip> #include<algorithm> #include<string.h> #include<cctype> #include<map> #include<set> #include<vector> #include<sstream> #include<stack> #include<queue> using namespace std; int arr[100000+5]={0}; int main()...
a.cc: In function 'int main()': a.cc:83:26: error: 'black_num' was not declared in this scope; did you mean 'blank_num'? 83 | if((blank_num==1||black_num==2)&&(!flag_2)) sum1=0; | ^~~~~~~~~ | blank_num
s738624528
p00440
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i, j, k) for(int i = j; i < k; ++i) #define rep(i, j) FOR(i, 0, j) #define repr(i, j) for(int i = j; i >= 0; --i) #define INF (1 << 30) #define MOD 1e9 + 7 typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> P; int N, K; bool card[...
a.cc: In function 'int main()': a.cc:53:32: error: 'i' was not declared in this scope 53 | maxi = i - (mini) - 1; | ^
s987562797
p00440
C++
#include <iostream> #include <cstdlib> using namespace std; int main(int argc, char **argv) { int k, n, a[100001], s, t, p, q, r, j; while(1){ cin >> n >> k; if(n == 0 && k == 0){ break; } for(int i = 0; i < k; i++){ cin >> a[i]; } sort(a, a+k); for(int i = 0; i < k; i++)...
a.cc: In function 'int main(int, char**)': a.cc:19:5: error: 'sort' was not declared in this scope; did you mean 'short'? 19 | sort(a, a+k); | ^~~~ | short
s284487362
p00440
C++
#include<iostream> #include<vector> using namespace std; vector<int> cards; int MAX = 0; int cont = 0; int flg = false; int use = false; void saiki(int now_card); int main() { for(;;){ int n, k, temp; int cont = 0; cards.clear(); cin >> n; cin >> k; if(n == 0 && k == 0){ break; } for(i...
a.cc: In function 'int main()': a.cc:35:17: error: 'sort' was not declared in this scope; did you mean 'short'? 35 | sort(cards.begin(), cards.end()); | ^~~~ | short
s910243522
p00440
C++
#include<cstdio> #include<cstring> #define ma(a,b) (a>b?a:b) int main(){ int k[100001],a,b,table[2][100001]; memset(k,0,sizeof(k)); memset(table,0,sizeof(table)); while(scanf("%d%d",&a,&b),a,b){ for(int i=0;i<b;i++){ int c; scanf("%d",&c);k[c]=1; } int res=0; for(int i=1;i<=a;i++){ if(k[i]){ t...
a.cc: In function 'int main()': a.cc:23:37: error: 'max' was not declared in this scope; did you mean 'ma'? 23 | res=max(res,max(table[0][i],table[1][i])); | ^~~ | ma a.cc:23:29: error: 'max' was not declared ...
s354261113
p00440
C++
1>------ ビルド開始: プロジェクト: AOJ, 構成: Debug Win32 ------ 1> 0517.cpp 1> AOJ.vcxproj -> C:\Users\ちきんぐ\documents\visual studio 2010\Projects\AOJ\Debug\AOJ.exe ========== ビルド: 1 正常終了、0 失敗、0 更新不要、0 スキップ ==========
a.cc:3:22: error: stray '\' in program 3 | 1> AOJ.vcxproj -> C:\Users\ちきんぐ\documents\visual studio 2010\Projects\AOJ\Debug\AOJ.exe | ^ a.cc:3:28: error: stray '\' in program 3 | 1> AOJ.vcxproj -> C:\Users\ちきんぐ\documents\visual studio 2010\Projects\AOJ\Debug\AOJ.exe | ...
s589731138
p00440
C++
#include <cstdio> #include <algorithm> #include <vector> using namespace std; struct Cards { int start,end; Cards(int _start,int _end) {start=_start,end=_end;} }; vector<Cards> cards; int card[100000]; int main() { int n,k,i,j; bool blank; while(scanf("%d %d",&n,&k),n|k) { memset(card,0,sizeof(card)); cards.c...
a.cc: In function 'int main()': a.cc:15:17: error: 'memset' was not declared in this scope 15 | memset(card,0,sizeof(card)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <vector> ++...
s073366239
p00440
C++
#include<iostream> using namespace std; int N,K; int data[100001]; int taba[100001]; //最初から連続して並んでいる数字の数 int main(){ int i,num; int max[1000]; int mcor = 0; while(1){ cin >> N >> K; if(N == 0 && K == 0) break; for(i = 0;i < K;i++){ cin >> num; data[num] = 1; } int tcor,count; tcor = 0; coun...
a.cc: In function 'int main()': a.cc:18:25: error: reference to 'data' is ambiguous 18 | data[num] = 1; | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/incl...