submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s348294835
p00118
C
#include<stdio.h> #include<string.h> char map[105][105]; int flag[105][105],M,N; void dfs(int x,int y) { flag[x][y]=1; if((x+1)>=0&&(x+1)<M&&map[x+1][y]==map[x][y]) dfs(x+1,y); if((x-1)>=0&&(x-1)<M&&map[x-1][y]==map[x][y]) dfs(x-1,y); if((y+1)>0&&(y+1)<N&&map[x][y]==map[x][y+1]) dfs(x,y+1); if((y-1)>=0&&(y-1...
main.c:17:1: error: expected identifier or '(' before '}' token 17 | } | ^
s943096744
p00118
C
/* Á·Ï°Ì⣺Property Distribution_AOJ 0118 */ #include <stdio.h> using namespace std; char maze[25][25]; int W, H; int sx, sy; int dx[]={1,0,-1,0}; int dy[]={0,1,0,-1}; int count; void dfs1(int x, int y) { for(int i=0; i<4; i++) { int nx=x+dx[i]; int ny=y+dy[i]; if(nx>=0&&nx<W&&ny>=0&&ny<H&&maze[nx][ny]=='@') ...
main.c:5:1: error: unknown type name 'using' 5 | using namespace std; | ^~~~~ main.c:5:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std' 5 | using namespace std; | ^~~
s597706249
p00118
C
#include<cstdio> #include<cstring> const int maxn=100+5; char pic[maxn][maxn]; int dix[4]={0,1,0,-1},diy[4]={1,0,-1,0},sum,m,n; void dfs(int i,int j,char x) { if(i<0||i>=m||j<0||j>=n||pic[i][j]=='z')return; pic[i][j]='z'; for(int s=0;s<4;s++) if(pic[i+dix[s]][j+diy[s]]==x)dfs(i+dix[s],j+diy[s],x); } int mai...
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s097054073
p00118
C
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; int N,M,ans; char map[25][25]; int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1}; void dfs(int x,int y,char c) { map[x][y]='.'; for(int i = 0; i < 4;i++) { int nx = x + dx[i]; int ny = y + dy[i]; if(0 <= nx && nx < N && 0 <...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s376722776
p00118
C
#include<iostream> #include<cstdio> #include<algorithm> #include<vector> using namespace std; int farm[101][101]; void kubun(int k,int a,int b){ farm[a][b]=0; if(k==farm[a-1][b])kubun(farm[a-1][b],a-1,b); if(k==farm[a+1][b])kubun(farm[a+1][b],a+1,b); if(k==farm[a][b-1])kubun(farm[a][b-1],a,b-1); if(k==farm[a][b+...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s040026119
p00118
C
#include<stdio.h> #include<windows.h> void main(void){ int H,W,o;int QWE; int HW[100][102];//農場データ int SoldFlag[100][102];//売約済みフラグ int Queue[100*102][2]; int QueueStart=0,QueueEnd=1; int QueueNow=0; int Answer=0; int Count,CountH,CountW,CountQ,CountH2,CountW2; int MH,MW; for(CountH=0;CountH<100;CountH++){ ...
main.c:2:9: fatal error: windows.h: No such file or directory 2 | #include<windows.h> | ^~~~~~~~~~~ compilation terminated.
s517631077
p00118
C
#include<stdio.h> #include<windows.h> #include<string.h> void main(void){ int H,W,o;int QWE; char HW[100][102];//農場データ char SoldFlag[100][102];//売約済みフラグ char Queue[100*102][2]; int QueueStart=0,QueueEnd=1; int QueueNow=0; int Answer=0; int Count,CountH,CountW,CountQ,CountH2,CountW2; int MH,MW; char *FinalAns...
main.c:2:9: fatal error: windows.h: No such file or directory 2 | #include<windows.h> | ^~~~~~~~~~~ compilation terminated.
s112563405
p00118
C
#include<stdio.h> int main(void) { int i, j, k; int H, W; char farm[102][102]; int vector[4][2]={{-1,0},{1,0},{0,-1},{0,1}}; int ans=0; while (scanf("%d %d\n",&H,&W) != EOF) { if (H == 0 && W == 0) { break; } for (i = 0; i < H + 2; i++) { if (i == 0 || i == H + 1) { for (j = 0; j < W + 2...
main.c: In function 'main': main.c:39:48: error: implicit declaration of function 'bfs' [-Wimplicit-function-declaration] 39 | ans += bfs(i, j, farm, vector); | ^~~
s150921825
p00118
C
#include<iostream> #include<cstdio> using namespace std; int h,w; char fruit[100][100]; void dfs(int y, int x); int dx[4] = {0,1,0,-1},dy[4] = {1,0,-1,0}; main(){ while(1){ int cnt=0; cin >> h >> w; if(h==0 && w==0) break; for(int i=0; i<h ;i++){ cin >> fruit[i]; } for(int i=0; i<h; i++){ for(in...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s091524074
p00118
C
#include <stdio.h> #include <stdlib.h> int i, j; int h, w; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; char **data; char rLine[101]; void dfs(int x, int y, char fType) { data[y][x] = 0; int k; for (k=0; k<4; k++) { int nx = x + dx[k]; int ny = y + dy[k]; if (nx>=0 && nx<w && ny>=0 && ny<h && dat...
main.c: In function 'main': main.c:35:25: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 35 | gets(rLine); | ^~~~ | fgets
s073221132
p00118
C
#include <stdio.h> #include <stdlib.h> int i, j; int h, w; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; char **data; char rLine[101]; void dfs(int x, int y, char fType) { data[y][x] = 0; int k; for (k=0; k<4; k++) { int nx = x + dx[k]; int ny = y + dy[k]; if (nx>=0 && nx<w && ny>=0 && ny<h && dat...
main.c: In function 'main': main.c:35:25: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 35 | gets(rLine); | ^~~~ | fgets
s281972953
p00118
C
#include <stdio.h> char mp[102][102];//mp[w][h] void dfs(int wj,int hi,char c){ mp[wj][hi] = '.'; if(mp[wj+1][hi] == c) dfs(wj+1,hi,c); if(mp[wj-1][hi] == c) dfs(wj-1,hi,c); if(mp[wj][hi+1] == c) dfs(wj,hi+1,c); if(mp[wj][hi-1] == c) dfs(wj,hi-1,c); return; } int main(){ int w,h,i,j; while(1){ ...
main.c: In function 'main': main.c:21:38: error: request for member 'mp' in something not a structure or union 21 | for(i=1;i <=h;i++) mp[0][i] = '.'.mp[w+1][i] = '.'; | ^
s834603053
p00118
C++
#include<cstdio> int H , W; char room[100][100]; int next_step[4][2] = { {0 , 1} , {1 , 0} , {0 , -1} , {-1 , 0} }; int number; void dfs(int x , int y , char c) { room[x][y] = 'X'; for(int i = 0 ; i < 4 ; i++) { int nx = x + next_step[i][0] , ny = y + next_step[i][1]; if(nx >= 0 && nx < W && ny >= 0 && ny < H &...
a.cc: In function 'int main(int, const char**)': a.cc:40:42: error: 'i' was not declared in this scope 40 | scanf("%s", room[i]); | ^ a.cc: At global scope: a.cc:47:1: error: expected unqualified-id before '...' token 47 | ....... | ^~~
s179641269
p00118
C++
#include<cstdio> int H , W; char room[100][100]; int next_step[4][2] = { {0 , 1} , {1 , 0} , {0 , -1} , {-1 , 0} }; int number; void dfs(int x , int y , char c) { room[x][y] = 'X'; for(int i = 0 ; i < 4 ; i++) { int nx = x + next_step[i][0] , ny = y + next_step[i][1]; if(nx >= 0 && nx < W && ny >= 0 && ny < H &...
a.cc:47:1: error: expected unqualified-id before '...' token 47 | ....................... | ^~~
s465178976
p00118
C++
#include<stdio.h> #include<iostream> using namespace std; int w,h; int dx[4]={1,0,-1,0},dy[4] = {0,1,0,-1}; char fruit[100][100]; //int num; void dfs(int x,int y,char c){ fruit[x][y]='.'; for(int i = 0; i < 4;i++){ int nx = x + dx[i], ny = y + dy[i]; if(nx<h&&nx>=0&&ny<w&&ny>=0&&fruit[nx...
a.cc: In function 'void solve()': a.cc:20:9: error: 'num' was not declared in this scope; did you mean 'enum'? 20 | num = 0; | ^~~ | enum
s466497968
p00118
C++
#include<iostream> #include<string> using namespace std; string map[101]; int count=0; int n,m; void dfs(char c,int i,int j){ s[i][j] = '.'; if(i+1 < n && s[i+1][j] == c) { dfs(c,i+1,j); } if(i-1 >= 0 && s[i-1][j] == c) { dfs(c,i-1,j); } if(j+1 < m && s[i][j+1] == c...
a.cc: In function 'void dfs(char, int, int)': a.cc:12:5: error: 's' was not declared in this scope 12 | s[i][j] = '.'; | ^ a.cc: In function 'int main()': a.cc:41:12: error: 'i' was not declared in this scope 41 | rep(i,n) cin >> s[i]; | ^ a.cc:41:8: error: 'rep' was not decl...
s162968007
p00118
C++
#include<iostream> #include<string> using namespace std; string map[101]; int count=0; int n,m; void dfs(char c,int i,int j){ s[i][j] = '.'; if(i+1 < n && s[i+1][j] == c) { dfs(c,i+1,j); } if(i-1 >= 0 && s[i-1][j] == c) { dfs(c,i-1,j); } if(j+1 < m && s[i][j+1] == c...
a.cc: In function 'void dfs(char, int, int)': a.cc:12:5: error: 's' was not declared in this scope 12 | s[i][j] = '.'; | ^ a.cc: In function 'int main()': a.cc:41:12: error: 'i' was not declared in this scope 41 | rep(i,n) cin >> s[i]; | ^ a.cc:41:8: error: 'rep' was not decl...
s485086471
p00118
C++
#include <iostream> #include <cstido> using namespace std; const int MAX = 100; int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1}; //INPUT int H, W, res; char garden[MAX][MAX]; void dfs(int x, int y, char c) { garden[x][y] = '.'; for (int i = 0; i < 4; i++) { int nx = x + dx[i], ny = y + dy[i]; if (garden[nx][...
a.cc:2:10: fatal error: cstido: No such file or directory 2 | #include <cstido> | ^~~~~~~~ compilation terminated.
s339186459
p00118
C++
#include <iostream> #include <cstdio> using namespace std; const int MAX = 100; int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1}; //INPUT int H, W, res; char garden[MAX][MAX]; void dfs(int x, int y, char c) { garden[x][y] = '.'; for (int i = 0; i < 4; i++) { int nx = x + dx[i], ny = y + dy[i]; if (garden[nx][...
a.cc: In function 'int main()': a.cc:52:17: error: 'memset' was not declared in this scope 52 | memset(garden, '.', sizeof(garden)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <cstd...
s780794311
p00118
C++
#include<cstdio> int H, W; char map[201][201]; int dx[4]{ 0, 0, 1, -1 }; int dy[4]{ 1, -1, 0, 0 }; int ans = 0; void dfs(int x, int y,char ch) { map[x][y] = '.';//把符号@,#,*其中一个替换成.。和poj1979很像,稍微改下1979的代码就行 for (int i = 0; i < 4; i++) { int nx = x + dx[i], ny = y + dy[i]; if (0 <= nx&&nx < H && 0 <= ny&&ny < W&&m...
a.cc: In function 'int main()': a.cc:25:25: error: 'gets' was not declared in this scope; did you mean 'getw'? 25 | gets(map[i]); | ^~~~ | getw
s346106284
p00118
C++
#include<cstdio> int H, W; char map[201][201]; int dx[4]{ 0, 0, 1, -1 }; int dy[4]{ 1, -1, 0, 0 }; int ans = 0; void dfs(int x, int y,char ch) { map[x][y] = '.'; for (int i = 0; i < 4; i++) { int nx = x + dx[i], ny = y + dy[i]; if (0 <= nx&&nx < H && 0 <= ny&&ny < W&&map[nx][ny] ==ch)dfs(nx, ny, ch); } } int m...
a.cc: In function 'int main()': a.cc:25:25: error: 'gets' was not declared in this scope; did you mean 'getw'? 25 | gets(map[i]); | ^~~~ | getw
s070420450
p00118
C++
#include<cstdio> int H, W; char map[201][201]; int dx[4]{ 0, 0, 1, -1 }; int dy[4]{ 1, -1, 0, 0 }; int ans = 0; void dfs(int x, int y,char ch) { map[x][y] = '.';//把符号@,#,*其中一个替换成.。和poj1979很像,稍微改下1979的代码就行 for (int i = 0; i < 4; i++) { int nx = x + dx[i], ny = y + dy[i]; if (0 <= nx&&nx < H && 0 <= ny&&ny < W&&ma...
a.cc: In function 'int main()': a.cc:24:25: error: 'gets' was not declared in this scope; did you mean 'getw'? 24 | gets(map[i]); | ^~~~ | getw
s929962390
p00118
C++
#include <cstdio> #include <cstring> const int MAXN = 105; char map[MAXN][MAXN]; int n, m; int d[4][2] = { {-1, 0}, {1, 0}, {0, -1}, {0, 1} }; int dfs(int px, int py, char c) { map[px][py] = ' '; for(int i = 0; i < 4; i++) { int x = px + d[i][0]; int y = py + d[i][1]; if(x >= 0 &&...
a.cc: In function 'int dfs(int, int, char)': a.cc:21:1: warning: no return statement in function returning non-void [-Wreturn-type] 21 | } | ^ a.cc: At global scope: a.cc:57:11: error: redefinition of 'const int MAXN' 57 | const int MAXN = 105; | ^~~~ a.cc:5:11: note: 'const int MAXN' previo...
s040685172
p00118
C++
#include <iostream> #include <vector> #include <algorithm> #include <numeric> #include <set> #include <map> #include <string> #include <stack> #include <queue> #include <cmath> #include <cstdio> #include <istream> #include <sstream> #include <iomanip> #include <iterator> #include <climits> using namespace std; typedef...
a.cc:80:2: error: expected class-name at end of input 80 | ~ | ^
s235284813
p00118
C++
import java.util.Arrays; import java.util.Scanner; public class Main { MyScanner sc = new MyScanner(); Scanner sc2 = new Scanner(System.in); final int MOD = 1000000007; int[] dx = { 1, 0, 0, -1 }; int[] dy = { 0, 1, -1, 0 }; char[][] f; boolean[][] visit; int H, W; void run() { for (;;) { H = sc.nextIn...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Arrays; | ^~~~~~ 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.Scanner; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-t...
s578786910
p00118
C++
#include <cstdio> #include <queue> using namespace std; char area[200][200]; typedef pair<int, int> P; #define x first #define y second /* struct P{ int x, y; };*/ int dx[] = {-1, 0, 1, 0}; int dy[] = {0, -1, 0, 1}; int main() { int w, h, area_sum; while (scanf("%d%d", &w, &h), w != 0){ memset(area, 0, si...
a.cc: In function 'int main()': a.cc:23:17: error: 'memset' was not declared in this scope 23 | memset(area, 0, sizeof(area)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <queue> +...
s680806360
p00118
C++
#include<iostream> using namespace std; char yard[102][102]; int ans=0; void dfs(int x,int y,char c){ if(yard[x][y]!=c) return; if(yard[x][y]==c) yard[x][y]='.'; for(int i=-1;i<=1;i++){ for(int j=-1;j<=1;j++){ if((i==0||j==0)&&(i!=0||j!=0)){ dfs(x+i,y+j,c); } } } return; } int main(){ memset(ya...
a.cc: In function 'int main()': a.cc:20:9: error: 'memset' was not declared in this scope 20 | memset(yard,'.',sizeof(yard)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <...
s597022545
p00118
C++
#include<iostream> using namespace std; char yard[102][102]; int ans=0; void dfs(int x,int y,char c){ if(yard[x][y]!=c) return; if(yard[x][y]==c) yard[x][y]='.'; for(int i=-1;i<=1;i++){ for(int j=-1;j<=1;j++){ if((i==0||j==0)&&(i!=0||j!=0)){ dfs(x+i,y+j,c); } } } return; } int main(){ memset(ya...
a.cc: In function 'int main()': a.cc:20:9: error: 'memset' was not declared in this scope 20 | memset(yard,'.',sizeof(yard)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <...
s596374279
p00118
C++
using System; using System.Collections.Generic; using System.ComponentModel.Design; class Program { private static int h, w; private static char[][] m = new char[100][]; private static int[] dx = new[] {0, 1, 0, -1, 1, 1, -1, -1}; private static int[] dy = new[] {1, 0, -1, 0, 1, -1, 1, -1}; public static int Main...
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:3:7: error: expected nested-name-specifier before 'System' 3 | using System.C...
s502944382
p00118
C++
#include<vector> using namespace std; const int VECX[4]={-1,0,1,0}; const int VECY[4]={0,-1,0,1}; bool tukattaka[100][100]; int h,w,count;//hはx wはy char sekai[100][100]; void func(int x,int y,char ki){ tukattaka[x][y]=true; for(int i=0;i<4;i++){ if(x+VECX[i]<w&&x+VECX[i]>=0&&y+VECY[i]<h&&y+VECY[i]>=0&&tukatta...
a.cc: In function 'int main()': a.cc:25:17: error: 'cin' was not declared in this scope 25 | cin>>h>>w; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include<vector> +++ |+#include <iostrea...
s712878513
p00118
C++
#include<vector> using namespace std; const int VECX[4]={-1,0,1,0}; const int VECY[4]={0,-1,0,1}; bool tukattaka[100][100]; int h,w,count;//hはx wはy char sekai[100][100]; void func(int x,int y,char ki){ tukattaka[x][y]=true; for(int i=0;i<4;i++){ if(x+VECX[i]<w&&x+VECX[i]>=0&&y+VECY[i]<h&&y+VECY[i]>=0&&tukatta...
a.cc: In function 'int main()': a.cc:25:22: error: 'cin' is not a member of 'std' 25 | std::cin>>h>>w; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include<vector> +++ |+#include <ios...
s764314324
p00118
C++
import java.util.*; public class Main{ Scanner sc=new Scanner(System.in); int H=sc.nextInt(); int W=sc.nextInt(); String[][] k=new String[H][W]; for(int i=0;i<H;i++){ for(int j=0;j<W;j++){ k[i][j]=sc.next(); } } public static void main(String[] args){ int num=0; for(int i=0;i<H;i++){ for(int j=0;j<W;j++)...
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{ | ^~~~~~
s967698206
p00118
C++
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int H=sc.nextInt(); int W=sc.nextInt(); String[][] k=new String[H][W]; for(int i=0;i<H;i++){ for(int j=0;j<W;j++){ k[i][j]=sc.next(); } } int num=0; for(int i=0;i<H;i++){ for(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{ | ^~~~~~
s200391185
p00118
C++
import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int H=sc.nextInt(); int W=sc.nextInt(); char[][] k=new char[H][W]; for(int i=0; i< H; i++){ String line=sc.next(); for(int j=0; j< W; j++){ k[i][j]=line.charAt(j); } } int num=0; for(int i=0; ...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:8: error: expected ':' before 'static' 4 | public static void main(String[] args){ | ^~~~~~~ | : a.cc:4:26: error: 'Stri...
s799580036
p00118
C++
import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int H=sc.nextInt(); int W=sc.nextInt(); char[][] k=new char[H][W]; for(int i=0; i< H; i++){ String line=sc.next(); for(int j=0; j< W; j++){ k[i][j]=line.charAt(j); } } int num=0; for(int i=0...
a.cc:2:1: error: 'import' does not name a type 2 | import java.util.Scanner; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:8: error: expected ':' before 'static' 5 | public static void main(String[] args){ | ^~~~~~~ | : a.cc:5:26: error: 'Stri...
s903908140
p00118
C++
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.awt.Point; import java.util.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String str; while(!(str=br.readLine())...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.BufferedReader; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.io.IOException; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fm...
s750235369
p00118
C++
// Property Distribution import java.util.ArrayDeque; import java.util.Queue; import java.util.Scanner; public class Main { int h, w; char[][] field; public static void main(String[] args) { new Main().run(); } void run() { Scanner sc = new Scanner(System.in); while (true) { h = sc.nextInt(); w = sc...
a.cc:2:1: error: 'import' does not name a type 2 | import java.util.ArrayDeque; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import java.util.Queue; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules...
s977793718
p00118
C++
#include<cstdio> #include<cmath> #include<algorithm> #include<iostream> #include<string> #include<vector> #include<map> #include<cstdlib> #include<iomanip> #include<queue> #include<set> using namespace std; char a[100][100]; int ans = 0; int h, w; void Solution(int y, int x, char z) { a[y][x] = '0'; if...
a.cc: In function 'int main()': a.cc:47:26: error: 'n' was not declared in this scope; did you mean 'yn'? 47 | while (cin>>h>>w && (n|m)) | ^ | yn a.cc:47:28: error: 'm' was not declared in this scope 47 | while (cin>>h>>w && (n|m)) | ...
s989015263
p00118
C++
#include<cstdio> #include<cmath> #include<algorithm> #include<iostream> #include<string> #include<vector> #include<map> #include<cstdlib> #include<iomanip> #include<queue> #include<set> using namespace std; char a[101][101]; int ans = 0; int h, w; void Solution(int y, int x, char z) { a[y][x] = '0'; if...
a.cc: In function 'int main()': a.cc:47:26: error: 'n' was not declared in this scope; did you mean 'yn'? 47 | while (cin>>h>>w && (n|m)) | ^ | yn a.cc:47:28: error: 'm' was not declared in this scope 47 | while (cin>>h>>w && (n|m)) | ...
s781839656
p00118
C++
#include<cstdio> #include<cmath> #include<algorithm> #include<iostream> #include<string> #include<vector> #include<map> #include<cstdlib> #include<iomanip> #include<queue> #include<set> using namespace std; char a[101][101]; int ans = 0; int h, w; void Solution(int y, int x, char z) { a[y][x] = '0'; if...
a.cc: In function 'int main()': a.cc:47:26: error: 'n' was not declared in this scope; did you mean 'yn'? 47 | while (cin>>h>>w && (n|m)) | ^ | yn a.cc:47:28: error: 'm' was not declared in this scope 47 | while (cin>>h>>w && (n|m)) | ...
s804589829
p00118
C++
void append(char fruit[100][100], int (&map)[100][100], int count, int i, int j, int h, int w){ if(j != w -1){ if(map[i][j+1] == 0 && fruit[i][j+1] == fruit[i][j]){ map[i][j+1] = count; append(fruit, map, count, i, j+1, h, w); } } if(i != h - 1){ if(map[i...
a.cc: In function 'int main(int, const char**)': a.cc:37:9: error: 'cin' was not declared in this scope 37 | cin >> H >> W; | ^~~ a.cc:69:17: error: 'cout' was not declared in this scope; did you mean 'count'? 69 | cout << map[i][j] << " "; | ^~~~ ...
s805491407
p00118
C++
#include<iostream> #include<algorithm> #include<vector> using namespace std; int H,W; void saiki(char map[][100],int i,int j,char c){ map[i][j] = ' '; for (int dx=-1;dx<=1;dx++){ if(i+dx >= 0 && i+dx<W){ if(map[i+dx][j] == c){ saiki(map,i+dx,j,c); } } } for (int dy=-1;dy<=1;dy++){ if(i...
a.cc:60:6: error: 'javascript' does not name a type 60 | }javascript:void(0) | ^~~~~~~~~~
s699423328
p00118
C++
//??-2015-11-1 /* ?意: 在H * W的矩形果?里有苹果、梨、蜜柑三?果?, 相?(上下左右)的同?果?属于同一个区域,?出果?的果?分布,求?共有多少个区域。 (原?的??中苹果?リ,梨?カ,蜜柑?ミ, ?中共10个区域) ?入: 多?数据,??数据第一行??个整数H,W(H <= 100, W <= 100), H = 0 且 W = 0代表?入?束。以下H行W列表示果?的果?分布, 苹果是@,梨是#, 蜜柑是*。 ?出: ?于??数据,?出其区域的个数。 */ # include <cstdio> # include <algorithm> # include <stack> # include <strin...
a.cc: In function 'int main()': a.cc:59:17: error: 'memset' was not declared in this scope 59 | memset(vis, 0, sizeof(vis)); | ^~~~~~ a.cc:15:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 14 | # include <iostream> ...
s303745401
p00118
C++
#include <bits/stdc++.h> #define range(i, a, n) for(int (i) = (a); (i) < (n); (i)++) #define rep(i, n) for(int (i) = 0; (i) < (n); (i)++) using namespace std; int h, w; string field[100]; int dx = { 1, 0,-1, 0}; int dy = { 0,-1, 0, 1}; void dfs(int y, int x, char mark){ field[y][x] = '-'; for(int i = 0; i <...
a.cc:9:5: error: scalar object 'dx' requires one element in initializer 9 | int dx = { 1, 0,-1, 0}; | ^~ a.cc:10:5: error: scalar object 'dy' requires one element in initializer 10 | int dy = { 0,-1, 0, 1}; | ^~
s230516534
p00118
C++
#include<stdio.h> int map[102][102]; void paint(int x,int y,int type){ if(map[x][y]==type){ map[x][y]=0; paint(x-1,y,type); paint(x+1,y,type); paint(x,y-1,type); paint(x,y+1,type); } } int main(void){ int h,w,i,j,ans=0; char str[110]; scanf("%d%d",&h,&w); ...
a.cc: In function 'int main()': a.cc:50:27: error: expected ';' before '}' token 50 | javascript:void(0) | ^ | ; 51 | } | ~
s035875878
p00118
C++
#include <string> #include <vector> #include <iostream> using namespace std; int H, W; vector<string> map; const vector<int> dx = { 0, 1, 0, -1 }; const vector<int> dy = { 1, 0, -1, 0 }; void rec(int x, int y, char c) { map[y][x] = '.'; for(int i = 0; i < 4; i++) { if(0 <= x + dx[i] && x +...
a.cc: In function 'void rec(int, int, char)': a.cc:24:17: error: 'dfs' was not declared in this scope 24 | dfs(x + dx[i], y + dy[i]); | ^~~ a.cc: In function 'int solve()': a.cc:38:23: error: 'j' was not declared in this scope 38 | if(map[i][j] != '.') | ...
s432134529
p00118
C++
#include <string> #include <vector> #include <iostream> using namespace std; int H, W; vector<string> map; const vector<int> dx = { 0, 1, 0, -1 }; const vector<int> dy = { 1, 0, -1, 0 }; void rec(int x, int y, char c) { map[y][x] = '.'; for(int i = 0; i < 4; i++) { if(0 <= x + dx[i] && x +...
a.cc: In function 'void rec(int, int, char)': a.cc:24:17: error: 'dfs' was not declared in this scope 24 | dfs(x + dx[i], y + dy[i]); | ^~~ a.cc: In function 'int solve()': a.cc:38:23: error: 'j' was not declared in this scope 38 | if(map[i][j] != '.') | ...
s464271892
p00118
C++
#include <iostream> #include <vector> #include <string> #include <cmath> using namespace std; typedef long long ll; ll W, H; char a[101][101]; ll sx, sy; ll SUM; void dfs(int x,int y, char cur) { if(a[y][x]==cur) { a[y][x] = '-'; }else { return; } int dx[4] = { -1,1,0,0 }; int dy[4] = { 0,0,-1,1 }; for (int...
a.cc: In function 'int main()': a.cc:33:17: error: 'memset' was not declared in this scope 33 | memset(a, 0, sizeof(a)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <cmath> +++ |+#...
s009483937
p00118
C++
#include <iostream> #include <vector> #include <string> #include <cmath> using namespace std; typedef long long ll; ll W, H; char a[101][101]; ll sx, sy; ll SUM; void dfs(int x,int y, char cur) { if(a[y][x]==cur) { a[y][x] = '-'; }else { return; } int dx[4] = { -1,1,0,0 }; int dy[4] = { 0,0,-1,1 }; for (int...
a.cc: In function 'int main()': a.cc:33:17: error: 'memset' was not declared in this scope 33 | memset(a, 0, sizeof(a)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <cmath> +++ |+#...
s982407359
p00118
C++
F #include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(int)(n);i++) int dx[] = {1,0,-1,0}, dy[] = {0,1,0,-1}; int w, h; char f[102][102]; bool ng(int x, int y) { return (x<0 or y<0 or x>=w or y>=h); } void dfs(int x, int y) { char c = f[y][x]; f[y][x] = '.'; rep(i,4) { ...
a.cc:1:1: error: 'F' does not name a type 1 | F | ^ 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:2: /usr/include/c++/14/ext/type_...
s910348542
p00118
C++
F #include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(int)(n);i++) int dx[] = {1,0,-1,0}, dy[] = {0,1,0,-1}; int w, h; char f[102][102]; bool ng(int x, int y) { return (x<0 or y<0 or x>=w or y>=h); } void dfs(int x, int y) { char c = f[y][x]; f[y][x] = '.'; rep(i,4) { ...
a.cc:1:1: error: 'F' does not name a type 1 | F | ^ 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:2: /usr/include/c++/14/ext/type_...
s327520544
p00118
C++
#include<iostream> using namespace std; #define MAXSIZE 100 char Graph[MAXSIZE][MAXSIZE]; int visited[MAXSIZE][MAXSIZE]; int h,w,number; int x[4]={-1,1,0,0}; int y[4]={0,0,-1,1}; void dfs(int i,int j) { int d,p,q; for(d=0;d<4;d++) { p=i+x[d]; q=j+y[d]; if(p>=0&&p<h&&q>=0&&q<w&&Graph[i][j]==Graph[p][q]&&visited...
a.cc: In function 'int main()': a.cc:30:9: error: 'memset' was not declared in this scope 30 | memset(visited,0,sizeof(visited)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#inclu...
s529352064
p00118
C++
#include <stdio.h> #include <stdlib.h> int dfs(char **map,int **check,int i,int j,int h){ int res=1; check[i][j]=2; if(map[i][j+1]==map[i][j] && check[i][j+1]==1)res=0; if(map[i][j+1]==map[i][j] && check[i][j+1]==0){ if(map[i][j+1]=='\n')return 0; else res*=dfs(map,check,i,j+1,h); } if(i+1>=h)return res; if...
a.cc: In function 'int main()': a.cc:29:19: error: invalid conversion from 'void*' to 'char**' [-fpermissive] 29 | map=malloc(sizeof(char *)*sx); | ~~~~~~^~~~~~~~~~~~~~~~~~~ | | | void* a.cc:31:30: error: invalid conversion from 'void*' to 'ch...
s879310895
p00118
C++
#include <iostream> using namespace std; int dx[] = {1, -1, 0, 0}; int dy[] = {0, 0, 1, -1}; char map[105][105]; //H <= 100, W <= 100 int h, w, vis[105][105]; void dfs(int x, int y, char c) { int i, xx, yy; for(i = 0; i < 4; i++) { xx = x + dx[i]; yy = y + dy[i]; if(xx >...
a.cc: In function 'void dfs(int, int, char)': a.cc:18:70: error: 'ma' was not declared in this scope; did you mean 'map'? 18 | if(xx >= 0 && xx < h && yy >= 0 && yy < w && !vis[xx][yy] && ma[xx][yy] == c) //?找相同区域?char相同 | ^~ |...
s116901092
p00118
C++
#include <iostream> using namespace std; int dx[] = {1, -1, 0, 0}; int dy[] = {0, 0, 1, -1}; char map[105][105]; //H <= 100, W <= 100 int h, w, vis[105][105]; void dfs(int x, int y, char c) { int i, xx, yy; for(i = 0; i < 4; i++) { xx = x + dx[i]; yy = y + dy[i]; if(xx >...
a.cc: In function 'int main()': a.cc:35:9: error: 'memset' was not declared in this scope 35 | memset(vis, 0, sizeof vis); //vis全部元素置?0,即初始化数? | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream>...
s844517491
p00118
C++
#include <iostream> #include <sstream> #include <cstdlib> const int MAX_W = 100; const int MAX_H = 100; int H, W; char field[MAX_H][MAX_W] = {'.'}; void solve(int y, int x) { int dx[4] = {-1, 0, 1, 0}; int dy[4] = {0, 1, 0, -1}; char c = field[y][x]; field[y][x] = '.'; for(int i = 0; i < 4; i++) ...
a.cc: In function 'void solve(int, int)': a.cc:20:18: error: too many arguments to function 'void solve(int, int)' 20 | solve(ny, nx, H, W); | ~~~~~^~~~~~~~~~~~~~ a.cc:10:6: note: declared here 10 | void solve(int y, int x) { | ^~~~~
s139750259
p00118
C++
#include <iostream> using namespace std; char f[124][124]; int H, W; const dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0}; inline bool inside(int y, int x){return 0 <= y && y < H && 0 <= x && x < W;} void area(int y, int x) { char if2 = f[y][x]; f[y][x] = '0'; for (int i = 0; i < 4; i++){ int ny = y + dy[i], nx =...
a.cc:7:7: error: 'dx' does not name a type 7 | const dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0}; | ^~ a.cc:7:27: error: expected unqualified-id before ',' token 7 | const dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0}; | ^ a.cc:7:34: error: expected constructor, destructo...
s105644952
p00118
C++
#include<iostream> #include<cstdio> #include<cstring> using namespace std; const int maxn = 103; char map[maxn][maxn]; int move [][2] = {{0,1},{1,0},{0,-1},{-1,0}}; int n , m; int ans; void dfs ( int i , int j ){ char temp = map[i][j]; map[i][j] = '.'; for(int k = 0 ; k < 4 ; k ++){ if((i+move[k][0]>0)&&(i+move...
a.cc: In function 'void dfs(int, int)': a.cc:17:23: error: reference to 'move' is ambiguous 17 | if((i+move[k][0]>0)&&(i+move[k][0]<=n)&&(j+move[k][1]>0)&&(j+move[k][1]<=m)&&map[i+move[k][0]][j+move[k][1]]==temp){ | ^~~~ In file included from /usr/include/c++/14/string:51,...
s611717872
p00118
C++
#include<iostream> #include<cstdio> #include<cstring> using namespace std; const int maxn = 103; char map[maxn][maxn]; int move [4][2] = {{0,1},{1,0},{0,-1},{-1,0}}; int n , m; int ans; void dfs ( int i , int j ){ char temp = map[i][j]; map[i][j] = '.'; for(int k = 0 ; k < 4 ; k ++){ if((i+move[k][0]>0)&&(i+mov...
a.cc: In function 'void dfs(int, int)': a.cc:17:23: error: reference to 'move' is ambiguous 17 | if((i+move[k][0]>0)&&(i+move[k][0]<=n)&&(j+move[k][1]>0)&&(j+move[k][1]<=m)&&map[i+move[k][0]][j+move[k][1]]==temp){ | ^~~~ In file included from /usr/include/c++/14/string:51,...
s003271672
p00118
C++
//AOJ0118 Property Distribution #include<cstdio> #include<cstring> char map[105][105]; int dx[4]={-1,0,1,0}; int dy[4]={0,1,0,-1}; int W,H; void dfs(int x,int y,char c){ map[x][y]='.'; for(int i=0;i<4;i++){ int nx=x+dx[i],ny=y+dy[i]; if(0<=nx&&nx<H&&0<=ny&&ny<W&&map[nx][ny]==c)dfs(nx,ny,c);果樹園 ...
a.cc: In function 'void dfs(int, int, char)': a.cc:12:66: error: '\U0000679c\U00006a39\U00005712' was not declared in this scope 12 | if(0<=nx&&nx<H&&0<=ny&&ny<W&&map[nx][ny]==c)dfs(nx,ny,c);果樹園 | ^~~~~~
s961586557
p00118
C++
#include <bits/stdc++.h> using namespace std; int H,M,cnt=0; char farm[100][100]; int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1}; void dfs(int x, int y ,char z){ farm[x][y]='.'; for(int i=0;i<4;i++){ if(x+dx[i]>=0 && x+dx[i]<H && y+dy[i]>=0 && y+dy[i]<M && farm[x+dx[i]][y+dy[i]]==z) dfs(x+dx[i],y+dy[i],z); retur...
a.cc: In function 'int main()': a.cc:21:22: error: expected ';' before ')' token 21 | for(int i=0;i<H,i++){ | ^ | ; a.cc:27:22: error: expected ';' before ')' token 27 | for(int i=0;i<H,i++){ | ^ | ;
s630838856
p00118
C++
#include <cstdio> #include <map> #include <queue> #include <cstring> #define PRINTF(...) int h, w; char area[100][100]; void visualize() { for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { PRINTF("%c", area[i][j]); } PRINTF("\n"); } } void replace(char c, int i...
a.cc: In function 'int solve()': a.cc:41:17: error: 'gets' was not declared in this scope; did you mean 'getw'? 41 | gets(buf); | ^~~~ | getw
s259829725
p00118
C++
#include <iostream> #include <limits.h> #include <queue> #include <algorithm> #include <string> //typedef pair<int,int> P; using namespace std; const int INF=INT_MAX/3; const int V_MAX=10000,E_MAX=10000; int H,W; const int MAX=200; char maps[MAX][MAX]; void solve(int i,int j){ int dx[4]={-1,0,1,0}; int dy[4]...
a.cc: In function 'int main()': a.cc:80:2: error: expected '}' at end of input 80 | } | ^ a.cc:43:11: note: to match this '{' 43 | int main(){ | ^
s167296823
p00118
C++
#include <bits/stdc++.h> using namespace std; char a[100][100]; int vis[110][110], m, n; int di[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}}; void dfs(int x,int y,char zf){ vis[x][y] = 1; for(int i = 0;i < 4;i++) { int tx = x + di[i][0]; int ty = y + di[i][1]; if(a[tx][ty] == op && tx <...
a.cc: In function 'void dfs(int, int, char)': a.cc:14:25: error: 'op' was not declared in this scope 14 | if(a[tx][ty] == op && tx < m && tx >= 0 && ty < n && ty >= 0 && !vis[tx][ty]) | ^~
s820311695
p00118
C++
#include<iostream> #include<string> using namespace std; const int MAX = 101; int X[MAX][MAX]; //??????????¨???? int used[MAX][MAX]; //???????????????????????????????????? int ans = 0; int H, W; void input() { cin >> H >> W; if (H == 0 && W == 0) return; for (int i = 0; i < H; i++) { string ch; cin >> ch; fo...
a.cc: In function 'void input()': a.cc:29:9: error: 'memset' was not declared in this scope 29 | memset(used, 0, sizeof(used)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include...
s544872198
p00118
C++
#include "stdafx.h" #include <iostream> #include <algorithm> using namespace std; #define MAX_H 100 // ??\??? int H, W; char graph[MAX_H + 2][MAX_H + 2]; int visited[MAX_H + 2][MAX_H + 2]; bool dfs(int bx, int by, int x, int y) { int dx[] = { 1,-1, 0, 0 }, dy[] = { 0,0, 1, -1 }; int nx = x, ny = y; bool res; ...
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s034909699
p00118
C++
#include <stdio.h> int H,W; char map[100][100]; bool paint(int i,int j,char data){ if(data==' ')return false; if(i>0&&map[i][j]==map[i-1][j])paint(i-1,j); if(j>0&&map[i][j]==map[i][j-1])paint(i,j-1); if(i<=H&&map[i][j]==map[i+1][j])paint(i+1,j); if(i<=W&&map[i][j]==map[i][j+1])paint(i,j+1); return true; int ...
a.cc: In function 'bool paint(int, int, char)': a.cc:9:45: error: too few arguments to function 'bool paint(int, int, char)' 9 | if(i>0&&map[i][j]==map[i-1][j])paint(i-1,j); | ~~~~~^~~~~~~ a.cc:6:6: note: declared here 6 | bool paint(int i,int j,char data){ ...
s605689271
p00118
C++
#include <stdio.h> int H,W; char map[100][100]; bool paint(int i,int j){ if(data==' ')return false; if(i>0&&map[i][j]==map[i-1][j])paint(i-1,j); if(j>0&&map[i][j]==map[i][j-1])paint(i,j-1); if(i<=H&&map[i][j]==map[i+1][j])paint(i+1,j); if(i<=W&&map[i][j]==map[i][j+1])paint(i,j+1); return true; } int main(){ ...
a.cc: In function 'bool paint(int, int)': a.cc:7:12: error: 'data' was not declared in this scope 7 | if(data==' ')return false; | ^~~~ a.cc: In function 'int main()': a.cc:21:34: error: expected ')' before ';' token 21 | scanf("%s",map[i]; | ~ ...
s117064429
p00118
C++
#include <stdio.h> int H,W; char map[100][100]; bool paint(int i,int j){ if(map[i][j]==' ')return false; if(i>0&&map[i][j]==map[i-1][j])paint(i-1,j); if(j>0&&map[i][j]==map[i][j-1])paint(i,j-1); if(i<=H&&map[i][j]==map[i+1][j])paint(i+1,j); if(i<=W&&map[i][j]==map[i][j+1])paint(i,j+1); map[i][j]=' '; return ...
a.cc: In function 'int main()': a.cc:22:34: error: expected ')' before ';' token 22 | scanf("%s",map[i]; | ~ ^ | )
s427736609
p00118
C++
#include<stdio.h> #include<string.h> using namespace std; int m,n,ans,v[30][30],move[4][2]= {0,1,0,-1,1,0,-1,0}; char a[30][30]; void dfs(char c,int x,int y) { for(int i = 0; i < 4; i ++) { int x1 = x+move[i][0]; int y1 = y+move[i][1]; if(x1>=0&&x1<m&&y1<n&&y1>=0&&a[x1][y1]==c&&!v[x1][y1...
a.cc: In function 'int main()': a.cc:29:13: error: 'gets' was not declared in this scope; did you mean 'getw'? 29 | gets(a[i]); | ^~~~ | getw
s425033302
p00118
C++
#include<iostream> using namespace std; const int MAXN = 200; char B[MAXN][MAXN]; int W,H,cnt; int dx[5] = {1,0,-1,0}; int dy[5] = {0,1,0,-1}; void isStar(int y, int x) { for(int i =0 ; i<5;i++) if(B[y+dy[i]][x+dx[i]]=='*') {B[y+dy[i]][x+dx[i]]='0';isStar(y+dy[i],x+dx[i]);} } void isSharp(int y, int x) { for(...
a.cc: In function 'int main()': a.cc:69:17: error: 'memset' was not declared in this scope 69 | memset(B,'0',sizeof(B)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |...
s044945587
p00118
C++
#include <cstdio> #include <algorithm> using namespace std; const int max_n = 21; int W, H; char farm[max_n][max_n]; const int dx[4] = {-1, 0, 1, 0}; const int dy[4] = {0, -1, 0, 1}; void dfs(int x, int y, char t){ farm[x][y] = '!'; for(int i = 0; i < 4; i++){ int xx = x+dx[i]; int yy = y+dy[i]; ...
a.cc:22:1: error: ISO C++ forbids declaration of 'solve' with no type [-fpermissive] 22 | solve(){ | ^~~~~ a.cc: In function 'int solve()': a.cc:35:1: warning: no return statement in function returning non-void [-Wreturn-type] 35 | } | ^ a.cc: In function 'int main()': a.cc:41:13: error: 'gets' was no...
s839865707
p00118
C++
#include <cstdio> #include <algorithm> using namespace std; const int max_n = 21; int W, H; char farm[max_n][max_n]; const int dx[4] = {-1, 0, 1, 0}; const int dy[4] = {0, -1, 0, 1}; void dfs(int x, int y, char t){ farm[x][y] = '!'; for(int i = 0; i < 4; i++){ int xx = x+dx[i]; int yy = y+dy[i]; ...
a.cc: In function 'int main()': a.cc:41:13: error: 'gets' was not declared in this scope; did you mean 'getw'? 41 | gets(farm[i]); | ^~~~ | getw
s561918545
p00118
C++
#include <stdio.h> void dfs(char values,int H,int W,int x, int y,int item) { if(x<0 || H<=x) return; if(y<0 || W<=y) return; if(values[x][y]!=item) return; farms[x][y] = '.'; dfs(values,H,W,x+1,y,item); dfs(values,H,W,x-1,y,item); dfs(values,H,W,x,y+1,item); dfs(values,H,W,x,y-1,item); } int solve(char value...
a.cc: In function 'void dfs(char, int, int, int, int, int)': a.cc:7:18: error: invalid types 'char[int]' for array subscript 7 | if(values[x][y]!=item) return; | ^ a.cc:8:9: error: 'farms' was not declared in this scope 8 | farms[x][y] = '.'; | ^~~~~ a.cc: In...
s173241649
p00118
C++
#include<iostream> #include <stdio.h> using namespace std; void dfs(char values,int H,int W,int x, int y,int item) { if(x<0 || H<=x) return; if(y<0 || W<=y) return; if(values[x][y]!=item) return; farms[x][y] = '.'; dfs(values,H,W,x+1,y,item); dfs(values,H,W,x-1,y,item); dfs(values,H,W,x,y+1,item); dfs(values,H...
a.cc: In function 'void dfs(char, int, int, int, int, int)': a.cc:9:18: error: invalid types 'char[int]' for array subscript 9 | if(values[x][y]!=item) return; | ^ a.cc:10:9: error: 'farms' was not declared in this scope 10 | farms[x][y] = '.'; | ^~~~~ a.cc: I...
s452679405
p00118
C++
#include<iostream> #include <stdio.h> using namespace std; /* void dfs(char values,int H,int W,int x, int y,int item) { if(x<0 || H<=x) return; if(y<0 || W<=y) return; if(values[x][y]!=item) return; farms[x][y] = '.'; dfs(values,H,W,x+1,y,item); dfs(values,H,W,x-1,y,item); dfs(values,H,W,x,y+1,item); dfs(value...
a.cc: In function 'int main()': a.cc:41:36: error: 'value' was not declared in this scope; did you mean 'values'? 41 | printf("%d", solve(value,H,W)); | ^~~~~ | values a.cc:41:30: error: 'solve' was not declared in this...
s327181197
p00118
C++
#include<iostream> #include <stdio.h> using namespace std; /* void dfs(char values,int H,int W,int x, int y,int item) { if(x<0 || H<=x) return; if(y<0 || W<=y) return; if(values[x][y]!=item) return; farms[x][y] = '.'; dfs(values,H,W,x+1,y,item); dfs(values,H,W,x-1,y,item); dfs(values,H,W,x,y+1,item); dfs(value...
a.cc: In function 'int main()': a.cc:41:36: error: 'value' was not declared in this scope; did you mean 'values'? 41 | std::cout << solve(value,H,W) << std::endl; | ^~~~~ | values a.cc:41:30: error: 'solve' was not decl...
s818044667
p00118
C++
#include<iostream> #include <stdio.h> using namespace std; /* void dfs(char values,int H,int W,int x, int y,int item) { if(x<0 && H<=x) return; if(y<0 && W<=y) return; if(values[x][y]!=item) return; farms[x][y] = '.'; dfs(values,H,W,x+1,y,item); dfs(values,H,W,x-1,y,item); dfs(values,H,W,x,y+1,item); dfs(value...
a.cc: In function 'int main()': a.cc:41:30: error: 'solve' was not declared in this scope 41 | std::cout << solve(values,H,W) << std::endl; | ^~~~~
s629973181
p00118
C++
#include <stdio.h> /* void dfs(char values,int H,int W,int x, int y,int item) { if(x<0 && H<=x) return; if(y<0 && W<=y) return; if(values[x][y]!=item) return; farms[x][y] = '.'; dfs(values,H,W,x+1,y,item); dfs(values,H,W,x-1,y,item); dfs(values,H,W,x,y+1,item); dfs(values,H,W,x,y-1,item); } int solve(char va...
a.cc: In function 'int main()': a.cc:32:14: error: 'cin' is not a member of 'std' 32 | std::cin >> H >> W; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include <stdio.h> +++ |+#include <iostream> ...
s660225231
p00118
C++
#include <stdio.h> /* void dfs(char values,int H,int W,int x, int y,int item) { if(x<0 && H<=x) return; if(y<0 && W<=y) return; if(values[x][y]!=item) return; farms[x][y] = '.'; dfs(values,H,W,x+1,y,item); dfs(values,H,W,x-1,y,item); dfs(values,H,W,x,y+1,item); dfs(values,H,W,x,y-1,item); } int solve(char va...
a.cc: In function 'int main()': a.cc:32:14: error: 'cin' is not a member of 'std' 32 | std::cin >> H >> W; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include <stdio.h> +++ |+#include <iostream> ...
s564729203
p00118
C++
import sys sys.setrecursionlimit(100000) fields = [] i = 0 H, W = 0, 0 field = [] for line in sys.stdin: line = line.rstrip() if line[0] not in ["#", "@", "*"]: line = line.split(" ") tmpH = H tmpW = W H = int(line[0]) W = int(line[1]) if (len(field) != 0): fields.append([field, tmpH, tmpW]) field ...
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'
s990641811
p00118
C++
#include <iostream> using namespace std; /* void dfs(char values,int H,int W,int x, int y,int item) { if(x<0 && H<=x) return; if(y<0 && W<=y) return; if(values[x][y]!=item) return; farms[x][y] = '.'; dfs(values,H,W,x+1,y,item); dfs(values,H,W,x-1,y,item); dfs(values,H,W,x,y+1,item); dfs(values,H,W,x,y-1,item); ...
a.cc: In function 'int main()': a.cc:39:30: error: 'solve' was not declared in this scope 39 | std::cout << solve(values,H,W) << std::endl; | ^~~~~
s395072985
p00118
C++
import sys sys.setrecursionlimit(100000000) def main(): process() def process(): for data in get_dataset(): print search(data) def search(data): count = 0 H = len(data) W = len(data[0]) for i in xrange(H): for j in xrange(W): if data[i][j] == '.': ...
a.cc:65:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes 65 | if __name__ == '__main__': | ^~~~~~~~~~ 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'
s558624734
p00118
C++
#include <iostream> using namespace std; int dir[4][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}}; char table[100][100]; void Dfs(vector<vector<char> >& table, int h, int w, int x, int y) { char cur = table[x][y]; table[x][y] = 'X'; for (int i = 0; i < 4; ++i) { int next_x = x + dir[i][0]; int next_y = y + d...
a.cc:8:6: error: variable or field 'Dfs' declared void 8 | void Dfs(vector<vector<char> >& table, int h, int w, int x, int y) { | ^~~ a.cc:8:10: error: 'vector' was not declared in this scope 8 | void Dfs(vector<vector<char> >& table, int h, int w, int x, int y) { | ^~~~~~ a.cc:2:1: no...
s861574791
p00118
C++
#include<iostream> using namespace std; char table[100][100]; int W, H; const int direction[4][2] = {{ -1, 0 }, { 1, 0 }, { 0, -1 }, { 0, 1 }}; void dfs(int x, int y, char cur) { table[x][y] = 'x'; for (int i = 0; i < 4; ++i) { int nx = x + direction[i][0]; int ny = y + ...
a.cc: In function 'void dfs(int, int, char)': a.cc:16:68: error: 'tree' was not declared in this scope; did you mean 'free'? 16 | if (nx >= 0 && nx < W && ny >= 0 && ny < H && table[nx][ny] == tree) | ^~~~ | ...
s753132222
p00118
C++
#include<iostream> using namespace std; char table[100][100]; int W, H; const int direction[4][2] = {{ -1, 0 }, { 1, 0 }, { 0, -1 }, { 0, 1 }}; void Dfs(int x, int y, char cur) { table[x][y] = 'X'; for (int i = 0; i < 4; ++i) { int next_x = x + dir[i][0]; int next_y = y + dir[i][1]; ...
a.cc: In function 'void Dfs(int, int, char)': a.cc:13:22: error: 'dir' was not declared in this scope; did you mean 'div'? 13 | int next_x = x + dir[i][0]; | ^~~ | div a.cc:15:33: error: 'w' was not declared in this scope 15 | if (next_x >= 0 && next_x...
s860791130
p00118
C++
#include<iostream> using namespace std; char table[100][100]; int W, H; const int dir[4][2] = {{ -1, 0 }, { 1, 0 }, { 0, -1 }, { 0, 1 }}; void Dfs(int x, int y, char cur) { table[x][y] = 'X'; for (int i = 0; i < 4; ++i) { int next_x = x + dir[i][0]; int next_y = y + dir[i][1]; if...
a.cc: In function 'void Dfs(int, int, char)': a.cc:15:33: error: 'w' was not declared in this scope 15 | if (next_x >= 0 && next_x < w | ^ a.cc:16:35: error: 'h' was not declared in this scope 16 | && next_y >=0 && next_y < h | ...
s643269563
p00118
C++
#include<iostream> using namespace std; char Array[200000][200000]; int count; void DFS(int h,int w,char c){ if(Array[h][w] != c){ return; } char tmp=Array[h][w]; Array[h][w] = '.'; DFS(h-1,w,tmp); DFS(h,w+1,tmp); DFS(h+1,w,tmp); DFS(h,w-1,tmp); } int main(){ int H,W; while(1){ ...
/tmp/ccgoxiMR.o: in function `main': a.cc:(.text+0x1bc): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccgoxiMR.o a.cc:(.text+0x1c5): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccgoxiMR.o a.cc:(.text+0x21b): reloc...
s392767528
p00118
C++
#include <iostream> using namespace std; char T[102][102]; void DFS(int y,int x,char f){ if(T[y][x]!=f) return; T[y][x]='?'; DFS(y-1,x ,f); DFS(y-1,x+1,f); DFS(y ,x+1,f); DFS(y+1,x+1,f); DFS(y+1,x ,f); DFS(y+1,x-1,f); DFS(y ,x-1,f); DFS(y-1,x-1,f); } int main(){ int h,w; cin>>h>>w; for(int i...
a.cc:40:41: error: stray '@' in program 40 | DFS(i,j,@); | ^ a.cc:50:41: error: stray '#' in program 50 | DFS(i,j,#); | ^ a.cc: In function 'int main()': a.cc...
s695762791
p00118
C++
#include<iostream> using namespace std; char HW[101][101]; void DFS(int Y,int X,char c) { if(HW[Y][X]=='0'||HW[Y][X]!=c) return; HW[Y][X]='0'; DFS(Y-1,X,c); DFS(Y,X+1,c); DFS(Y+1,X,c); DFS(Y,X-1,c); } int main() { int H,W; while(1){ cin>>H>>W; if(H==0&&W==0) break; for(int y=1;y<=H+1;y++){ ...
a.cc: In function 'int main()': a.cc:46:2: error: expected '}' at end of input 46 | } | ^ a.cc:22:17: note: to match this '{' 22 | while(1){ | ^ a.cc:46:2: error: expected '}' at end of input 46 | } | ^ a.cc:20:1: note: to match this '{' 20 | { | ^
s719390317
p00118
C++
#include<iostream> #include<algorithm> #include<utility> #include<cmath> #include<string> using namespace std; char map[101][101]; void dfs(int x,int y,char a){ if(x>a||x<0){ return; } else if(y>b||y<0){ return; } if(map[x][y]== a){ map[x][y]='x'; } else{ return; } dfs(x+1,y,a); ...
a.cc: In function 'void dfs(int, int, char)': a.cc:15:13: error: 'b' was not declared in this scope 15 | else if(y>b||y<0){ | ^
s667233845
p00118
C++
#include<iostream> #include<algorithm> #include<utility> #include<cmath> #include<string> using namespace std; char map[101][101]; void dfs(int x,int y,char a){ if(x>a||x<0){ return; } else if(y>b||y<0){ return; } if(map[x][y]== a){ map[x][y]='x'; } else{ return; } dfs(x+1,y,a); ...
a.cc: In function 'void dfs(int, int, char)': a.cc:15:13: error: 'b' was not declared in this scope 15 | else if(y>b||y<0){ | ^
s967985314
p00118
C++
#include<iostream> #include<algorityhm> using namespace std; int x,y; int map(int a,int b,char s){ if(a>x||a<0){ return; } if(b>y||b<0){ return; } if(s=='@'||s=='#'||s=='*'){ s='X'; } if(s!='X'){ map(a+1,b,s); map(a-1,b,s); map(a,b-1,s); map(a,b+1,s); } } int main(){ ...
a.cc:2:9: fatal error: algorityhm: No such file or directory 2 | #include<algorityhm> | ^~~~~~~~~~~~ compilation terminated.
s038698481
p00118
C++
#include<iostream> using namespace std; int x,y; int map(int a,int b,char s){ if(a>x||a<0){ return; } if(b>y||b<0){ return; } if(s=='@'||s=='#'||s=='*'){ s='X'; } if(s!='X'){ map(a+1,b,s); map(a-1,b,s); map(a,b-1,s); map(a,b+1,s); } } int main(){ char t[100][100]; ...
a.cc: In function 'int map(int, int, char)': a.cc:9:5: error: return-statement with no value, in function returning 'int' [-fpermissive] 9 | return; | ^~~~~~ a.cc:12:5: error: return-statement with no value, in function returning 'int' [-fpermissive] 12 | return; | ^~~~~~ a.cc:23:1: w...
s194281750
p00118
C++
#include<iostream> #include<cstdio> #include<cstring> using namespace std; const int maxn=1000,inf=0x3f3f3f3f; char maze[maxn][maxn]; int h,w,ans=0; void dfs(int x,int y,char sig){ maze[x][y]='.'; for(int i=-1;i<=1;i++){ for(int j=-1;j<=1;j++){ if(i*j==0){ int nx=x+i,ny=y+j; if(0<=nx&&nx<h&&0<=ny&&ny<w&&...
a.cc: In function 'int main()': a.cc:36:22: error: expected ';' before '}' token 36 | ans=0 | ^ | ; 37 | } | ~
s967496735
p00118
C++
def infection(i, j,H, W, moji): if farm[i][j] == moji: farm[i][j] = '+' if j + 1 < W : infection(i, j + 1,H,W,moji) if i + 1 < H : infection(i + 1, j,H,W,moji) if j - 1 >= 0 :infection(i, j - 1,H,W,moji) if i - 1 >= 0 :infection(i - 1, j,H,W,moji) while(1): farm = [] ...
a.cc:1:1: error: 'def' does not name a type 1 | def infection(i, j,H, W, moji): | ^~~
s753059028
p00118
C++
#include <stdio.h> #include <string.h> int k,t=0; char a[100][100]; void bfs(int i,int j,int n,int m,char x) { k=0; if (i<0||j<0||i>=n||j>=m||a[i][j]=='\0'||a[i][j]!=x) return ; a[i][j]='\0'; bfs(i-1,j,n,m,x); bfs(i+1,j,n,m,x); bfs(i,j-1,n,m,x); bfs(i,j+1,n,m,x); k++; } int main (void) { int n,m,i,j; while (s...
a.cc: In function 'int main()': a.cc:24:17: error: 'gets' was not declared in this scope; did you mean 'getw'? 24 | gets(a[i]); | ^~~~ | getw
s123910824
p00118
C++
#include<iostream> #include<algorithm> #include<cstring> char arr[105][105],temp; int n,m; int direction[4][2]={{0,1},{-1,0},{0,-1},{1,0}}; using namespace std; void bfs(int i,int j) { if(i<0||i>=m||j<0||j>=n) return; if(arr[i][j]!=temp) return; arr[i][j]='.'; for(int k=0;k<4;k++) ...
a.cc: In function 'int main()': a.cc:29:20: error: 'gets' was not declared in this scope; did you mean 'getw'? 29 | gets(arr[i]); | ^~~~ | getw
s622029179
p00118
C++
/* Á·Ï°Ì⣺Property Distribution_AOJ 0118 */ #include <cstdio> using namespace std; char maze[25][25]; int W, H; int sx, sy; int dx[]={1,0,-1,0}; int dy[]={0,1,0,-1}; int count; void dfs1(int x, int y) { for(int i=0; i<4; i++) { int nx=x+dx[i]; int ny=y+dy[i]; if(nx>=0&&nx<W&&ny>=0&&ny<H&&maze[nx][ny]=='@') ...
a.cc: In function 'int main()': a.cc:66:25: error: 'gets' was not declared in this scope; did you mean 'getw'? 66 | gets(maze[i]); | ^~~~ | getw
s920805652
p00118
C++
/* Á·Ï°Ì⣺Property Distribution_AOJ 0118 */ #include <cstdio> using namespace std; char maze[25][25]; int W, H; int sx, sy; int dx[]={1,0,-1,0}; int dy[]={0,1,0,-1}; int count; void dfs1(int x, int y) { for(int i=0; i<4; i++) { int nx=x+dx[i]; int ny=y+dy[i]; if(nx>=0&&nx<W&&ny>=0&&ny<H&&maze[nx][ny]=='@') ...
a.cc: In function 'int main()': a.cc:66:25: error: 'gets' was not declared in this scope; did you mean 'getw'? 66 | gets(maze[i]); | ^~~~ | getw