submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s715215103 | p02244 | C | #include <stdio.h>
#define N 8
#define free 0
#define unfree 1
int Q[N][N],row[N],col[N],dpos[2*N-1],dneg[2*N-1];
int putQueen(int i){
int k,j;
if(i==N){
for(k=0;k<N;k++){
for(l=0;l<N;l++){
if(Q[k][l] == free){
printf(".");
}
else printf("Q");
return;
}
}
if(row[i]==unfree)
putQuee... | main.c: In function 'putQueen':
main.c:12:8: error: 'l' undeclared (first use in this function)
12 | for(l=0;l<N;l++){
| ^
main.c:12:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:5: error: 'return' with no value, in function returning non-void [-W... |
s026799399 | p02244 | C | #include<stdio.h>
#define N 8
#define FREE -1
#define NOT_FREE 1
#define TRUE 1
#define FALSE 0
int row[N], col[N], dpos[2 * N - 1], dneg[2 * N - 1];
int X[N][N];
void initialize(){
int i;
for(i = 0; i < N; i++){
row[i] = FREE;
col[i] = FREE;
}
for(i = 0; i < 2 * N - 1; i++){
dpos[i] = FREE;
... | main.c: In function 'main':
main.c:69:3: error: implicit declaration of function 'recuresive'; did you mean 'recursive'? [-Wimplicit-function-declaration]
69 | recuresive(0);
| ^~~~~~~~~~
| recursive
|
s979513199 | p02244 | C | #include <stdio.h>
??
int bunpai(int A[8][8], int *a, int *h, int *s, int *d, int n)
{
????int r, c;
????int x;
??
????if (n == 0) return 1;
??
????for (r = 0; r < 8; r++) {
????????if (h[r] == 0) {
????????????for (c = 0; c < 8; c++) {
????????if (v[c] == 0) {
????????????if (s[r+c] == 0 && d[r-c+7] == 0) {
??????????... | main.c:2:1: error: expected identifier or '(' before '?' token
2 | ??
| ^
main.c:37:1: error: expected identifier or '(' before '?' token
37 | ??
| ^
main.c:85:1: error: expected identifier or '(' before '?' token
85 | ??
| ^
|
s533676824 | p02244 | C | #include <iostream>
using namespace std;
int n;
char p[8][8];
bool di(int a,int b){
for(int i=a,j=b;i<8&&j<8;){
if(p[i][j]=='Q')
return 0;
i++;
j++;
}
for(int i=a,j=b;i>=0&&j<8;){
if(p[i][j]=='Q')
return 0;
i--;
j++;
}
for(int i=a,j=b;i<8&&j>=0;){
if(p[i][j]=='Q')
return 0;
i++;
j--;
}
... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s667571533 | p02244 | C | #define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
using namespace std;
int dx[] = { 1,1,1,0,0,-1,-1,-1 };
int dy[] = { 1,0,-1,1,-1,1,0,-1 };
bool flag = false;
void dfs(char table[8][8], int k, int i, int j) {
int m, n;
if (k == 7) {
table[i][j] = 'Q';
for (m = 0; m < 8; m++) {
for (n = 0... | main.c:4:1: error: unknown type name 'using'
4 | using namespace std;
| ^~~~~
main.c:4:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
4 | using namespace std;
| ^~~
main.c:9:1: error: unknown type name 'bool'
9 | bool flag = false;
| ^~~~
main.c:4:... |
s060916487 | p02244 | C++ | #include <iostream>
using namespace std;
#define N 8
// x 0 1 2 3 ...
// y
// 0
// 1
// 2
// 3
// ...
int pos[N];
int row_reserved[N];
bool col_owned[N];
bool down_owned[2 * N - 1];
bool up_owned[2 * N - 1];
void init_board() {
memset(pos, -1, sizeof(pos));
memset(row_reserved, -1, sizeof(row_reserved));
me... | a.cc: In function 'void init_board()':
a.cc:22:3: error: 'memset' was not declared in this scope
22 | memset(pos, -1, sizeof(pos));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cstri... |
s303614903 | p02244 | C++ | from itertools import permutations
def check(queen):
for r1, c1 in queen:
if any((r1 != r2 or c1 != c2) and (r1 == r2 or c1 == c2 or r1 + c1 == r2 + c2 or r1 - c1 == r2 - c2) for r2, c2 in queen):
return False
return True
N = int(input())
queen, row, col = [], list(range(8)), list(range(8))
... | a.cc:17:18: error: empty character constant
17 | board = [''.join('Q' if (r, c) in queen_tmp else '.' for c in range(8)) for r in range(8)]
| ^~
a.cc:1:1: error: 'from' does not name a type
1 | from itertools import permutations
| ^~~~
|
s215010605 | p02244 | C++ | #include<bits/stdc++.h>
using namespace std;
free 0
false 0;
int a[8]={},b[8]={},c[15]={},d[15]={};
int x[8][8]={};
void dfs(int i){
int j;
if(i==N){
for(int i=0;i<8;i++)
for(int j=0;j<8;j++)
if(x[i][j]==1)
if(a[i]!=j)return;
for(int i=0;i<N;i++){
for(int j=0;j<N;j++)
printf("%s"... | a.cc:4:1: error: 'free' does not name a type
4 | free 0
| ^~~~
a.cc:2:1: note: 'free' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
1 | #include<bits/stdc++.h>
+++ |+#include <cstdlib>
2 | using namespace std;
a.cc: In function 'void dfs(int)':
a.cc:13:9: ... |
s788711540 | p02244 | C++ | #include<bits/stdc++.h>
using namespace std;
void dfs(int );
int a[8]={},b[8]={},c[15]={},d[15]={};
int x[8][8]={};
void dfs(int i){
if(i==N){
for(int i=0;i<8;i++)
for(int j=0;j<8;j++)
if(x[i][j]==1)
if(a[i]!=j)return;
for(int i=0;i<N;i++){
for(int j=0;j<N;j++)
printf("%s",(row[i] == j... | a.cc: In function 'void dfs(int)':
a.cc:9:9: error: 'N' was not declared in this scope
9 | if(i==N){
| ^
a.cc:17:20: error: 'row' was not declared in this scope; did you mean 'pow'?
17 | printf("%s",(row[i] == j)?"Q":".");
| ^~~
| pow
a.cc: ... |
s870328245 | p02244 | C++ | #include<bits/stdc++.h>
using namespace std;
void dfs(int );
int a[8]={},b[8]={},c[15]={},d[15]={};
char ch[8][8];
void dfs(int i){
if(i==N){
for(int i=0;i<8;i++)
for(int j=0;j<8;j++)
if(x[i][j]=='Q')
if(a[i]!=j)return;
for(int i=0;i<N;i++){
for(int j=0;j<N;j++)
cout<<x[i][j];
... | a.cc: In function 'void dfs(int)':
a.cc:9:9: error: 'N' was not declared in this scope
9 | if(i==N){
| ^
a.cc:12:9: error: 'x' was not declared in this scope
12 | if(x[i][j]=='Q')
| ^
a.cc:17:12: error: 'x' was not declared in this scope
17 | cout<<x[i][j];
| ... |
s972924944 | p02244 | C++ | #include<bits/stdc++.h>
using namespace std;
void dfs(int);
int a[8]={},b[8]={},c[15]={},d[15]={};
char ch[8][8];
void dfs(int x){
if(x==8){
for(int i=0;i<8;i++)
for(int j=0;j<8;j++)
if(x[i][j]=='Q')
if(a[i]!=j)return;
for(int i=0;i<8;i++){
for(int j=0;j<8;j++)
cout<<x[i][j];
... | a.cc: In function 'void dfs(int)':
a.cc:12:10: error: invalid types 'int[int]' for array subscript
12 | if(x[i][j]=='Q')
| ^
a.cc:16:13: error: invalid types 'int[int]' for array subscript
16 | cout<<x[i][j];
| ^
a.cc: In function 'int main()':
a.cc:36:5: error: 'x' was ... |
s856051704 | p02244 | C++ | #include <iostream>
using namespace std;
char print[8][8];
bool board[8][8];
void put(int r, int c){
print[c][r] = 'Q';
board[c][r] = false;
int temp_x[8] = { -1, -1, 0, 1, 1, 1, 0, -1 };
int temp_y[8] = { 0, -1, -1, -1, 0, 1, 1, 1 };
int x = r, y = c;
for (int i = 0; i < 8; i++){
x = r, y = c;
while... | a.cc: In function 'int main()':
a.cc:88:9: error: 'memset' was not declared in this scope
88 | memset(board, true, sizeof(board));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#inc... |
s931211054 | p02244 | C++ | /************************************************************
MiniSat -- Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson
Copyright (c) 2007-2010 Niklas Sorensson
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Softw... | a.cc:44:25: error: 'UINT32_MAX' was not declared in this scope
44 | const CRef CRef_Undef = UINT32_MAX;
| ^~~~~~~~~~
a.cc:36:1: note: 'UINT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
35 | #include <unordered_set>
+++ |+#include ... |
s816669293 | p02244 | C++ | /************************************************************
MiniSat -- Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson
Copyright (c) 2007-2010 Niklas Sorensson
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Softw... | a.cc:44:25: error: 'INT32_MAX' was not declared in this scope
44 | const CRef CRef_Undef = INT32_MAX;
| ^~~~~~~~~
a.cc:36:1: note: 'INT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
35 | #include <unordered_set>
+++ |+#include <cst... |
s718441890 | p02244 | C++ | /************************************************************
MiniSat -- Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson
Copyright (c) 2007-2010 Niklas Sorensson
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Softw... | a.cc:44:25: error: 'INT32_MAX' was not declared in this scope
44 | const CRef CRef_Undef = INT32_MAX;
| ^~~~~~~~~
a.cc:36:1: note: 'INT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
35 | #include <unordered_set>
+++ |+#include <cst... |
s185800244 | p02244 | C++ | /************************************************************
MiniSat -- Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson
Copyright (c) 2007-2010 Niklas Sorensson
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Softw... | a.cc:44:25: error: 'UINT32_MAX' was not declared in this scope
44 | const CRef CRef_Undef = UINT32_MAX;
| ^~~~~~~~~~
a.cc:36:1: note: 'UINT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
35 | #include <unordered_set>
+++ |+#include ... |
s441120854 | p02244 | C++ | #define FOR(i,n) for(int i=0; i<n; ++i)
#define GET(type,name) type name; std::cin >> name;
inline std::pair<int, int> min_max_in_the_same_line(const std::vector<std::vector<int>>& a){
int n = a.size();
std::vector<int> left(n);
std::vector<int> up(n);
std::vector<int> upleft(2*n-1); // (7,0) --> 0, ... | a.cc:4:15: error: 'pair' in namespace 'std' does not name a template type
4 | inline std::pair<int, int> min_max_in_the_same_line(const std::vector<std::vector<int>>& a){
| ^~~~
a.cc:1:1: note: 'std::pair' is defined in header '<utility>'; this is probably fixable by adding '#include <utility>... |
s048855138 | p02244 | C++ | #include <iostream>
#include <stack>
#define N 8
using namespace std;
stack<char> s[N][N];
char map[N][N];
int kazu;
void post(int a,int b){
for(int i=0;i<N;i++){
s[i][b].push(1);
if(i!=b) s[a][i].push(1);
}
for(int i=1;i+a<N&&i+b<N;i++){
s[a+i][b+i].push(1);
}
for(int i=1;a-i>=0&&b-i>=0;i++){
s[a-i][b-i... | a.cc: In function 'void rop(int, int)':
a.cc:54:17: error: 'view' was not declared in this scope
54 | view();
| ^~~~
|
s678819808 | p02244 | C++ | #include"windows.h"
#include<cstring>
#include<iostream>
#include<cassert>
using namespace std;
#define N 8
#define FREE -1
#define NOT_FREE 1
int row[N], col[N], dpos[2*N-1], dneg[2*N-1];
bool X[N][N];
void initialize(){
for(int i=0; i<N; i++){ row[i]=FREE, col[i]=FREE; }
for(int i=0; i<2*N-1; i++){ dpos[i]=FREE;... | a.cc:1:9: fatal error: windows.h: No such file or directory
1 | #include"windows.h"
| ^~~~~~~~~~~
compilation terminated.
|
s557212282 | p02244 | C++ | #include"windows.h"
#include<cstring>
#include<iostream>
#include<cassert>
using namespace std;
#define N 8
#define FREE -1
#define NOT_FREE 1
int row[N], col[N], dpos[2*N-1], dneg[2*N-1];
bool X[N][N];
void initialize(){
for(int i=0; i<N; i++){ row[i]=FREE, col[i]=FREE; }
for(int i=0; i<2*N-1; i++){ dpos[i]=FREE;... | a.cc:1:9: fatal error: windows.h: No such file or directory
1 | #include"windows.h"
| ^~~~~~~~~~~
compilation terminated.
|
s801015034 | p02244 | C++ | #include"windows.h"
#include<cstring>
#include<iostream>
#include<cassert>
using namespace std;
#define N 8
#define FREE -1
#define NOT_FREE 1
int row[N], col[N], dpos[2*N-1], dneg[2*N-1];
bool X[N][N];
void initialize(){
for(int i=0; i<N; i++){ row[i]=FREE, col[i]=FREE; }
for(int i=0; i<2*N-1; i++){ dpos[i]=FREE;... | a.cc:1:9: fatal error: windows.h: No such file or directory
1 | #include"windows.h"
| ^~~~~~~~~~~
compilation terminated.
|
s020560591 | p02244 | C++ | #include"windows.h"
#include<cstring>
#include<iostream>
#include<cassert>
using namespace std;
#define N 8
#define FREE -1
#define NOT_FREE 1
int row[N], col[N], dpos[2*N-1], dneg[2*N-1];
bool X[N][N];
void initialize(){
for(int i=0; i<N; i++){ row[i]=FREE, col[i]=FREE; }
for(int i=0; i<2*N-1; i++){ dpos[i]=FREE;... | a.cc:1:9: fatal error: windows.h: No such file or directory
1 | #include"windows.h"
| ^~~~~~~~~~~
compilation terminated.
|
s458972992 | p02244 | C++ | #include <cassert>
#include <iostream>
#include <vector>
/*
` `: Free
`Q`: Queen
`A`: Attackable
*/
typedef std::vector<std::vector<char> > TBoard;
struct TResult
{
TBoard Board;
bool IsOk;
TResult(const TBoard& ABoard, bool AIsOk)
: Board(ABoard), IsOk(AIsOk){}
};
TBoard AddQueen(const TBoard& ABoard,... | a.cc: In function 'void Print(const TBoard&, std::ostream&)':
a.cc:59:6: error: expected primary-expression before '?' token
59 | }???
| ^
a.cc:59:7: error: expected primary-expression before '?' token
59 | }???
| ^
a.cc:59:8: error: expected primary-expression before '?' token
5... |
s223574856 | p02244 | C++ | #include <bits/stdc++.h>
using namespace std;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
#define P(x) cout << (x) << "\n"
#define p(x) cout << (x)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define vv(type, c, m, n, i) vector<vector<type>> c(m, vector<type>(n, i)... | a.cc:9:20: error: expected unqualified-id before 'for'
9 | #define rep(i,a,n) for(int i=(a), i##_len=(n); i<i##_len; ++i)
| ^~~
a.cc:31:9: note: in expansion of macro 'rep'
31 | rep(i, 0, N) {
| ^~~
a.cc:31:13: error: 'i' does not name a type; did you mean 'vi'?
... |
s089842596 | p02244 | C++ | #include<iostream>
#include<cassert>
using namespace std;
#define N 8
#define FREE -1
#define NOT_FREE 1
int row[N], col[N], dpos[2 * N - 1], dneg[2 * N - 1];
bool X[N][N];
void initialize(){
int i;
for(i = 0 ; i < N ; i++) {row[i] = FREE, col[i] = FREE;}
for(i = 0 ; i < 2 * N ; i++) {dpos[i] = FREE, dneg[i]]... | a.cc: In function 'void initialize()':
a.cc:16:56: error: expected ';' before ']' token
16 | for(i = 0 ; i < 2 * N ; i++) {dpos[i] = FREE, dneg[i]] = FREE;}
| ^
| ;
a.cc: In function 'void recu... |
s886521170 | p02244 | C++ | #include <stdio.h>
#define NOT_FREE 1
#define FREE -1
#define N 8
int r,c,k,i,j;
int col[N],row[N],dneg[2*N-1],dpos[2*N-1];
int p[N][N];
void putqueen(int);
void printboard();
int main(){
for(i=0;i<N;i++){
col[i]=FREE;
row[i]=FREE;
}
for(i=0;i<2*N-1;i++){
dneg[i]=FREE;
dpos[i]=FREE;
}
for(... | a.cc: In function 'void putqueen(int)':
a.cc:52:5: error: 'recursive' was not declared in this scope
52 | recursive(i+1);
| ^~~~~~~~~
|
s520524215 | p02244 | C++ | 1#include<stdio.h>
#define N 8
#define FREE -1
#define NOT_FREE 1
#define FALSE 0
#define TRUE 1
int row[N],col[N],dpos[2*N -1],dneg[2*N-1];
int X[N][N];
void initialize(){
int i;
for(i=0;i<N;i++){
row[i]=0;
col[i]=0;
}
for(i=0;i<2*N-1;i++){
dpos[i]=FREE;
dneg[i]=FREE;
}
}
void print(){
int... | a.cc:1:2: error: stray '#' in program
1 | 1#include<stdio.h>
| ^
a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 1#include<stdio.h>
| ^
a.cc: In function 'void initialize()':
a.cc:13:5: error: 'row' was not declared in this scope
13 | row[i]=0;
| ^~~
a.cc:14:5:... |
s888677389 | p02244 | C++ | ////////////////////////////////////////
//ALDS1_12_B: Single Source Shortest Path I
//ALDS1_12_C: Single Source Shortest Path II
//priority_queue????????¨??????????£?????????´??????1?????????????´????????£?????????????????????????
//??¨?????£????????£?????????MLE???????????????
//???????????????adjacencyMatrix[][]... | a.cc: In function 'bool solve(int (*)[8])':
a.cc:167:9: error: 'memcpy' was not declared in this scope
167 | memcpy(board_copy, board, sizeof(board_copy)); //??????????????????????????¶???????????????????????¢??????????????????
| ^~~~~~
a.cc:27:1: note: 'memcpy' is defined in header '<cstring>';... |
s061486472 | p02244 | C++ | ////////////////////////////////////////
//ALDS1_12_B: Single Source Shortest Path I
//ALDS1_12_C: Single Source Shortest Path II
//priority_queue????????¨??????????£?????????´??????1?????????????´????????£?????????????????????????
//??¨?????£????????£?????????MLE???????????????
//???????????????adjacencyMatrix[][]... | a.cc: In function 'bool solve(int (*)[8])':
a.cc:167:9: error: 'memcpy' was not declared in this scope
167 | memcpy(board_copy, board, sizeof(board_copy)); //??????????????????????????¶???????????????????????¢??????????????????
| ^~~~~~
a.cc:27:1: note: 'memcpy' is defined in header '<cstring>';... |
s242816685 | p02244 | C++ | #include <iostream>
#include <string>
using namespace std;
int eight_queen[8];
bool check(int row, int value) {
int data;
for (int i = 0; i < 8; i++) {
if (eight_queen[i] != -1) {
data = eight_queen[i];
if (value == data) return false;
if ((value + row) == (data + i)) return false;
if ((value - row) ==... | a.cc: In function 'int main()':
a.cc:49:9: error: 'memset' was not declared in this scope
49 | memset(eight_queen, -1, sizeof(eight_queen));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
... |
s335020780 | p02244 | C++ | // ALDS1_13_A.cpp
// Heuristic Search - 8 Queens Problem
#include <iostream>
#include <vector>
#include <stack>
#include <csdtio>
using namespace std;
const int N = 8;
vector<int> row(N);
vector<int> col(N);
vector<int> md(2*N - 1); // main diagonal
vector<int> ad(2*N - 1); // anti-diagnoal
vector<int> res(N);
//vector... | a.cc:6:10: fatal error: csdtio: No such file or directory
6 | #include <csdtio>
| ^~~~~~~~
compilation terminated.
|
s516664720 | p02244 | C++ | #include <iostream>
#include <map>
static const int BOARD_SIZE = 8; // チェスボードの大きさ(縦横で同じ)
/* -------------------------------------------------------------------------- */
/* QueenCommand クラス */
/* -------------------------------------------------------------------... | a.cc:85:41: error: expected ';' at end of member declaration
85 | bool can_put(int row, int column)
| ^
| ;
a.cc: In member function 'void Queen8::put_on(int, int)':
a.cc:190:16: error: return-statement with a value,... |
s869985106 | p02244 | C++ | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
| |
s164091623 | p02244 | C++ | #include <iostream>
using namespace std;
#define number 8
int a[number][number] = {{}};
int row[number] = {};
int l[15] = {};
int r[15] = {};
int s[number] = {};
int main(){
int r,c,k;
cin >> k;
for(int i = 0;i < k;i++){
cin >> r >> c;
a[r][c] = 1;
}
backtrack(0);
}
void print(... | a.cc: In function 'int main()':
a.cc:24:3: error: 'backtrack' was not declared in this scope
24 | backtrack(0);
| ^~~~~~~~~
|
s642930271 | p02244 | C++ |
#include<iostream>
using namespace std;
#define N 8
#define FREE -1
#define NOT_FREE 1
int row[N], col[N], dpos[2 * N - 1], dneg[2 * N - 1]
bool X[N][N]
void initialize() {
for (int i = 0; i < N; i++) {
row[i] = FREE;
col[i] = FREE;
}
for (int i = 0; i < 2 * N - 1; i++) {
dpos[i] = FREE;
dne... | a.cc:12:1: error: expected initializer before 'bool'
12 | bool X[N][N]
| ^~~~
a.cc: In function 'void printBoard()':
a.cc:28:11: error: 'X' was not declared in this scope
28 | if (X[i][j]) {
| ^
a.cc: In function 'void recursive(int)':
a.cc:53:9: error: 'dneg' was not declared in this ... |
s724045793 | p02244 | C++ |
#include<iostream>
using namespace std;
#define N 8
#define FREE -1
#define NOT_FREE 1
int row[N], col[N], dpos[2 * N - 1], dneg[2 * N - 1];
bool X[N][N]
void initialize() {
for (int i = 0; i < N; i++) {
row[i] = FREE;
col[i] = FREE;
}
for (int i = 0; i < 2 * N - 1; i++) {
dpos[i] = FREE;
dn... | a.cc:14:1: error: expected initializer before 'void'
14 | void initialize() {
| ^~~~
a.cc: In function 'void printBoard()':
a.cc:28:11: error: 'X' was not declared in this scope
28 | if (X[i][j]) {
| ^
a.cc: In function 'void recursive(int)':
a.cc:54:15: error: expected ';' before '}' ... |
s363763994 | p02244 | C++ |
#include<iostream>
using namespace std;
#define N 8
#define FREE -1
#define NOT_FREE 1
int row[N], col[N], dpos[2 * N - 1], dneg[2 * N - 1];
bool X[N][N]
void initialize() {
for (int i = 0; i < N; i++) {
row[i] = FREE;
col[i] = FREE;
}
for (int i = 0; i < 2 * N - 1; i++) {
dpos[i] = FREE;
dn... | a.cc:14:1: error: expected initializer before 'void'
14 | void initialize() {
| ^~~~
a.cc: In function 'void printBoard()':
a.cc:28:11: error: 'X' was not declared in this scope
28 | if (X[i][j]) {
| ^
a.cc: In function 'void recursive(int)':
a.cc:54:15: error: expected ';' before '}' ... |
s130307817 | p02244 | C++ |
#include<iostream>
using namespace std;
#define N 8
#define FREE -1
#define NOT_FREE 1
int row[N], col[N], dpos[2 * N - 1], dneg[2 * N - 1];
bool X[N][N];
void initialize() {
for (int i = 0; i < N; i++) {
row[i] = FREE;
col[i] = FREE;
}
for (int i = 0; i < 2 * N - 1; i++) {
dpos[i] = FREE;
d... | a.cc: In function 'void recursive(int)':
a.cc:54:15: error: expected ';' before '}' token
54 | continue
| ^
| ;
55 | }
| ~
|
s411414635 | p02244 | C++ | package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
const (
BLOCKED = -1
EMPTY = 0
QUEEN = 1
BOARD_DIM = 8
QUEEN_NUM = 8
)
type Board struct {
table [][]int
dim int
}
func main() {
sc := bufio.NewScanner(os.Stdin)
sc.Split(bufio.ScanWords)
board := NewBoard(BOARD_DIM)
n, err... | a.cc:1:1: error: 'package' does not name a type
1 | package main
| ^~~~~~~
a.cc:24:1: error: 'func' does not name a type
24 | func main() {
| ^~~~
a.cc:62:1: error: 'func' does not name a type
62 | func eightQueens(numQueens int, board *Board) (bool, *Board) {
| ^~~~
a.cc:80:1: error: 'func'... |
s423109725 | p02244 | C++ | // 8クィーン問題
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<stack>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<vector>
#include<queue>
using namespace std;
const int SQUARE_NUM = 8;
// 駒が存在するかの定義
const int CAN_PUT = 0; // 置くことが出来るマス
const int EXIST = 1; // 駒が存在するマス
const... | a.cc: In function 'int main()':
a.cc:66:9: error: break statement not within loop or switch
66 | break;
| ^~~~~
|
s800523998 | p02245 | Java | package sample;
import java.util.Scanner;
/**
* IDA*?±??§£15puzzle????¢?
* IDA*??´??????IDDFS???A*???????????¶???IDDFS??§??¶????±??§£????¨??????????????????????A*???????????????"?????????"????´¢???
* IDA*?????\????§£????????£??±??????A*???????????¶????????????"??±???"?????????????¢?????§£???"????????????"???
* ??... | Main.java:15: error: class IDAStarAlgorithm is public, should be declared in a file named IDAStarAlgorithm.java
public class IDAStarAlgorithm {
^
1 error
|
s650509948 | p02245 | Java |
import java.util.*;
import java.io.*;
class field{
int cell[] = new int[9];
int evaluation;
int route[];
int floor;
field(int cell[], int hash){
floor = 1;
route = new int[1];
route[0] = hash;
for(int i = 0; i < 9; i++) this.cell[i] = cell[i];
int eva = 0;
for(int i = 0; i < 9; i++){
if(cell[i] !... | Main.java:180: error: ']' expected
cell[3i+j] = scan.nextInt();
^
Main.java:180: error: not a statement
cell[3i+j] = scan.nextInt();
^
Main.java:180: error: not a statement
cell[3i+j] = scan.nextInt();
^
Main.java:180: error: ';' expected
cell[3i+j] = scan.nextInt();
... |
s599152430 | p02245 | Java | import java.io.*;
import java.util.*;
public class Main {
public static final int SIZE = 3;
public static final int ALL_SIZE = SIZE * SIZE;
public static int[] factor= { 1, 1, 2, 6, 24, 120, 720, 5040, 50320, 362880 };
public static int hash(int[] A){
int[] A... | Main.java:144: error: class, interface, enum, or record expected
}
^
1 error
|
s724761388 | p02245 | Java | import sys;
import heapq
def iterative(i,j):
q = []
heapq.heappush(q,(0,i,j,puz))
global finding
while len(q):
items = heapq.heappop(q)
c_depth = items[0]
_i = items[1]
_j = items[2]
c_puz = items[3]
if(puzzleCheck(c_puz)):
finding = 1
... | Main.java:1: error: '.' expected
import sys;
^
Main.java:2: error: '.' expected
import heapq
^
Main.java:4: error: ';' expected
def iterative(i,j):
^
Main.java:75: error: class, interface, enum, or record expected
if(puz[i*3] == 0):
^
4 errors
|
s149945663 | p02245 | C | #include<stdio.h>
#include<stdlib>
int puzle[3][3];
int tmp[3][3;
int d1[4]={0,1,0,-1};
int d2[4]={1,0,-1,0};
void empty(int *x,int *y){
int i,j;
for(i=0;i<3;i++){
for(j=0;j<3;j++){
... | main.c:2:9: fatal error: stdlib: No such file or directory
2 | #include<stdlib>
| ^~~~~~~~
compilation terminated.
|
s660709916 | p02245 | C | #include<stdio.h>
#include<stdlib.h>
int puzle[3][3];
int tmp[3][3;
int d1[4]={0,1,0,-1};
int d2[4]={1,0,-1,0};
void empty(int *x,int *y){
int i,j;
for(i=0;i<3;i++){
for(j=0;j<3;j++){
... | main.c:5:14: error: expected ']' before ';' token
5 | int tmp[3][3;
| ^
| ]
|
s122508975 | p02245 | C | #include <stdlib.h>
#include <string.h>
typedef char Board[10];
Board ini_board, board, *history;
const Board target = "123456780";
int nhistories=0;
typedef enum { U, D, L, R } Direction;
typedef struct {
char pos;
char dir;
} Motion;
int minstep;
const Motion motion[9][5] =
{{{1,L},{3,U},{-1}}, {{0,R},{2,L... | main.c: In function 'search_path':
main.c:31:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
31 | printf("%d\n", step);
| ^~~~~~
main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'printf'
2 | #include <string.h>
+++ |+#include <stdio.h>
3 ... |
s600375377 | p02245 | C | #include<stdio.h>
#define MAX 100000
#define SENTINEL 2000000000
struct Card{
char suit;
int value;
};
struct Card L[MAX/2+2], R[MAX/2+2];
void merge(struct Card A[], int n, int left, int mid, int right){
int i, j, k;
int n1 = mid - left;
int n2 = right - mid;
for(i=0; i<n1; i++){
L[i] = A[left+1];... | main.c:73:1: error: expected identifier or '(' before '}' token
73 | }
| ^
main.c:75:1: warning: data definition has no type or storage class
75 | t = A[i+1];
| ^
main.c:75:1: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int]
main.c:75:5: error: 'A' undeclared here (not in a functio... |
s171852887 | p02245 | C | #include <stdio.h>
#include <math.h>
#define N 3
int search(int board[N][N], int min, int limit, int r_0, int c_0);
int search(int board[N][N], int min, int limit, int r_0, int c_0){
int md_c;
int num;
int res[4];
if (min == 0){
return 0;
}
if (r_0 != 0) {
md_c = min;
num = board[r_0-1][c_0]... | main.c: In function 'search':
main.c:121:14: error: expected expression before '{' token
121 | else return{
| ^
|
s357717524 | p02245 | C | #include<iostream>
#include<cmath>
#include<string>
#include<map>
#include<queue>
using namespace std;
#define N 3
#define N2 9
struct Puzzle{
int i,f[N2];
int space;
string path;
bool operator < (const Puzzle &p) const{
for(i = 0;i < N2;i ++)
{
if(f[i] == p.f[i]) continue;
return f[i] > p.f[i]... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s588088395 | p02245 | C | #include <stdio.h>
#include <stdlib.h>
int puzzle[3][3];
int tmp[3][3];
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};
void empty(int *,int *);
int dfs(int,int,int,int,const int);
int cal();
void swap(int *,int *);
int main() {
int i,j,a,x,y,l;
for(i=0; i<3; i++) {
for(j=0; j<3; j++) scanf("%d",&puz... | main.c: In function 'main':
main.c:26:9: error: 'ans' undeclared (first use in this function); did you mean 'abs'?
26 | ans = dfs(x,y,-1,0,l);
| ^~~
| abs
main.c:26:9: note: each undeclared identifier is reported only once for each function it appears in
|
s414065786 | p02245 | C | #include <iostream>
#include <cmath>
#include <string>
#include <map>
#include <queue>
using namespace std;
#define N 3
#define N2 9
struct Puzzle{
int f[N2];
int space;
string path;
bool operator < (const Puzzle &p) const{
for(int i=0;i<N2;i++){
if(f[i]==p.f[i]) continue... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s938245911 | p02245 | C | #include <stdio.h>
#include <stdlib.h>
????
int mas[3][3];
int cpy[3][3];
????
void input() {
????int i, j;
????for(i = 0; i < 3; i++)
????????for(j = 0; j < 3; j++)
????????????scanf("%d", &mas[i][j]);
}
????
void output() {
????int i, j;
????for(i = 0; i < 3; i++) {
????????for(j = 0; j < 3; j++) printf("%3d", mas[i]... | main.c:3:1: error: expected identifier or '(' before '?' token
3 | ????
| ^
main.c:6:1: error: expected identifier or '(' before '?' token
6 | ????
| ^
main.c:13:1: error: expected identifier or '(' before '?' token
13 | ????
| ^
main.c:21:1: error: expected identifier or '(' before '?' tok... |
s248706197 | p02245 | C | #include <stdio.h>
#include <stdlib.h>
????
int mas[3][3];
int cpy[3][3];
????
void input() {
????int i, j;
????for(i = 0; i < 3; i++)
????????for(j = 0; j < 3; j++)
????????????scanf("%d", &mas[i][j]);
}
????
void output() {
????int i, j;
????for(i = 0; i < 3; i++) {
????????for(j = 0; j < 3; j++) printf("%3d", mas[i]... | main.c:3:1: error: expected identifier or '(' before '?' token
3 | ????
| ^
main.c:6:1: error: expected identifier or '(' before '?' token
6 | ????
| ^
main.c:13:1: error: expected identifier or '(' before '?' token
13 | ????
| ^
main.c:21:1: error: expected identifier or '(' before '?' tok... |
s504740854 | p02245 | C | #include <stdio.h>
#include <stdlib.h>
??
int puz[3][3];
int tmp[3][3];
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
??
void empty(int *x,int *y) {
????int i,j;
????for(i=0;i<3;i++){
????????for(j=0;j<3;j++){
????????????if(!puz[i][j]){
????????????????*x=j;
????????????????*y=i;
????????????????return;
????????????}
??... | main.c:3:1: error: expected identifier or '(' before '?' token
3 | ??
| ^
main.c:8:1: error: expected identifier or '(' before '?' token
8 | ??
| ^
main.c:21:1: error: expected identifier or '(' before '?' token
21 | ??
| ^
main.c:28:1: error: expected identifier or '(' before '?' token
... |
s911512696 | p02245 | C | #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define MAX 2000000
#define INFTY (1<<30)
??
int H, A[MAX+1];
??
void swap(int *a, int *b) {
????????int t;
????????t = *a;
????????*a = *b;
????????*b = t;
}
??
void maxHeapify(int i) {
????????int largest;
????????int l = 2 * i;
????????int r... | main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s385966692 | p02245 | C | #include <stdio.h>
#include <stdlib.h>
????
int mas[3][3];
int cpy[3][3];
????
void input() {
????int i, j;
????for(i = 0; i < 3; i++)
????????for(j = 0; j < 3; j++)
????????????scanf("%d", &mas[i][j]);
}
????
void output() {
????int i, j;
????for(i = 0; i < 3; i++) {
????????for(j = 0; j < 3; j++) printf("%3d", mas[i]... | main.c:3:1: error: expected identifier or '(' before '?' token
3 | ????
| ^
main.c:6:1: error: expected identifier or '(' before '?' token
6 | ????
| ^
main.c:13:1: error: expected identifier or '(' before '?' token
13 | ????
| ^
main.c:21:1: error: expected identifier or '(' before '?' tok... |
s019297360 | p02245 | C | #include <stdio.h>
#include <stdlib.h>
??
int mas[3][3];
int cpy[3][3];
??
void input() {
????int i, j;
????for(i = 0; i < 3; i++)
????????for(j = 0; j < 3; j++)
????????????scanf("%d", &mas[i][j]);
}
??
void output() {
????int i, j;
????for(i = 0; i < 3; i++) {
????????for(j = 0; j < 3; j++) printf("%3d", mas[i][j]);
... | main.c:3:1: error: expected identifier or '(' before '?' token
3 | ??
| ^
main.c:6:1: error: expected identifier or '(' before '?' token
6 | ??
| ^
main.c:13:1: error: expected identifier or '(' before '?' token
13 | ??
| ^
main.c:21:1: error: expected identifier or '(' before '?' token
... |
s130903844 | p02245 | C | #include<stdio.h>
#include<stdlib.h>
int mas[3][3];
int cpy[3][3];
????
void input() {
????int i, j;
????for(i = 0; i < 3; i++)
????????for(j = 0; j < 3; j++)
????????????scanf("%d", &mas[i][j]);
}
????
void output() {
????int i, j;
????for(i = 0; i < 3; i++) {
????????for(j = 0; j < 3; j++) printf("%3d", mas[i][j]);
... | main.c:6:1: error: expected identifier or '(' before '?' token
6 | ????
| ^
main.c:13:1: error: expected identifier or '(' before '?' token
13 | ????
| ^
main.c:21:1: error: expected identifier or '(' before '?' token
21 | ????
| ^
main.c:28:1: error: expected identifier or '(' before '?' to... |
s618503922 | p02245 | C | #include<stdio.h>
#include<string.h>
#include<queue>
#include<iostream>
#include<algorithm>
#include<map>
#include<string>
using namespace std;
int c[4][2]={1,0,0,1,-1,0,0,-1};
int puzzle[10];
map<string,int> book;
struct yun
{
int s;
int state[9];
};
int bfs()
{
int i,j,k,l;
yun st,en;
queue<yun>... | main.c:3:9: fatal error: queue: No such file or directory
3 | #include<queue>
| ^~~~~~~
compilation terminated.
|
s234752697 | p02245 | C | if (x < cols - 1 && previousMove != 0) {
// up
board[zeroIndex] = board[zeroIndex - rows];
zeroIndex -= rows;
foundAnswer = blindSearch(x + 1, y, moves - 1, 1);
if (foundAnswer) {
//printf("yes\n");
return 1;
}
board[zeroIndex] = board[zeroIndex + rows];
zeroIndex += rows;
... | main.c:1:1: error: expected identifier or '(' before 'if'
1 | if (x < cols - 1 && previousMove != 0) {
| ^~
main.c:16:3: error: expected identifier or '(' before 'return'
16 | return 0;
| ^~~~~~
main.c:17:1: error: expected identifier or '(' before '}' token
17 | }
| ^
main.c: In functio... |
s019517111 | p02245 | C | int main() {
int i, x, y;
current = 0;
for (i = 0; i < 9; i++) {
scanf("%d", &board[i]);
if (!board[i])
zeroIndex = i;
}
x = cols - (zeroIndex / rows) - 1;
y = rows - (zeroIndex % cols) - 1;
while (current < 50) {
if (blindSearch(x, y, current, -1)) {
printf("%d\n", current);
... | main.c: In function 'main':
main.c:3:3: error: 'current' undeclared (first use in this function)
3 | current = 0;
| ^~~~~~~
main.c:3:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-de... |
s186784165 | p02245 | C | #include<stdio.h>
#include<string.h>
#include<algorithm>
#include<stdlib.h>
using namespace std;
const int Max = 3;
int a[4][2]= {0,-1,1,0,0,1,-1,0};
int last[9][2]= {{2,2},{0,0},{0,1},{0,2},{1,0},{1,1},{1,2},{2,0},{2,1}}; // 目标状态的数字所在位置
int k[Max][Max],k2[Max*Max],flag=0,limit,Mi; // k用来保存八数码状态,k2用来计算曼巴顿距离
int add(i... | main.c:3:9: fatal error: algorithm: No such file or directory
3 | #include<algorithm>
| ^~~~~~~~~~~
compilation terminated.
|
s318172093 | p02245 | C | #include<stdio.h>
#include<string.h>
#include<queue>
#include<map>
using namespace std;
int str[5][5];
struct edge
{
int x,y,n;
int s[5][5];
};
void bfs(int x,int y)
{
int i,j,k=0,next[4][2]={0,1,1,0,0,-1,-1,0}; //四个方向
long long l=0; //初始化为0
queue<edge>Q;
map<... | main.c:3:9: fatal error: queue: No such file or directory
3 | #include<queue>
| ^~~~~~~
compilation terminated.
|
s387166295 | p02245 | C++ | #include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
#define DIVN 3
void swap(int &a, int &b);
int fact(int a);
int dist(int x);
int abs(int x);
void insert(vector<int> &A, int v);
int extract(vector<int> &A);
int PtoI(vector<int> p);
vector<int> ItoP(int ii);
int SolvePuzzle(vector<int> P);
... | a.cc:18:38: error: 'INT_MAX' was not declared in this scope
18 | vector<int> Puzzles(fact(DIVN*DIVN), INT_MAX);
| ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
3 | #include <vector>
+++ |+#i... |
s026946668 | p02245 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()
const int INF = 1e9;
using namespace std;
const int answer[9] = {1, 2, 3, 4, 5, 6, 7, 8, 0};
const int edge[4][3] = {{0, 3, 6}, {0, 1, 2}, {6, 7, 8}, {2, 5, 8}}; /* l, t, b, r */
const bool direction[9][4] = {{... | a.cc:19:57: error: too many initializers for 'const bool [9][4]'
19 | {true, true, false, false}}
| ^
a.cc: In function 'int check()':
a.cc:25:12: error: 'tiles' was not declared in this scope
25 | if(tiles[i] != a... |
s762571612 | p02245 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()
const int INF = 1e9;
using namespace std;
const int answer[9] = {1, 2, 3, 4, 5, 6, 7, 8, 0};
const bool dir[9][4] = {{false, false, true, true},
{true, false, true, true},
... | a.cc: In function 'bool operator<(board, board)':
a.cc:87:47: error: expected ')' before ';' token
87 | return ((b1.cost > b2.cost) ? true : false;
| ~ ^
| )
|
s426573587 | p02245 | C++ | #include <vector>
#include <queue>
#include <map>
#include <cstdio>
using namespace std;
#define X 3
#define Y 3
#define THRESHOLD 2
int manhattan(int x1,int y1,int x2,int y2){
return abs(x1-x2)+abs(y1-y2);
}
int calc(vector<int>&v){
int s=0;
for(int coor=0;coor<X*Y;coor++){
if(v[coor]!=0){
s+=manhattan(coor%X,... | a.cc: In function 'int manhattan(int, int, int, int)':
a.cc:10:16: error: 'abs' was not declared in this scope
10 | return abs(x1-x2)+abs(y1-y2);
| ^~~
|
s747115893 | p02245 | C++ | // ------ Includes ------ //
#include <set>
#include <queue>
#include <vector>
#include <utility>
#include <iostream>
using namespace std;
// ------ Directions ------ //
const int dx[4] = { 0, 1, 0, -1 };
const int dy[4] = { 1, 0, -1, 0 };
// ------ BFS ------ //
int BFS(vector<vector<int> > p)
{
// ------ Ini... | In file included from /usr/include/c++/14/set:62,
from a.cc:3:
/usr/include/c++/14/bits/stl_tree.h: In instantiation of 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::find(const _Key&) [with _Key = std::vector<std::vector<in... |
s253419651 | p02245 | C++ | #include <algorithm>
#include <iostream>
#include <list>
#include <vector>
#include <string>
#include <map>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
using namespace std;
typedef long long Board;
const int N = 9;
const Board GOAL = 0x087654321;
struct state {
B... | a.cc: In function 'int main()':
a.cc:115:1: error: jump to label 'END'
115 | END:
| ^~~
a.cc:74:14: note: from here
74 | goto END;
| ^~~
a.cc:81:9: note: crosses initialization of 'int count'
81 | int count = 0;
| ^~~~~
|
s669329472 | p02245 | C++ | #include <iostream>
#include <vector>
#include <queue>
namespace eight_puzzle{
typedef unsigned int uint;
const int N = 3;
struct State{
State(const State &s){
table = s.table;
n = s.n;
}
State(const uint tt,const uint tn){
table = tt;
n = tn;
}
State& operator=(const State &s){
table = s.... | a.cc: In function 'int main()':
a.cc:91:37: error: no matching function for call to 'find(std::vector<unsigned int>::iterator, std::vector<unsigned int>::iterator, eight_puzzle::uint&)'
91 | if(std::find(visited.begin(),visited.end(),states[i].table)==visited.end()){
| ... |
s398895862 | p02245 | C++ | #include <iostream>
#include <iterator>
#include <vector>
#include <queue>
namespace eight_puzzle{
typedef unsigned int uint;
const int N = 3;
struct State{
State(const State &s){
table = s.table;
n = s.n;
}
State(const uint tt,const uint tn){
table = tt;
n = tn;
}
State& operator=(const Stat... | a.cc: In function 'int main()':
a.cc:92:37: error: no matching function for call to 'find(std::vector<unsigned int>::iterator, std::vector<unsigned int>::iterator, eight_puzzle::uint&)'
92 | if(std::find(visited.begin(),visited.end(),states[i].table)==visited.end()){
| ... |
s231429280 | p02245 | C++ | typedef std::vector<std::vector<int>> State;
const int N = 3;
State int_to_state(int c){
std::vector<std::vector<int>> state(N, std::vector<int>(N));
FOR(i, N) {
FOR(j, N) {
int r = c%10;
c = c/10;
state[i][j] = r;
}
}
return state;
... | a.cc:1:18: error: 'vector' in namespace 'std' does not name a template type
1 | typedef std::vector<std::vector<int>> State;
| ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
+++ |+#include <vector>
1 | ... |
s445656378 | p02245 | C++ | #include <iostream>
#include <vector>
#include <utility>
#include <utility>
#include <algorithm>
#include <queue>
#include <numeric>
#include <unordered_map>
typedef std::vector<std::vector<int>> State;
const int N = 3;
State int_to_state(int c){
std::vector<std::vector<int>> state(N, std::vector<i... | a.cc: In function 'State int_to_state(int)':
a.cc:16:11: error: 'i' was not declared in this scope
16 | FOR(i, N) {
| ^
a.cc:16:7: error: 'FOR' was not declared in this scope
16 | FOR(i, N) {
| ^~~
a.cc: In function 'int state_to_int(State)':
a.cc:28:11: error: 'i' was not ... |
s817470437 | p02245 | C++ | #define FOR(i,n) for(int i=0; i<n; ++i)
#define GET(type,name) type name; std::cin >> name;
#include <iostream>
#include <vector>
#include <utility>
#include <utility>
#include <algorithm>
#include <queue>
#include <numeric>
#include <unordered_map>
typedef std::vector<std::vector<int>> State;
const int N =... | a.cc: In function 'std::vector<std::vector<std::vector<int> > > next_states_of(State)':
a.cc:93:34: error: a function-definition is not allowed here before '{' token
93 | int solve_puzzle(State state){
| ^
a.cc:127:13: warning: empty parentheses were disambiguated as a func... |
s401977824 | p02245 | C++ | #define FOR(i,n) for(int i=0; i<n; ++i)
#define GET(type,name) type name; std::cin >> name;
#include <iostream>
#include <vector>
#include <utility>
#include <utility>
#include <algorithm>
#include <queue>
#include <numeric>
#include <unordered_map>
typedef std::vector<std::vector<int>> State;
const int N =... | a.cc: In function 'std::vector<std::vector<std::vector<int> > > next_states_of(State)':
a.cc:93:34: error: a function-definition is not allowed here before '{' token
93 | int solve_puzzle(State state){
| ^
a.cc:127:13: warning: empty parentheses were disambiguated as a func... |
s945507012 | p02245 | C++ | #define FOR(i,n) for(int i=0; i<n; ++i)
#define GET(type,name) type name; std::cin >> name;
#include <iostream>
#include <vector>
#include <utility>
#include <utility>
#include <algorithm>
#include <queue>
#include <numeric>
#include <unordered_map>
typedef std::vector<std::vector<int>> State;
const int N =... | a.cc: In function 'std::vector<std::vector<std::vector<int> > > next_states_of(State)':
a.cc:93:34: error: a function-definition is not allowed here before '{' token
93 | int solve_puzzle(State state){
| ^
a.cc:127:13: warning: empty parentheses were disambiguated as a func... |
s903026323 | p02245 | C++ | #include<algorithm>
#include<iostream>
#include<vector>
#include<queue>
#include<set>
using namespace std;
struct Node{
vector<int> arr;
int step;
};
const int tx[]={1,0,-1,0};
const int ty[]={0,1,0,-1};
vector<int> start,end;
queue<Node> sq;
set<int> pan;
void input()
{
int tmp;
for(int i=0;i!=3;++i)
for(int j... | a.cc: In function 'void input()':
a.cc:28:17: error: reference to 'end' is ambiguous
28 | end.push_back(i+1);
| ^~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/... |
s285965848 | p02245 | C++ | #include<cstdio>
#include<iostream>
#include<stack>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cstdlib>
#define _USE_MATH_DEFINES // M_PI????????????????????????
#include<math.h>
#include<queue>
#include<map>
#pragma warning(disable:4996)
using namespace std;
#define N 3
#define N2 9
struct Puzzl... | a.cc:36:1: error: expected ',' or ';' before 'bool'
36 | bool isTarget(Puzzle p){
| ^~~~
a.cc: In function 'std::string bfs(Puzzle)':
a.cc:46:11: error: 'struct Puzzle' has no member named 'puth'; did you mean 'path'?
46 | s.puth = "";
| ^~~~
| path
a.cc:47:11: error:... |
s850247435 | p02245 | C++ | #include<iostream>
#include<cmath>
#include<string>
#include<map>
#include<queue>
using namespace std;
#define N 3
#define N29
struct Puzzle{
int f[N2];
int space;
string path;
bool operator<(const Puzzle &p)const{
for(int i=0;i<N2;i++){
if(f[i]==p.f[i])continue;
return f[i]>p.f[i];
}
... | a.cc:11:9: error: 'N2' was not declared in this scope; did you mean 'N29'?
11 | int f[N2];
| ^~
| N29
a.cc: In member function 'bool Puzzle::operator<(const Puzzle&) const':
a.cc:16:19: error: 'N2' was not declared in this scope; did you mean 'N29'?
16 | for(int i=0;i<N2;i++){
... |
s717240319 | p02245 | C++ | #include<iostream>
#include<cmath>
#include<string>
#include<map>
#include<queue>
using namespace std;
#define N 3
#define N2 9
struct Puzzle{
int f[N2];
int space;
string path;
bool operator<(const Puzzle &p)const{
for(int i=0;i<N2;i++){
if(f[i]==p.f[i])continue;
return f[i]>p.f[i];
}
... | a.cc:26:15: error: 'Pizzle' was not declared in this scope; did you mean 'Puzzle'?
26 | bool isTarget(Pizzle p){
| ^~~~~~
| Puzzle
a.cc: In function 'int main()':
a.cc:65:14: error: 'bfs' was not declared in this scope
65 | string ans=bfs(in);
| ^~~
|
s855109675 | p02245 | C++ | #include<iostream>
#include<cmath>
#include<string>
#include<map>
#include<queue>
using namespace std;
#define N 3
#define N2 9
struct Puzzle{
int f[N2];
int space;
string path;
bool operator<(const Puzzle &p)const{
for(int i=0;i<N2;i++){
if(f[i]==p.f[i])continue;
return f[i]>p.f[i];
}
... | a.cc: In function 'bool isTarget(Puzzle)':
a.cc:30:3: error: 's' was not declared in this scope
30 | s.path="";
| ^
a.cc:34:9: error: expected primary-expression before '!=' token
34 | while(!=Q.empty()){
| ^~
a.cc:36:5: error: 'is' was not declared in this scope
36 | is(isTarget(... |
s135791616 | p02245 | C++ | #include<iostream>
#include<cmath>
#include<string>
#include<map>
#include<queue>
using namespace std;
#define N 3
#define N2 9
struct Puzzle{
int f[N2];
int space;
string path;
bool operator < (const Puzzle &p) const{
for(int i = 0; i < N2; i++){
if(f[i] == p.f[i]) continue;
return f[i] > p.f[i];
}
return false;
}
}... | a.cc: In function 'int main()':
a.cc:74:13: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'sizu'; did you mean 'size'?
74 | cout << ans.sizu() << endl;
| ^~~~
| size
|
s433664074 | p02245 | C++ | #include<iostream>
#include<cmath>
#include<string>
#include<map>
#include<queue>
using namespace std;
#define N 3
#define N2 9
struct Puzzle{
int i,f[N2];
int space;
string path;
bool operator < (const Puzzle &p) const{
for(i = 0;i < N2;i ++)
{
if(f[i] == p.f[i]) continue;
return f[i] > p.f[i]... | a.cc: In member function 'bool Puzzle::operator<(const Puzzle&) const':
a.cc:17:11: error: assignment of member 'Puzzle::i' in read-only object
17 | for(i = 0;i < N2;i ++)
| ~~^~~
a.cc:17:22: error: increment of member 'Puzzle::i' in read-only object
17 | for(i = 0;i < N2;i ++)
| ... |
s145717011 | p02245 | C++ | #include<iostream>
#include<cmath>
#include<string>
#include<map>
#include<queue>
using namespace std;
#define N 3
#define N2 9
bool isTarget(Puzzle );
string bfs(Puzzle );
struct Puzzle{
int i,f[N2];
int space;
string path;
bool operator < (const Puzzle &p) const{
for(i = 0;i < N2;i ++)
{
if(f[... | a.cc:10:15: error: 'Puzzle' was not declared in this scope
10 | bool isTarget(Puzzle );
| ^~~~~~
a.cc:11:12: error: 'Puzzle' was not declared in this scope
11 | string bfs(Puzzle );
| ^~~~~~
a.cc: In member function 'bool Puzzle::operator<(const Puzzle&) const':
a.cc:20:11: er... |
s110159397 | p02245 | C++ | #include <iostream>
#include <cmath>
#include <string>
#include <map>
#include <queue>
using namespace std;
#define N 3
#define N2 9
typedef struct {
int f[N2];
int space:
string path;
bool operator < (const puzzle &p) const {
for(int i=0; i<N2; i++){
if(f[i] == p.f[i]) continue;
return f[i] >... | a.cc:13:10: error: expected primary-expression before 'path'
13 | string path;
| ^~~~
a.cc:13:3: error: expected ';' at end of member declaration
13 | string path;
| ^~~~~~
| ;
a.cc:13:10: error: 'path' does not name a type
13 | string path;
| ^~~~
a.cc... |
s765721501 | p02245 | C++ | #include <iostream>
#include <cmath>
#include <string>
#include <map>
#include <queue>
using namespace std;
#define N 3
#define N2 9
struct Puzzle{
int f[N2];
int space:
string path;
bool operator < (const puzzle &p) const {
for(int i=0; i<N2; i++){
if(f[i] == p.f[i]) continue;
return f[i] > p... | a.cc:13:10: error: expected primary-expression before 'path'
13 | string path;
| ^~~~
a.cc:13:3: error: expected ';' at end of member declaration
13 | string path;
| ^~~~~~
| ;
a.cc:13:10: error: 'path' does not name a type
13 | string path;
| ^~~~
a.cc... |
s399186864 | p02245 | C++ | #include <iostream>
#include <cmath>
#include <string>
#include <map>
#include <queue>
using namespace std;
#define N 3
#define N2 9
struct Puzzle {
int f[N2];
int space;
string path;
bool operator < (const Puzzle &p) const {
for(int i=0; i<N2; i++){
if(f[i] == p.f[i]) continue;
return f[i] > ... | a.cc:25:38: error: expected '}' before ')' token
25 | static const int dy[4] = {0, -1, 0, 1);
| ~ ^
a.cc:25:38: error: expected ',' or ';' before ')' token
a.cc: In function 'bool isTarget(Puzzle)':
a.cc:30:12: error: 'o' was not declared in this scope
30 | if(p.f[o] !... |
s286843506 | p02245 | C++ | #include <bits/stdc++.h>
#define MAX 3
#define MAX2 9
using namespace std;
struct Puzzle{
int f[MAX2];
int space;
string path;
bool operator < (Puzzle &p){
int i;
for(i = 0; i < MAX2; i++){
if( f[i] == p.f[i] ){
continue;
}
return f[i] > p.f[i];
}
return false;
}
};
... | In file included from /usr/include/c++/14/string:49,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/stl_function.h: In instantiation of 'constexpr bool std::less<_Tp>::operator()(con... |
s471466722 | p02245 | C++ | #include <bits/stdc++.h>
#include "puzzle.h"
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef vector<ll> Vector;
typedef vector<vector<ll>> DVector;
#define fi first
#define se second
#define pb push_back
#define INF INT_MAX/... | a.cc:2:10: fatal error: puzzle.h: No such file or directory
2 | #include "puzzle.h"
| ^~~~~~~~~~
compilation terminated.
|
s630179775 | p02245 | C++ | #include <bits/stdc++.h>
using namespace std;
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define INF INT_MAX/3
#define N 3
#define LIMIT_TIME 180000
typedef pair<int, int> P;
struct State {
int g, h;
string state;
P blank;
string path;
bool operator<(const ... | a.cc: In function 'int h0()':
a.cc:35:26: error: 'start' was not declared in this scope
35 | auto dur = end - start;
| ^~~~~
|
s099369357 | p02245 | C++ | #include<iostream>
#include<cmath>
#include<string>
#include<map>
#include<queue>
using namespace std;
#define N 3
#define N2 9
struct Puzzle {
int f[N2];
int space;
string path;
bool operator < ( const Puzzle &p ) const {
for ( int i = 0; i < N2; i++ ) {
if ( f[i] == p.f[i] ) continue;
return... | a.cc: In function 'std::string bfs(Puzzle)':
a.cc:38:3: error: 's' was not declared in this scope
38 | s.path = "";
| ^
|
s482980191 | p02245 | C++ | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
| |
s707546106 | p02245 | C++ | #include<stdio.h>
#include<string.h>
#include<queue>
using namespace std;
#define MAXN 363000 //9!==326880
struct node
{
int s[9];
int a;
int b;
int step;
};
int fac[10]= {1,1,2,6,24,120,720,5040,40320,362880};//分别存储1--9的阶乘值
int dir[4][2]= {-1,0,1,0,0,-1,0,1};
int aim=322561;//123456780对应的hash值
bool vi... | a.cc:18:1: error: expected initializer before 'int'
18 | int cantor(const int *s)
| ^~~
a.cc: In function 'bool bfs()':
a.cc:48:18: error: overloaded function with no contextual type information
48 | next=now;
| ^~~
a.cc:49:18: error: overloaded function with no contextual... |
s416387675 | p02245 | C++ | #include <bits/stdc++.h>
using namespace std;
static const int dx[4] = {-1, 0, 1, 0};
static const int dy[4] = {0, -1, 0, 1};
static const char dir[4] = {'u', 'l', 'd', 'r'};
#define N 3
#define N2 9
int main()
{
8puzzle in;
for (int i = 0; i < N2; i++)
{
cin >> in.f[i];
if (in.f[i] == 0... | a.cc: In function 'int main()':
a.cc:14:5: error: unable to find numeric literal operator 'operator""puzzle'
14 | 8puzzle in;
| ^~~~~~~
a.cc:17:16: error: 'in' was not declared in this scope; did you mean 'i'?
17 | cin >> in.f[i];
| ^~
| i
a.cc:24:22... |
s423005867 | p02245 | C++ | #include <bits/stdc++.h>
using namespace std;
static const int dx[4] = {-1, 0, 1, 0};
static const int dy[4] = {0, -1, 0, 1};
static const char dir[4] = {'u', 'l', 'd', 'r'};
#define N 3
#define N2 9
struct 8puzzle
{
int f[N2];
int space;
string path;
bool operator<(const 8puzzle & p) const
{
... | a.cc:12:8: error: expected identifier before numeric constant
12 | struct 8puzzle
| ^~~~~~~
a.cc:12:8: error: expected unqualified-id before numeric constant
a.cc:31:15: error: unable to find numeric literal operator 'operator""puzzle'
31 | bool isTarget(8puzzle p)
| ^~~~~~~
a.cc:... |
s904661421 | p02245 | C++ | #include <bits/stdc++.h>
using namespace std;
#define N 3
#define N2 9
int main()
{
8puzzle in;
for (int i = 0; i < N2; i++)
{
cin >> in.f[i];
if (in.f[i] == 0)
{
in.f[i] = N2;
in.space = i;
}
}
string ans = bfs(in);
cout << ans.size() <... | a.cc: In function 'int main()':
a.cc:10:5: error: unable to find numeric literal operator 'operator""puzzle'
10 | 8puzzle in;
| ^~~~~~~
a.cc:13:16: error: 'in' was not declared in this scope; did you mean 'i'?
13 | cin >> in.f[i];
| ^~
| i
a.cc:20:22... |
s809362754 | p02245 | C++ | #include<bits/stdc++.h>
using namespace std;
#define N 3
#define N2 9
struct 8puzzle{
int f[N2];
int space;
string path;
bool operator < (const 8puzzle &p) const{
for(int i = 0; i < N2; i++){
if(f[i] == p.f[i]) continue;
return f[i] > p.f[i];
}
return false;
}
};
static const int dx[4] = {-1,0,1,0};
static co... | a.cc:7:8: error: expected identifier before numeric constant
7 | struct 8puzzle{
| ^~~~~~~
a.cc:7:8: error: expected unqualified-id before numeric constant
a.cc:25:15: error: unable to find numeric literal operator 'operator""puzzle'
25 | bool isTarget(8puzzle p){
| ^~~~~~~
a.cc:... |
s832264627 | p02245 | C++ | #include<iostream>
#include<cmath>
#include<string>
#include<map>
#include<queue>
#include<bits/stdc++.h>
using namespace std;
#define N 3
#define N2 9
struct 8puzzle{
int f[N2];
int space;
string path;
bool operator < (const 8puzzle &p) const{
for(int i = 0; i < N2; i++){
if(f[i] == p.f[i]) continue;
return f[... | a.cc:13:8: error: expected identifier before numeric constant
13 | struct 8puzzle{
| ^~~~~~~
a.cc:13:8: error: expected unqualified-id before numeric constant
a.cc:31:15: error: unable to find numeric literal operator 'operator""puzzle'
31 | bool isTarget(8puzzle p){
| ^~~~~~~
a.c... |
s969168951 | p02245 | C++ |
#include<iostream>
#include<cmath>
#include<string>
#include<map>
#include<queue>
using namespace std;
#define N 3
#define N2 9
struct Puzzle {
int f[N2];
int space;
string path;
bool operator < (const Puzzle& p) const {
for (int i = 0; i < N2; i++) {
if (f[i] == p.f[i]) {
continue;
... | a.cc: In function 'std::string bfs(Puzzle)':
a.cc:60:37: error: expected primary-expression before '||' token
60 | if (tx < 0 || ty < 0 || tx >= || ty >= N) {
| ^~
a.cc: In function 'int main()':
a.cc:88:14: error: expected identifier before '.' token
88 | cout <<... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.