submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s376280853
p00118
C++
#include <cstdio> #include <cstring> using namespace std; const int maxn = 105; int h, w; char Map[maxn][maxn]; int dir[4][2] = {-1, 0, 1, 0, 0, -1, 0, 1}; void Dfs(int x, int y, char c){ Map[x][y] = '.'; for(int i = 0; i < 4; i++){ int xx = x + dir[i][0]; int yy = y + dir[i][1]; if(xx >...
a.cc: In function 'int main()': a.cc:20:20: error: expected primary-expression before ')' token 20 | if(!h + !w)) break; | ^
s539138442
p00118
C++
import java.util.*; class Main { public static int[] dx = {-1, 0, 1, 0}; public static int[] dy = {0, -1, 0, 1}; public static void dfs(int x, int y, char[][] region, int n, int m) { char c = region[x][y]; region[x][y] = 'x'; for(int i=0;i<4;i++) { ...
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:4:11: error: expected ':' before 'static' 4 | public static int[] dx = {-1, 0, 1, 0}; | ^~~~~~~ | : a.cc:4:22: error: e...
s345635335
p00118
C++
#include <iostream> using namespace std; #define MaxH 20 #define MaxW 20 int W,H; bool visited[MaxH][MaxW]; char A[MaxH][MaxW]; int dx[4] = {-1,0,1,0},dy[4] = {0,1,0,-1}; void dfs(int x, int y){ for (int i = 0; i < 4; ++i) { int nextx = x + dx[i]; int nexty = y + dy[i]; if (nextx >=0 && ...
a.cc: In function 'int main()': a.cc:49:14: error: expected '}' at end of input 49 | return 0; | ^ a.cc:29:11: note: to match this '{' 29 | int main(){ | ^
s928331398
p00118
C++
#include <iostream> using namespace std; #define MaxH 20 #define MaxW 20 int W,H; bool visited[MaxH][MaxW]; char A[MaxH][MaxW]; int dx[4] = {-1,0,1,0},dy[4] = {0,1,0,-1}; void dfs(int x, int y){ for (int i = 0; i < 4; ++i) { int nextx = x + dx[i]; int nexty = y + dy[i]; if (nextx >=0 && ...
a.cc: In function 'int main()': a.cc:49:14: error: expected '}' at end of input 49 | return 0; | ^ a.cc:29:11: note: to match this '{' 29 | int main(){ | ^
s114642618
p00118
C++
#include "stdio.h" #include "stdlib.h" #include "iostream" #include "math.h" #include <string.h> ssss using namespace std; #define fori0(G) for(int i=0;i<G;i++) #define fori1(G) for(int i=1;i<=G;i++) #define forj0(G) for(int j=0;j<G;j++) #define forj1(G) for(int j=1;j<=G;j++) #define fork0(G) for(int k=0;k<G;k++) #def...
a.cc:7:1: error: 'ssss' does not name a type 7 | ssss | ^~~~ a.cc: In function 'int main()': a.cc:43:17: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 43 | cin >> h >> w; | ^~~ | std::cin In file included from a.cc:3: /usr/...
s024981243
p00118
C++
#include <iostream> #include <cstdio> #include <queue> #include <memory.h> using namespace std; const int LIM = 100; char m[LIM][LIM]; bool vis[LIM][LIM + 1]; int R, C; struct node { int r, c; } DIR[] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}}; void bfs(const int & r, const int & c, char ch) { queue<node> q; ...
a.cc: In function 'int main()': a.cc:46:13: error: 'gets' was not declared in this scope; did you mean 'getw'? 46 | gets(m[i]); | ^~~~ | getw
s904699754
p00118
C++
#include<iostream> #include<cstdio> using namespace std; const int maxn=110; int next[][2]={{0,1},{1,0},{0,-1},{-1,0}}; int h,w; char s[maxn][maxn]; int safe(int row,int col) { return row<h&&row>=0&&col<w&&col>=0; } void dfs(int row,int col) { char c=s[row][col]; s[row][col]='.'; for(int i=0;i<4;i++){ int x...
a.cc: In function 'void dfs(int, int)': a.cc:22:27: error: reference to 'next' is ambiguous 22 | int x=row+next[i][0]; | ^~~~ In file included from /usr/include/c++/14/string:47, from /usr/include/c++/14/bits/locale_classes.h:40, from ...
s389412403
p00118
C++
#include<bits./stdc++.h> using namespace std; #define rep(i,j,k) for(int i = j;i<k,i++) int H,W; char m[102][102]; int dx[4]={1,0,-1,0} int dy[4]=(0,1,0,-1) void DFS(int x,int y,char c){ if(m[x][y]!='c')break; m[x][y]='.'; rep(i,0.4){ DFS(x+dx[i],y+dy[i],c); } } int main(){ cin >>H>>W; while(H!=0){ ...
a.cc:1:9: fatal error: bits./stdc++.h: No such file or directory 1 | #include<bits./stdc++.h> | ^~~~~~~~~~~~~~~~ compilation terminated.
s300401748
p00118
C++
#include <iostream> using namespace std; char F[102][102]; void DFS(int Y,int X,char c){ if(F[Y][X]!=c){ return; } F[Y][X] = c; DFS(Y-1,X ); DFS(Y-1,X+1); DFS(Y ,X+1); DFS(Y+1,X+1); DFS(Y+1,X ); DFS(Y+1,X-1); DFS(Y ,X-1); DFS(Y-1,X-1); } int main(){ int N,M; cin >> N >> M; for(...
a.cc: In function 'void DFS(int, int, char)': a.cc:13:6: error: too few arguments to function 'void DFS(int, int, char)' 13 | DFS(Y-1,X ); | ~~~^~~~~~~~~ a.cc:6:6: note: declared here 6 | void DFS(int Y,int X,char c){ | ^~~ a.cc:14:6: error: too few arguments to function 'void DFS(int, int,...
s997651847
p00118
C++
int main(){ while(1){ int N,M; cin>>N>>M; if(N==0&&M==0){ break; } for(int h=1;h<=N;h++){ for(int w=1;w<=M;w++){ cin>>F[h][w]; } } int cnt=0; for(int h=1;h<=N;h++){ for(int w=1;w<=M;w++){ if(F[h][w]=='@'){ cnt++; DFS(h,w,'@'); }else if(F[h][w]=='#'){...
a.cc: In function 'int main()': a.cc:4:3: error: 'cin' was not declared in this scope 4 | cin>>N>>M; | ^~~ a.cc:10:12: error: 'F' was not declared in this scope 10 | cin>>F[h][w]; | ^ a.cc:17:10: error: 'F' was not declared in this scope 17 | if(F[h][w]=='@'){ | ...
s643116617
p00118
C++
#include <iostream> using namespace std; char F[100][100]; void DFS(int H, int W, char c){ if(F[H][W]!=c) return; F[H][W] = '.'; DFS(H-1, W ,c); DFS(H , W+1,c); DFS(H+1, W ,c); DFS(H , W-1,c); } int main(){ int N,M; cin >> N >> M; for(int y=1; y<=N; y++) for(int x=1; x<=M; x++) ...
a.cc:34:1: error: expected unqualified-id before 'while' 34 | while(true){ | ^~~~~ a.cc:41:3: error: expected unqualified-id before 'return' 41 | return 0; | ^~~~~~ a.cc:42:1: error: expected declaration before '}' token 42 | } | ^
s957876350
p00118
C++
#include<iostream> using namespace std; char F[102][102]; void DFS(int y, int x, char a){#include<iostream> using namespace std; char F[102][102]; void DFS(int y, int x, char a){ if(F[y][x]!=a){ return; } F[y][x]='.'; DFS(y-1,x,a); DFS(y,x+1,a); DFS(y+1,x,a); DFS(y,x-1,a); } int main(){ int n,...
a.cc:6:32: error: stray '#' in program 6 | void DFS(int y, int x, char a){#include<iostream> | ^ a.cc: In function 'void DFS(int, int, char)': a.cc:6:33: error: 'include' was not declared in this scope 6 | void DFS(int y, int x, char a){#include<iostream> | ...
s739493883
p00118
C++
nclude<iostream> using namespace std; char f[102][102]; char cnt_c[1]; void DFS(int y,int x){ if(f[y][x]=='.'||f[y][x]==0||f[y][x]!=cnt_c[0])return; if(f[y][x]==cnt_c[0]){ f[y][x]='.'; } DFS(y+1,x); DFS(y-1,x); DFS(y,x+1); DFS(y,x-1); } int main(){ int H,W; while(cin>>H>>W){ if(H==0&&W==0)...
a.cc:1:1: error: 'nclude' does not name a type 1 | nclude<iostream> | ^~~~~~ a.cc: In function 'int main()': a.cc:20:9: error: 'cin' was not declared in this scope 20 | while(cin>>H>>W){ | ^~~ a.cc:37:7: error: 'cout' was not declared in this scope 37 | cout<<cnt<<endl; | ...
s073971956
p00118
C++
import java.util.Scanner; import java.util.Queue; import java.util.Stack; public class Main { int H, W; char[][] map; int res; char tmp; char ringo = '@', kaki = '#', mikan = '*', non = '.'; void deback() { for(int i = 0; i < H; i++) { for(int j = 0; j < W; j++) { System.out.print(map[i][j]); } Sy...
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:2:1: error: 'import' does not name a type 2 | import java.util.Queue; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts...
s748772801
p00118
C++
// // main.cpp // #include <iostream> #include <algorithm> #include <vector> #include <limits> #include <math.h> #include <queue> #include <tuple> #include <stdio.h> #include <stdlib.h> #include <string> #include "string.h" #include <unordered_map> #include <unordered_set> #include <array> #include <set> // http://j...
a.cc: In function 'int main()': a.cc:58:17: error: 'unique_ptr' was not declared in this scope 58 | unique_ptr<char[]> field(new char[W * H]); | ^~~~~~~~~~ a.cc:20:1: note: 'std::unique_ptr' is defined in header '<memory>'; this is probably fixable by adding '#include <memory>' ...
s118644509
p00118
C++
// // main.cpp // #include <iostream> #include <algorithm> #include <vector> #include <limits> #include <math.h> #include <queue> #include <tuple> #include <stdio.h> #include <stdlib.h> #include <string> #include "string.h" #include <unordered_map> #include <unordered_set> #include <array> #include <set> // http://j...
a.cc: In function 'int main()': a.cc:58:9: error: 'unique_ptr' was not declared in this scope 58 | unique_ptr<char[]> field(new char[W * H]); | ^~~~~~~~~~ a.cc:20:1: note: 'std::unique_ptr' is defined in header '<memory>'; this is probably fixable by adding '#include <memory>' 19 | #include ...
s900211666
p00118
C++
#include<iostream> using namespace std; #define LP(i,N) for(int i=0;i<N;i++) #define MAX 100 int H,W; char map[MAX+1][MAX+1]; int dx[]={ 0, 1, 0,-1}; int dy[]={-1, 0, 1, 0}; void dfs(int h,int w,char fruit){ if(map[h][w]=='0')return ; fruit map[h][w]='0'; LP(i,4){ if(h+dy[i]<0||w+dx[i]<0||h+dy[i]>=W||w+dx[i]>=H|...
a.cc: In function 'void dfs(int, int, char)': a.cc:12:14: error: expected ';' before 'map' 12 | fruit | ^ | ; 13 | map[h][w]='0'; | ~~~
s027135702
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+...
a.cc: In function 'int main()': a.cc:24:17: error: 'memset' was not declared in this scope 24 | memset(farm,0,sizeof(farm)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include<vector> +++...
s890617214
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+...
a.cc: In function 'int main()': a.cc:25:17: error: 'memset' was not declared in this scope 25 | memset(farm,0,sizeof(farm)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include<vector> +++...
s105525563
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+...
a.cc: In function 'int main()': a.cc:25:17: error: 'memset' was not declared in this scope 25 | memset(farm,0,sizeof(farm)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include<vector> +++...
s887707317
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+...
a.cc: In function 'int main()': a.cc:25:17: error: 'memset' was not declared in this scope 25 | memset(farm,0,sizeof(farm)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include<vector> +++...
s979392496
p00118
C++
#include<iostream> #include<string> 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+1])kubun(farm[a][b+1],a,b+1); } in...
a.cc: In function 'int main()': a.cc:22:17: error: 'memset' was not declared in this scope 22 | memset(farm,0,sizeof(farm)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +...
s702166213
p00118
C++
#include <iostream> #include <cstdio> #include <string> using namespace std; int h,w; string s[100]; void newland(int i, int j) { char t = s[i][j]; s[i][j] = '.'; if(j!=w-1 && t == s[i][j+1]) newland(i,j+1); if(i!=h-1 && t == s[i+1][j]) newland(i+1,j); if(j!=0 && t == s[i][j-1]) newland(i,j-1); if(i!=0 &&...
a.cc: In function 'void solve()': a.cc:22:5: error: expected ',' or ';' before 'cin' 22 | cin >> h >> w; | ^~~
s726430112
p00118
C++
#include <cstdio> #define N_MAX 100 #define M_MAX 100 int N, M; char Field[N][M+1] int main(void) { scanf("%d %d", &N, &M); int i, j; for(i = 0; i < N; i++) { scanf("%s", Field[i]); } scanf("%d %d", &i, &j); if(i == 0 && j == 0) return 1; int count = 0; for(i = 0; i < N; i++)...
a.cc:9:1: error: expected initializer before 'int' 9 | int main(void) { | ^~~ a.cc: In function 'void solve(int, int)': a.cc:32:16: error: 'Field' was not declared in this scope 32 | char tmp = Field[x][y]; | ^~~~~
s609726531
p00118
C++
#include <cstdio> #define N_MAX 100 #define M_MAX 100 int N, M; char Field[N][M+1]; int main(void) { scanf("%d %d", &N, &M); int i, j; for(i = 0; i < N; i++) { scanf("%s", Field[i]); } scanf("%d %d", &i, &j); if(i == 0 && j == 0) return 1; int count = 0; for(i = 0; i < N; i++...
a.cc:7:16: error: size of array 'Field' is not an integral constant-expression 7 | char Field[N][M+1]; | ~^~ a.cc:7:12: error: size of array 'Field' is not an integral constant-expression 7 | char Field[N][M+1]; | ^ a.cc: In function 'int main()': a.cc:22:17: error: 'solve' ...
s174547704
p00118
C++
#include <cstdio> #define N_MAX 100 #define M_MAX 100 int N, M; char Field[N_MAX][M_MAX+1]; int main(void) { scanf("%d %d", &N, &M); int i, j; for(i = 0; i < N; i++) { scanf("%s", Field[i]); } scanf("%d %d", &i, &j); if(i == 0 && j == 0) return 1; int count = 0; for(i = 0; i ...
a.cc: In function 'int main()': a.cc:22:17: error: 'solve' was not declared in this scope 22 | solve(i, j); | ^~~~~
s944366759
p00118
C++
#include<iostream> using namespace std; void dfs(int x,int y,char z); char a[100][100]; int ans = 0; int main(){ int h,w; while(cin>>h>>w,h){ ans = 0; for(int i=0;i<h;i++){ for(int j=0;j<w;j++){ cin>>a[i][j]; } } for(int i=0;i<h;i++){ ...
a.cc: In function 'void dfs(int, int, char)': a.cc:35:26: error: 'w' was not declared in this scope 35 | if(z==a[x][y+1]&&y+1<w)dfs(x,y+1,z); | ^ a.cc:36:26: error: 'h' was not declared in this scope 36 | if(z==a[x+1][y]&&x+1<h)dfs(x+1,y,z); | ...
s920096875
p00118
C++
#include<algorithm> #include<iostream> #include<string.h> #include<sstream> #include<stdio.h> #include<math.h> #include<vector> #include<string> #include<queue> #include<set> #include<map> //#pragma comment(linker,"/STACK:1024000000,1024000000") using namespace std; const int INF=0x3f3f3f3f; const double eps=1e-8; cons...
a.cc:18:9: error: '__int64' does not name a type; did you mean '__int64_t'? 18 | typedef __int64 ll; | ^~~~~~~ | __int64_t
s469909202
p00118
C++
//-*-coding:utf-8-*- //---------------------------------------------------------- // module: main //---------------------------------------------------------- #include <algorithm> #include <vector> #include <deque> #include <map> #include <iostream> #include <cstdio> using namespace std; const int MAX_S = 100+1; in...
a.cc: In function 'void solve()': a.cc:57:5: error: 'memset' was not declared in this scope 57 | memset(u, 0, MAX_S*MAX_S); | ^~~~~~ a.cc:12:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 11 | #include <cstdio> +++ |+#include <cstring> ...
s277504321
p00118
C++
//-*-coding:utf-8-*- //---------------------------------------------------------- // module: main //---------------------------------------------------------- #include <algorithm> #include <vector> #include <deque> #include <map> #include <iostream> #include <cstdio> using namespace std; const int MAX_S = 100+1; in...
a.cc: In function 'void solve()': a.cc:57:5: error: 'memset' was not declared in this scope 57 | memset(u, 0, MAX_S*MAX_S); | ^~~~~~ a.cc:12:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 11 | #include <cstdio> +++ |+#include <cstring> ...
s152122820
p00118
C++
#include <cstdio> using namespace std; const int MAX_H = 101; const int MAX_W = 101; int H, W; char blocks[MAX_H][MAX_W]; int init() { scanf("%d%d", &H, &W); if (H == 0 && W == 0) return -1; for (int i = 0; i < H; i++) { scanf("%s", blocks[i]); } return 0; } void fill(int row, int col) { char type = bl...
a.cc: In function 'void fill(int, int)': a.cc:30:26: error: 'i' was not declared in this scope; did you mean 'ti'? 30 | int ti = i + di[k]; | ^ | ti a.cc:31:26: error: 'j' was not declared in this scope; did you mean 'tj'? 31 | ...
s313889513
p00118
C++
#include <iostream> using namespace std; const int MAX_H = 1000; const int MAX_W = 1000; char field[MAX_H][MAX_W]; int dy[] = { 0, -1, 0, 1 }; int dx[] = { -1, 0, 1, 0 }; void dfs(int i, int j) { char c = field[i][j]; if (c == 0) return; field[i][j] = 0; // mark as visited for (int k = 0; k < 4; k++) { ...
a.cc: In function 'int main()': a.cc:37:5: error: 'memset' was not declared in this scope 37 | memset(field, 0, MAX_W * MAX_H); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstri...
s694257902
p00118
C++
#include <iostream> #include <cstdlib> using namespace std; const int MAX_H = 1000; const int MAX_W = 1000; char field[MAX_H][MAX_W]; int dy[] = { 0, -1, 0, 1 }; int dx[] = { -1, 0, 1, 0 }; void dfs(int i, int j) { char c = field[i][j]; if (c == 0) return; field[i][j] = 0; // mark as visited for (int k = ...
a.cc: In function 'int main()': a.cc:38:5: error: 'memset' was not declared in this scope 38 | memset(field, 0, MAX_W * MAX_H); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <cstdlib> +++ |+#include <cstrin...
s738996428
p00118
C++
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> typedef unsigned int uint; typedef long long ll; typedef unsigned long ...
a.cc: In function 'int main()': a.cc:41:42: error: reference to 'data' is ambiguous 41 | foreach (i, H) foreach (j, W) cin >> data[i][j]; | ^~~~ In file included from /usr/include/c++/14/deque:68, from a.cc:4: /usr/include/c++/14/bits/range_access.h...
s657394349
p00118
C++
#include <stdio.h> #include <algorithm> #include <iostream> #include <math.h> using namespace std; const int M = 186; int n; int m; char g[M][M]; int dir[4][2] = {{0,-1},{0,1},{-1,0},{1,0}}; void dfs(int x,int y,char k) { int i; int dx; int dy; for(i = 0 ;i < 4; i++) { dx = x+dir[i][0]; dy = y+dir[i][1]; ...
a.cc: In function 'int main()': a.cc:65:18: error: expected '}' at end of input 65 | return 0; | ^ a.cc:63:1: note: to match this '{' 63 | { | ^
s858130273
p00119
Java
import java.util.Scanner; import java.util.Deque; import java.util.ArrayDeque; public class Main { static Scanner sc = new Scanner(System.in); static int h, w; static char fruitFarm; static int dx = {-1, 0, 1, 0}; static int dy = {0, -1, 0, 1}; static Deque<int> stack; public static void main(Stri...
Main.java:29: error: '[' expected stack.offerLast(new int{i, j}); ^ Main.java:54: error: '[' expected stack.offerLast(new int{nx, ny}); ^ 2 errors
s181022060
p00119
C++
#include <queue> #include <cstdio> #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; int main(){ int n,m; scanf("%d%d",&n,&m); vector<int> G[20]; int deg[20]={}; rep(i,m){ int u,v; scanf("%d%d",&u,&v); u--; v--; G[u].push_back(v); deg[v]++; } vector<int> ans; bool vis[20]={}; while(count(vi...
a.cc: In function 'int main()': a.cc:20:15: error: 'count' was not declared in this scope 20 | while(count(vis,vis+n,false)>0){ | ^~~~~
s652366061
p00119
C++
#include <bits/stdc++.h> #define rep(x,to) for(int (x)=0;(x)<(to);(x)++) using namespace std; vector<int> ans, usd(22), g[22]; void dfs(int s){ if(usd[s]) return; usd[s]=1; for(auto v: g[s]) if(!usd[v]) dfa(v); ans.push_back(s); } int main() { int n,m; cin >> m >> n; rep(i,n){ int x,y; cin >>x >>y; ...
a.cc: In function 'void dfs(int)': a.cc:13:39: error: 'dfa' was not declared in this scope; did you mean 'dfs'? 13 | for(auto v: g[s]) if(!usd[v]) dfa(v); | ^~~ | dfs
s845283565
p00119
C++
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <stdio.h> #include <ctype.h> #include <string> #include <iostream> #include <vector> #include <stack> #include <fstream> #include <sstream> #include <queue> #include <exception> #include <cmath> #include <numeric> #include <map> using namespace std; t...
a.cc: In function 'void AOJ0119()': a.cc:67:41: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' 67 | if (find(list[i].begin(), list[i].end(), b) != list[i].end()) { | ~~~~^~~~~~~~~~~...
s992309308
p00119
C++
#include <iostream> #include <vector> using namespace std; struct st {int from, to;}; vector<st> v; int main() { int m, n, a, b; cin >> m >> n; int c[21]; fill(c, c+21, 0); for (int i = 0;i < n;i++) { cin >> a >> b; v.push_back((st){a, v}); c[y]++; } for (int i = ...
a.cc: In function 'int main()': a.cc:16:29: error: cannot convert 'std::vector<st>' to 'int' in initialization 16 | v.push_back((st){a, v}); | ^ | | | std::vector<st> a.cc:17:11: error: 'y' was not declared ...
s269600651
p00119
C++
v#include <bits/stdc++.h> using namespace std; int main() { int m, n; cin >> m >> n; vector<vector<int>> g(m); vector<int> cnt(m, 0); while (n--) { int x, y; cin >> x >> y; --x; --y; g[x].push_back(y); ++cnt[y]; } vector<bool> used(m, false); for (int i = 0; i < m; ++i) { for (int j =...
a.cc:1:2: error: stray '#' in program 1 | v#include <bits/stdc++.h> | ^ a.cc:1:1: error: 'v' does not name a type 1 | v#include <bits/stdc++.h> | ^ a.cc: In function 'int main()': a.cc:5:13: error: 'cin' was not declared in this scope 5 | int m, n; cin >> m >> n; | ^~~ a.cc:...
s759667764
p00119
C++
#include<iostream> int main{ std::cout<<"Hello!"<<endl; }
a.cc:3:5: error: cannot declare '::main' to be a global variable 3 | int main{ | ^~~~ a.cc:4:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 4 | std::cout<<"Hello!"<<endl; | ^~~~ | std::endl In file included ...
s199288110
p00119
C++
#include<iostream> #include<vector> using namespace std; int main() { int n,m; cin >> m >> n; cerr << m >> " " << n << endl; vector<int> per; vector<vector<int> > G; G.resize(m); bool used[m]; per.resize(m); for(int i=0;i<m;i++) per[i] = 0,used[i] = false; for(int i=0;i<n;i++) { int...
a.cc: In function 'int main()': a.cc:10:13: error: no match for 'operator>>' (operand types are 'std::basic_ostream<char>' and 'const char [2]') 10 | cerr << m >> " " << n << endl; | ~~~~~~~~~ ^~ ~~~ | | | | | const char [2] | std::basic_ostream<char> In f...
s929683455
p00119
C++
#include<iostream> #include<vector> using namespace std; int main() { int n,m; cin >> m >> n; cerr << m >> " " << n << endl; vector<int> per; vector<vector<int> > G; G.resize(m); bool used[m]; per.resize(m); for(int i=0;i<m;i++) per[i] = 0,used[i] = false; for(int i=0;i<n;i++) { int...
a.cc: In function 'int main()': a.cc:10:13: error: no match for 'operator>>' (operand types are 'std::basic_ostream<char>' and 'const char [2]') 10 | cerr << m >> " " << n << endl; | ~~~~~~~~~ ^~ ~~~ | | | | | const char [2] | std::basic_ostream<char> In f...
s474722615
p00119
C++
#include <queue> #include <cstdio> using namespace std; main(){ int n,m,x,y; scanf("%d%d",&m,&n); vector<vector<int> >v(m+1); vector<int>c(m+1); queue<int>q; for(;n--;)scanf("%d%d",&x,&y),v[x].push_back(y),c[y]++; for(x=1;x<=m;x++)if(!c[x])q.push(x); for(;!q.empty();)for(printf("%d\n",n=q.front),q.pop(),x=0;x<v...
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:12:48: error: cannot resolve overloaded function 'front' based on conversion to type 'int' 12 | for(;!q.empty();)for(printf("%d\n",n=q.front),q.pop(),x=0;x<v...
s201233372
p00119
C++
$m = gets.to_i $n = gets.to_i $s = (1..$n).map{gets.split.map(&:to_i)} def solve(a) if a.size == $m return a end $s.select{|e|a.include?(e[1])&& !a.include?(e[0])}.map{|e| solve(a + [e[0]]) }.shuffle[0] end p solve([2])
a.cc:3:7: error: too many decimal points in number 3 | $s = (1..$n).map{gets.split.map(&:to_i)} | ^~~~~ a.cc:1:1: error: '$m' does not name a type 1 | $m = gets.to_i | ^~ a.cc:5:1: error: 'def' does not name a type 5 | def solve(a) | ^~~ a.cc:9:53: error: expected unqualified-id befo...
s528732768
p00119
C++
def solve(a,M): for x,y in xy: if x in a and (y not in a or a.index(x) > a.index(y)): break else: if len(a) == m: return a for i in range(len(M)): r = solve([M[i]] + a,M[:i]+M[i+1:]) if r: return r m = input() xy = [map(int,raw_input().split()) for i in range(input())] for i in solve([],range(1,m+1)): pr...
a.cc:1:1: error: 'def' does not name a type 1 | def solve(a,M): | ^~~
s411365195
p00119
C++
#include<iostream> #include<cstdlib> using namespace std; // Ans // 有向グラフの先の出次数が0のところから取り除いて、出力する #define N 21 #define rep(i, n) for(int i=0; i<n; ++i) int main() { int m, n, x, y, deg[N]; bool e[N][N]; memset(deg, 0, sizeof(deg)); memset(e, 0, sizeof(e)); cin >> m >> n; rep(i, n) { cin >> x >> y; --x; --y;...
a.cc: In function 'int main()': a.cc:15:9: error: 'memset' was not declared in this scope 15 | memset(deg, 0, sizeof(deg)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<cstdlib> +++ |+#include <cst...
s005110046
p00119
C++
#include<iostream> #include<cstdio> using namespace std; // Ans // 有向グラフの先の出次数が0のところから取り除いて、出力する #define N 21 #define rep(i, n) for(int i=0; i<n; ++i) int main() { int m, n, x, y, deg[N]; bool e[N][N]; memset(deg, 0, sizeof(deg)); memset(e, 0, sizeof(e)); cin >> m >> n; rep(i, n) { cin >> x >> y; --x; --y; ...
a.cc: In function 'int main()': a.cc:15:9: error: 'memset' was not declared in this scope 15 | memset(deg, 0, sizeof(deg)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<cstdio> +++ |+#include <cstr...
s117009431
p00120
Java
import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class Main { public static void main(String[] args) throws IOException{ //Scanner sc = new Scanner(System.in); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); while(true){ String str; i...
Main.java:7: error: cannot find symbol public static void main(String[] args) throws IOException{ ^ symbol: class IOException location: class Main Main.java:10: error: cannot find symbol BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^...
s665415970
p00120
Java
import java.util.Arrays; import java.util.LinkedList; import java.util.Scanner; public class Sample0120 { public static void main(String[] args) { Scanner sc =new Scanner(System.in); while(sc.hasNext()){ int box = sc.nextInt(); LinkedList<Integer> array = new LinkedList<Integer>(); while(sc.hasNextI...
Main.java:5: error: class Sample0120 is public, should be declared in a file named Sample0120.java public class Sample0120 { ^ 1 error
s557681630
p00120
Java
import java.util.Scanner; public class A0120 { static double dp[][][]; static int n, a; static double r[]; public static double f(int left, int right, int bit) { if (0 < dp[left][right][bit]) { return dp[left][right][bit]; } int k = check(bit); if (k == 1) { return dp[left][right][bit] = 2.0 * r[lef...
Main.java:3: error: class A0120 is public, should be declared in a file named A0120.java public class A0120 { ^ 1 error
s125260162
p00120
C
clude <stdio.h> // printf() #include <stdlib.h> // exit(), free(), strtol() #include <stdbool.h> #include <errno.h> // errno #include <error.h> // error() #define MAX_N 12 int lineno; char *linebuff = NULL; size_t linebuffsize = 0; int r[MAX_N]; void cleanup(int ecode) { if (line...
main.c:1:7: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | clude <stdio.h> // printf() | ^ In file included from main.c:2: /usr/include/stdlib.h:98:8: error: unknown type name 'size_t' 98 | extern size_t __ctype_get_mb_cur_max (void) __THROW __wur; | ...
s151057563
p00120
C
#define N 12 double M[N][1<<N],r; int D[N],n; double dfs(int p,int f){ if(M[p][f]<0){ int i=0; M[p][f]=0; for(;i<n;i++){ if(f&1<<i)continue; M[p][f]=max(M[p][f],dfs(i,f|1<<i)+D[p]+D[i]-2*sqrt(D[p]*D[i])); } } return M[p][f]; } main(){ int L,l,i,j,d; string s; for(;~scanf("%d",&L);){ d=0;do{scanf("...
main.c: In function 'dfs': main.c:10:33: error: implicit declaration of function 'max' [-Wimplicit-function-declaration] 10 | M[p][f]=max(M[p][f],dfs(i,f|1<<i)+D[p]+D[i]-2*sqrt(D[p]*D[i])); | ^~~ main.c:10:71: error: implicit declaration of function 'sqrt...
s852797739
p00120
C
#define N 12 double M[N][1<<N],r; int D[N],n; double dfs(int p,int f){ if(M[p][f]<0){ int i=0; M[p][f]=0; for(;i<n;i++){ if(f&1<<i)continue; M[p][f]=max(M[p][f],dfs(i,f|1<<i)+D[p]+D[i]-2*sqrt(D[p]*D[i])); } } return M[p][f]; } main(){ int L,l,i,j,d; for(;~scanf("%d",&L);){ d=0;do{scanf("%d",D+n);d+...
main.c: In function 'dfs': main.c:10:33: error: implicit declaration of function 'max' [-Wimplicit-function-declaration] 10 | M[p][f]=max(M[p][f],dfs(i,f|1<<i)+D[p]+D[i]-2*sqrt(D[p]*D[i])); | ^~~ main.c:10:71: error: implicit declaration of function 'sqrt...
s454174140
p00120
C
double M[12][4096],r,t;D[N],n; double dfs(p,f){if(M[p][f]<0){ int i=0; for(M[p][f]=0;i<n;i++)if(!(f&1<<i)&&(t=dfs(i,f|1<<i)+D[p]+D[i]-2*sqrt(D[p]*D[i]),M[p][f]<t))M[p][f]=t; }return M[p][f];} main(l,i,j,d){for(;~scanf("%d",&l);puts(d-r<=l?"OK":"NA")){ for(d=n=0;getchar()!='\n';d+=D[n++]*2)scanf("%d",D+n); for(i=0;i<n;i...
main.c:1:26: error: 'N' undeclared here (not in a function) 1 | double M[12][4096],r,t;D[N],n; | ^ main.c:1:24: warning: data definition has no type or storage class 1 | double M[12][4096],r,t;D[N],n; | ^ main.c:1:24: error: type defaults to 'int' in d...
s010714153
p00120
C++
const int INF = 100000000; typedef double D; const double EPS = 1e-8; const double PI = 3.14159; int dx[4]={-1, 0, 1, 0}, dy[4]={0, -1, 0, 1}; using namespace std; typedef pair<int, int> P; /** Problem0120 : Patisserie **/ const int MAX_N = 12; double W; vector<double> size; int dp[1<<MAX_N][MAX_N]; int N; int sig(d...
a.cc:7:9: error: 'pair' does not name a type 7 | typedef pair<int, int> P; | ^~~~ a.cc:13:1: error: 'vector' does not name a type 13 | vector<double> size; | ^~~~~~ a.cc: In function 'bool rec(int, int, double)': a.cc:31:17: error: 'printf' was not declared in this scope 31 | ...
s958669013
p00120
C++
#include <algorithm> #include <iostream> #include <sstream> #include <vector> using namespace std; double getPackWidth(vector<int> &v) { int n = v.size(); double ret = v[0] + v[n-1]; for (int i=0; i+1<n; ++i) { ret += sqrt(pow(v[i] + v[i+1], 2) - pow(v[i] - v[i+1], 2)); } return ret; } in...
a.cc: In function 'double getPackWidth(std::vector<int>&)': a.cc:12:21: error: 'pow' was not declared in this scope 12 | ret += sqrt(pow(v[i] + v[i+1], 2) - pow(v[i] - v[i+1], 2)); | ^~~ a.cc:12:16: error: 'sqrt' was not declared in this scope 12 | ret += sqrt(pow(v[i] + ...
s776330700
p00120
C++
import sys from math import sqrt def rec(state, v): if state == (1 << N) - 1: return cakes[v] if dp[state][v] != -1: return dp[state][v] ret = INF for i in range(N): if not (state >> i & 1): ret = min(ret, rec(state | 1 << i, i) + sqrt(pow(cakes[i] + cakes[v], 2) -...
a.cc:29:11: warning: multi-character character constant [-Wmultichar] 29 | print('OK' if ans <= box else 'NA') | ^~~~ a.cc:29:35: warning: multi-character character constant [-Wmultichar] 29 | print('OK' if ans <= box else 'NA') | ^~~~ a.cc:1:1: erro...
s808970035
p00120
C++
#include <algorithm> #include <string> #include <sstream> #include <iostream> using namespace std; const int LOOP = 10000; //??????????????° const double EPS = 1e-6; //??????????????¨(?°??????????????????????) int L; int N; //???????????±???????????° //???????????±????????????????????????????????¨?????¨???????¨??????...
a.cc: In function 'double Evaluate(int*)': a.cc:18:24: error: 'sqrt' was not declared in this scope 18 | val += sqrt(c*c - a*a); | ^~~~
s815153133
p00120
C++
#include <algorithm> #include <string> #include <sstream> #include <iostream> #include<time> #include<cstdlib> using namespace std; const int LOOP = 10000; //??????????????° const double EPS = 1e-6; //??????????????¨(?°??????????????????????) int L; int N; //???????????±???????????° //???????????±????????????????????...
a.cc:5:9: fatal error: time: No such file or directory 5 | #include<time> | ^~~~~~ compilation terminated.
s334764017
p00120
C++
#include <algorithm> #include <string> #include <sstream> #include <iostream> #include <ctime> #include<cstdlib> using namespace std; const int LOOP = 10000; //??????????????° const double EPS = 1e-6; //??????????????¨(?°??????????????????????) int L; int N; //???????????±???????????° //???????????±??????????????????...
a.cc: In function 'double Evaluate(int*)': a.cc:20:24: error: 'sqrt' was not declared in this scope 20 | val += sqrt(c*c - a*a); | ^~~~
s703073099
p00120
C++
#include <algorithm> #include <string> #include <stream> #include <iostream> #include <ctime> #include <cstdlib> #include <cmath> #include <cstdio> using namespace std; const int LOOP = 10000; //??????????????° const double EPS = 1e-6; //??????????????¨(?°??????????????????????) int L; int N; //???????????±???????????...
a.cc:3:10: fatal error: stream: No such file or directory 3 | #include <stream> | ^~~~~~~~ compilation terminated.
s866426022
p00120
C++
#include<sstream> #include<iostream> #include<cmath> using namespace std; int w,n; int c[12]; string s; double calc(int *c){ double r=c[0]+c[n-1]; for(int i=0;i<n-1;i++)r+=2*sqrt(c[i]*c[i+1]); return r; } int main(){ while(getline(cin,s)){ stringstream ss; ss<<s; ss>>w; for(n=0;ss>>c[n];n++); do{ if(cal...
a.cc: In function 'int main()': a.cc:23:24: error: 'next_permutation' was not declared in this scope 23 | }while(next_permutation(c,c+n)); | ^~~~~~~~~~~~~~~~
s698399342
p00120
C++
#include<iostream> #include<vector> #include<cmath> #include<algorithm> using namespace std; #define MAX 12 double sqs[MAX][MAX] = {{0,}}; class Cake{ public: Cake():r(0),used(false){}; int r; bool used; bool operator<(const Cake &t) const{ return r < t.r; } }; bool check(int p[], int n, int w){ double t = ...
a.cc: In function 'int main()': a.cc:130:49: error: 'minins' was not declared in this scope 130 | vR.insert( vR.begin() + minins, vCandR[minind] ); | ^~~~~~ a.cc:130:64: error: 'minind' was not declared in this scope 130 | ...
s867420629
p00120
C++
#include<iostream> #include<vector> #include<cmath> #include<cassert> #include<algorithm> #define MAX 12 using namespace std; typedef unsigned int set; typedef struct tagcombstruct{ set K,N,x,overx; } combStruct; int g_cnt; /* gencomb1 from http://www5.airnet.ne.jp/tomy/cpro/pe1.htm (C) Tomy */ set nextset(set x...
a.cc: In function 'std::vector<std::pair<T, int> > unique(const std::vector<T>&)': a.cc:57:17: error: need 'typename' before 'std::vector<std::pair<T, int> >::iterator' because 'std::vector<std::pair<T, int> >' is a dependent scope 57 | vector<pair<T, int > >::iterator itV = unique( vret.begin(), vre...
s358446664
p00120
C++
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <cmath> using namespace std; int length; vector<int> rn; double dp[1 << 12 + 1][12]; const int INF = 1000000; // n‚̃rƒbƒg‚ª—§‚Á‚Ä‚¢‚鏊‚ªŒ»Ý” ‚É“ü‚Á‚Ä‚¢‚é‰~ // n‚̏ó‘Ô‚©‚炽‚ǂ肂¯‚éÅ¬‚Ì’·‚³‚ð‹‚ß‚é void solve(){ for(int i...
a.cc:91:2: warning: null character(s) ignored 91 | }<U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><...
s109262884
p00120
C++
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctime> #include <climits> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <ss...
a.cc: In function 'int main()': a.cc:33:11: error: 'gets' was not declared in this scope; did you mean 'getw'? 33 | while(gets(li)!=NULL){ | ^~~~ | getw
s501040219
p00120
C++
//38 #include<iostream> #include<string> #include<sstream> #include<vector> #include<cmath> using namespace std; int c[11]; bool dfs(double r,int nr,int p){ if(nr==0){ return r>=p; }else{ for(int i=3;i<=10;i++){ if(c[i]){ c[i]--; if(dfs(r-2*sqrt(i*p),nr-1,i))return true; c[i]++; } }...
a.cc: In function 'int main()': a.cc:46:15: error: 'v' was not declared in this scope 46 | cout<<((i<v.size())?"OK":"NA")<<endl; | ^
s463614858
p00120
C++
#include<iostream> #include<cstdio> #include<vector> #include<string> #include <sstream> using namespace std; const double INF=1000000000; double ans; double l; bool flag; string str; vector<double> r; double dp[1<<12][12]; void rec(int x,int bit,double nl,double nh){ if(dp[bit][x]<nl)return; dp[bit][x]=nl; if(bi...
a.cc: In function 'void rec(int, int, double, double)': a.cc:29:52: error: 'pow' was not declared in this scope 29 | double nnl=nl+sqrt(pow(nh+nnh,2)-pow(fabs(nh-nnh),2)); | ^~~ a.cc:29:70: error: 'fabs' was not declared in this...
s026535665
p00120
C++
#include <iostream> #include <string> #include <sstream> #include <vector> #include <cmath> #define MAX 12 using namespace std; vector<int> split(const string &str, char delim){ istringstream iss(str); string tmp; vector<int> res; while(getline(iss, tmp, delim)) { int i; std::istringstream is...
a.cc: In function 'float rec(int, int)': a.cc:29:20: error: reference to 'size' is ambiguous 29 | if (S == (1 << size) -1 && v == 0) { | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /us...
s847088919
p00120
C++
#include <iostream> #include <string> #include <sstream> #include <vector> #include <cmath> #define MAX 12 using namespace std; vector<int> split(const string &str, char delim){ istringstream iss(str); string tmp; vector<int> res; while(getline(iss, tmp, delim)) { int i; std::istringstream is...
a.cc: In function 'float rec(int, int)': a.cc:29:20: error: reference to 'size' is ambiguous 29 | if (S == (1 << size) -1 && v == 0) { | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /us...
s023550640
p00120
C++
#include <iostream> #include <string> #include <sstream> #include <vector> #include <cmath> #define MAX 12 using namespace std; vector<int> split(const string &str, char delim){ istringstream iss(str); string tmp; vector<int> res; while(getline(iss, tmp, delim)) { int i; std::istringstream is...
a.cc: In function 'float rec(int, int)': a.cc:29:20: error: reference to 'size' is ambiguous 29 | if (S == (1 << size) -1 && v == 0) { | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /us...
s162944387
p00120
C++
#include <iostream> #include <vector> #include <set> #include <sstream> #include <cmath> #include <string> #include <algorithm> using namespace std; typedef long long LL; #define OFFSET 2 int box_width; double dist(int r1, int r2) { double a = pow(abs(r1 - r2), 2); double b = pow(r1 + r2, 2); return sqrt(-a + b); ...
a.cc: In function 'bool solve(std::vector<int>, LL)': a.cc:53:29: error: statement cannot resolve address of overloaded function 53 | next; | ^
s627180401
p00121
Java
import com.sun.tools.javac.parser.Tokens; import java.io.*; import java.util.*; public class Main { void run() { try { for (String line; (line = in.readLine()) != null; ) { StringTokenizer tokenizer = new StringTokenizer(line); int[] init = new int[8]; ...
Main.java:1: error: package com.sun.tools.javac.parser is not visible import com.sun.tools.javac.parser.Tokens; ^ (package com.sun.tools.javac.parser is declared in module jdk.compiler, which does not export it to the unnamed module) 1 error
s983299331
p00121
Java
import com.sun.tools.javac.parser.Tokens; import java.io.*; import java.util.*; public class Main { void run() { try { for (String line; (line = in.readLine()) != null; ) { StringTokenizer tokenizer = new StringTokenizer(line); int[] init = new int[8]; ...
Main.java:1: error: package com.sun.tools.javac.parser is not visible import com.sun.tools.javac.parser.Tokens; ^ (package com.sun.tools.javac.parser is declared in module jdk.compiler, which does not export it to the unnamed module) 1 error
s370820359
p00121
Java
import java.util.*; public class Main { static final int[] dir={1,-1,4,-4}; static Map<String,Integer> m=new HashMap<String,Integer>(); static void bfs(){ String s="01234567"; m.put(s,0); Queue<String> que=new LinkedList<String>(); que.offer(s); while(!que.isEmpty()){ String tmp=que.poll(); int step=m.get(t...
Main.java:39: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args){ ^ (use --enable-preview to enable unnamed classes) Main.java:49: error: class, interface, enum, or record expected } ^ 2 errors
s430281300
p00121
Java
import java.util.*; class State { private static int[] vy = {0, 1, 0, -1}; private static int[] vx = {1, 0, -1, 0}; private int[][] nums; private int zeroY, zeroX; private int hash; int step; public State(int[][] _nums, int _zeroY, int _zeroX, int _step) { nums = _nums; ze...
Main.java:101: error: reached end of file while parsing } ^ 1 error
s203577446
p00121
Java
public class Main { private static int[] move = {1, -1, 4, -4}; private static Map<String, Integer> map = new HashMap<>(); public static void main(String[] args) { Scanner in = new Scanner(System.in); dsf(); while (in.hasNext()) { String str = in.nextLine(); s...
Main.java:3: error: cannot find symbol private static Map<String, Integer> map = new HashMap<>(); ^ symbol: class Map location: class Main Main.java:3: error: cannot find symbol private static Map<String, Integer> map = new HashMap<>(); ...
s233068448
p00121
Java
import java.util.*; import java.io.*; public class q0121 { static IO io = new IO(); public static void main(String[] args) { while (io.hasNext()) { // 0..7:????????????????????¶??? 8:???????????§?¨? 9:??´??????????????§?¨? 10:???????????° int n[] = new int[11]; Deque<int[]> que = new ArrayDeque<int[]>(...
Main.java:3: error: class q0121 is public, should be declared in a file named q0121.java public class q0121 { ^ 1 error
s556747771
p00121
Java
import java.util.*; import java.io.*; public class Main { static IO io = new IO(); public static void main(String[] args) { while (io.hasNext()) { // 0..7:????????????????????¶??? 8:???????????§?¨? 9:??´??????????????§?¨? 10:???????????° int n[] = new int[11]; Deque<int[]> que = new ArrayDeque<int[]>()...
Main.java:209: error: class, interface, enum, or record expected import java.util.*; ^ Main.java:210: error: class, interface, enum, or record expected import java.io.*; ^ 2 errors
s260537844
p00121
Java
import java.util.Scanner; import java.util.LinkedList; import java.util.Queue; public class sevenp{ public static void main(String[] args){ Scanner s = new Scanner(System.in); int[][] a = new int[2][4]; int i,j,m; long k=1,n=0; while(s.hasNext()){ for(i=0;i<2;i++){ ...
Main.java:6: error: class sevenp is public, should be declared in a file named sevenp.java public class sevenp{ ^ 1 error
s078512123
p00121
Java
public class Main { public static void main(String[] agrs){ Scanner x = new Scanner(System.in); int data [] = new int[8]; for(int i = 0;i<8;i++) { data[i]=x.nextInt(); } int count = 0; for(int i = 0;i < data.length;i++) { for(int j = i + 1; j<data.length;j++) { if(data[i]>data[j...
Main.java:5: error: cannot find symbol Scanner x = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:5: error: cannot find symbol Scanner x = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s408702276
p00121
Java
7 パズルは 8 つの正方形のカードとこれらのカードがぴたりと収まる枠で構成されています。それぞれのカードには、互いに区別できるように 0, 1, 2, ..., 7 と番号がつけられています。枠には、縦に 2 個、横に 4 個のカードを並べることができます。 7 パズルを始めるときには、まず枠にすべてのカードを入れます。枠のなかで 0 のカードだけは、上下左右に隣接するカードと位置を交換することができます。たとえば、枠の状態が図(a) のときに、0 のカードの右に隣接した、7 のカードと位置を交換すれば、図(b) の状態になります。あるいは、図(a) の状態から 0 のカードの下に隣接した 2 のカードと位置を交換すれば図(c)...
Main.java:1: error: class, interface, enum, or record expected 7 ???? 8 ?????????????????????????????????????????????????????????? 0, 1, 2, ..., 7 ??????????????????? 2 ???? 4 ????????????????? ^ Main.java:1: error: illegal character: '\u3002' 7 ???? 8 ?????????????????????????????????????????????????????????? 0, 1, 2,...
s087319137
p00121
Java
public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true) { HashMap<Integer, Integer> map = new HashMap<>(); Queue<int[]> que = new ArrayDeque<int[]>(); int[] state = new int[9]; int[] temp = new i...
Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:6: erro...
s438629375
p00121
Java
import java.util.*; import static java.lang.Math.*; import static java.util.Arrays.*; public class P0121 { int INF = 1 << 28; int[][] next = {{1,4}, {0,2,5}, {1,3,6}, {2,7}, {0,5}, {1,4,6}, {2,5,7}, {3,6}}; void run() { Scanner sc = new Scanner(System.in); while(sc.hasNe...
Main.java:6: error: class P0121 is public, should be declared in a file named P0121.java public class P0121 { ^ 1 error
s446828134
p00121
Java
package aizu_olinejudge; import java.util.*; public class SevenPuzzle { public static int lzh(int puzzle[]){ return puzzle[0]*10000000+puzzle[1]*1000000+puzzle[2]*100000+puzzle[3]*10000+puzzle[4]*1000+puzzle[5]*100+puzzle[6]*10+puzzle[7]; } public static void changein(int puzzle[],LinkedList<Integer> que,int a...
Main.java:5: error: class SevenPuzzle is public, should be declared in a file named SevenPuzzle.java public class SevenPuzzle { ^ 1 error
s947488992
p00121
Java
#include <iostream> #include <cstring> #include <queue> #define SIZE (8) #define ANSWER_STATE_CODE (342391) #define STATE_SIZE (16434824+1-ANSWER_STATE_CODE) int coefficients[SIZE] = {2097152, 262144, 32768, 4096, 512, 64, 8, 1}; int movablePairs[SIZE][4] = { {1,4,-1,-1}, {0,2,5,-1}, {1,3,6,-1}, {2,7,-1,-1}, ...
Main.java:1: error: illegal character: '#' #include <iostream> ^ Main.java:2: error: illegal character: '#' #include <cstring> ^ Main.java:3: error: illegal character: '#' #include <queue> ^ Main.java:5: error: illegal character: '#' #define SIZE (8) ^ Main.java:6: error: illegal character: '#' #define ANSWER_STATE_COD...
s008843856
p00121
Java
import java.util.ArrayDeque; import java.util.Arrays; import java.util.Scanner; public class Main { private final static int SIZE = 8; private final static int[][] MOVABLE_PAIRS = { {1,4}, {0,2,5}, {1,3,6}, {2,7}, {0,5}, {1,4,6}, {2,5,7}, {3,6} }; private final static int[] coefficients = {5040, 720, 120, ...
Main.java:29: error: not a statement - start); ^ Main.java:29: error: ';' expected - start); ^ 2 errors
s385348450
p00121
Java
package exp0121; import java.util.ArrayDeque; import java.util.Arrays; import java.util.Scanner; public class Main { private final static int SIZE = 8; private final static int[][] MOVABLE_PAIRS = { {1,4}, {0,2,5}, {1,3,6}, {2,7}, {0,5}, {1,4,6}, {2,5,7}, {3,6} }; private final static int[] coefficients =...
Main.java:22: error: invalid method declaration; return type required private Main3() { ^ 1 error
s836399618
p00121
Java
import java.util.*; import java.io.*; import static java.util.Arrays.*; import static java.util.Collections.*; import static java.lang.Math.*; public class P0121_ { int INF = 1 << 28; //long INF = 1L << 62; double EPS = 1e-10; HashMap<Integer, Integer> map = new HashMap<Integer, Integer>(); void run() { Scann...
Main.java:8: error: class P0121_ is public, should be declared in a file named P0121_.java public class P0121_ { ^ Main.java:84: error: cannot access Main new Main().run(); ^ bad source file: ./Main.java file does not contain class Main Please remove or make sure it appears in the correct subdi...
s682368592
p00121
C
//??-2015-11-8 # include <cstdio> # include <algorithm> # include <iostream> # include <string> # include <cstring> # include <map> # include <queue> using namespace std; int direction[4] = { -4, 4, -1, 1 }; //4个方向,上下左右 map<string, int>dp; //事先将?果保存在?里 void Bfs() { ...
main.c:2:11: fatal error: cstdio: No such file or directory 2 | # include <cstdio> | ^~~~~~~~ compilation terminated.
s368533737
p00121
C
#include<cstdio> #include<map> #include<queue> using namespace std; map<int,bool>p; map<int,int>ans; int a[10],b[10],dr[4]={1,-1,4,-4}; struct nde { int x,c,t; }f,g; queue<nde>q; int main() { int i,j,k; while(scanf("%d",&a[1])==1) { while(!q.empty()) q.pop(); p.clear(); f.t=0; for(i=2;i<=8;i++) { scan...
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s026058177
p00121
C
#include<iostream> #include<cstdio> #include<queue> #include<algorithm> #include<string> #include<vector> #include<cstdlib> using namespace std; #define maxn 305 int map[3][5]; int main() { int i,j; cin>>i; cout<<1<<endl; return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s393725865
p00121
C
#include <iostream> #include <vector> #include <algorithm> #include <map> #include <queue> using namespace std; typedef pair<string, int> P; vector<string> make(string str) { vector<string> ret; int pos; for (int i = 0; i < str.size(); ++i) if (str[i] == '0') pos = i; vector<int> v; if (pos % 4 != 3) v.push...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s949536936
p00121
C
#include <iostream> #include <vector> #include <algorithm> #include <map> #include <cstdio> #include <queue> using namespace std; typedef pair<string, int> P; string String(vector<int> v) { string ret = ""; for (int i = 0; i < v.size(); ++i) ret += v[i] + '0'; return ret; } int main() { map<string, int> step...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s723654453
p00121
C++
#include <cstdio> #include <queue> #include <complex> #include <algorithm> using namespace std; const int MAX_PTN = 76543211; struct state { int i; int n; int t; state(int i, int n, int t) : i(i), n(n), t(t) {} }; bool done[MAX_PTN]; int zi, n; int di[4] = {4, -4, 1, -1}; int make_nextnum(state cur, int ne...
a.cc: In function 'int bfs()': a.cc:32:3: error: 'memset' was not declared in this scope 32 | memset(done, false, sizeof done); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <algorithm> +++ |+#include <cstring>...
s478579597
p00121
C++
#include <cstdio> #include <queue> #include <complex> #include <algorithm> using namespace std; const int MAX_PTN = 76543211; struct state { int i; int n; int t; state(int i, int n, int t) : i(i), n(n), t(t) {} }; bool done[MAX_PTN]; int zi, n; int di[4] = {4, -4, 1, -1}; int make_nextnum(state cur, int ne...
a.cc: In function 'int bfs()': a.cc:32:3: error: 'memset' was not declared in this scope 32 | memset(done, false, sizeof done); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <algorithm> +++ |+#include <cstring>...
s764043680
p00121
C++
#include <bits/stdc++.h> using namespace std; #define int long long #define vvi vector<vector<int>> #define vec vector #define pq priority_queue #define all(v) (v).begin(), (v).end() #define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end()); #define rep(i, n) for (int (i) = (0); (i) < (...
a.cc: In function 'long long int bfs(std::vector<long long int>)': a.cc:52:5: error: '\U0000521d\U0000624b\U0000306b\U0000623b\U00003063\U0000305f\U0000304b\U000030c1\U000030a7\U000030c3\U000030af\U00003059\U0000308b' was not declared in this scope 52 | 初手に戻ったかチェックする | ^~~~~~~~~~~~~~~~~~~~~~~~~~
s544982742
p00121
C++
#include<iostream> #include<queue> using namespace std; bool acceptable(int** p) { for (int j = 0; j < 2; j++) for (int i = 0; i < 4; i++) if (p[i][j] != j * 4 + i) return false; return true; } int** move_0_up(int** p) { int val[4][2]; for (int j = 0; j < 2; j++) for (int i = 0; i < 4; i++) ...
a.cc: In function 'int** move_0_up(int**)': a.cc:32:10: error: cannot convert 'int (*)[2]' to 'int**' in return 32 | return val; | ^~~ | | | int (*)[2] a.cc: In function 'int** move_0_right(int**)': a.cc:51:22: error: cannot convert 'int (*)[2]' to 'int**' in return ...