submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s326433700 | p00121 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <queue>
using namespace std;
map<string, int> dp;
int direction[4] = { 1, -1, 4, -4 };
//************************************
// Method: bfs
// FullName: bfs
// Access: public
// Returns: void
// Qualifier: 隶ゥ0貍ォ貂ク謨エ荳ェ蟄嶺クイ
... | a.cc: In function 'void bfs()':
a.cc:42:24: error: expected primary-expression before 'next'
42 | string next = now;
| ^~~~
a.cc:43:26: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
43 | swap(next[p], next[n]);
... |
s997566647 | 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
... |
s720297321 | 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
... |
s474404528 | p00121 | C++ | //AOJ 0121
//include
#include<bits/stdc++.h>
//using
using namespace std;
//define static const typedef
#define FOR(i, s, n) for(int (i) = (s); (i) < (n); (i)++)
#define REP(i, n) FOR((i), 0, (n))
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pai... | a.cc: In function 'int main()':
a.cc:47:3: error: reference to 'move' is ambiguous
47 | move[0].PB(1);
| ^~~~
In file included from /usr/include/c++/14/algorithm:86,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:4:
/usr/include/c++/14/pstl/glue_algo... |
s599007281 | p00121 | C++ | //AOJ 0121
//include
#include<bits/stdc++.h>
//using
using namespace std;
//define static const typedef
#define FOR(i, s, n) for(int (i) = (s); (i) < (n); (i)++)
#define REP(i, n) FOR((i), 0, (n))
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pai... | a.cc: In function 'int main()':
a.cc:49:3: error: reference to 'move' is ambiguous
49 | move[0].PB(1);
| ^~~~
In file included from /usr/include/c++/14/algorithm:86,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:4:
/usr/include/c++/14/pstl/glue_algo... |
s237930880 | p00121 | C++ | //AOJ 0121
//include
#include<bits/stdc++.h>
//using
using namespace std;
//define static const typedef
#define FOR(i, s, n) for(int (i) = (s); (i) < (n); (i)++)
#define REP(i, n) FOR((i), 0, (n))
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pai... | a.cc:45:12: error: cannot declare '::main' to be static
45 | static int main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:49:3: error: reference to 'move' is ambiguous
49 | move[0].PB(1);
| ^~~~
In file included from /usr/include/c++/14/algorithm:86,
from /usr/include... |
s018589603 | p00121 | C++ | //AOJ 0121
//include
#include<bits/stdc++.h>
//using
using namespace std;
//define static const typedef
#define FOR(i, s, n) for(int (i) = (s); (i) < (n); (i)++)
#define REP(i, n) FOR((i), 0, (n))
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pai... | a.cc:45:12: error: cannot declare '::main' to be static
45 | static int main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:49:3: error: reference to 'move' is ambiguous
49 | move[0].PB(1);
| ^~~~
In file included from /usr/include/c++/14/algorithm:86,
from /usr/include... |
s699469002 | p00121 | C++ | //AOJ 0121
//include
#include<bits/stdc++.h>
//using
using namespace std;
//define static const typedef
#define FOR(i, s, n) for(int (i) = (s); (i) < (n); (i)++)
#define REP(i, n) FOR((i), 0, (n))
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pai... | a.cc: In function 'int main()':
a.cc:49:3: error: reference to 'move' is ambiguous
49 | move[0].PB(1);
| ^~~~
In file included from /usr/include/c++/14/algorithm:86,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:4:
/usr/include/c++/14/pstl/glue_algo... |
s206947601 | p00121 | C++ | //AOJ 0121
//include
#include<bits/stdc++.h>
//using
using namespace std;
//define static const typedef
#define FOR(i, s, n) for(int (i) = (s); (i) < (n); (i)++)
#define REP(i, n) FOR((i), 0, (n))
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pai... | a.cc:42:8: error: 'VVII' does not name a type; did you mean 'VVI'?
42 | static VVII c;
| ^~~~
| VVI
a.cc: In function 'int main()':
a.cc:48:3: error: reference to 'move' is ambiguous
48 | move[0].PB(1);
| ^~~~
In file included from /usr/include/c++/14/algorithm:86,
... |
s683392596 | p00121 | C++ | //AOJ 0121
//include
#include<bits/stdc++.h>
//using
using namespace std;
//define static const typedef
#define FOR(i, s, n) for(int (i) = (s); (i) < (n); (i)++)
#define REP(i, n) FOR((i), 0, (n))
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make... | a.cc: In function 'int main()':
a.cc:48:3: error: reference to 'move' is ambiguous
48 | move[0].PB(1);
| ^~~~
In file included from /usr/include/c++/14/algorithm:86,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:4:
/usr/include/c++/14/pstl/glue_algo... |
s917185027 | p00121 | C++ | #include <iostream>
#include <vector>
#include <map>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
static const int INF=1<<24;
map<vector<vector<int> >,int> ma;
vector<vector<int> > puz;
vector<vectr<int> > v;
template<class T>
void initvv(vector<vector<T> > &v,int a,int b,const T &t=T()){
v.assign(a,ve... | a.cc:11:8: error: 'vectr' was not declared in this scope; did you mean 'qecvt_r'?
11 | vector<vectr<int> > v;
| ^~~~~
| qecvt_r
a.cc:11:17: error: template argument 1 is invalid
11 | vector<vectr<int> > v;
| ^
a.cc:11:17: error: template argument 2 is invalid
a.cc:1... |
s349681072 | p00121 | C++ | #include<iostream>
#include<queue>
#include<algorithm>
using namespace std;
int vis[17000000];
int temp[10];
int s;
int dir[4]={-1,1,4,-4};
struct Node
{
int x;
int line;
int step;
friend bool operator <(Node a, Node b)
{
return a.step>b.step;
}
};
void BFS(int x,int s)
{
priority_queue... | a.cc: In function 'int main()':
a.cc:81:17: error: 'memset' was not declared in this scope
81 | memset(vis,0,sizeof(vis));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<algorithm>
++... |
s461979430 | p00121 | C++ | import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Scanner;
public class Main {
Scanner sc = new Scanner(System.in);
HashMap<String, Integer> map;
LinkedList<String> que;
void run() {
map = new HashMap<String, Integer>();
que = new LinkedList<String>();
int cnt... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Arrays;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.HashMap;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-t... |
s527370892 | p00121 | C++ | #include<iostream>
#include<set>
#include<deque>
#include<utility>
#include<algorithm>
#include<stack>
#include<vector>
#include<string>
using namespace std;
bool used[8][8][8][8][8][8][8][8];
inline bool judge(vector<int> ar){
for(int i=0;i<ar.size();i++){
if (ar[i] != i) return false;
}
return true;
... | a.cc: In function 'int main()':
a.cc:41:9: error: 'memset' was not declared in this scope
41 | memset(used,0,sizeof(used));
| ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
7 | #include<vector>
+++ |+#include <cstr... |
s312856292 | p00121 | C++ | #include<iostream>
#include<set>
#include<deque>
#include<utility>
#include<algorithm>
#include<stack>
#include<vector>
#include<string.h>
using namespace std;
bool used[8][8][8][8][8][8][8][8];
inline bool judge(vector<int> ar){
for(int i=0;i<ar.size();i++){
if (ar[i] != i) return false;
}
return true... | a.cc: In function 'int main()':
a.cc:55:30: error: no match for 'operator==' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int')
55 | if((cin >> ar[i])==0){
| ~~~~~~~~~~~~~~^~~
| | |
| ... |
s095222293 | p00121 | C++ | #include<iostream>
#include<set>
#include<deque>
#include<utility>
#include<algorithm>
#include<stack>
#include<vector>
#include<string.h>
using namespace std;
bool used[8][8][8][8][8][8][8][8];
short dp[8][8][8][8][8][8][8][8];
inline bool judge(vector<int> ar){
for(int i=0;i<ar.size();i++){
if (ar[i] != i) ... | a.cc: In function 'int main()':
a.cc:56:30: error: no match for 'operator==' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int')
56 | if((cin >> ar[i])==0){
| ~~~~~~~~~~~~~~^~~
| | |
| ... |
s025360779 | p00121 | C++ | #include <iostream>
#include <queue>
#define INF 9999999
using namespace std;
typedef struct {
int d[9];
}data;
int main() {
while(true) {
queue<data> bfs;
data first;
bool checked[8][8][8][8][8][8][8];
int min = INF;
for (int i = 0;i < 8;i++) {
cin >> first.d[i];
}
first.d[8] = 0;
bfs.push(first... | a.cc: In function 'int main()':
a.cc:10:27: error: template argument 1 is invalid
10 | queue<data> bfs;
| ^
a.cc:10:27: error: template argument 2 is invalid
a.cc:11:17: error: reference to 'data' is ambiguous
11 | data first;
| ... |
s902560072 | p00121 | C++ | #include <iostream>
#include <map>
#include <queue>
using namespace std;
typedef struct {
int d[8];
int count;
} data;
map <string,int> memo;
queue <data> bfs;
int main() {
data first;
for (int i = 0;i < 8;i++) {
first.d[i] = i;
}
first.count = 0;
bfs.push(first);
for (;;) {
if (bfs.empty()) break;
data... | a.cc:11:12: error: template argument 1 is invalid
11 | queue <data> bfs;
| ^
a.cc:11:12: error: template argument 2 is invalid
a.cc: In function 'int main()':
a.cc:14:9: error: reference to 'data' is ambiguous
14 | data first;
| ^~~~
In file included from /usr/include/c++/14... |
s449822696 | p00121 | C++ | #include <iostream>
#include <map>
#include <queue>
using namespace std;
typedef struct {
int d[8];
int count;
} data;
map <string,int> memo;
queue <data> bfs;
string to_string(int n) {
string x = n;
return x;
}
int main() {
data first;
for (int i = 0;i < 8;i++) {
first.d[i] = i;
}
first.count = 0;
bfs.pu... | a.cc:11:12: error: template argument 1 is invalid
11 | queue <data> bfs;
| ^
a.cc:11:12: error: template argument 2 is invalid
a.cc: In function 'std::string to_string(int)':
a.cc:14:20: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
... |
s964040202 | p00121 | C++ | #include <iostream>
#include <map>
#include <queue>
using namespace std;
typedef struct {
int d[8];
int count;
} data;
map <string,int> memo;
queue <data> bfs;
string to_string(int n) {
char a = n;
string b = a;
return b;
}
int main() {
data first;
for (int i = 0;i < 8;i++) {
first.d[i] = i;
}
first.count... | a.cc:11:12: error: template argument 1 is invalid
11 | queue <data> bfs;
| ^
a.cc:11:12: error: template argument 2 is invalid
a.cc: In function 'std::string to_string(int)':
a.cc:15:20: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested... |
s741103408 | p00121 | C++ | #include <iostream>
#include <map>
#include <queue>
using namespace std;
typedef struct {
int d[8];
int count;
} data;
map <string,int> memo;
queue <data> bfs;
char to_string(int n) {
char a = n;
string b = a;
return a;
}
int main() {
data first;
for (int i = 0;i < 8;i++) {
first.d[i] = i;
}
first.count =... | a.cc:11:12: error: template argument 1 is invalid
11 | queue <data> bfs;
| ^
a.cc:11:12: error: template argument 2 is invalid
a.cc: In function 'char to_string(int)':
a.cc:15:20: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
15 ... |
s825500658 | p00121 | C++ | #include <iostream>
#include <map>
#include <queue>
using namespace std;
typedef struct {
int d[8];
int count;
} data;
map <string,int> memo;
queue <data> bfs;
char to_string(int n) {
for (int i = 0;i < 10;i++) {
if (n==i) return i;
}
}
int main() {
data first;
for (int i = 0;i < 8;i++) {
first.d[i] = i;
... | a.cc:11:12: error: template argument 1 is invalid
11 | queue <data> bfs;
| ^
a.cc:11:12: error: template argument 2 is invalid
a.cc: In function 'int main()':
a.cc:20:9: error: reference to 'data' is ambiguous
20 | data first;
| ^~~~
In file included from /usr/include/c++/14... |
s474007250 | p00121 | C++ | #include <iostream>
#include <map>
#include <queue>
using namespace std;
typedef struct {
int d[8];
int count;
} data;
map <string,int> memo;
queue <data> bfs;
string tto_string(int n) {
std::stringstream ss;
ss << n;
std::string str = ss.str();
return str;
}
int main() {
data first;
for (int i = 0;i < 8;i++) ... | a.cc:11:12: error: template argument 1 is invalid
11 | queue <data> bfs;
| ^
a.cc:11:12: error: template argument 2 is invalid
a.cc: In function 'std::string tto_string(int)':
a.cc:14:19: error: aggregate 'std::stringstream ss' has incomplete type and cannot be defined
14 | std::stringstream ss;
... |
s554360712 | p00121 | C++ | #include <iostream>
#include <string>
using namespace std;
int main()
{
string a;
cin >> a
cout << a << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:9: error: expected ';' before 'cout'
8 | cin >> a
| ^
| ;
9 | cout << a << endl;
| ~~~~
|
s677693940 | p00121 | C++ | テ」ツつ?」ツつ?
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<int,pii> piii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a) (a).begin(),(a).end()
#define pb push_back
#define INF 999999999
#define MAX_V 100
unsigned int dp[8][8][8][8][8][8][8];
int d[... | a.cc:1:1: error: extended character 」 is not valid in an identifier
1 | テ」ツつ?」ツつ?
| ^
a.cc:1:10: error: extended character 」 is not valid in an identifier
1 | テ」ツつ?」ツつ?
| ^
a.cc:1:1: error: '\U000030c6\U0000300d\U000030c4\U00003064' does not name a type
1 | テ」ツつ?」ツつ?
| ^~~~~~~~
In... |
s729963408 | p00121 | C++ | #include <cstdio>
#include <iostream>
#include <string>
#include <queue>
using namespace std;
typedef struct node {
int seq[8];
int id;
int s;
int step;
} item;
int idBox[40400];
int idCnt;
int dmove[] = {-1, -4, +1, +4};
int ans[] = {0,1,2,3,4,5,6,7};
int bfs(item n);
bool isUnique(int id);
int main() {
whi... | a.cc: In function 'int main()':
a.cc:40:17: error: 'memset' was not declared in this scope
40 | memset(idBox, 0, sizeof(idBox));
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <queue>
... |
s173648202 | p00121 | C++ | #include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <functional>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <deque>
#include <ctime>
using name... | a.cc: In function 'int main()':
a.cc:68:43: error: 'i' was not declared in this scope; did you mean 'vi'?
68 | while(/*cin>>d[0]*/scanf("%d", &d[i])!=EOF){
| ^
| vi
|
s963259904 | p00121 | C++ | // test.cpp : 定?控制台?用程序的入口点。
//
#include "stdafx.h"
#include<stdio.h>
#include<map>
#include<queue>
using namespace std;
int a[8] = {0};
int direction[4][2] = {{-1,0},{1,0},{0,-1},{0,1}};
map<int,int> exitmap;
struct array{
int map[2][4];
int step;
};
bool isInMap(int x,int y){
if(x<0 || x>=2)return 0;
if(y<0 ... | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s308343359 | p00121 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <queue>
#include <map>
using namespace std;
typedef pair<string, int> P;
map<string, int> m;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
queue<P> q;
q.push(P("01234567", 0));
m["01234567"] = 0;
while(!q.empty()) {
P p = q.front();
... | a.cc: In function 'int main()':
a.cc:23:35: error: expected '}' before numeric constant
23 | int d[] = { 1, -1 4, -4 };
| ~ ^
a.cc:23:35: error: expected ',' or ';' before numeric constant
a.cc:25:28: error: 's' was not declared in this scope
25 | ... |
s044303942 | p00121 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
map<vector<int>, int>MVII;
vector<int>D(8);
for(int i = 0;i < 8; i++){
D[i]=i;
}
queue<vector<int>>que;
que.push(D);
while(que.size()){
auto now = que.front(); que.pop();
for(int i = 0;i < 4; i++){
auto E = now;
swap(E[i], E[i+4]);
if(MVII[E]==0){
M... | a.cc: In function 'int main()':
a.cc:21:21: error: no match for call to '(std::map<std::vector<int>, int>) (std::vector<int>&)'
21 | MVII[E]=MVII(now)+1;
| ~~~~^~~~~
a.cc:30:21: error: no match for call to '(std::map<std::vector<int>, int>) (std::vector<int>&)'
30 | MVII[E]=M... |
s137484947 | p00121 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
map<vector<int>, int>MVII;
vector<int>D(8);
for(int i = 0;i < 8; i++){
D[i]=i;
}
queue<vector<int>>que;
que.push(D);
while(que.size()){
vector<int> now = que.front(); que.pop();
for(int i = 0;i < 4; i++){
auto E = now;
swap(E[i], E[i+4]);
if(MVII[E]=... | a.cc: In function 'int main()':
a.cc:21:21: error: no match for call to '(std::map<std::vector<int>, int>) (std::vector<int>&)'
21 | MVII[E]=MVII(now)+1;
| ~~~~^~~~~
a.cc:30:21: error: no match for call to '(std::map<std::vector<int>, int>) (std::vector<int>&)'
30 | MVII[E]=M... |
s695083057 | p00121 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
map<vector<int>, int>MVII;
vector<int>D(8);
for(int i = 0;i < 8; i++){
D[i]=i;
}
queue<vector<int>>que;
que.push(D);
while(que.size()){
vector<int> now = que.front(); que.pop();
for(int i = 0;i < 4; i++){
auto E = now;
swap(E[i], E[i+4]);
if(MVII[E]=... | a.cc: In function 'int main()':
a.cc:42:2: error: expected '}' at end of input
42 | }
| ^
a.cc:14:18: note: to match this '{'
14 | while(que.size()){
| ^
a.cc:42:2: error: expected '}' at end of input
42 | }
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
|... |
s891339402 | p00121 | C++ | #include <cstdio>
#include <map>
#include <queue>
#define PRINTF(...)
using namespace std;
int puzzles[1000][8];
int goal[8] = {0, 1, 2, 3, 4, 5, 6, 7};
int n;
static inline int encode(int arg[8]) {
int ret = 0;
for (int i = 0; i < 8; i++) {
ret += arg[i] * (1 << (3 * (7 - i)));
}
return re... | a.cc: In function 'int solve(int*)':
a.cc:76:17: error: 'memcpy' was not declared in this scope
76 | memcpy(np, cp, sizeof(np));
| ^~~~~~
a.cc:4:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <queue>
... |
s462964153 | p00121 | C++ | import java.util.HashSet;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;
public class Main {
public static void main(String[] args) throws Exception{
try(Scanner sc = new Scanner(System.in)){
while(sc.hasNextInt()){
Queue<State> queue = new LinkedList<>()... | a.cc:93:9: error: stray '@' in program
93 | @Override
| ^
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.HashSet;
| ^~~~~~
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.Lin... |
s866778051 | p00121 | C++ | #include <cstdio>
#include <set>
#include <vector>
#include <ctype.h>
#include <iostream>
bool is_find(std::vector<int> pieace,std::vector<int> cadidate)
{
for(int i=0;i<8;i++)
if(pieace[i]!=cadidate[i]) return false;
return true;
}
int solve(std::vector<int> init_pieace)
{
int total_step = 0;
std::vector<int> t... | a.cc: In function 'int solve(std::vector<int>)':
a.cc:52:37: error: no matching function for call to 'find(std::set<std::vector<int> >::iterator, std::set<std::vector<int> >::iterator, std::vector<int>&)'
52 | if(std::find(previous_frontier.begin(), previous_frontier.end(), new_peiace) == pre... |
s570273368 | p00121 | C++ | #include <cstdio>
#include <set>
#include <vector>
#include <ctype.h>
#include <iostream>
#include <<algorithm>
bool is_find(std::vector<int> pieace,std::vector<int> cadidate)
{
for(int i=0;i<8;i++)
if(pieace[i]!=cadidate[i]) return false;
return true;
}
int solve(std::vector<int> init_pieace)
{
int total_step = ... | a.cc:6:10: fatal error: <algorithm: No such file or directory
6 | #include <<algorithm>
| ^~~~~~~~~~~~
compilation terminated.
|
s660343989 | p00121 | C++ | #include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
#include <queue>
#include <utility>
using namespace std;
using Point = pair<int, int>;
const int MAX_N = 8;
const int MAX_ID = 40320;
const int GOAL_ID = 0;
const int INF = 0x3f3f3f3f;
const int RULE_NUM = 3;
const int RU... | a.cc: In function 'int ConvertVectorToId(const std::vector<int>&)':
a.cc:24:5: error: 'memset' was not declared in this scope
24 | memset(is_used, false, sizeof(is_used));
| ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
7 |... |
s092798299 | p00121 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <queue>
#include <stack>
#include <map>
#include <vector>
#include <set>
#include <utility>
#define ll long long
#define inf 0x3f3f3f3f
using namespace std;
typedef pair<string,i... | a.cc: In function 'int main()':
a.cc:54:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
54 | while(gets(sstr))
| ^~~~
| getw
|
s999442251 | p00121 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <queue>
#include <stack>
#include <map>
#include <vector>
#include <set>
#include <utility>
#define ll long long
#define inf 0x3f3f3f3f
using namespace std;
typedef pair<string,i... | a.cc: In function 'int main()':
a.cc:54:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
54 | while(gets(sstr))
| ^~~~
| getw
|
s904212631 | p00121 | C++ | #include <iostream>
#include <string>
#include <queue>
#include <unordered_map>
#include <algorithm>
using namespace std;
struct Node {
int start;
string buf;
Node(int index, string s): start(index), buf(s) {}
};
int dir[4] = {-1, 1, -4, 4};
unordered_map<string, int> dp;
void solve() {
dp["01234567"] = 0;
... | a.cc: In function 'int main()':
a.cc:55:21: error: no matching function for call to 'std::__cxx11::basic_string<char>::append(char&)'
55 | input.append(c);
| ~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
... |
s362156117 | p00121 | C++ | #include <iostream>
#include <queue>
#include <string>
#include <algorithm>
#include <map>
using namespace std;
string data;
char goal[9] = "01234567";
queue<string> qu;
map<string,int> mp;
int d[4] = {-4,-1,1,4};
int pos;
int ans[1000];
char tmp;
int solve(){
mp[data] = 0;
qu.push(data);
string pre_data;
w... | a.cc: In function 'int solve()':
a.cc:20:6: error: reference to 'data' is ambiguous
20 | mp[data] = 0;
| ^~~~
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/bits/ios_base.h:41,
... |
s772701644 | p00121 | C++ | //AOJ0121
#include <iostream>
#include <queue>
using namespace std;
const int INF = 100000000;
class Point{
public:
int x;
int y;
};
int main(){
char paz[3][5]; //???????????????
int xz, xy; //0?????\??£???????????´???
for(int y=0; y<=3; y++){
for(int x=0; x<5=; x++){
paz[y][x] = '#';
}
}... | a.cc: In function 'int main()':
a.cc:20:22: error: expected primary-expression before ';' token
20 | for(int x=0; x<5=; x++){
| ^
a.cc:30:9: error: 'yz' was not declared in this scope; did you mean 'y'?
30 | yz == y;
| ^~
| y
a.cc:49:6: error: exp... |
s692937848 | p00121 | C++ | //AOJ0121
#include <iostream>
#include <queue>
using namespace std;
const int INF = 100000000;
class Point{
public:
int x;
int y;
};
int main(){
char paz[3][5]; //???????????????
int xz, yz; //0?????\??£???????????´???
for(int y=0; y<=3; y++){
for(int x=0; x<5=; x++){
paz[y][x] = '#';
}
}... | a.cc: In function 'int main()':
a.cc:20:22: error: expected primary-expression before ';' token
20 | for(int x=0; x<5=; x++){
| ^
a.cc:45:17: error: 'xy' was not declared in this scope; did you mean 'xz'?
45 | p.x = xz; p.y = xy;
| ^~
| xz... |
s878593235 | p00121 | C++ | //AOJ0121
#include <iostream>
#include <queue>
using namespace std;
const int INF = 100000000;
class Point{
public:
int x;
int y;
};
int main(){
char paz[3][5]; //???????????????
int xz, yz; //0?????\??£???????????´???
for(int y=0; y<=3; y++){
for(int x=0; x<5=; x++){
paz[y][x] = '#';
}
}... | a.cc: In function 'int main()':
a.cc:20:22: error: expected primary-expression before ';' token
20 | for(int x=0; x<5=; x++){
| ^
a.cc:45:17: error: 'xy' was not declared in this scope; did you mean 'xz'?
45 | p.x = xz; p.y = xy;
| ^~
| xz... |
s817157574 | p00121 | C++ | #include<iostream>
#include<queue>
#include<vector>
using namespace std;
class Puzzle{
public:
vector<vector<int> > p;
int lastorder;//1 ??? 3?????? 5 ??????
int ordernum;
Puzzle(){
this->p.resize(2);
for(int i=0;i<2;i++){
this->p[i].resize(4);
}
this->lastorder = 60;
this->orde... | a.cc: In member function 'Puzzle& Puzzle::operator=(const Puzzle&)':
a.cc:34:3: warning: no return statement in function returning non-void [-Wreturn-type]
33 | this->ordernum = p1.ordernum;
+++ |+ return *this;
34 | }
| ^
a.cc: In destructor 'Puzzle::~Puzzle()':
a.cc:39:24: error: cannot convert... |
s562799981 | p00121 | C++ | #include<iostream>
#include<queue>
#include<vector>
using namespace std;
class Puzzle{
public:
vector<vector<int> > p;
int lastorder;//1 ??? 3?????? 5 ??????
int ordernum;
Puzzle(){
this->p.resize(2);
for(int i=0;i<2;i++){
this->p[i].resize(4);
}
this->lastorder = 60;
this->orde... | a.cc: In member function 'Puzzle& Puzzle::operator=(const Puzzle&)':
a.cc:34:3: warning: no return statement in function returning non-void [-Wreturn-type]
33 | this->ordernum = p1.ordernum;
+++ |+ return *this;
34 | }
| ^
a.cc: In function 'int main()':
a.cc:124:9: error: no matching function fo... |
s495561307 | p00121 | C++ | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
... | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 1
| ^
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a... |
s969118588 | p00121 | C++ | #include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
class SP{
public:
int p[2][4];
int n;
bool finish(){
p[0][0]==0 && p[0][1]==1 && p[0][2]==2 && p[0][3]==3&&
p[1][0]==4 && p[1][1]==5 && p[1][2]==6 && p[1][3]==7;
}
void move_right(int x,int y){
if(x!=3)
s... | a.cc:35:2: error: expected ';' after class definition
35 | }
| ^
| ;
a.cc: In member function 'bool SP::finish()':
a.cc:14:9: warning: no return statement in function returning non-void [-Wreturn-type]
14 | }
| ^
a.cc: In member function 'void SP::move_right(int, int)':
a.cc:19... |
s837772091 | p00121 | C++ | #include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
class SP{
public:
int p[2][4];
int n;
bool finish(){
p[0][0]==0 && p[0][1]==1 && p[0][2]==2 && p[0][3]==3&&
p[1][0]==4 && p[1][1]==5 && p[1][2]==6 && p[1][3]==7;
}
void move_right(int x,int y){
if(x!=3)
s... | a.cc: In member function 'bool SP::finish()':
a.cc:14:9: warning: no return statement in function returning non-void [-Wreturn-type]
14 | }
| ^
a.cc: In member function 'void SP::move_right(int, int)':
a.cc:19:9: error: expected ';' before '}' token
19 | }
| ^
a.cc: In ... |
s305872290 | p00121 | C++ | #include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
class SP{
public:
int p[2][4];
int n;
bool finish(){
p[0][0]==0 && p[0][1]==1 && p[0][2]==2 && p[0][3]==3&&
p[1][0]==4 && p[1][1]==5 && p[1][2]==6 && p[1][3]==7;
}
void move_right(int x,int y){
if(x!=3)
s... | a.cc: In member function 'bool SP::finish()':
a.cc:14:9: warning: no return statement in function returning non-void [-Wreturn-type]
14 | }
| ^
a.cc: In function 'int main()':
a.cc:44:13: error: 'y' was not declared in this scope; did you mean 'zy'?
44 | for(y=0;y<2;y++){
| ... |
s411664384 | p00121 | C++ | #include <iostream>
#include <map>
#include <string>
using namespace std;
void swap(char *a,char *b){
char temp = *a;
*a = *b;
*b = temp;
}
int main(){
int dx[] = {+1,-1,+4,-4};
string start = "01234567";
queue<string> que;
map<string,int> d;
que.push(start);
d[start] = 0;
while(que.size()... | a.cc: In function 'int main()':
a.cc:18:3: error: 'queue' was not declared in this scope
18 | queue<string> que;
| ^~~~~
a.cc:3:1: note: 'std::queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
2 | #include <map>
+++ |+#include <queue>
3 | #include <strin... |
s667008502 | p00121 | C++ | #include<iostream>
#include<queue>
#include<algorithm>
using namespace std;
class SevenPuzzle{
public:
int p[2][4];
int n;
int zero_x,zero_y;
bool finish(){
return p[0][0]==0&&p[0][1]==1&&p[0][2]==2&&p[0][3]==3&&
p[1][0]==4&&p[1][1]==5&&p[1][2]==6&&p[1][3]==7;
}
void move_right(int x,int y){
if(zero_x... | a.cc: In function 'int main()':
a.cc:53:38: error: 'A' was not declared in this scope
53 | for(int i=0;i<2;i++){A
| ^
a.cc:54:37: error: 'j' was not declared in this scope
54 | for(int j=0;j<4;j++){
| ... |
s482715693 | p00121 | C++ | #include<iostream>
#include<queue>
#include<vector>
using namespace std;
bool checker[8][8][8][8][8][8][8];
class Puzzle{
public:
short** p;
short lastorder;//1 ??? 3?????? 5 ??????
short ordernum;
Puzzle(){
p = new short*[2];
for(int i=0; i<2; i++){
p[i] = new short[4];
}
this->last... | a.cc: In function 'int main()':
a.cc:58:15: error: 'i' was not declared in this scope
58 | for(int a=0;i<8;i++){
| ^
a.cc:65:33: error: two consecutive '[' shall only introduce an attribute before '[' token
65 | checker[a][b][c][[d]][e][f][g] = false;
| ... |
s377304237 | p00121 | C++ | #include<iostream>
#include<queue>
#include<vector>
using namespace std;
bool checker[8][8][8][8][8][8][8];
class Puzzle{
public:
short** p;
short lastorder;//1 ??? 3?????? 5 ??????
short ordernum;
Puzzle(){
p = new short*[2];
for(int i=0; i<2; i++){
p[i] = new short[4];
}
this->last... | a.cc: In function 'int main()':
a.cc:65:33: error: two consecutive '[' shall only introduce an attribute before '[' token
65 | checker[a][b][c][[d]][e][f][g] = false;
| ^
|
s052382246 | p00121 | C++ | #include<iostream>
#include<queue>
#include<vector>
using namespace std;
bool checker[8][8][8][8][8][8][8];
class Puzzle{
public:
short p[2][4];
short lastorder;//1 ??? 3?????? 5 ??????
short ordernum;
Puzzle(){
/*p = new short*[2];
for(int i=0; i<2; i++){
p[i] = new short[4];
}*/
th... | a.cc:44:4: error: expected ';' after class definition
44 | }
| ^
| ;
a.cc:54:1: error: expected declaration before '}' token
54 | };
| ^
|
s937344743 | p00121 | C++ | #include<iostream>
#include<queue>
#include<vector>
using namespace std;
bool checker[8][8][8][8][8][8][8];
class Puzzle{
public:
short p[2][4];
short lastorder;//1 ??? 3?????? 5 ??????
short ordernum;
Puzzle(){
/*p = new short*[2];
for(int i=0; i<2; i++){
p[i] = new short[4];
}*/
th... | a.cc: In function 'int main()':
a.cc:119:16: error: expected ';' before '}' token
119 | i=3
| ^
| ;
120 | }
| ~
|
s530750139 | p00121 | C++ | #include<iostream>
#include<queue>
#include<vector>
#include<list>
using namespace std;
bool checker[8][8][8][8][8][8][8];
list<short[7]> checklist;
class Puzzle{
public:
short p[2][4];
short lastorder;//1 ??? 3?????? 5 ??????
short ordernum;
Puzzle(){
/*p = new short*[2];
for(int i=0; i<2; i++){
... | In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33,
from /usr/include/c++/14/bits/allocator.h:46,
from /usr/include/c++/14/string:43,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_ba... |
s014093103 | p00121 | C++ | #include<iostream>
#include<queue>
#include<vector>
using namespace std;
bool checker[8][8][8][8][8][8][8];
vector<short[8]> checkvec;
class Puzzle{
public:
short p[2][4];
short lastorder;//1 ??? 3?????? 5 ??????
short ordernum;
Puzzle(){
/*p = new short*[2];
for(int i=0; i<2; i++){
p[i] = n... | a.cc: In function 'int main()':
a.cc:140:25: error: incompatible types in assignment of 'short int' to '__gnu_cxx::__alloc_traits<std::allocator<short int [8]>, short int [8]>::value_type' {aka 'short int [8]'}
140 | checkvec[i] = puzzle.p[i/4][i%4];
a.cc:155:25: error: incompatible types in assignment of... |
s393471330 | p00121 | C++ | #include<iostream>
#include<queue>
#include<vector>
using namespace std;
bool checker[8][8][8][8][8][8][8];
class Puzzle{
public:
short p[2][4];
short lastorder;//1 ??? 3?????? 5 ??????
short ordernum;
Puzzle(){
/*p = new short*[2];
for(int i=0; i<2; i++){
p[i] = new short[4];
}*/
th... | a.cc: In function 'int main()':
a.cc:132:20: error: 'Beforeorder' was not declared in this scope
132 | if(x != 3 && Beforeorder != 3){
| ^~~~~~~~~~~
a.cc:145:20: error: 'Beforeorder' was not declared in this scope
145 | if(x != 0 && Beforeorder != 1){
| ... |
s688890179 | p00121 | C++ | #include <iostream>
#include <cstdio>
#include <cstring>
#include <queue>
#include <stack>
#include <fstream>
#include <vector>
#include <map>
#include <set>
#include <cmath>
#include <algorithm>
#include <functional>
#define inf 0x3f3f3f3f
#define inff -30000000
using namespace std;
typedef long long ll;
const int MAX... | a.cc: In function 'int main()':
a.cc:49:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
49 | while(gets(ch)){
| ^~~~
| getw
|
s261130301 | p00121 | C++ | #include <bits/stdc++.h>
using namespace std;
string swp(string s, const int& a, const int &b) {
swap(s[a],s[b]); return s;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
string s = "01234567";
queue<string> q;
map<string, int> m;
q.push(s);
m[s] = 0;
while (!q.empty()) {
string t =... | a.cc: In function 'int main()':
a.cc:33:17: error: no match for 'operator[]' (operand types are '<unresolved overloaded function type>' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
33 | if (m.find[u] == m.end()) {
| ^
a.cc:42:11: error: 'class std::map<std::__cxx11::basic_s... |
s367676550 | p00121 | C++ | #include <bits/stdc++.h>
using namespace std;
using namespace std;
typedef pair<int,string> P;
int main(){
int d[4] = {-1,1,-4,4};
map<string,int> ans;
ans["01234567"] = 0;
queue<P> que;
que.push(P(0,"01234567"));
while(que.size()){
P p = que.front(); que.pop();
int k = ans[p.second];
for(in... | a.cc: In function 'int main()':
a.cc:24:30: error: expected ';' before 'tmp'
24 | tmp = p.second
| ^
| ;
25 | tmp[p.first] = tmp[n];
| ~~~
|
s179574941 | p00121 | C++ | #include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <queue>
#include <cmath>
#include <map>
#include <algorithm>
#include <stack>
#include <set>
//反向bfs
using namespace std;
map<string ,int> t;
int num;
int mv[]={-4,4,1,-1};//上下右左
void bfs(string st)
{
queue<strin... | a.cc: In function 'void bfs(std::string)':
a.cc:25:8: error: 's' was not declared in this scope
25 | s=q.front(),q.pop();
| ^
|
s335251004 | p00121 | C++ |
#include <iostream>
#include <stdlib.h>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
using namespace std;
const int N = 8;
const int INF = INT_MAX;
bool hantei(int * box){
for(int i = 0; i < N; i++){
if( box[i] != i) return false;
}
return true;
}
int zeroIndex(int * box){
for(int i ... | a.cc:10:17: error: 'INT_MAX' was not declared in this scope
10 | const int INF = INT_MAX;
| ^~~~~~~
a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
6 | #include <queue>
+++ |+#include <climits>
7 | #include <vector>
a... |
s915740203 | p00121 | C++ | #include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <utility>
#include <algorithm>
using namespace std;
int find_locate(int node,int num) {
int ans=0;
while(ans < 8) {
int a, b, c;
int keta_a=1, keta_b=1;
for (int j=0; j<ans; j++) {
keta_a = ke... | a.cc: In function 'int main()':
a.cc:144:25: error: 'n' was not declared in this scope
144 | for (int i=0; i<n; i++) {
| ^
a.cc: In function 'int proceed_adj(int, int)':
a.cc:114:1: warning: control reaches end of non-void function [-Wreturn-type]
114 | }
| ^
|
s338028434 | p00121 | C++ | #include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <utility>
#include <algorithm>
using namespace std;
int find_locate(int node,int num) {
int ans=0;
while(ans < 8) {
int a, b, c;
int keta_a=1, keta_b=1;
for (int j=0; j<ans; j++) {
keta_a = ke... | a.cc: In function 'int main()':
a.cc:134:5: error: 'n' was not declared in this scope
134 | n = 76543210;
| ^
a.cc: In function 'int proceed_adj(int, int)':
a.cc:114:1: warning: control reaches end of non-void function [-Wreturn-type]
114 | }
| ^
|
s207354112 | p00121 | C++ | #include<stdio.h>
#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<stack>
#include<map>
#include<cstring>
#include<algorithm>
#define cdebug() freopen("C:\\Users\\netmaster.ASUS\\Desktop\\123.txt","r",stdin)
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rev(i,a,b) for(int i=(a);i>=(b);... | a.cc:95:6: error: stray '#' in program
95 | Case # Verdict CPU Time Memory In Out Case Name
| ^
a.cc:96:6: error: stray '#' in program
96 | Case #1: : Accepted 00.00 sec 9500 KB
| ^
a.cc:100:13: error: stray '#' in program
100 | Judge Input #1 ( in1.txt ... |
s009355545 | p00121 | C++ | //
// 0121.cpp
//
//
// Created by Yoshida Satoshi on 2017/11/16.
//
//
#include <iostream>
#include <queue>
#include <stdlib.h>
#include <algorithm>
#include <map>
#define INF 100000
using namespace std;
int main(){
int num[8];
queue<vector<int>> que;
vector<int> state={1,0,1,2,3,4,5,6,7};//??????... | a.cc: In function 'int main()':
a.cc:36:16: error: 'i' was not declared in this scope
36 | if(tmp[i]>4){
| ^
a.cc:44:16: error: 'i' was not declared in this scope
44 | if(tmp[i]<5){
| ^
a.cc:52:16: error: 'i' was not declared in this scope
52 | ... |
s211049620 | p00121 | C++ | //
// 0121.cpp
//
//
// Created by Yoshida Satoshi on 2017/11/16.
//
//
#include <iostream>
#include <queue>
#include <stdlib.h>
#include <algorithm>
#include <map>
#define INF 100000
using namespace std;
int main(){
int num[8];
queue<vector<int>> que;
vector<int> state={1,0,1,2,3,4,5,6,7};//??????... | a.cc: In function 'int main()':
a.cc:36:16: error: 'i' was not declared in this scope
36 | if(tmp[i]>4){
| ^
a.cc:44:16: error: 'i' was not declared in this scope
44 | if(tmp[i]<5){
| ^
a.cc:52:16: error: 'i' was not declared in this scope
52 | ... |
s310189259 | p00121 | C++ | //
// 0121.cpp
//
//
// Created by Yoshida Satoshi on 2017/11/16.
//
//
#include <iostream>
#include <queue>
#include <stdlib.h>
#include <algorithm>
#include <map>
#define INF 100000
using namespace std;
int main(){
int num[8];
queue<vector<int> > que;
vector<int> state={1,0,1,2,3,4,5,6,7};//?????... | a.cc: In function 'int main()':
a.cc:71:25: error: no match for 'operator==' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'long int')
71 | if((cin>>num[0])==NULL) break;
| ^
a.cc:71:25: note: candidate: 'operator==(int, long ... |
s662527285 | p00121 | C++ | //
// 0121.cpp
//
//
// Created by Yoshida Satoshi on 2017/11/16.
//
//
#include <iostream>
#include <queue>
#include <stdlib.h>
#include <algorithm>
#include <map>
#define INF 100000
using namespace std;
int main(){
int num[8];
queue<vector<int> > que;
vector<int> state={1,0,1,2,3,4,5,6,7};//?????... | a.cc: In function 'int main()':
a.cc:71:25: error: no match for 'operator==' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'long int')
71 | if((cin>>num[0])==NULL) break;
| ^
a.cc:71:25: note: candidate: 'operator==(int, long ... |
s785091869 | p00121 | C++ | #include <iostream>
#include <cstdio>
#include <queue>
using namespace std;
char str[8];
char fin={0,1,2,3,4,5,6,7};
int dir[4]={-1,1,-4,4};
struct stat={
char temp[8];
int num;
stat(char* tt, int nn){
for(int i=0; i<8; i++) temp[i]==tt[i];
num =nn;
}
}
bool equal(char* p1, char* p2){
... | a.cc:7:6: error: scalar object 'fin' requires one element in initializer
7 | char fin={0,1,2,3,4,5,6,7};
| ^~~
a.cc:10:12: error: expected unqualified-id before '=' token
10 | struct stat={
| ^
a.cc: In function 'int bfs(char*)':
a.cc:27:21: error: invalid use of incomplete type 'stru... |
s883668402 | p00121 | C++ | #include <iostream>
#include <cstdio>
#include <queue>
using namespace std;
char str[8];
char fin[8]={0,1,2,3,4,5,6,7};
int dir[4]={-1,1,-4,4};
struct stat={
char temp[8];
int num;
stat(char* tt, int nn){
for(int i=0; i<8; i++) temp[i]==tt[i];
num =nn;
}
}
bool equal(char* p1, char* p2... | a.cc:10:12: error: expected unqualified-id before '=' token
10 | struct stat={
| ^
a.cc: In function 'int bfs(char*)':
a.cc:27:21: error: invalid use of incomplete type 'struct stat'
27 | q.push(stat(s, 0));
| ^
a.cc:10:8: note: forward declaration of 'struct stat'
... |
s308153632 | p00121 | C++ | #include <iostream>
#include <cstdio>
#include <queue>
using namespace std;
char str[8];
char fin[8]={0,1,2,3,4,5,6,7};
int dir[4]={-1,1,-4,4};
struct stat{
char temp[8];
int num;
stat(char* tt, int nn){
for(int i=0; i<8; i++) temp[i]==tt[i];
num =nn;
}
}
bool equal(char* p1, char* p2)... | a.cc:17:2: error: expected ';' after struct definition
17 | }
| ^
| ;
a.cc: In function 'int bfs(char*)':
a.cc:31:44: error: 'struct stat' has no member named 'step'
31 | if(equal(cur.temp,fin)) return cur.step;
| ^~~~
a.cc:38:17: error: 'strc... |
s714571112 | p00121 | C++ | #include <iostream>
#include <cstdio>
#include <queue>
using namespace std;
char str[8];
char fin[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };
int dir[4] = { -1, 1, -4, 4 };
struct point{
char temp[8];
int num;
point(char* tt, int nn){
strcpy(temp, tt);
num = nn;
}
};
bool equal(char* p1, char* p2){
for (int i = 0; i<8... | a.cc: In constructor 'point::point(char*, int)':
a.cc:14:17: error: 'strcpy' was not declared in this scope
14 | strcpy(temp, tt);
| ^~~~~~
a.cc:4:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <queue>... |
s249628822 | p00121 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <queue>
using namespace std;
map<string, int> dp;
int dx[4]={-1, 1, 4, -4};
void bfs(){
string now="01234567";
dp[now]=0;
queue<string> q;
q.push(now);
while(q.size()){
now=q.front(); q.pop();
int z... | In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from... |
s538393946 | p00121 | C++ | #include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0); cin.tie(0);
using namespace std;
int main(){_
map<string,int> vis;
map<string,int> step;
queue<string> qu;
vis["01234567"] = 1;
step["01234567"] = 0;
qu.push("01234567");
while(!qu.empty()){
string now = qu.front();
... | a.cc: In function 'int main()':
a.cc:67:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
67 | while(gets(ch)){
| ^~~~
| getw
|
s995650488 | p00121 | C++ | #include <iostream>
#include <unordered_map>
#include <queue>
int a[2][4] , stx , sty , nx;
int dirc[4][2] = {{-1 , 0} , {1 , 0} , {0 , -1} , {0 , 1}};
std::unordered_map <int , int> st;
struct node{
int x;
int step;
};
void fx(int y){
for(int i = 0;i < 2;i++){
for(int j = 0;j < 4;j++){
... | a.cc: In function 'int main()':
a.cc:55:57: error: cannot bind rvalue reference of type 'int&&' to lvalue of type 'int'
55 | st.insert(std::make_pair<int , int>(nx , nod.step + 1));
| ^~
In file included from /usr/include/c++/14/bits/s... |
s664968250 | p00121 | C++ | #include <iostream>
#include <unordered_map>
#include <queue>
#include <utility>
int a[2][4] , stx , sty , nx;
int dirc[4][2] = {{-1 , 0} , {1 , 0} , {0 , -1} , {0 , 1}};
std::unordered_map <int , int> st;
struct node{
int x;
int step;
};
void fx(int y){
for(int i = 0;i < 2;i++){
for(int j = 0;j < 4... | a.cc: In function 'int main()':
a.cc:56:57: error: cannot bind rvalue reference of type 'int&&' to lvalue of type 'int'
56 | st.insert(std::make_pair<int , int>(nx , nod.step + 1));
| ^~
In file included from /usr/include/c++/14/bits/s... |
s604701178 | p00121 | C++ | #include <iostream>
#include <unordered_map>
#include <queue>
#include <utility>
#include <functional>
int a[2][4] , stx , sty , nx;
int dirc[4][2] = {{-1 , 0} , {1 , 0} , {0 , -1} , {0 , 1}};
std::unordered_map <int , int> st;
struct node{
int x;
int step;
};
void fx(int y){
for(int i = 0;i < 2;i++){
... | a.cc: In function 'int main()':
a.cc:58:57: error: cannot bind rvalue reference of type 'int&&' to lvalue of type 'int'
58 | st.insert(std::make_pair<int , int>(nx , nod.step + 1));
| ^~
In file included from /usr/include/c++/14/bits/s... |
s985564634 | p00121 | C++ | #include <iostream>
#include <unordered_map>
#include <queue>
#include <utility>
#include <functional>
int a[2][4] , stx , sty , nx;
int dirc[4][2] = {{-1 , 0} , {1 , 0} , {0 , -1} , {0 , 1}};
std::unordered_map <int , int> st;
struct node{
int x;
int step;
};
void fx(int y){
for(int i = 0;i < 2;i++){
... | a.cc: In function 'int main()':
a.cc:58:57: error: cannot bind rvalue reference of type 'int&&' to lvalue of type 'int'
58 | st.insert(std::make_pair<int , int>(nx , nod.step + 1));
| ^~
In file included from /usr/include/c++/14/bits/s... |
s288958306 | p00121 | C++ | #include <iostream>
#include <unordered_map>
#include <queue>
#include <utility>
#include <functional>
int a[2][4] , stx , sty , nx;
int dirc[4][2] = {{-1 , 0} , {1 , 0} , {0 , -1} , {0 , 1}};
std::unordered_map <int , int> st;
struct node{
int x;
int step;
};
void fx(int y){
for(int i = 0;i < 2;i++){
... | a.cc: In function 'int main()':
a.cc:58:57: error: cannot bind rvalue reference of type 'int&&' to lvalue of type 'int'
58 | st.insert(std::make_pair<int , int>(nx , nod.step + 1));
| ^~
In file included from /usr/include/c++/14/bits/s... |
s530165105 | p00121 | C++ | #include <iostream>
#include <unordered_map>
#include <queue>
#include <utility>
#include <functional>
int a[2][4] , stx , sty , nx;
int dirc[4][2] = {{-1 , 0} , {1 , 0} , {0 , -1} , {0 , 1}};
std::unordered_map <int , int> st;
struct node{
int x;
int step;
};
void fx(int y){
for(int i = 0;i < 2;i++){
... | a.cc: In function 'int main()':
a.cc:58:57: error: cannot bind rvalue reference of type 'int&&' to lvalue of type 'int'
58 | st.insert(std::make_pair<int , int>(nx , nod.step + 1));
| ^~
In file included from /usr/include/c++/14/bits/s... |
s364783208 | p00121 | C++ | #include <iostream>
#include <map>
#include <queue>
#include <string>
using namespace std;
map<string, int> res;
int d[4] = {1, -1, 4, -4};
void bfs() {
queue<string> que;
que.push("01234567");
res["01234567"] = 0;
while (!que.empty()) {
string s = que.front();
que.pop();
int pos = 0;
while (s... | a.cc: In function 'int main()':
a.cc:37:33: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'const char*'
37 | line.erase(remove(line.begin(), line.end(), ' '),
| ~~~~~~~~~~^~
| |
| std::... |
s511953644 | p00121 | C++ | #include<stdio.h>
#include<queue>
#include<bitset>
using namespace std;
const int N = 8;
const int SHIFT_BITS = 3;
unsigned Swap3Bits(unsigned x, int b1, int b2)
{
unsigned a,b,s;
b1 *= SHIFT_BITS;
b2 *= SHIFT_BITS;
a = (x& (07<<b1));
b = (x& (07<<b2));
s = (a>>b1<<b2) | (b>>b2<<b1);
return (x&~a&~b)|s;
}
int... | a.cc: In function 'int Ans(int)':
a.cc:24:9: error: 'set' was not declared in this scope
24 | set<unsigned> his;
| ^~~
a.cc:4:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
3 | #include<bitset>
+++ |+#include <set>
4 | using names... |
s079145281 | p00121 | C++ | #include <iostream>
#include <queue>
#include <string>
#include <set>
#include <map>
using namespace std;
map<string, int> stoi;
map<int, string> itos;
int solve(string str){
bool dp[30][40320];
dp[0][stoi[str]] = true;
for(int i=0;i<30;i++){
for(int j=0;j<40320;j++){
if(!dp[i][j]) continue;
if... | a.cc: In function 'int solve(std::string)':
a.cc:14:9: error: reference to 'stoi' is ambiguous
14 | dp[0][stoi[str]] = true;
| ^~~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/i... |
s928209440 | p00121 | C++ | #include <iostream>
#include <string>
#include <queue>
#include <map>
#define FOR(a,start,end) for(I64 a=(start);a<(end);a++)
using namespace std;
int main(){
int vec[4] = {-1, 1, 4, -4};
queue<string> que;
que.push("01234567");
map<string, int> d;
d["01234567"] = 0;
while(!que.empty()){
string str = que.front(... | a.cc: In function 'int main()':
a.cc:5:30: error: 'I64' was not declared in this scope
5 | #define FOR(a,start,end) for(I64 a=(start);a<(end);a++)
| ^~~
a.cc:17:17: note: in expansion of macro 'FOR'
17 | FOR(i, 0, 4){
| ^~~
a.cc:17:21: erro... |
s510285824 | p00121 | C++ | #include <iostream>
#include <cmath>
#include <string>
#include <queue>
#include <set>
#include <map>
#define I64 long long int
#define FOR(a,start,end) for(I64 a=(start);a<(end);a++)
using namespace std;
int main(){
int vec[4] = {-1, 1, 4, -4};
queue<string> que;
que.push("01234567");
map<string, int> d;
d["0123... | a.cc: In function 'int main()':
a.cc:36:59: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'const char*'
36 | string::iterator end_it = remove(num.begin(), num.end(), ' ');
| ~~~~~~~~~^~
| ... |
s249805811 | p00121 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <queue>
#include <map>
#define INF 10000000
#define I64 long long int
#define FOR(a,start,end) for(I64 a=(start);a<(end);a++)
using namespace std;
typedef pair<string, int> P;
int main(){
//4ûüpzñ
int vec[] = {1, -1, 4, -4};
queue<string> que... | a.cc: In function 'int main()':
a.cc:32:74: error: 'next_4' was not declared in this scope; did you mean 'next_z'?
32 | if(next_z >= 0 && next_z <= 7 && !((zero == 3 && next_4) || (zero == 4 && next_z == 3))){
| ^~... |
s512644421 | p00121 | C++ | #include <iostream>
#include <vector>
#include <queue>
#include <set>
using namespace std;
class pz{
public:
int a,b,c,d,e,f,g,h;
bool operator < (const pz& a) const{
if(a.a != this->a) return a.a > this->a;
else if(a.b != this->b) return a.b > this->b;
else if(a.c != this->c) return a.c > this->c;
... | a.cc: In member function 'bool pz::operator==(const pz&) const':
a.cc:20:42: error: request for member 'b' in '(const pz*)this', which is of pointer type 'const pz*' (maybe you meant to use '->' ?)
20 | return a.a == this->a && a.b == this.b && a.c == this->c && a.d == this->d
| ... |
s145653852 | p00121 | C++ |
#include <iostream>
#include <queue>
using namespace std;
#define SIZE 8
int coefficients[SIZE] = {10000000, 1000000, 100000, 10000, 1000, 100, 10, 1};
int movablePairs[SIZE][4] = {
{1,4,-1,-1}, {0,2,5,-1}, {1,3,6,-1}, {2,7,-1,-1},
{0,5,-1,-1}, {1,4,6,-1}, {2,5,7,-1}, {3,6,-1,-1}
};
int answerStateCode = 1... | a.cc: In constructor 'Puzzle::Puzzle(int*, int)':
a.cc:26:9: error: 'memcpy' was not declared in this scope
26 | memcpy(state, state0, sizeof(int)*SIZE);
| ^~~~~~
a.cc:4:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include ... |
s644018754 | p00121 | C++ | import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Scanner;
/**
* AIZU 0121
* 幅優先探索
*/
public class Main {
private final static int SIZE = 8;
private final BitSet isVisit;// 既に生成した状態かどうかを管理するフラグセット
// int[0の座標番号][交換候補の座標]
private final static int[][] MOVABLE_PAIRS =... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.ArrayDeque;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.Arrays;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodule... |
s008141022 | p00121 | C++ | #include<stdio.h>
#include<utility>
#include<string.h>
#include<queue>
using namespace std;
int d[1<<27]={0};
int main()
{
typedef struct p{int n;char s[9];}p;
queue<p> Q;
int m[4]={1,4,-4,-1};
char s[9]={48,49,50,51,52,53,54,55,0},c[18];
memset(d,1,sizeof(d));
d[1234567]=0;
p T;
T.n=-1;
strcpy(T.s,s);
Q.push... | a.cc: In function 'int main()':
a.cc:44:46: error: 'atoi' was not declared in this scope
44 | if(d[atoi(T.s)]>d[atoi(w)]+1)
| ^~~~
a.cc:59:33: error: 'atoi' was not declared in this scope
59 | printf("%d\n",... |
s450171604 | p00121 | C++ | #include <iostream>
#include <queue>
#include <string>
#include <map>
#include <stdio.h>
using namespace std;
int dd[] = {1, -1, 4, -4};
int dfs(string cards){
//その時のカードの状態をqueueに突っ込む
map<string, int> done;
queue<string> que;
if(cards == "01234567")
return 0;
que.push(cards);
... | a.cc: In function 'int main()':
a.cc:44:39: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'const char*'
44 | t.erase(remove(t.begin(),t.end(),' '),t.end());
| ~~~~~~~^~
| |
| ... |
s624948940 | p00121 | C++ | #include<iostream>
#include<fstream>
#include<vector>
#include<algorithm>
#include<string>
#include<cstring>
#include<queue>
using namespace std;
char visited[0xffffff];
inline int is_visited(unsigned s){ return visited[s&0xffffff]; }
inline void set_visited(unsigned s){ visited[s&0xffffff]=1; }
inline unsigned exc... | a.cc: In function 'int main()':
a.cc:27:9: error: 'std::istream' {aka 'class std::basic_istream<char>'} has no member named 'sync_with_stdin'; did you mean 'sync_with_stdio'?
27 | cin.sync_with_stdin(false);
| ^~~~~~~~~~~~~~~
| sync_with_stdio
|
s629887025 | p00121 | C++ | #include <vector>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <string>
#include <cstring>
using namespace std;
typedef pair<string, int> P;
int iti;
string n;
void solve(){
queue<P> que;
map<string, int> m;
map<string, int>::iterator ite;
que.push(P(n, 0));
m.insert(make_pair(n, 0));
while... | a.cc: In function 'void solve()':
a.cc:14:9: error: 'queue' was not declared in this scope
14 | queue<P> que;
| ^~~~~
a.cc:7:1: note: 'std::queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
6 | #include <cstring>
+++ |+#include <queue>
7 | us... |
s104675126 | p00121 | C++ | #include <vector>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <string>
#include <cstring>
using namespace std;
typedef pair<string, int> P;
int iti;
string n;
void solve(){
queue<P> que;
map<string, int> m;
map<string, int>::iterator ite;
que.push(P(n, 0));
m.insert(make_pair(n, 0));
while... | a.cc: In function 'void solve()':
a.cc:14:9: error: 'queue' was not declared in this scope
14 | queue<P> que;
| ^~~~~
a.cc:7:1: note: 'std::queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
6 | #include <cstring>
+++ |+#include <queue>
7 | us... |
s611903215 | p00121 | C++ | #include <iostream>
#include <queue>
#include <vector>
#include <set>
using namespace std;
#define loop(i,a,b) for(int i=(a); i<(int)(b); i++)
#define rep(i,b) loop(i,0,b)
typedef vector<int> vi;
struct state {
int v[8];
int step, x, y;
};
const int dx[] = { 1, 0, -1, 0 };
const int dy[] = { 0, 1, 0, -1 };... | a.cc: In function 'int main()':
a.cc:53:9: error: 'memset' was not declared in this scope
53 | memset(dp, 0, sizeof(dp));
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <set>
+++ |+#include <cstring>... |
s868106633 | p00121 | C++ | #include <cstdio>
#include <vector>
#include <queue>
#include <map>
using namespace std;
#define MAX_HIT ((0<<0)|(1<<3)|(2<<6)|(3<<9)|(4<<12)|(5<<15)|(6<<18)|(7<<21))
bool hit[MAX_HIT+1];
int swap_pos(int value, int i, int j)
{
int vi, vj;
i*=3; j*=3;
vi = (value>>i) & 7;
vj = (value>>j) & 7;
value = (value ... | a.cc: In function 'int main()':
a.cc:50:17: error: 'memset' was not declared in this scope
50 | memset(hit, 0, sizeof(hit));
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <map>
+++ |... |
s977191918 | p00121 | C++ | #include <iostream>
#include <queue>
#include <map>
#include <string>
#include <algorithm>
using namespace std;
typedef pair<string, int> P;
const int INF = 100000000;
//霎灘?
string a;
//遘サ蜉ィ譁ケ蜷?int dir[4] = {-1, 1, -4, 4};
map<string, int> dp; //菫晏ュ倅サ市tring蜿伜芦"01234567"逧?nt
//隶。邂嶺サ?0123456... | a.cc: In function 'void bfs()':
a.cc:34:30: error: 'dir' was not declared in this scope; did you mean 'div'?
34 | int next = cur + dir[i];
| ^~~
| div
a.cc:39:20: error: expected identifier before '!' token
39 | && !... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.