submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s928598664
p01139
Java
import java.io.IOException; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); while (true) { final int w = sc.nextInt(); final int h = sc.nextInt(); if (w == 0 && h == 0) { break; } int[][] map = ne...
Main.java:253: error: reached end of file while parsing } ^ 1 error
s115420429
p01139
Java
import java.util.*; public class Main { int w, h, count, cb, cw; int[][] map; boolean black, white; public void func(){ for(int i=0;i<h;i++){ for(int j=0;j<w;j++){ if(map[i][j]==0){ count = 0; black = true; white = true; loop(i, j); if(black==false && white==true){ cb += ...
Main.java:48: error: cannot find symbol AOJ_2014 A = new AOJ_2014(); ^ symbol: class AOJ_2014 location: class Main Main.java:48: error: cannot find symbol AOJ_2014 A = new AOJ_2014(); ^ symbol: class AOJ_2014 location: class Main 2 errors
s238463556
p01139
C
#include <stdio.h> char map[50][50]; //map[h][w] int w,h; void scanmap(){ int i; for(i=0;i<h;i++){ scanf("%s",map[i]); } } void wpaint(int a,int b){ if(a>0 && map[a-1][b] == '.'){ map[a-1][b] = 'w'; wpaint(a-1,b); } if(b>0 && map[a][b-1] == '.'){ map[a][b-1] = 'w'; wpaint(a,b-1); } if(a<h && map[a+...
main.c: In function 'main': main.c:120:30: error: 'b' undeclared (first use in this function) 120 | if(w == 0 && b == 0) break; | ^ main.c:120:30: note: each undeclared identifier is reported only once for each function it appears in
s719689920
p01139
C
#include <cstdio> #include <iostream> #include <string> using namespace std; int a[51][51],w,h,c; bool f; void visit(int i,int j,int bw){ a[i][j] = 3; c++; int di[4] = {1,0,-1,0}; int dj[4] = {0,1,0,-1}; for(int t=0;t<4;t++){ int vi = i + di[t]; int vj = j + dj[t]; if(bw == 1){ if(a[vi][vj]...
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s265553176
p01139
C++
#include<bits/stdc++.h> using namespace std; typedef pair<int,int> P; int dxy[4] = {-1, 1, 0, 0}; int W, H; char a[60][60]; int temp[4][60][60]; void huga(int y, int x, int Z){//cout<<y<<" "<<x<<endl; int w = 0, b = 0, s = 0, ans=-3, t; queue <P> Q; Q.push(P(y,x)); while(!Q.empty()){ P p = Q.front();Q.pop(...
a.cc: In function 'int main()': a.cc:42:97: error: 's0' was not declared in this scope; did you mean 'y0'? 42 | temp[0][i][j] = temp[1][i][j] = temp[2][i][j] = temp[3][i][j] = s0; | ^...
s779585955
p01139
C++
k
a.cc:1:1: error: 'k' does not name a type 1 | k | ^
s417288892
p01139
C++
あ
a.cc:1:1: error: '\U00003042' does not name a type 1 | あ | ^~
s971543793
p01139
C++
#include <iostream> #include <algorithm> using namespace std; int w,h; char tbl[60][60]; bool f[2][60][60]; int dx[] = {0,1,0,-1}; int dy[] = {1,0,-1,0}; void dfs(int x,int y,int c){ f[c][y][x]=true; for(int i=0;i<4;++i){ int mx = x+dx[i]; int my = y+dy[i]; if(mx<0 || my<0) continue; if(mx>=w || my>...
a.cc: In function 'int main()': a.cc:24:5: error: 'memset' was not declared in this scope 24 | memset(f,0,sizeof(f)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <algorithm> +++ |+#include <cstring> 3...
s131479417
p01139
C++
#include<iostream> #include<queue> using namespace std; struct data { int x; int y; }; struct mapData { int black = 0; int white = 0; }; int main() { int w, h; int dx[4] = {1,0,-1,0}; int dy[4] = {0,1,0,-1}; while (cin >> w >> h && w != 0 || h != 0) { char map[50][50]; for (int i = 0; i < h; i++) { ci...
a.cc: In function 'int main()': a.cc:43:43: error: template argument 1 is invalid 43 | queue<data> q; | ^ a.cc:43:43: error: template argument 2 is invalid a.cc:44:33: error: reference to 'data' is ambiguous 44 | ...
s668685345
p01139
C++
#include <iostream> #include <algorithm> #include <vector> #include <stack> #include <queue> #include <map> #include <cmath> #include <string> #include <sstream> #include <iomanip> #include <complex> using namespace std; #define ll long long #define vvi vector< vector<int> > #define vi vector<int> #define All(X) X.beg...
a.cc: In function 'int dfs(int, int, char)': a.cc:42:32: error: too few arguments to function 'int dfs(int, int, char)' 42 | else return dfs(nx,ny); | ~~~^~~~~~~ a.cc:35:5: note: declared here 35 | int dfs(int px, int py,char c){ | ^~~ a.cc: In function ...
s114225208
p01139
C++
#include <iostream> using namespace std; int w,h,c1,c2,b,d; char a[51][51]; int dfs(int i,int j){ if(i==h||j==w||i<0||j<0||a[i][j]=='#')return 0; if(a[i][j]=='W'){d++;return 0;} else if(a[i][j]=='B'){b++;return 0;} int s=1; a[i][j]='#'; s+=dfs(i+1,j); s+=dfs(i-1,j); s+=dfs(i,j+1); s+=dfs(i,j-1); ret...
a.cc: In function 'int main()': a.cc:21:31: error: invalid operands of types 'const char [3]' and 'char [51]' to binary 'operator&' 21 | for(i=0;i<h;i++)scanf("%c"&a[i]); | ~~~~^~~~~ | | | | | char [51] ...
s768951205
p01139
C++
#include <iostream> #include <cstdio> #include <cmath> #include <string> #include <vector> #include <set> #include <map> #include <algorithm> #define CH(N,A,B) (A<=N&&N<B) #define REP(i,a,b) for(int i=a;i<b;i++) #define RREP(i,a,b) for(int i=(b-1);a<=i;i--) using namespace std; int dx[] = {1, 0, -1, 0}; int dy[] = {...
a.cc: In function 'int main()': a.cc:47:5: error: 'memset' was not declared in this scope 47 | memset(grand, 0, sizeof(grand)); | ^~~~~~ a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 8 | #include <algorithm> +++ |+#include <cstr...
s700031342
p01139
C++
#include<iostream> #include<algorithm> #include<stack> #include<queue> #include<string> #include<string.h> #include<functional> using namespace std; #define INF 1<<21 #define DIV 1000000007 typedef pair<int, int>P; int w, h; int cnt; char f[51][51]; int dx[] = { 1,-1,0,0 }, dy[] = { 0,0,1,-1 }; void rec(int x, int...
a.cc:84:3: error: expected unqualified-id before 'return' 84 | return 0; | ^~~~~~ a.cc:85:1: error: expected declaration before '}' token 85 | } | ^
s450467355
p01139
C++
#include<iostream> #include<algorithm> #include<stack> #include<queue> #include<string> #include<string.h> #include<functional> using namespace std; #define INF 1<<21 #define DIV 1000000007 typedef pair<int, int>P; int w, h; int cnt; char f[51][51]; int dx[] = { 1,-1,0,0 }, dy[] = { 0,0,1,-1 }; void rec(int x, int...
a.cc:84:3: error: expected unqualified-id before 'return' 84 | return 0; | ^~~~~~ a.cc:85:1: error: expected declaration before '}' token 85 | } | ^
s353356028
p01139
C++
#include <iostream> #include <map> using namespace std; int w, h; char mas[50][50]; int vb[50][50], vw[50][50]; map< char, int > c; static int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1}; void rec(int y, int x, int color) { if(!(0 <= x && x < w && 0 <= y && y < h)) return; if(color != c[mas[y][x]] && mas[y][...
a.cc: In function 'int main()': a.cc:30:9: error: 'memset' was not declared in this scope 30 | memset(vb, 0, sizeof(vb)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <map> +++ |+#include <cstring>...
s537867093
p01139
C++
#include <bits/stdc++.h> using namespace std; int dx[] = {1,0,-1,0}; int dy[] = {0,1,0,-1}; struct lattice{ bool wallB,wallW,black,white; }; struct zahyou{ int x; int y; }; int main() { vector<int> ans_B,ans_W; while(1){ int w,h; char a; cin >> w >> h; if(!w && !h)break; vector<vector<...
a.cc:122:1: error: expected unqualified-id before numeric constant 122 | 44 15 | ^~
s308435455
p01139
C++
#include <iostream> #include <cstdio> #include <queue> using namespace std; char field[52][52]; bool black[52][52]; bool white[52][52]; typedef pair<int, int> p; int t_x[] = {1, 0, -1, 0}; int t_y[] = {0, 1, 0, -1}; void search(int h, int w) { char c = field[h][w]; queue<p> que; que.push( p(h, w) ); while ...
a.cc: In function 'int main()': a.cc:60:5: error: 'memset' was not declared in this scope 60 | memset(field, '#', sizeof field); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <queue> +++ |+#include <cstring...
s744387040
p01139
C++
#include<iostream> #include<cstdio> using namespace std; char d[50][60]; bool w[50][50]; bool b[50][50]; int ww,hh; const int dx[4] = {1,-1,0,0}; const int dy[4] = {0,0,1,-1}; #define REP(i,n) for(int i = 0; i<(n); i++) void dfsw(int y, int x){ w[y][x] == true; REP(i,4){ int xx = x + dx[i]; int yy = y ...
a.cc: In function 'int main()': a.cc:45:5: error: 'memset' was not declared in this scope 45 | memset(w,0,sizeof(w)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<cstdio> +++ |+#include <cstring> 3 |
s252835009
p01139
C++
#include <string> #include <cstring> #include <cstdio> #include <vector> using namespace std; typedef vector<pair<int,int> >vpii; char m[99][99]; char dfs(int i, int j, vpii&v){ if(m[i][j]=='B')return 1; if(m[i][j]=='W')return 2; if(m[i][j]=='X')return 0; int ret=0; v.push_back(make_pair(i,j)); if(find(v.begin(...
a.cc: In function 'char dfs(int, int, vpii&)': a.cc:16:12: error: 'find' was not declared in this scope 16 | if(find(v.begin(),v.end(),make_pair(i-1,j))==v.end())ret|=dfs(i-1,j,v); | ^~~~ a.cc:17:12: error: 'find' was not declared in this scope 17 | if(find(v.begin(),v.end(),make_...
s404911737
p01139
C++
#include <stdio.h> #include <queue> using namespace std; int main(void){ int black[50][50], white[50][50], h, w, i, j, k, x, y, bc, wc; char field[50][51]; const int dx[4] = {1,0,-1,0},dy[4] = {0,1,0,-1}; queue<int> qx,qy; scanf("%d%d%*c",&w,&h); while(w != 0 || h != 0){ memset(black,0,sizeof(black)); memse...
a.cc: In function 'int main()': a.cc:13:17: error: 'memset' was not declared in this scope 13 | memset(black,0,sizeof(black)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <queue> +...
s765687095
p01139
C++
#include "iostream" #include "vector" #include "string" #include "queue" using namespace std; int dx[4]={1,0,-1,0}; int dy[4]={0,1,0,-1}; bool black[50][50],white[50][50]; int main(void) { int w,h; while (cin>>w>>h,w) { memset(black,0,sizeof(black)); memset(white,0,sizeof(white)); vector<string> in; for (int ...
a.cc: In function 'int main()': a.cc:13:17: error: 'memset' was not declared in this scope 13 | memset(black,0,sizeof(black)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include "queue" +...
s462249619
p01139
C++
#include<iostream> #define rep(i,n) for(int i=0;i<n;i++) using namespace std; int w,h; string grid[55],col[55]; bool vis[55][55]; int dy[] = {-1,0,1,0}, dx[] = {0,1,0,-1}; int count(char color){ int res = 0; rep(i,h)rep(j,w)if(col[i][j]==color)res++; return res; } void rec(int y,int x,int color){ if(vis[y][x...
a.cc: In function 'int main()': a.cc:44:11: error: 'memset' was not declared in this scope 44 | memset(vis,0,sizeof(vis)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include ...
s598924866
p01139
C++
#include<cstdio> #include<iostream> #define W_MAX 50 #define H_MAX 50 using namespace std; int map[H_MAX][W_MAX]; int zyo[H_MAX][W_MAX]; int w,h; int flag; void solve(int H,int W){ int dx[4]={-1,1,0, 0}; int dy[4]={ 0,0,1,-1}; /*cout<<H<<","<<W<<","<<map[H][W]<<","<<zyo[H][W]<<","<<flag<<endl;*/ for(int a=0;a<...
a.cc: In function 'int main()': a.cc:44:25: error: 'memset' was not declared in this scope 44 | memset(map,-1,sizeof(map)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #includ...
s845209341
p01139
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(n);i++) int dx[] = {0,1,0,-1}; int dy[] = {1,0,-1,0}; int w,h; vector<string> ss; bool write[52][52]; bool black[52][52]; void dfs(int x_,int y_,bool (*f_)[52],bool f2) { //cout<<x_<<","<<y_<<endl; if(f_[x_][y_]||(ss[x_][y_]!='.'&&...
a.cc:10:18: error: 'bool write [52][52]' redeclared as different kind of entity 10 | bool write[52][52]; | ^ In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24, from /usr/include/signal.h:328, from /usr/include/c++/14/csignal:42, ...
s526172728
p01140
Java
#include <algorithm> #include <cmath> #include <climits> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #include <cassert> #include <func...
Main.java:1: error: illegal character: '#' #include <algorithm> ^ Main.java:2: error: illegal character: '#' #include <cmath> ^ Main.java:3: error: illegal character: '#' #include <climits> ^ Main.java:4: error: illegal character: '#' #include <cstdio> ^ Main.java:5: error: illegal character: '#' #include <cstdlib> ^ M...
s718859484
p01140
Java
import java.util.*; import java.io.*; import java.awt.geom.*; import java.math.*; public class AOJ2015 { static final Scanner in = new Scanner(System.in); static final PrintWriter out = new PrintWriter(System.out,false); static int[] cnth = new int[1500001]; static int[] cntw = new int[1500001]; static boolean...
Main.java:6: error: class AOJ2015 is public, should be declared in a file named AOJ2015.java public class AOJ2015 { ^ 1 error
s238592924
p01140
Java
import java.util.HashMap; import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n, m; while ((n = in.nextInt()) != 0 & (m = in.nextInt()) != 0) { HashMap<Integer, Integer> hmap = new Hash...
Main.java:42: error: reached end of file while parsing } ^ 1 error
s943238237
p01140
Java
import java.util.*; public class Square_Route { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true) { int n = sc.nextInt(); int m = sc.nextInt(); if (n == 0 && m == 0) break; int[] h = new int[n]; int[] w = new int[m]; // int[] y = new int[1500001]; L...
Main.java:3: error: class Square_Route is public, should be declared in a file named Square_Route.java public class Square_Route { ^ 1 error
s151987536
p01140
C
#include <stdio.h> int main(){ int N,M,i,j,k,l,a,h[i],w[i],s,t,x; x=0; scanf("%d %d",&N,&M); while (N!==0 && M!==0) { for (i=0;i<N;i++) { scanf("%d",&h[i]); } for (i=0;i<M;i++){ scanf("%d",&w[i]); } for (i=0;i<N;i++) { for (j=i;j<N;j++) { for(k=0;...
main.c: In function 'main': main.c:7:15: error: expected expression before '=' token 7 | while (N!==0 && M!==0) { | ^
s189027007
p01140
C
#import<cstdio> #import<map> #define I(M,A)for(i=1;i<=M;i++)scanf("%d",A+i),A[i]+=A[i-1]; main(){for(int n[1501],m[1501],o,a,b,i,j;scanf("%d%d",&a,&b),a;printf("%d\n",o)){std::map<int,int>z;*n=*m=o=0;I(a,n)I(b,m)for(i=0;i<=a;i++)for(j=0;j<=b;)z[n[i]+m[j++]]++;for(typeof(z.begin())p=z.begin();p!=z.end();)o+=p->second*(p...
main.c:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated] 1 | #import<cstdio> | ^~~~~~ main.c:1:8: fatal error: cstdio: No such file or directory 1 | #import<cstdio> | ^~~~~~~~ compilation terminated.
s094414941
p01140
C
#include <cstdio> #include <algorithm> #define N 1500 static int my[ N + 1 ][ N + 1 ]; using namespace std; /** Application main entry point. */ int main ( int argc, char * argv[ ] ) { int i; for ( ; ; ) { int px[ N + 1 ], py[ N + 1 ]; /** Allocated in Heap Memory Area: * int my[ N + ...
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s793846422
p01140
C
#include <iostream> #include <vector> #include <map> using namespace std; int main(){ int n,m; while(cin >> n >> m){ if((n|m) == 0) break; vector<int> h,w; map<int,int> mh, mw; int sum=0,tmp; h.push_back(0); for(int i=0;i<n;i++){ cin >> tmp; ...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s551033102
p01140
C
include<stdio.h> int main(){ int N,M,h[2000],w[2000],i,j,k,l,th=0,tw=0,cnt; while(1){ scanf("%d %d",&N,&M); if(M==0&&N==0) break; for(i=0;i<N;i++) scanf("%d",&h[i]); for(i=0;i<M;i++) scanf("%d",&w[i]); for(cnt=0,k=0;k<N;k++){ for(l=0;l<M;l++){ ...
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^
s814712218
p01140
C
#include <stdio.h> int main() { register int h[1501], w[1501]; register int n, m, i, j, k, l; while(scanf("%d%d", &n, &m) && (n|m)) { n++, m++; h[0] = w[0] = 0; for(i=1; i<n; i++) scanf("%d", &h[i]); for(i=1; i<m; i++) scanf("%d", &w[i]); for(i=1; i<n-1; i++) h[i+1] += h[i]; for(i...
main.c: In function 'main': main.c:7:3: error: address of register variable 'n' requested 7 | while(scanf("%d%d", &n, &m) && (n|m)) { | ^~~~~ main.c:7:3: error: address of register variable 'm' requested main.c:10:5: error: address of register variable 'h' requested 10 | for(i=1; i<n; i++) scanf("%...
s746211335
p01140
C++
/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 returned 1 exit status
s619750549
p01140
C++
#include <iostream> #include <math.h> #include <string> #include <algorithm> #include <utility> using namespace std; const int MAX_LEN=100000; int N,M; int h[MAX_LEN],w[MAX_LEN]; int x,y; int x,y; int solve() { int sum=0; int k=N; for(int i=0;i<N;i++) { h[k]=h[i]; for(int j=i+1;j<N;j++)...
a.cc:12:5: error: redefinition of 'int x' 12 | int x,y; | ^ a.cc:11:5: note: 'int x' previously declared here 11 | int x,y; | ^ a.cc:12:7: error: redefinition of 'int y' 12 | int x,y; | ^ a.cc:11:7: note: 'int y' previously declared here 11 | int x,y; | ^
s436110018
p01140
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef tuple<int, int> duo; const int dx[] = {0, 0, 1, -1, 1, 1, -1, -1}; const int dy[] = {1, -1, 0, 0, 1, -1, 1, -1}; const int Mod = 1000000000 + 0; //{{{ templates #define TT_ template<typename T>inline #define TTF_ templ...
a.cc: In function 'int main()': a.cc:38:5: error: 'unorderd_set' was not declared in this scope 38 | unorderd_set<int> hs; | ^~~~~~~~~~~~ a.cc:38:18: error: expected primary-expression before 'int' 38 | unorderd_set<int> hs; | ^~~ a.cc:39:5: error: 'hs' was not declared in...
s763882553
p01140
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef tuple<int, int> duo; const int dx[] = {0, 0, 1, -1, 1, 1, -1, -1}; const int dy[] = {1, -1, 0, 0, 1, -1, 1, -1}; const int Mod = 1000000000 + 0; //{{{ templates #define TT_ template<typename T>inline #define TTF_ templ...
a.cc: In function 'int main()': a.cc:38:5: error: 'unorderd_set' was not declared in this scope 38 | unorderd_set<int> hs; | ^~~~~~~~~~~~ a.cc:38:18: error: expected primary-expression before 'int' 38 | unorderd_set<int> hs; | ^~~ a.cc:39:5: error: 'hs' was not declared in...
s210676696
p01140
C++
#include <stdio.h> #include <vector> #include <map> auto solve(int N, int M) -> int { using namespace std; vector<int> h(N); vector<int> w(M); for(int i = 0; i < N; i++) { int x; scanf("%d", &x); h[i] = x; } for(int i = 0; i < M; i++) { int x; scanf("%d", &x); w[i] = x; } map<int, int>& eh = *(...
a.cc: In function 'int solve(int, int)': a.cc:58:16: error: type 'class std::vector<int>' argument given to 'delete', expected pointer 58 | delete h; | ^ a.cc:59:16: error: type 'class std::vector<int>' argument given to 'delete', expected pointer 59 | delete w; | ...
s879050515
p01140
C++
#include<iostream> #include<vector> #include<algorithm> #include<queue> #include<cstdio> #include<cstring> #include<string> #define REP(i,n) for(int i=0;i<(n);i++) int di[4] = {1, 0, -1, 0}; int dj[4] = {0, 1, 0, -1}; using namespace std; typedef long long ll; typedef pair<int, int> P; const ll INF = 1e18; int main...
a.cc: In function 'int main()': a.cc:32:27: error: expected ';' before '<' token 32 | for(int j=i, j<n; j++){ | ^ | ; a.cc:32:27: error: expected primary-expression before '<' token a.cc:39:27: error: expected ';' before '<' token 39 | ...
s709600710
p01140
C++
#include <iostream> #include <algorithm> using namespace std; int N,M; int main() { for (; ;) { cin >>N>>M; if (N==0&&M==0) { break; } int h[N],w[M]; h[0]=0; w[0]=0; for (int i=1; i<=N; i++) { int k; cin >>k; ...
a.cc: In function 'int main()': a.cc:29:9: error: 'memset' was not declared in this scope 29 | memset(H, 100000007, sizeof(H)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <algorithm> +++ |+#inclu...
s583368875
p01140
C++
int main() { for (; ;) { int N,M; cin >>N>>M; if (N==0&&M==0) { break; } int h[N],w[M]; h[0]=0; w[0]=0; for (int i=1; i<=N; i++) { int k; cin >>k; h[i]=(h[i-1]+k); } for (int i=1; i<=M; i+...
a.cc: In function 'int main()': a.cc:4:9: error: 'cin' was not declared in this scope 4 | cin >>N>>M; | ^~~ a.cc:22:9: error: 'memset' was not declared in this scope 22 | memset(H, 1000000007, sizeof(H)); | ^~~~~~ a.cc:1:1: note: 'memset' is defined in header '<cstring...
s799224770
p01140
C++
int main() { for (; ;) { int N,M; cin >>N>>M; if (N==0&&M==0) { break; } int h[N],w[M]; h[0]=0; w[0]=0; for (int i=1; i<=N; i++) { int k; cin >>k; h[i]=(h[i-1]+k); } for (int i=1; i<=M; i+...
a.cc: In function 'int main()': a.cc:4:9: error: 'cin' was not declared in this scope 4 | cin >>N>>M; | ^~~ a.cc:22:9: error: 'memset' was not declared in this scope 22 | memset(H, 150000007, sizeof(H)); | ^~~~~~ a.cc:1:1: note: 'memset' is defined in header '<cstring>...
s210276039
p01140
C++
#include<iostream> using namespace std; int t[2000],u[2000]; int a[2000000],b[2000000]; int N,M; int main(){ while(1){ cin>>N>>M; if(N==0&&M==0)break; for(int i=0;i<2000000;i++)a[i]=b[i]=0; for(int i=1;i<=N;i++)cin>>t[i],t[i]+=t[i-1]; for(int i=1;i<=M;i++)cin>>u[i],u[i]+=u[i-1]; for(int i=1;i<...
a.cc: In function 'int main()': a.cc:23:12: error: expected '}' at end of input 23 | return 0; | ^ a.cc:6:11: note: to match this '{' 6 | int main(){ | ^
s127945183
p01140
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n , m; while(cin >> n >> m , n||m ){ vector<int> h(n,0) , w(n,0); vector<short> h_pos(n*1000,0); vector<short> w_pos(w*1000,0); for(int i=0;i<n;++i){ cin >> h[i]; } for(int i=0;i<m;++i){ cin >> w[i]; } for(int i=0;i<n;++i){ ...
a.cc: In function 'int main()': a.cc:9:38: error: no match for 'operator*' (operand types are 'std::vector<int>' and 'int') 9 | vector<short> w_pos(w*1000,0); | ~^~~~~ | | | | ...
s855316551
p01140
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n , m; while(cin >> n >> m , n||m ){ vector<int> h(n) , w(m); vector<short> h_pos(n*1000,0); vector<short> w_pos(w*1000,0); for(int i=0;i<n;++i){ cin >> h[i]; } for(int i=0;i<m;++i){ cin >> w[i]; } for(int i=0;i<n;++i){ int ...
a.cc: In function 'int main()': a.cc:9:38: error: no match for 'operator*' (operand types are 'std::vector<int>' and 'int') 9 | vector<short> w_pos(w*1000,0); | ~^~~~~ | | | | ...
s588497341
p01140
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n , m; while(cin >> n >> m , n||m ){ vector<int> h(n) , w(m); vector<int> h_pos(n*1000,0); vector<int> w_pos(w*1000,0); for(int i=0;i<n;++i){ cin >> h[i]; } for(int i=0;i<m;++i){ cin >> w[i]; } for(int i=0;i<n;++i){ int sum=...
a.cc: In function 'int main()': a.cc:9:36: error: no match for 'operator*' (operand types are 'std::vector<int>' and 'int') 9 | vector<int> w_pos(w*1000,0); | ~^~~~~ | | | | | int ...
s720000319
p01140
C++
#include <iostream> #include <algolithm> #include <vector> using namespace std; int main(){ int N,M; while(cin >> N >> M){ if(N==0&&M==0){ break; } vector<int> X(N,0); vector<int> Y(M,0); for(int i=0;i<N;i++){ cin >> X[i]; } for(int i=0;i<M;i++){ cin >> Y[i]; } ...
a.cc:2:10: fatal error: algolithm: No such file or directory 2 | #include <algolithm> | ^~~~~~~~~~~ compilation terminated.
s766669742
p01140
C++
[i]; } cout << cnt << endl; } return 0; } h
a.cc:1:1: error: expected unqualified-id before '[' token 1 | [i]; | ^ a.cc:2:5: error: expected declaration before '}' token 2 | } | ^ a.cc:4:5: error: 'cout' does not name a type 4 | cout << cnt << endl; | ^~~~ a.cc:6:3: error: expected declaration before '}' token 6 ...
s809780406
p01140
C++
// Aoj_2015.cpp : ??????????????? ??¢????????±????????§????????¨????????? ????????????????????????????????? // #include "stdafx.h" #include<iostream> #include<string.h> using namespace std; static int table[1500 * 1000]; int main() { int n, m; while (cin >> n >> m && n != 0 || m != 0) { int x[1502]; int y[1502]...
a.cc:4:10: fatal error: stdafx.h: No such file or directory 4 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s216603624
p01140
C++
#include <iostream> #include <map> using namespace std; #define rep(i, a, b) for(int i=(a);i<=(b);i++) int n, m, c; int h[1001], w[1001]; int main() { while(cin>>n>>m,n|m) { c = 0; h = {}; w = {}; map<int, int> mh, mw; rep(i, 1, n) { cin>>h[i]; h[i] += h[i-1]; } rep(i, 1, ...
a.cc: In function 'int main()': a.cc:13:7: error: assigning to an array from an initializer list 13 | h = {}; | ~~^~~~ a.cc:14:7: error: assigning to an array from an initializer list 14 | w = {}; | ~~^~~~
s674906949
p01140
C++
#include <iostream> #include <map> using namespace std; #define rep(i, a, b) for(int i=(a);i<=(b);i++) int n, m, c; int h[1001], w[1001]; int main() { while(cin>>n>>m,n|m) { c = 0; h[] = {}; w[] = {}; map<int, int> mh, mw; rep(i, 1, n) { cin>>h[i]; h[i] += h[i-1]; } rep(i,...
a.cc: In function 'int main()': a.cc:13:7: error: expected primary-expression before ']' token 13 | h[] = {}; | ^ a.cc:14:7: error: expected primary-expression before ']' token 14 | w[] = {}; | ^
s315193213
p01140
C++
#include <string> #include <vector> #include <map> #include <iostream> #include <set> #include <list> #include <cmath> #include <queue> #include <stack> #include <cstdio> #include <cmath> #include <cctype> #include <climits> #include <complex> #include <cstdlib> #include <cstring> #include <numeric> #include <sstream> ...
a.cc: In function 'int main()': a.cc:54:25: error: 'cnt' was not declared in this scope; did you mean 'int'? 54 | cnt=0; | ^~~ | int
s181726733
p01140
C++
//?????????????????§??????????????????????????£???????????? #include <stdio.h> #include <iostream> #include <queue> #include <map> #include <string> #include <vector> #include <algorithm> #include <math.h> #define PB push_back #define in scanf #define FOR(i,a,b) for (int i=(a);i<(b);i++) #define RFOR(i,a,b) for (int i=...
a.cc: In function 'void solve()': a.cc:33:25: error: 'memset' was not declared in this scope 33 | memset(www,0,sizeof(www)); | ^~~~~~ a.cc:10:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 9 | #incl...
s295643580
p01140
C++
int main() { ios_base::sync_with_stdio(0); int n, m, i, j, sumV, sumH, cnt; while(1){ cin >> n >> m; if(n==0 && m==0) break; for(i=0; i<n; i++) cin >> roadV[i]; for(i=0; i<m; i++) cin >> roadH[i]; for(i=1; i<=n*1000; i...
a.cc: In function 'int main()': a.cc:2:5: error: 'ios_base' has not been declared 2 | ios_base::sync_with_stdio(0); | ^~~~~~~~ a.cc:6:9: error: 'cin' was not declared in this scope 6 | cin >> n >> m; | ^~~ a.cc:10:20: error: 'roadV' was not declared in this scope 10 | ...
s958745700
p01140
C++
using namespace std; int main(){ int n,m,sum=0,a,sums=0,sumh; vector<int> x,y,sa; while(1){ cin>>n>>m; if(n==0)break; x.clear(); y.clear(); sa.clear(); cin>>a; x.push_back(a); for(int i=1;i<n;i++){ cin>>a; x.push_back(a+x[i-1]); } cin>>a; y.push_back(a); fo...
a.cc: In function 'int main()': a.cc:5:3: error: 'vector' was not declared in this scope 5 | vector<int> x,y,sa; | ^~~~~~ a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' +++ |+#include <vector> 1 | using namespace std; a.cc:5:10: ...
s027121676
p01140
C++
#include<iostream> #include<vector> #include<string> #include<cstdio> #include<map> using namespace std; int c[1500]; int d[1500]; int main() { int a, b; while (scanf("%d%d", &a, &b),a | b) { map<int, int>e; map<int, int>f; memset(c, 0, a * 4); memset(d, 0, b * 4); for (int g = 0; g < a; g++) { int h; ...
a.cc: In function 'int main()': a.cc:15:17: error: 'memset' was not declared in this scope 15 | memset(c, 0, a * 4); | ^~~~~~ a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 5 | #include<map> +++ |+#include...
s691419149
p01140
C++
#include <iostream> #include <sstream> #include <fstream> #include <string> #include <vector> #include <array> #include <deque> #include <queue> #include <stack> #include <set> #include <map> #include <algorithm> #include <functional> #include <utility> #include <bitset> #include <cmath> #include <cstdlib> #include <ct...
a.cc: In member function 'void Solve::solver()': a.cc:37:30: error: 'memset' is not a member of 'std'; did you mean 'wmemset'? 37 | std::memset(intervalX, 0, sizeof(intervalX)); | ^~~~~~ | wmemset a.cc:38:30: error: 'memset...
s877472878
p01140
C++
#include<cstdio> #include<vector> using namespace std; vector<int> Na;//???????´??????? vector<int> Ma; vector<int> Nw;//?????¨???????????????????????? vector<int> Mw; int main(void){ int i,j,ans=0,a=0,N=0,M=0; scanf("%d %d",&N,&M); Na.push_back(0); Ma.push_back(0); for(i=0;i<N;i++){ scanf("%d",&a); a+=Na[i]; ...
a.cc: In function 'int main()': a.cc:25:50: error: expected ';' before '}' token 25 | Nw.push_back(Na[j]-Na[i]) | ^ | ; 26 | } | ~ ...
s570818299
p01140
C++
#include<iostream> #include<fstream> #include<vector> #include<algorithm> #define fin cin using namespace std; int n = 0, m = 0; vector<int> h; vector<int> w; template<typename Vec> push_sum(Vec &v, int size) { for(unsigned i = 0; i < size; i++){ int num = v[i]; unsigned sub = i + 1; wh...
a.cc:15:1: error: ISO C++ forbids declaration of 'push_sum' with no type [-fpermissive] 15 | push_sum(Vec &v, int size) | ^~~~~~~~ a.cc: In instantiation of 'int push_sum(Vec&, int) [with Vec = std::vector<int>]': a.cc:51:17: required from here 51 | push_sum(h, n); | ~~~~~~~~^~~~~~ a...
s950060848
p01140
C++
#include<iostream> #include<fstream> #include<vector> #include<algorithm> #define fin cin using namespace std; int n = 0, m = 0; vector<int> h; vector<int> w; template<typename Vec> push_sum(Vec &v, int size) { for(unsigned i = 0; i < size; i++){ int num = v[i]; unsigned sub = i + 1; wh...
a.cc:15:1: error: ISO C++ forbids declaration of 'push_sum' with no type [-fpermissive] 15 | push_sum(Vec &v, int size) | ^~~~~~~~ a.cc: In instantiation of 'int push_sum(Vec&, int) [with Vec = std::vector<int>]': a.cc:51:17: required from here 51 | push_sum(h, n); | ~~~~~~~~^~~~~~ a...
s478343319
p01140
C++
#include<iostream> #include<fstream> #include<vector> #include<algorithm> #define fin cin using namespace std; int n = 0, m = 0; vector<int> h; vector<int> w; template<typename Vec> push_sum(Vec &v, int size) { for(unsigned i = 0; i < size; i++){ int num = v[i]; unsigned sub = i + 1; wh...
a.cc:15:1: error: ISO C++ forbids declaration of 'push_sum' with no type [-fpermissive] 15 | push_sum(Vec &v, int size) | ^~~~~~~~ a.cc: In instantiation of 'int push_sum(Vec&, int) [with Vec = std::vector<int>]': a.cc:51:17: required from here 51 | push_sum(h, n); | ~~~~~~~~^~~~~~ a...
s255410385
p01140
C++
using System; using System.Collections.Generic; class squareroute { static void Main(string[] args) { while (true) { int N, M; string[] s = Console.ReadLine().Split(' '); if (s[0] == "0" & s[1] == "0") break; N = int.Parse(s[0]); M = ...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:7:22: error: 'string' has not been declared 7 | static void Main(string[]...
s618378623
p01140
C++
#include<cstdio> #include<cstring> #include<vector> #include<queue> #include<algorithm> #include<cmath> #include<climits> #include<string> #include<set> #include<numeric> #include<map> #include<iostream> using namespace std; #define rep(i,n) for(int i = 0;i<((int)(n));i++) #define reg(i,a,b) for(int i = ((int)(a));i<=(...
a.cc: In function 'int main()': a.cc:54:60: error: conversion from '_Rb_tree_iterator<pair<const long long int,[...]>>' to non-scalar type '_Rb_tree_iterator<pair<const std::__cxx11::basic_string<char>,[...]>>' requested 54 | for (map<string,int>::iterator p=mapW.begin();p!=mapW.end();++p){ | ...
s811461826
p01140
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <numeric> #include <stack> #include <queue> #include <map> #include <set> #include <utility> #include <sstream> #include <complex> #include <fstream> #include <bitset> #include ...
In file included from a.cc:72: /usr/include/c++/14/cmath:3911: error: unterminated argument list invoking macro "REP" 3911 | #endif a.cc: In function 'int main()': a.cc:68:17: error: 'REP' was not declared in this scope 68 | REP(i, #include <iostream> | ^~~ a.cc:68:17: note: th...
s035087366
p01140
C++
include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int N,M; int a; while(1){ vector<int> v1; vector<int> v2; vector<int> vh; vector<int> vw; cin>>N>>M; if(N == 0 && M == 0){ break; } for(int i = 0;i < N;++i){ cin>>a; ...
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/vector:62, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu...
s894773705
p01140
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; while(cin >> n && n) { int m; cin >> m; int h[n], w[m]; int p[n+1], q[m+1]; //h[0]+...+h[i]??????????????????????¨???????????????? p[0] = 0; q[0] = 0; for(int i = 0; i < n; i++) ...
a.cc: In function 'int main()': a.cc:34:33: error: lvalue required as left operand of assignment 34 | if(p[a] - p[b]= q[c] - q[d]) | ~~~~~^~~~~~
s618004607
p01140
C++
def ans(N, M, h, w): count = 0 for hr1 in range(N+1): for hr2 in range(N+1): if hr2 <= hr1: continue height = sum(h[e] for e in range(hr1, hr2)) for wr1 in range(M+1): for wr2 in range(M+1): if wr2 <= w...
a.cc:1:1: error: 'def' does not name a type 1 | def ans(N, M, h, w): | ^~~
s893032329
p01140
C++
#include<bits/stdc++.h> using namespace std; #ifdef LOCAL #include "../dump.hpp" #else #define dump(...) #endif #define rep(i,n) for(ll i=0,i##_cond=(n);i<i##_cond;i++) #define FOR(i,a,b) for(ll i=(a),i##_cond=(b);i<i##_cond;i++) #define ROF(i,a,b) for(ll i=(a)-1,i##_cond=(b);i>=i##_cond;i--) #define all(a) (a).begin...
a.cc:34:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 34 | main() | ^~~~ a.cc: In function 'int main()': a.cc:55:11: error: found ':' in nested-name-specifier, expected '::' 55 | for(x : mph){ | ^ | :: a.cc:55:9: error: 'x' has not been de...
s169778678
p01140
C++
/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 returned 1 exit status
s797958143
p01140
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main(){ int N, M, h[1501], w[1501]; while(cin >> N >> M){ if(N == 0 && M == 0) break; for(int i=0;i<N;i++) cin >> h[i]; for(int i=0;i<M;i++) cin >> w[i]; int mxh=accumulate(h,h+N,0); //縦総和 int mxw=accum...
a.cc: In function 'int main()': a.cc:13:13: error: 'accumulate' was not declared in this scope 13 | int mxh=accumulate(h,h+N,0); //縦総和 | ^~~~~~~~~~
s731751925
p01140
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main(){ int N, M, h[1501], w[1501]; while(cin >> N >> M){ if(N == 0 && M == 0) break; for(int i=0;i<N;i++) cin >> h[i]; for(int i=0;i<M;i++) cin >> w[i]; int mxh=accumulate(h,h+N,0); int mxw=accumulate...
a.cc: In function 'int main()': a.cc:13:13: error: 'accumulate' was not declared in this scope 13 | int mxh=accumulate(h,h+N,0); | ^~~~~~~~~~
s038167899
p01140
C++
#include <cstdio> #include <map> using namespace std;int main(o,cn,cm,i,j,x){ for(;scanf("%d %d", &cn, &cm),cn;printf("%d\n",o)){ map<int, int> point; map<int, int>::iterator p; int n[1501], m[1501]; n[0]=m[0]=o=0; for(i=0;i<cn;i++){ scanf("%d", &x); n[i+1]=n[i]+x; } for(i=0;i<cm;i++){ scanf...
a.cc:3:25: error: cannot declare '::main' to be a global variable 3 | using namespace std;int main(o,cn,cm,i,j,x){ | ^~~~ a.cc:3:30: error: 'o' was not declared in this scope 3 | using namespace std;int main(o,cn,cm,i,j,x){ | ^ a.cc:3:32: error: '...
s954082433
p01140
C++
#include <cstdio> #include <map> using namespace std;int main(){ for(;scanf("%d %d", &cn, &cm),cn;printf("%d\n",o)){ map<int,int> point; map<int,int>::iterator p; int n[1501], m[1501],o,cn,cm,i,j,x; n[0]=m[0]=o=0; for(i=0;i<cn;i++){ scanf("%d", &x); n[i+1]=n[i]+x; } for(i=0;i<cm;i++){ scanf(...
a.cc: In function 'int main()': a.cc:4:22: error: 'cn' was not declared in this scope 4 | for(;scanf("%d %d", &cn, &cm),cn;printf("%d\n",o)){ | ^~ a.cc:4:27: error: 'cm' was not declared in this scope 4 | for(;scanf("%d %d", &cn, &cm),cn;printf("%d\n",o)){ | ...
s479480608
p01140
C++
#include <cstdio> #include <map> using namespace std;int main(){ for(int n[1501], m[1501],o,a,b,i,j,x;scanf("%d%d",&a,&b),cn;printf("%d\n",o)){ map<int,int> point; map<int,int>::iterator p; n[0]=m[0]=o=0; for(i=0;i<cn;i++){ scanf("%d", &x); n[i+1]=n[i]+x; } for(i=0;i<cm;i++){ scanf("%d", &x...
a.cc: In function 'int main()': a.cc:5:58: error: 'cn' was not declared in this scope; did you mean 'n'? 5 | for(int n[1501], m[1501],o,a,b,i,j,x;scanf("%d%d",&a,&b),cn;printf("%d\n",o)){ | ^~ | ...
s103672367
p01140
C++
#import<cstdio> #import<map> #define I(M,A)for(i=0;i<M;i++)scanf("%d",&x),A[i+1]=A[i]+x; main(){for(int n[1501],m[1501],o,a,b,i,j,x;scanf("%d%d",&a,&b),a;printf("%d\n",o)){std::map<int,int>z;*n=*m=o=0;I(a,n)I(b,m)for(i=0;i<=a;i++)for(j=0;j<=b;j++)z[n[i]+m[j]]++;for(std::map<int,int>::iteartor p=z.begin();p!=z.end();p++...
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated] 1 | #import<cstdio> | ^~~~~~ a.cc:2:2: warning: #import is a deprecated GCC extension [-Wdeprecated] 2 | #import<map> | ^~~~~~ a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main(...
s749415732
p01140
C++
#import<cstdio> #import<map> #define I(M,A)for(i=1;i<=M;i++)scanf("%d",A+i),A[i]+=A[i-1]; n[1501],m[1501],o,a,b,i,j;main(){for(scanf("%d%d",&a,&b),a;printf("%d\n",o)){std::map<int,int>z;*n=*m=o=0;I(a,n)I(b,m)for(i=0;i<=a;i++)for(j=0;j<=b;)z[n[i]+m[j++]]++;for(typeof(z.begin())p=z.begin();p!=z.end();)o+=p->second*(p++->...
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated] 1 | #import<cstdio> | ^~~~~~ a.cc:2:2: warning: #import is a deprecated GCC extension [-Wdeprecated] 2 | #import<map> | ^~~~~~ a.cc:4:1: error: 'n' does not name a type 4 | n[1501],m[1501],o,a,b,i,j;main(){for(scanf("%d%d"...
s286857610
p01140
C++
#include<iostream> #include<algorithm> #include<cstdio> #include<cstring> using namespace std; int h[1024*1500]; int w[1024*1500]; int getInt(){ int c = getchar(); int ret = 0; while(!isdigit(c)) c = getchar(); while(isdigit(c)){ ret *= 10; ret += c - '0'; c = getchar(); } return ret; } int ...
a.cc: In function 'int main()': a.cc:25:38: error: expected ')' before '{' token 25 | while(n=getInt(), (m=getInt(), n+m){ | ~ ^ | )
s171387060
p01140
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int w[1501]={0}, h[1501]={0}; int W[2250000]={0}, H[2250000]={0}; int sum(int* a , int i,int n,int size){ int s = 0; for(int j=n ; j-- ; ){ if( i >= size ){ return 0; } s += a[i++]; } return s; } int main(){ int n,m,w_,h_; ...
a.cc: In function 'int main()': a.cc:62:17: error: expected primary-expression before '}' token 62 | } | ^
s237000249
p01140
C++
#include <iostream> #include <algorithm> #include <cstdlib> #define MAX 1500001 using namespace std; int tate[MAX], yoko[MAX]; int main( void ) { int n, m; int h[1500], w[1500]; while(cin >> n >> m, n | m) { int sum_all_h, sum_all_w; sum_all_h = sum_all_w = 0; for(int i=0; i < n; ++i) { cin >> h[i]; sum_al...
a.cc: In function 'int main()': a.cc:20:17: error: 'memset' was not declared in this scope 20 | memset(tate, 0, sizeof(tate)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <cstdlib> ...
s579289979
p01140
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int w[1501]={0}, h[1501]={0}; int W[2250000]={0}, H[2250000]={0}; int sum(int* a , int i,int n,int size){ int s = 0; for(int j=n ; j-- ; ){ if( i >= size ){ return 0; } s += a[i++]; } ...
a.cc: In function 'int main()': a.cc:49:27: error: 'i_' was not declared in this scope; did you mean 'i'? 49 | for(int i=0 ; i < i_ ; i++ ){ | ^~ | i
s013163750
p01140
C++
#include <iostream> #include <algorithm> #include <vector> #include <hamkoutil.hpp> using namespace std; #define NUMMAX 1500 #define CMAX (NUMMAX * (NUMMAX + 1) / 2) void makecvec(vector<int>& in, vector<int>& out) { for (int ni = 0; ni < (int)in.size(); ni++) { for (int pi = 0; pi < (int)in.size() - ni;...
a.cc:4:10: fatal error: hamkoutil.hpp: No such file or directory 4 | #include <hamkoutil.hpp> | ^~~~~~~~~~~~~~~ compilation terminated.
s172760559
p01140
C++
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true) { int n = sc.nextInt(); int m = sc.nextInt(); if (n == 0 && m == 0) break; int[] h = new int[n]; Map height = new HashMap<Integer, Integer>(); int[] w = new int[...
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 { | ^~~~~~
s976926104
p01142
C
#include <stdio.h> #include <queue> #include <set> #include <utility> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define mp make_pair const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; struct S { int x, y, d; S() {} S(int x, int y, int d) : x(x), y(y), d(d) {}...
main.c:2:10: fatal error: queue: No such file or directory 2 | #include <queue> | ^~~~~~~ compilation terminated.
s204629497
p01142
C
#include <stdio.h> #include <queue> #include <unordered_set> #include <utility> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define mp make_pair const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; struct S { unsigned x, y, d; S() {} S(unsigned x, unsigned y, uns...
main.c:2:10: fatal error: queue: No such file or directory 2 | #include <queue> | ^~~~~~~ compilation terminated.
s670518364
p01142
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; struct S{ int y,x,ry,rx,d,rd; }; struct SS{ int y,x,d; }; int main(){ for(int W,H;cin>>W>>H,W;){ char g[16][64]; int y,x; for(int i=0;i<H;i++){ for(int j=0;j<W;j++){ cin>>g[i][j]; if(g[i][j]=='K'){ y=i; x=j;...
a.cc: In function 'int main()': a.cc:45:29: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17 45 | if(ps[cs.y][cs.x][cs.d]++)continue; | ~~~~~~~~~~~~~~~~~~~^ a.cc:56:49: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17 56 | if(p[c...
s753996928
p01142
C++
#include<stdio.h> #include <iostream> #include <math.h> #include <numeric> #include <vector> #include <map> #include <functional> #include <stdio.h> #include <array> #include <algorithm> #include <string> #include <string.h> #include <assert.h> #include <stdio.h> #include <queue> #include<iomanip> #include<bitset> #inc...
a.cc:158:5: error: conflicting declaration 'int dx [7]' 158 | int dx[7] = { -1,0,1,0,-1,0,1 }; | ^~ a.cc:95:5: note: previous declaration as 'int dx [4]' 95 | int dx[4] = { -1,0,1,0 }; | ^~ a.cc:159:5: error: conflicting declaration 'int dy [7]' 159 | int dy[7] = { 0,1,0,-1,0,1,0 }; | ...
s859688252
p01142
C++
#include <string> #include <iostream> #pragma warning(disable : 4996) using namespace std; int H, W; string M[16]; bool visited[16][64][4]; const int dx[4] = { 0, 1, 0, -1 }; const int dy[4] = { -1, 0, 1, 0 }; void rec(int x, int y, int dir) { if (!visited[y][x][dir]) { visited[y][x][dir] = true; while (M...
a.cc: In function 'int main()': a.cc:71:17: error: 'memset' was not declared in this scope 71 | memset(visited, false, sizeof(visited)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <...
s967799266
p01142
C++
#include<iostream> #include<algorithm> #include<queue> #include<string> using namespace std; typedef pair<int, int> pi; pi mp; string in[16]; const int dy[] = { -1,0,1,0 }, dx[] = { 0,-1,0,1 }; #define rep(i,n) for(int i=0;i<(int)n;i++) bool solve(int sy,int sx,int w,int gy,int gx ) { static bool v[16][64][4]; mems...
a.cc: In function 'bool solve(int, int, int, int, int)': a.cc:15:9: error: 'memset' was not declared in this scope 15 | memset(v, 0, sizeof(v)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<queue> ...
s079256977
p01142
C++
#include<iostream> #include<algorithm> #include<queue> #include<string> #include<string.h> using namespace std; typedef pair<int, int> pi; pi mp; string in[16]; const int W = 100; const int dy[] = { -1,0,1,0 }, dx[] = { 0,-1,0,1 }; #define rep(i,n) for(int i=0;i<(int)n;i++) bool solve(int sy,int sx,int sd,int gy,int ...
a.cc:62:2: error: expected declaration before '}' token 62 | }} | ^ a.cc: In function 'int dir(int, int)': a.cc:45:1: warning: control reaches end of non-void function [-Wreturn-type] 45 | } | ^
s335846389
p01142
C++
#include<iostream> #include<algorithm> #include<queue> #include<string> #include<string.h> using namespace std; typedef pair<int, int> pi; pi mp; string in[16]; const int W = 100; const int dy[] = { -1,0,1,0 }, dx[] = { 0,-1,0,1 }; #define rep(i,n) for(int i=0;i<(int)n;i++) bool solve(int sy,int sx,int sd,int gy,int ...
a.cc: In function 'int main()': a.cc:53:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 53 | scanf_s("%d %d", &w, &h); | ^~~~~~~ | scanf a.cc: In function 'int dir(int, int)': a.cc:48:1: warning: control reaches end of non-void fu...
s134848361
p01142
C++
#include<iostream> #include<algorithm> #include<queue> #include<string> #include<string.h> #include<cstdio> using namespace std; typedef pair<int, int> pi; pi mp; string in[16]; const int W = 100; const int dy[] = { -1,0,1,0 }, dx[] = { 0,-1,0,1 }; #define rep(i,n) for(int i=0;i<(int)n;i++) bool solve(int sy,int sx,i...
a.cc: In function 'int main()': a.cc:54:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 54 | scanf_s("%d %d", &w, &h); | ^~~~~~~ | scanf a.cc: In function 'int dir(int, int)': a.cc:49:1: warning: control reaches end of non-void fu...
s859710633
p01142
C++
#include<iostream> #include<algorithm> #include<queue> #include<string> #include<string.h> #include<cstdio> using namespace std; typedef pair<int, int> pi; pi mp; string in[16]; const int W = 100; const int dy[] = { -1,0,1,0 }, dx[] = { 0,-1,0,1 }; #define rep(i,n) for(int i=0;i<(int)n;i++) bool solve(int sy,int sx,i...
a.cc: In function 'int main()': a.cc:52:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 52 | scanf_s("%d %d", &w, &h); | ^~~~~~~ | scanf a.cc: In function 'int dir(int, int)': a.cc:47:1: warning: control reaches end of non-void fu...
s905017486
p01143
Java
import java.util.Scanner; public class Princess_Gamble { static Scanner scan = new Scanner(System.in); public static void main(String[] args) { int N, M ,P; while((N=scan.nextInt())!=0 && (M=scan.nextInt())!=0 && (P=scan.nextInt())!=0){ int sum = 0; int[] ticket = new i...
Main.java:3: error: class Princess_Gamble is public, should be declared in a file named Princess_Gamble.java public class Princess_Gamble { ^ 1 error
s235530027
p01143
Java
import java.io.InputStream; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.InputMismatchException; import java.util.NoSuchElementException; import java.math.BigDecimal; import java.math.BigInteger; public cl...
Main.java:20: error: cannot find symbol while(ture){ ^ symbol: variable ture location: class Main Main.java:30: error: cannot find symbol out.println(all/x[i]); ^ symbol: variable i location: class Main 2 errors
s183055725
p01143
Java
import java.io.InputStream; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.InputMismatchException; import java.util.NoSuchElementException; import java.math.BigDecimal; import java.math.BigInteger; public cl...
Main.java:20: error: cannot find symbol while(ture){ ^ symbol: variable ture location: class Main Main.java:31: error: cannot find symbol out.println(all/x[i]); ^ symbol: variable i location: class Main 2 errors
s829149963
p01143
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { try(Scanner sc = new Scanner(System.in)) { while(sc.hasNext()) { int N = sc.nextInt(); int M = sc.nextInt(); int P = sc.nextInt(); if(N + M + P == 0) break; int w = 0; int sum = 0; boolean win...
Main.java:18: error: cannot find symbol if(x == 0) win = false; ^ symbol: variable x location: class Main 1 error
s446531847
p01143
C
#include<iostream> using namespace std; int main(){ int n,m,p; double sum; double sumg; int gold; int x[101]; while(1){ sum=0; sumg=0; gold=0; cin >> n >> m >> p; if(n==0 && m==0 && p==0)break; for(int i=0;i<n;i++){ cin >> x[i]; sum+=100*x[i]; } sumg=sum-sum*(p*...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s913007315
p01143
C
#include <stdio.h> int main(void) { int i,n,m,p,ans; while(scanf("%d %d %d",&n,&m,&p)!=0&&n+m+p){ int sum=0 int x[n]; for(i=0;i<n;i++){ scanf("%d",x[i]); sum+=x[i]; } sum*=100; sum*=1-(p/100); ans=sum/x[m]; printf("%d\n",ans); } return 0; }
main.c: In function 'main': main.c:7:5: error: expected ',' or ';' before 'int' 7 | int x[n]; | ^~~ main.c:9:18: error: 'x' undeclared (first use in this function) 9 | scanf("%d",x[i]); | ^ main.c:9:18: note: each undeclared identifier is reported only once for each fu...
s041426972
p01143
C
#include <stdio.h> int main() { while (true) { int N, M, P; scanf("%d %d %d", &N, &M, &P); if (N == 0 && M == 0 && P == 0) break; int X[100]; int sum = 0; for (int i = 0; i < N; i++) { scanf("%d", &X[i]); sum += X[i] * 100; } sum = sum * (100 - P) / 100; printf("%d\n",...
main.c: In function 'main': main.c:4:10: error: 'true' undeclared (first use in this function) 4 | while (true) { | ^~~~ main.c:2:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' 1 | #include <stdio.h> +++ |+#include <stdbool.h> ...