submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s711432672 | p03805 | Java | import java.util.Arrays;
import java.util.Scanner;
public class Main {
private static int N = 0;
private static int M = 0;
private static int[][] abArray;
private static Boolean[] flagArray;
private static int count = 0;
public static void main(String[] args) {
try (Scanner sc = new Scanner(System.in)) {
... | Main.java:56: error: class, interface, enum, or record expected
}
^
1 error
|
s580929359 | p03805 | C++ | #include <iostream>
#include <vector>
#include <set>
#include <utility>
#include <string>
#include <algorithm>
#include <cmath>
typedef long long ll;
#define INF 1e9
using namespace std;
int nmax = 8;
int graph[nmax][nmax];
int dfs(int v, int n, bool visited[nmax]){
bool all_visited = true;
for (int i = 0; ... | a.cc:14:17: error: size of array 'graph' is not an integral constant-expression
14 | int graph[nmax][nmax];
| ^~~~
a.cc:14:11: error: size of array 'graph' is not an integral constant-expression
14 | int graph[nmax][nmax];
| ^~~~
a.cc:16:36: error: size of array 'visited' is ... |
s371186324 | p03805 | C++ | #include<iostream>
#include<vector>
using namespace std;
bool graph[8][8]={};
int DFS (int v,int N,bool visited[8]/*訪れたノード*/){
//最後かどうか確認する
bool all_visited=true;
for(int i=0;i<N;++i){
if(visited[i]==false){
all_visited=false;
}
}
//最後だったら
if(all_visited){
... | a.cc: In function 'int DFS(int, int, bool*)':
a.cc:34:12: error: 'res' was not declared in this scope; did you mean 'ret'?
34 | return res;
| ^~~
| ret
|
s228623902 | p03805 | C++ | #include<cstdio>
#include<vector>
#include<queue>
using namespace std;
int N,M;
struct Edge
{
int to;
bool visited;
};
vector<Edge>V[10];
bool visited[10];
int ans;
void dfs(int x,int count)
{
if(count==N-1)
{
ans++;
return ;
}
visited[x]=true;
for(int i=0;i<V[x].size();i++)
... | a.cc: In function 'int main()':
a.cc:50:5: error: 'memset' was not declared in this scope
50 | memset(visited,false,sizeof(visited));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<queue>
+++ |+#include <cst... |
s739539419 | p03805 | C++ | N,M = map(int,input().split())
T = {}
for i in range(M):
a,b = map(int,input().split())
if a not in T.keys():
T[a] = []
if b not in T.keys():
T[b] = []
T[a].append(b)
T[b].append(a)
ans = 0
def dfs(graph,start,path):
global ans
global N
path = path + [start]
if len(... | a.cc:1:1: error: 'N' does not name a type
1 | N,M = map(int,input().split())
| ^
a.cc:3:1: error: expected unqualified-id before 'for'
3 | for i in range(M):
| ^~~
|
s006386915 | p03805 | C++ | #include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#define MAX_N 100
#define INF 100000
#define rep(i, n) for(int i=0; i<n; ++i)
#define REP(i, s, t) for(int i=s; i<=s; ++i)
using namespace std;
const int nmax=8;
bool graph[nmax][nmax];
int main(void)
{
cin.tie(0);
ios::sync_with_... | a.cc: In function 'int main()':
a.cc:35:13: error: 'dfs' was not declared in this scope
35 | cout << dfs(0, N, visited) << endl;
| ^~~
|
s227609063 | p03805 | C++ | #include<iostream>
#include<vector>
using namespace std;
vector used;
vector connect;
int N, M;
int dfs(int now, int depth) {
if (used[now]) return 0;
if (depth == N) return 1;
used[now] == 1;
int ans =0:
for (int i = 0; i < N; i++) {
if (connect[now][i])ans += dfs(i, depth + 1);
}
used[now] = 0;
return ans;... | a.cc:5:8: error: class template argument deduction failed:
5 | vector used;
| ^~~~
a.cc:5:8: error: no matching function for call to 'vector()'
In file included from /usr/include/c++/14/vector:66,
from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate: 'template<clas... |
s922394467 | p03805 | C++ | #include<iostream>
using namespace std;
int nmax=8;
bool graph[nmax][nmax];
int dfs(in v,int N,bool visited[nmax]){
bool all_visited=true;
for(int i=;i<n;i++){
if(visited[i]==false)all_visited=false;
}
if(all_visited){
return 1;
}
int ret=0;
for(int i=0;i<N;i++){
if(graph[v][i]==false)continu... | a.cc:4:18: error: size of array 'graph' is not an integral constant-expression
4 | bool graph[nmax][nmax];
| ^~~~
a.cc:4:12: error: size of array 'graph' is not an integral constant-expression
4 | bool graph[nmax][nmax];
| ^~~~
a.cc:6:9: error: 'in' was not declared in th... |
s388519464 | p03805 | C++ | #include <iostream>
using namespace std;
const int nmax=8;
bool graph[nmax][nmax]
int dfs(int v,int N, bool visited[nmax]) {
bool all_visited=true;
for (int i=0; i<N; ++i) {
if (visited[i]==false)
all_visited=false;
}
if (all_visited){
return 1;
}
int ret=0;... | a.cc:6:1: error: expected initializer before 'int'
6 | int dfs(int v,int N, bool visited[nmax]) {
| ^~~
a.cc: In function 'int main()':
a.cc:39:9: error: 'graph' was not declared in this scope; did you mean 'isgraph'?
39 | graph[a-1][b-1] = graph[b-1][a-1] = true;
| ^~~~~
| ... |
s653135050 | p03805 | C++ | #include <iostream>
#include <vector>
using namespace std;
int ans;
bool visited[8];
bool all_visited;
vector<int> G[8];
void dfs(int cur, int n) {
visited[cur] = true;
all_visited = true;
for (int i = 0; i < n; i++) {
if (!visited[i]) {
all_visited = false;
break;
... | a.cc: In function 'void dfs(int, int)':
a.cc:23:16: error: too few arguments to function 'void dfs(int, int)'
23 | dfs(e);
| ~~~^~~
a.cc:11:6: note: declared here
11 | void dfs(int cur, int n) {
| ^~~
|
s998932502 | p03805 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <functional>
#include <numeric>
#include <list>
#include <set>
#include <map>
#include <cmath>
#define v_exists(elem, v) find(v.begin(),v.end(),elem)!=v.end()
#define s_exists(elem, s) s.find(elem)!=s.end()
using namespace std;
const ... | a.cc: In function 'int main()':
a.cc:72:9: error: 'memset' was not declared in this scope
72 | memset(adj, 0, sizeof(adj));
| ^~~~~~
a.cc:11:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
10 | #include <cmath>
+++ |+#include <cst... |
s316164164 | p03805 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<list>
#include<cmath>
#include<map>
using namespace std;
using ll = long long;
const int INF = 1e9;
#define rep(i,n)for(int i=0;i<n;++i)
#define p pair<int,int>
vector<int>used;
vector<int>connect;
int N, M;
vector<int>G[10];
vector<int>u... | a.cc:17:12: error: redefinition of 'std::vector<int> used'
17 | vector<int>used(8, 0);
| ^~~~
a.cc:13:12: note: 'std::vector<int> used' previously declared here
13 | vector<int>used;
| ^~~~
a.cc: In function 'int dfs(int, int)':
a.cc:36:18: warning: control reaches end of non-voi... |
s078854846 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef struct {
bool to[8];
} node;
node _node[8];
int n,m;
int ans = 0;
void go(int now,int x[8],int cnt) {
if (cnt == n) {
ans++;
return 0;
}
for(int i = 0;i < 8;i++) {
if (x[_node[now].to[i]] = false) {
int y[8];
for (int j = 0... | a.cc: In function 'void go(int, int*, int)':
a.cc:18:24: error: return-statement with a value, in function returning 'void' [-fpermissive]
18 | return 0;
| ^
a.cc:30:16: error: return-statement with a value, in function returning 'void' [-fpermissive]
30 | retu... |
s301455497 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef struct {
bool to[8];
} node;
_node[8];
int n,m;
int ans = 0;
void go(int now,int x[8],int cnt) {
if (cnt == n) {
ans++;
return 0;
}
for(int i = 0;i < 8;i++) {
if (x[_node[now].to[i]] = false) {
int y[8];
for (int j = 0;j < ... | a.cc:10:1: error: '_node' does not name a type; did you mean 'node'?
10 | _node[8];
| ^~~~~
| node
a.cc: In function 'void go(int, int*, int)':
a.cc:18:24: error: return-statement with a value, in function returning 'void' [-fpermissive]
18 | return 0;
| ^
... |
s578296346 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef struct {
bool to[8];
} node;
_node[8];
int n,m;
int ans = 0;
void go(int now,int x[8],int cnt) {
if (cnt == n) {
ans++;
return 0;
}
for(int i = 0;i < 8;i++) {
if (x[_node[now].to[i]] = false) {
int y[8];
for (int j = 0;j < ... | a.cc:10:1: error: '_node' does not name a type; did you mean 'node'?
10 | _node[8];
| ^~~~~
| node
a.cc: In function 'void go(int, int*, int)':
a.cc:18:24: error: return-statement with a value, in function returning 'void' [-fpermissive]
18 | return 0;
| ^
... |
s532136325 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef struct {
bool to[8];
} node;
int n,m;
int ans = 0;
void go(int now,int x[8],int cnt) {
if (cnt == n) {
ans++;
return 0;
}
for(int i = 0;i < 8;i++) {
if (x[node[now].to[i]] = false) {
int y[8];
for (int j = 0;j < 8;j++) {
... | a.cc: In function 'void go(int, int*, int)':
a.cc:16:24: error: return-statement with a value, in function returning 'void' [-fpermissive]
16 | return 0;
| ^
a.cc:19:27: error: expected primary-expression before '[' token
19 | if (x[node[now].to[i]] = f... |
s873688447 | p03805 | C++ | #!/usr/bin/env python
from collections import deque
import itertools as it
import sys
import math
sys.setrecursionlimit(1000000)
INF = 10 ** 18
MOD = 10 ** 9 + 7
N, M = map(int, raw_input().split())
edge = [[False] * N for i in range(N)]
for i in range(M):
a, b = map(int, raw_input().split())
a, b = a - 1,... | a.cc:1:2: error: invalid preprocessing directive #!
1 | #!/usr/bin/env python
| ^
a.cc:3:1: error: 'from' does not name a type
3 | from collections import deque
| ^~~~
|
s693087684 | p03805 | C++ | #include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <climits>
#include <sstream>
using namespace std;
const int nmax = 8;
bool graph[nmax][nmax];
int dfs(int v, int N, bool visited[nmax]){
bool all_visit = true;
for(int i = 0; i < N; i++){
if(vi... | a.cc: In function 'int dfs(int, int, bool*)':
a.cc:21:13: error: 'all_visited' was not declared in this scope; did you mean 'all_visit'?
21 | all_visited = false;
| ^~~~~~~~~~~
| all_visit
a.cc:25:8: error: 'all_visited' was not declared in this scope; did you mean 'al... |
s943983279 | p03805 | C++ |
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <i... | a.cc: In function 'int main()':
a.cc:102:55: error: expected ';' before ')' token
102 | } while (next_permutation(v.begin(), v.end())));
| ^
| ;
a.cc:102:55: error: expected primary-expressi... |
s437935105 | p03805 | C++ | #include<iostream>
#include<set>
using namespace std;
int res,start[56],end[56],n,m;
int pass(int k,int in,set<int> a){
int num;
if(k==n){
res++;
return 0;
}
for(int i=0;i<n*2;i++){
if(start[i]==in&&a.count(end[i])==0){
a.insert(in);
pass(k+1,end[i],a);
}
}
return 0;
}
int main(){
cin>>n>>m;
set<i... | a.cc: In function 'int pass(int, int, std::set<int>)':
a.cc:12:42: error: reference to 'end' is ambiguous
12 | if(start[i]==in&&a.count(end[i])==0){
| ^~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bits... |
s990147962 | p03805 | C++ | #include<iostream>
#include<set>
using namespace std;
int n,m;
int start[8];
int end[8];
int result=0;
/**判断是否所有点都遍历过,passPoint表示已经遍历过的点*/
bool allPassed(set<int> passPoint){
for(int i =1;i<=n;i++){
//从1到n,只要有一个在passPoint 里面不存在,说明没有都遍历过
if(passPoint.count(i)==0){
return 0;
}
}
return 1;
}
void printSet(s... | a.cc: In function 'void goOneStep(int, std::set<int>, std::set<int>)':
a.cc:57:30: error: reference to 'end' is ambiguous
57 | next=end[i];
| ^~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bits/locale_class... |
s645123154 | p03805 | C++ | #include<iostream>
#include<set>
using namespace std;
int n,m;
int start[8],end[8];
int result=0;
/**判断是否所有点都遍历过,passPoint表示已经遍历过的点*/
bool allPassed(set<int> passPoint){
for(int i =1;i<=n;i++){
//从1到n,只要有一个在passPoint 里面不存在,说明没有都遍历过
if(passPoint.count(i)==0){
return 0;
}
}
return 1;
}
void printSet(set<in... | a.cc: In function 'void goOneStep(int, std::set<int>, std::set<int>)':
a.cc:56:30: error: reference to 'end' is ambiguous
56 | next=end[i];
| ^~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bits/locale_class... |
s039989461 | p03805 | C++ | #include<iostream>
#include <algorithm>
#include<string>
#include <bitset>
#include <vector>
#include <functional>
#include <climits>
#include <iomanip>
#include <utility>
#include <stack>
#include <queue>
#include <math.h>
#include <iomanip>
using namespace std;
using ll = long long;
ll n, m;
ll sum = 0;
ll memo[50][... | a.cc: In function 'void kansuu(ll, ll*)':
a.cc:38:25: error: 'memcpy' was not declared in this scope
38 | memcpy(x, visited, sizeof(ll)*10);
| ^~~~~~
a.cc:13:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring... |
s956870519 | p03805 | C++ | #include<iostream>
#include <algorithm>
#include<string>
#include <bitset>
#include <vector>
#include <functional>
#include <climits>
#include <iomanip>
#include <utility>
#include <stack>
#include <queue>
#include <math.h>
#include <iomanip>
using namespace std;
using ll = long long;
ll n, m;
ll sum = 0;
ll memo[50][... | a.cc: In function 'void kansuu(ll, ll*)':
a.cc:38:25: error: 'memcpy' was not declared in this scope
38 | memcpy(x, visited, sizeof(ll)*n);
| ^~~~~~
a.cc:13:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>... |
s761879300 | p03805 | C++ | #include<iostream>
#include <algorithm>
#include<string>
#include <bitset>
#include <vector>
#include <functional>
#include <climits>
#include <iomanip>
#include <utility>
#include <stack>
#include <queue>
#include <math.h>
#include <iomanip>
using namespace std;
using ll = long long;
ll n, m;
ll sum = 0;
ll memo[50][... | a.cc: In function 'void kansuu(ll, ll*)':
a.cc:38:25: error: 'memcpy' was not declared in this scope
38 | memcpy(x, visited, 10*8);
| ^~~~~~
a.cc:13:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
12 ... |
s098869627 | p03805 | C++ | #include<iostream>
#include <algorithm>
#include<string>
#include <bitset>
#include <vector>
#include <functional>
#include <climits>
#include <iomanip>
#include <utility>
#include <stack>
#include <queue>
#include <math.h>
#include <iomanip>
using namespace std;
using ll = long long;
ll n, m;
ll sum = 0;
ll memo[50][... | a.cc: In function 'void kansuu(ll, ll*)':
a.cc:38:25: error: 'memcpy' was not declared in this scope
38 | memcpy(x, visited, n*8);
| ^~~~~~
a.cc:13:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
12 |... |
s760861148 | p03805 | C++ | import itertools
na = lambda: list(map(int, input().split()))
n, m = na()
t = [[0] * 10 for _ in range(10)]
for _ in range(m):
a, b = na()
a -= 1
b -= 1
t[a][b] = t[b][a] = 1
ans = 0
for l in itertools.permutations(range(m)):
if l[0]: continue
flag = 1
for i in range(1, n):
if t[l[... | a.cc:1:1: error: 'import' does not name a type
1 | import itertools
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s739257188 | p03805 | C++ | #include <iostream>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#define rep(i, N) for(int (i) = 0; (i) < (N); (i) ++)
typedef long long ll;
using namespace std;
vector<vector<int>> dp;
vector<vector<bool>> edges;
ll memo(int a, int p, int end){
if(dp[a][p] != -1){
return dp[a][p]... | a.cc: In function 'll memo(int, int, int)':
a.cc:22:16: error: 'TMP' was not declared in this scope
22 | bitset<TMP> pb = (p);
| ^~~
a.cc:22:19: error: template argument 1 is invalid
22 | bitset<TMP> pb = (p);
| ^
a.cc:23:31: error: invalid types 'int[i... |
s717663581 | p03805 | C++ | #include <iostream>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#define rep(i, N) for(int (i) = 0; (i) < (N); (i) ++)
typedef long long ll;
using namespace std;
#define TMP 9
void print_dp(vector<vector<int>> dp){
int y = dp.size();
int x = dp[0].size();
cout << endl;
rep(i,... | /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
|
s614880234 | p03805 | C++ | #include<cstdio>
#include<vector>
using namespace std;
vector<int> G[100]
int dfs(int n, int mask, int now) {
int res = 0;
if(mask == (1<<n)-1) return 1;
for(auto v : G[now]) {
if(~mask & (1<<v)) res += dfs(n, mask | (1<<v), v);
}
return res;
}
int main(void) {
int n,m;
scanf("%d%d",&n,&m);
fo... | a.cc:7:1: error: expected initializer before 'int'
7 | int dfs(int n, int mask, int now) {
| ^~~
a.cc: In function 'int main()':
a.cc:24:5: error: 'G' was not declared in this scope
24 | G[a].push_back(b);
| ^
a.cc:27:17: error: 'dfs' was not declared in this scope
27 | printf("%d\n",dfs... |
s442489698 | p03805 | C++ | #include <cstdio>
using namespace std;
const int nmax = 8;
bool graph[nmax][nmax];
int n;
int dfs(int v, bool visited[nmax])
{
bool all_visited = true;
for (int i = 0; i < n; i++) {
if (visited[i] = false)
all_visited = false;
}
if (all_visited)
return 1;
int ret =... | a.cc: In function 'int dfs(int, bool*)':
a.cc:30:9: error: 'visitet' was not declared in this scope; did you mean 'visited'?
30 | visitet[i] = true;
| ^~~~~~~
| visited
a.cc:31:23: error: invalid conversion from 'int' to 'bool*' [-fpermissive]
31 | ret += dfs(i, n, visi... |
s018047534 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
int temp[10][10] = {}, N, M;
int foo(int n,int coun,int bb[]){//cout<<coun<<" "<<n<<endl;
if(coun == N)return 1;
int tee[10][10], ans =0, aa[10]={},C=0;
for(int i = 1; i <= coun;i++){aa[bb[i]]=1;
for(int i = 1; i <= N; i++){
if(aa[i]==1)continue;
//tee... | a.cc: In function 'int foo(int, int, int*)':
a.cc:21:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
21 | int main(){
| ^~
a.cc:21:9: note: remove parentheses to default-initialize a variable
21 | int main(){
| ^~
| --
a.cc:21:9... |
s430257028 | p03805 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
int numlen( int n ) {
std::string s = std::to_string( n );
return s.size();
}
bool chk_permu( int n, int i ) {
std::string ns = std::to_string( n );
std::sort( ns.begin(), ns.end() );
std::string is = std::to_string( i );
std::sort( is... | a.cc: In function 'int next_permu(int)':
a.cc:23:25: error: 'pow' is not a member of 'std'
23 | int nmax = std::pow( 10, len - 1 ) * 2;
| ^~~
|
s449151581 | p03805 | C++ | #include <iostream>
using namespace std;
/* define const */
/* finish defineing const */
int n, m;
long cnt = 0;
int a[10] = {};
int b[10] = {};
string table[50000];
pair<int, int> p[10];
bool allt(bool *b)
{
bool f = true;
for (int i = 1; i <= n; i++)
{
if (b[i] == false)
{
... | a.cc: In function 'int main()':
a.cc:83:5: error: 'sort' was not declared in this scope; did you mean 'short'?
83 | sort(p, p + n);
| ^~~~
| short
|
s038112456 | p03805 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
using namespace std;
using ll =int long long;
map <int ,int> mpa,mpb;
const int nmax= 8;
bool graph[nmax][nmax];
int DFS(int v, int ... | a.cc: In function 'int DFS(int, int, bool*)':
a.cc:44:15: error: a function-definition is not allowed here before '{' token
44 | int main(void){
| ^
a.cc:61:2: error: expected '}' at end of input
61 | }
| ^
a.cc:18:42: note: to match this '{'
18 | int DFS(int v, int N, bool visited[n... |
s187088001 | p03805 | C++ | #include <iostream>
#include <numeric>
using namespace std;
int adj[8][8];
int N, M;
int answer;
void search(int src, int visited[]) {
// cout << "search(" << src << ", [";
// for (int i = 1; i <= N; i++) {
// cout << visited[i] << ", ";
// }
// cout << "])" << endl;
int newVisited[9];
... | a.cc: In function 'void search(int, int*)':
a.cc:22:17: error: 'memcpy' was not declared in this scope
22 | memcpy(newVisited, visited, sizeof(int) * 9);
| ^~~~~~
a.cc:3:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
... |
s877921589 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, m;
bool used[10];
vector<int> g[10];
int dfs(int s, int num) {
if(num == n-1) {
//cout << s << endl;
return 1;
}
int ret = 0;
for(int i=0;i<g[s].size();i++) {
if(!used[g[s][i]]) {
used[g[s][i]] = true;
ret += ... | a.cc: In function 'int main()':
a.cc:42:23: error: 'sizseof' was not declared in this scope
42 | memset(used, false, sizseof(used));
| ^~~~~~~
|
s684295800 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,M,i,j;
int ans=0;
cin>>N>>M;
vector<int>a(M),b(M),c(M),r(N);
for(i=0;i<M;i++){
cin>>a[i]>>b[i];
c[i]=a[i]*b[i]*100+a[i]+b[i];
}
for(i=0;i<N;i++)r[i]=i+1;
if(r[0]!=1)continue;
for(i=0;i<N-1;i++){
for(j=0;j<M;j++){
if(r[... | a.cc: In function 'int main()':
a.cc:14:14: error: continue statement not within a loop
14 | if(r[0]!=1)continue;
| ^~~~~~~~
|
s746814423 | p03805 | Java | import java.util.Scanner;
/*
* AtCoder Beginner Contest 054
* 2017/02/11
* C - One-stroke Path
*
* https://beta.atcoder.jp/contests/abc054/tasks/abc054_c
* */
public class OneStrokePath {
static int[] a, b;
static int N, M, ans;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);... | Main.java:10: error: class OneStrokePath is public, should be declared in a file named OneStrokePath.java
public class OneStrokePath {
^
1 error
|
s938444217 | p03805 | C++ | #include <iostream>
#include <list>
using namespace std;
const int nmax = 8;
int N = nmax;
bool graph[nmax][nmax];
int dsf(int v,bool visited[nmax]){
int i;
for(i = 0;i < N;++i)if(!visited[i])break;
if(i == N)return 1;
int ret=0;
for (i = 0; i < N; ++i)
{
if(visited[i])continue;
visited[i]=true;
ret+=dsf(i... | a.cc: In function 'int main()':
a.cc:31:25: error: cannot resolve overloaded function 'max' based on conversion to type 'long unsigned int'
31 | bool visited[max];
| ^
a.cc:31:14: error: size of array 'visited' has non-integral type '<unresolved overloaded function type>'
31 ... |
s471947343 | p03805 | C++ | #include <iostream>
#include <list>
using namespace std;
const int nmax = 8;
int N = nmax;
bool graph[nmax][nmax];
int dsf(int v,bool visited[nmax]){
int i;
for(i = 0;i < N;++i)if(!visited[i])break;
if(i == N)return 1;
int ret=0;
for (i = 0; i < N; ++i)
{
if(visited[i])continue;
visited[i]=true;
ret+=dsf(i... | a.cc: In function 'int main()':
a.cc:27:13: error: 'i' was not declared in this scope
27 | for(i = 0;i < m;i++){
| ^
a.cc:31:25: error: cannot resolve overloaded function 'max' based on conversion to type 'long unsigned int'
31 | bool visited[max];
| ... |
s664276428 | p03805 | C++ | #include <iostream>
#include <list>
using namespace std;
const int nmax = 8
int N = nmax;
bool graph[nmax][nmax];
int dsf(int v,bool visited[nmax]){
int i;
for(i = 0;i < N;++i)if(!visited[i])break;
if(i == N)return 1;
int ret=0;
for (i = 0; i < N; ++i)
{
if(visited[i])continue;
visited[i]=true;
ret+=dsf(i,... | a.cc:5:1: error: expected ',' or ';' before 'int'
5 | int N = nmax;
| ^~~
a.cc: In function 'int dsf(int, bool*)':
a.cc:10:23: error: 'N' was not declared in this scope
10 | for(i = 0;i < N;++i)if(!visited[i])break;
| ^
a.cc:11:17: error: 'N' was not declared in this sco... |
s872543860 | p03805 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <list>
#include <string>
#include <cstdlib>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstring>
#include <climits>
using namespace std;
typedef long long ll;
typedef vector<int> ivec;
typedef pair<int, int> ipair;
int ... | a.cc: In function 'int main()':
a.cc:35:5: error: 'iota' was not declared in this scope
35 | iota(p.begin() + 1, p.end(), 1);
| ^~~~
|
s708404618 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int n, m, ans = 0;
vector<int> g[8];
cin >> n >> m;
for (int i = 0; i < n; i++) {
int a, b;
cin >> a >> b;
a--, b--;
g[a].push_back(b);
g[b].push_back(a);
}
queue<pair<int, vector<bool>>> que;... | a.cc: In function 'int main()':
a.cc:19:14: error: 'temp' was not declared in this scope; did you mean 'tm'?
19 | que.push(temp);
| ^~~~
| tm
|
s914489007 | p03805 | C++ | int v=p.second;
if(d[v]<p.first)continue;
for(int i=0;i<(signed)G[v].size();i++){
edge e =G[v][i];
if(d[e.to]>d[v]+e.cost){
d[e.to]=d[v]+e.cost;
que.push(P(d[e.to],e.to));
}
}
}
}
int main(){
cout<<boolalpha;
cin>>N>>M;
REP(i,M){
int a,b;
cin>>a>>b;
info[i]=P(a,b);
}
REP(Bit,1<<M){... | a.cc:1:23: error: 'p' was not declared in this scope
1 | int v=p.second;
| ^
a.cc:2:17: error: expected unqualified-id before 'if'
2 | if(d[v]<p.first)continue;
| ^~
a.cc:3:17: error: expected unqualified-id before 'for'
3 | ... |
s966965426 | p03805 | C++ | #include <iostream>
#include <string>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
bool path[N][N];
memset(path,false,sizeof(path));
for (int i=0; i<M; i++) {
int a, b;
cin >> a >> b;
a--;
b--;
path[a][b]=true;
path[b][a]=true;
}
int vertex[N];
for (int i=0; i<N; i... | a.cc: In function 'int main()':
a.cc:9:3: error: 'memset' was not declared in this scope
9 | memset(path,false,sizeof(path));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cstring>
... |
s307437923 | p03805 | C++ | #include <iostream>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
bool path[N][N];
memset(path,false,sizeof(path));
for (int i=0; i<M; i++) {
int a, b;
cin >> a >> b;
a--;
b--;
path[a][b]=true;
path[b][a]=true;
}
int vertex[N];
for (int i=0; i<N; i++) {
vertex[i... | a.cc: In function 'int main()':
a.cc:8:3: error: 'memset' was not declared in this scope
8 | memset(path,false,sizeof(path));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cstring>
... |
s217393137 | p03805 | C++ | #include <algorithm>
#include <cctype>
#include <complex>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::to_string;
using std::vector;
using std::set;
using std::queue;
using std... | a.cc: In function 'int main()':
a.cc:52:10: error: 'iota' is not a member of 'std'
52 | std::iota(p.begin(), p.end(), 1);
| ^~~~
|
s304188754 | p03805 | C++ | #include <algorithm>
#include <cctype>
#include <complex>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::to_string;
using std::vector;
using std::set;
using std::queue;
using std... | a.cc: In function 'int main()':
a.cc:52:5: error: 'iota' was not declared in this scope
52 | iota(p.begin(), p.end(), 1);
| ^~~~
|
s404207287 | p03805 | C++ | #include <algorithm>
#include <cctype>
#include <complex>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::to_string;
using std::vector;
using std::set;
using std::queue;
using std... | a.cc: In function 'int main()':
a.cc:52:5: error: 'iota' was not declared in this scope
52 | iota(p.begin(), p.end(), 1);
| ^~~~
|
s584885653 | p03805 | C++ | {-# LANGUAGE FlexibleContexts, OverloadedStrings #-}
import Control.Applicative
import Control.Monad
import qualified Data.ByteString.Char8 as B
import Data.Maybe (fromJust)
import Data.List
import Text.Printf
import Debug.Trace
istour g [_] = 1
istour g (x:y:ys) = if [x,y] `elem` g
then istour g (... | a.cc:1:3: error: stray '#' in program
1 | {-# LANGUAGE FlexibleContexts, OverloadedStrings #-}
| ^
a.cc:1:50: error: stray '#' in program
1 | {-# LANGUAGE FlexibleContexts, OverloadedStrings #-}
| ^
a.cc:11:30: error: stray '`' in program
11 | is... |
s982593836 | p03805 | Java | import org.junit.Test;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Main {
static int n;
static boolean[][] connected;
static public int countPattern(int pos, Set<Integer> visited) {
if (visited.size() == n) return 1;
int count = 0;
f... | Main.java:1: error: package org.junit does not exist
import org.junit.Test;
^
Main.java:45: error: cannot find symbol
@Test
^
symbol: class Test
location: class Main
2 errors
|
s573660793 | p03805 | Java |
import org.junit.Test;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Main {
static int n;
static boolean[][] connected;
static public int countPattern(int pos, Set<Integer> visited) {
if (visited.size() == n) return 1;
int count = 0;
for ... | Main.java:2: error: package org.junit does not exist
import org.junit.Test;
^
Main.java:46: error: cannot find symbol
@Test
^
symbol: class Test
location: class Main
2 errors
|
s147908219 | p03805 | Java | package atcoder.beginnercontest.abc054.c;
import org.junit.Test;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Main {
static int n;
static boolean[][] connected;
static public int countPattern(int pos, Set<Integer> visited) {
if (visited.size() == n) retu... | Main.java:3: error: package org.junit does not exist
import org.junit.Test;
^
Main.java:47: error: cannot find symbol
@Test
^
symbol: class Test
location: class Main
2 errors
|
s198097687 | p03805 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
struct node
{
vector<int> next;
};
int calc(vector<node> &n, int index, vector<bool> &map)
{
map[index] = true;
int result = 0;
if (all_of(map.begin(), map.end(), [](auto &v) {return v; }))
{
result = 1;
}
for (au... | 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... |
s867364893 | p03805 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
struct node
{
vector<int> next;
};
int calc(vector<node> &n, int index, vector<bool> &map)
{
map[index] = true;
int result = 0;
if (all_of(map.begin(), map.end(), [](auto &v) {return v; }))
{
result = 1;
}
for (au... | 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... |
s090507603 | p03805 | C++ | #include <iostream>
#include<sstream>
#include<vector>
#include<iterator>
using namespace std;
void wfs(int pos, int& cnt, vector<bool> hist, const vector<vector<bool>>& table)
{
hist[pos] = true;
if(count(hist.begin(), hist.end(), false) == 0)
{
cnt++;
return;
}
for(int i=1; i<table[pos].size(); i++)
{
i... | a.cc: In function 'void wfs(int, int&, std::vector<bool>, const std::vector<std::vector<bool> >&)':
a.cc:10:12: error: 'count' was not declared in this scope; did you mean 'cnt'?
10 | if(count(hist.begin(), hist.end(), false) == 0)
| ^~~~~
| cnt
|
s744926484 | p03805 | C++ | #include <bits/stdc++.h>
#include "example.h"
using namespace std;
// Powered by caide (code generator, tester, and library code inliner)
class Solution {
int n, m;
vector<int> edge[8];
public:
int dfs(int now, int bits)
{
if (bits & 1 << now) return 0;
bits |= 1 << now;
if (bits + 1 == (1 << n)) ... | a.cc:2:10: fatal error: example.h: No such file or directory
2 | #include "example.h"
| ^~~~~~~~~~~
compilation terminated.
|
s219934753 | p03805 | C++ | #include"bits/stdc++.h"
//#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define print(x) cout<<x<<endl;
typedef long long ll;
int n, m;
int a[30], b[30];
bool exist = 0;
int cnt = 0;
bool check(bool flag[8]) {
int c = 0;
rep(i, 0, n) {
if (flag[i] == 1)c += 1;
}
if (c == n)... | /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
|
s969224485 | p03805 | Java | import java.io.*;
import java.util.*;
import java.math.BigInteger;
public class java{
public static boolean[] visited;
public static ArrayList<Integer>[] graph;
public static final int MOD = (int) 1e9 + 7;
public static void main(String[] args) {
InputReader in = new InputReader(System.in);
PrintWriter ... | Main.java:4: error: class java is public, should be declared in a file named java.java
public class java{
^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
|
s434172543 | p03805 | C++ | #include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
const int MAXN = 15;
const int MAXCASE = 25;
vector<int> m[MAXN];
int n, p;
int sum;
int vis[MAXN];
int judge[MAXN][MAXN];
void dfs(int cot,int num)
{
if(num == n)
{
sum++;
return;
}
for(... | a.cc:8:1: error: 'vector' does not name a type
8 | vector<int> m[MAXN];
| ^~~~~~
a.cc: In function 'void dfs(int, int)':
a.cc:20:23: error: 'm' was not declared in this scope
20 | for(int i = 0;i < m[cot].size();i++)
| ^
a.cc: In function 'int main()':
a.cc:37:9: error: 'ass... |
s764625509 | p03805 | C++ | // 簡易競プロテンプレ
#include <bits/stdc++.h>
using namespace std;
int n, m;
int f[8][8];
int a,b;
int main(void){
cin >> n >> m;
for(int i=0;i<m;i++){cin >> a >> b; f[a-1][b-1] = f[b-1][a-1] = 1;}
vector<int> p(n);
for(int i=0;i<n;i++) p[i] = i;
int ans = 0;
do{
if (p[0]!=0) continue;
int ok = 1;
for(int i=0;i+1<n... | a.cc: In function 'int main()':
a.cc:18:45: error: expected ')' before ';' token
18 | }while(next_permutation(p.begin(), p.end());
| ~ ^
| )
|
s727520748 | p03805 | C++ | // 簡易競プロテンプレ
#include <bits/stdc++.h>
using namespace std;
int n, m;
int f[8][8];
int a,b;
int main(void){
cin >> n >> m;
for(int i=0;i<m;i++){cin >> a >> b; f[a-1][b-1] = f[b-1][a-1] = 1;}
vector<int> p(n);
for(int i=0;i<n;i++) p[i] = i;
int ans = 0;
do{
if (p[i]!=0) continue;
int ok = 1;
for(int i=0;i+1<n... | a.cc: In function 'int main()':
a.cc:14:9: error: 'i' was not declared in this scope
14 | if (p[i]!=0) continue;
| ^
a.cc:18:45: error: expected ')' before ';' token
18 | }while(next_permutation(p.begin(), p.end());
| ~ ^
| ... |
s678763732 | p03805 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <queue>
using namespace std;
class Node
{
public:
vector<int> visited;
int count;
int cur_pos;
Node(int n_){
count = 0;
visited = vector<int>(n_, 0);
}
};
class oneStrokePath
{
private:
int n, m;
vector<vector<int> > adj;
public:
oneStrokeP... | a.cc: In member function 'void oneStrokePath::execute()':
a.cc:65:32: error: 'cur_pos' was not declared in this scope
65 | if(adj[cur_pos][i] == 1 && cur.visited[i] == 0){
| ^~~~~~~
|
s168804160 | p03805 | Java | import java.util.*;
public class Main {
static int count = 0;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int[][] edge = new int[N][N];
for(int i = 0; i < M; i++) {
int a = sc.nextInt();
int b = sc.nextIn... | Main.java:33: error: bad operand types for binary operator '&'
if(mask & (1 << j) == 0) {
^
first type: int
second type: boolean
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
|
s126874589 | p03805 | C++ | #include<iostream>
using namespace std;
int main(void){
int N,Ma,Mb;
cin>>N>>Ma>>Mb;
//それぞれ物質Aの含有量,Bの含有量,値段の合計の最大値
const int amax=400;
const int bmax=400;
const int pmax=100000;
//リストを作成してすべてを最大値に初期化
int list[N+1][amax+1][bmax+1];
for(int i=0;i<N+1;i++){
for(int a=0;a<amax+1;a++){
for(int b=0;b<bmax+... | a.cc: In function 'int main()':
a.cc:38:112: error: expected ';' before '}' token
38 | else list[i][anow][bnow]=min(list[i-1][anow-a][bnow-b]+p,list[i-1][anow][bnow])
| ... |
s773632386 | p03805 | C++ | #include<iostream>
using namespace std;
int main(void){
int N,Ma,Mb;
cin>>N>>Ma>>Mb;
//それぞれ物質Aの含有量,Bの含有量,値段の合計の最大値
const int amax=400;
const int bmax=400;
const int pmax=100000;
//リストを作成してすべてを最大値に初期化
int list[N+1][amax+1][bmax+1];
for(int i=0;i<N+1;i++){
for(int a=0;a<amax+1;a++){
for(int b=0;b<bmax+... | a.cc: In function 'int main()':
a.cc:38:112: error: expected ';' before '}' token
38 | else list[i][anow][bnow]=min(list[i-1][anow-a][bnow-b]+p,list[i-1][anow][bnow])
| ... |
s069963497 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
template <class ForwardIterator, class T>
void iota (ForwardIterator first, ForwardIterator last, T val)
{
while (first!=last) {
*first = val;
++first;
++val;
}
}
int g[11][11];
int main()
{
int n,m,x,y,res=0;
cin>>n>>m;
vector<int> island(n);
... | a.cc: In function 'int main()':
a.cc:18:17: error: 'class std::vector<int>' has no member named 'island'
18 | iota(island.island(),p.end(),0);
| ^~~~~~
a.cc:18:26: error: 'p' was not declared in this scope
18 | iota(island.island(),p.end(),0);
| ^
|
s258835034 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
template <class ForwardIterator, class T>
void iota (ForwardIterator first, ForwardIterator last, T val)
{
while (first!=last) {
*first = val;
++first;
++val;
}
}
int g[11][11]={0};
int main()
{
int n,m,x,y,res=0;
cin>>n>>m;
vector<int> island(... | a.cc: In function 'int main()':
a.cc:18:17: error: 'class std::vector<int>' has no member named 'island'
18 | iota(island.island(),p.end(),0);
| ^~~~~~
a.cc:18:26: error: 'p' was not declared in this scope
18 | iota(island.island(),p.end(),0);
| ^
|
s881308598 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
template <class ForwardIterator, class T>
void iota (ForwardIterator first, ForwardIterator last, T val)
{
while (first!=last) {
*first = val;
++first;
++val;
}
}
int g[11][11];
int main()
{
int n,m,x,y,res=0;
cin>>n>>m;
vector<int> p(n);
i... | a.cc: In function 'int main()':
a.cc:18:9: error: call of overloaded 'iota(std::vector<int>::iterator, std::vector<int>::iterator, int)' is ambiguous
18 | iota(p.begin(),p.end(),0);
| ~~~~^~~~~~~~~~~~~~~~~~~~~
a.cc:4:8: note: candidate: 'void iota(ForwardIterator, ForwardIterator, T) [with ForwardItera... |
s943272167 | p03805 | C++ | #include <iostream>
#include <vector>
int* E;
int N, M;
int eval(int ind,std::vector<int>& route)
{
if (route.size() == N)
return 1;
int ans = 0;
for (int i = 0; i < N; i++)
{
std::vector<int> route_n = route;
if (!E[ind*N + i])
continue;
std::vector<int>::iterator iter = std::find(route.begin(), ... | a.cc: In function 'int eval(int, std::vector<int>&)':
a.cc:22:60: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
22 | std::vector<int>::iterator iter = std::find(route.begin(), route.end(), i);
| ... |
s126064675 | p03805 | C++ | #include <iostream>
#include <vector>
int* E;
int N, M;
int eval(int ind,const std::vector<int>& route)
{
if (route.size() == N)
return 1;
int ans = 0;
for (int i = 0; i < N; i++)
{
std::vector<int> route_n = route;
if (!E[ind*N + i])
continue;
std::vector<int>::const_iterator iter = std::find(rou... | a.cc: In function 'int eval(int, const std::vector<int>&)':
a.cc:22:66: error: no matching function for call to 'find(std::vector<int>::const_iterator, std::vector<int>::const_iterator, int&)'
22 | std::vector<int>::const_iterator iter = std::find(route.cbegin(), route.cend(), i);
| ... |
s017799674 | p03805 | C++ | #include <iostream>
#include <vector>
int* E;
int N, M;
int eval(int ind,const std::vector<int>& route)
{
if (route.size() == N)
return 1;
int ans = 0;
for (int i = 0; i < N; i++)
{
std::vector<int> route_n = route;
if (!E[ind*N + i])
continue;
std::vector<int>::const_iterator iter = std::find(rou... | a.cc: In function 'int eval(int, const std::vector<int>&)':
a.cc:22:66: error: no matching function for call to 'find(std::vector<int>::const_iterator, std::vector<int>::const_iterator, int&)'
22 | std::vector<int>::const_iterator iter = std::find(route.cbegin(), route.cend(), i);
| ... |
s312684883 | p03805 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <queue>
using namespace std;
int main()
{
int N, M, a, b;
cin >> N >> M;
vector<vector<int>> arr(N);
for (int i = 0; i < M; i++) {
cin >> a >> b;
arr[a - 1].push_back(b - 1);
arr[b - 1].push_back(a - 1);
}
queue<vector<int>> roots;
roots.p... | a.cc: In function 'int main()':
a.cc:28:33: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
28 | if (find(root.begin(), root.end(), val) == root.end()) {
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In fil... |
s908983306 | p03805 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <queue>
using namespace std;
int main()
{
int N, M, a, b;
cin >> N >> M;
vector<vector<int>> arr(N);
for (int i = 0; i < M; i++) {
cin >> a >> b;
arr[a - 1].push_back(b - 1);
arr[b - 1].push_back(a - 1);
}
queue<vector<int>> roots;
roots.p... | a.cc: In function 'int main()':
a.cc:27:21: error: expected '(' before 'each'
27 | for each(int val in arr[root.back()]) {
| ^~~~
| (
a.cc:27:26: error: expected primary-expression before 'int'
27 | for each(int val in arr[root.ba... |
s812089848 | p03805 | C | #include<cstdio>
#include<cstring>
int vis[10],map[10][10],n,m;
int dfs(int x)
{
int i;
for(i=1;i<=n;i++)
if(vis[i]!=1)
break;
if(i==n+1)
return 1;
for(i=1;i<=n;i++)
if(map[x][i]==1&&vis[i]==0)
{
vis[i]=1;
dfs(i);
vis[i]=0;
}
}
int main()
{
int sum,i,j,x,y;
while(scanf("%d%d",&n,&m)!=EOF)
{
memset(... | main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s712714760 | p03805 | C++ | #include <iostream>
using namespace std;
const int max = 8;
bool graph[max][max];
int dfs(int v, int N, bool visited[max]) {
bool all_visited = true;
for (int i = 0; i < N; ++i) {
if (visited[i] == false)
all_visited = false;
}
if (all_visited) {
return 1;
}
int ret = 0;
for (int i = 0; i < N; i++) ... | a.cc:4:12: error: reference to 'max' is ambiguous
4 | bool graph[max][max];
| ^~~
In file included 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... |
s207260679 | p03805 | C++ | #include <iostream>
using namespace std;
const int max = 8;
bool graph[max][max];
int dfs(int v, int N, bool visited[max]) {
bool all_visited = true;
for (int i = 0; i < N; ++i) {
if (visited[i] == false)
all_visited = false;
}
if (all_visited) {
return 1;
}
int ret = 0;
for (int i = 0; i < N; i++) ... | a.cc:4:12: error: reference to 'max' is ambiguous
4 | bool graph[max][max];
| ^~~
In file included 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... |
s216147330 | p03805 | C++ | #include <iostream>
#define REP(i, a, n) for(int (i) = (a); (i) <= (n); (i)++)
using namespace std;
int N, M, E[10][10];
bool is_valid(int* order) {
REP(i, 1, N) cout << order[i] << " ";
cout << "]" << endl;
REP(i, 1, N - 1) {
if(!E[order[i]][order[i + 1]]) return false;
}
return true;
}
int main(void... | a.cc: In function 'int main()':
a.cc:32:11: error: 'next_permutation' was not declared in this scope
32 | } while(next_permutation(order + 2, order + N + 1));
| ^~~~~~~~~~~~~~~~
|
s231421041 | p03805 | C++ | #include <iostream>
using namespace std;
struct Vertice{
int neighbors[8];
int neighbor_count;
};
int N, M;
Vertice vertices[8];
int main(){
int a, b;
cin >> N >> M;
while(true) {
cin >> a;
if(a == '\0') break;
cin >> b;
vertices[a].neighbors[b] = 1;
vertices[a].neighbor_count += 1;
}
cout << B... | a.cc: In function 'int main()':
a.cc:25:17: error: 'BFS' was not declared in this scope
25 | cout << BFS(1, 0);
| ^~~
|
s745558883 | p03805 | C++ | #include <iostream>
using namespace std;
struct Vertice{
int neighbors[8];
int neighbor_count;
};
int N, M;
Vertice vertices[8];
int main(){
int a, b;
cin >> N >> M;
while(true) {
cin >> a;
if(a == NULL) break;
cin >> b;
vertices[a].neighbors[b] = 1;
vertices[a].neighbor_count += 1;
}
cout << B... | a.cc: In function 'int main()':
a.cc:19:25: warning: NULL used in arithmetic [-Wpointer-arith]
19 | if(a == NULL) break;
| ^~~~
a.cc:25:17: error: 'BFS' was not declared in this scope
25 | cout << BFS(1, 0);
| ^~~
|
s658182463 | p03805 | C++ | #include <iostream>
using namespace std;
struct Vertice{
int neighbors[8];
int neighbor_count;
}
int N, M;
Vertice vertices[N];
int main(){
int a, b;
cin >> N >> M;
while(true) {
cin >> a;
if(a == null) break;
cin >> b;
vertices[a].neighbors[b] = 1;
vertices[a].neighbor_count += 1;
}
cout << BF... | a.cc:7:2: error: expected ';' after struct definition
7 | }
| ^
| ;
a.cc:10:18: error: size of array 'vertices' is not an integral constant-expression
10 | Vertice vertices[N];
| ^
a.cc: In function 'int main()':
a.cc:19:25: error: 'null' was not declared in this scope
19 ... |
s210207739 | p03805 | Java | import java.util.*;
public class Main {
int[] p = new int[10];
static int count = 0;
static int[][] edge;
static int N;
static int M;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
N = sc.nextInt();
M = sc.nextInt();
edge = new int[N][N];
for(int i = 0; i ... | Main.java:20: error: non-static method dfs(int,int) cannot be referenced from a static context
dfs(1, (1 << N) - 2);
^
Main.java:35: error: bad operand types for binary operator '&'
if(mask & (1 << i) != 0) {
^
first type: int
second type: boolean
2 errors
|
s850445508 | p03805 | Java | import java.util.*;
public class Main {
int[] p = new int[10];
int count = 0;
static int[][] edge;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
edge = new int[N][N];
for(int i = 0; i < M; i++) {
int a = sc.ne... | Main.java:19: error: non-static variable count cannot be referenced from a static context
System.out.println(count);
^
Main.java:22: error: cannot find symbol
if(pos == N) {
^
symbol: variable N
location: class Main
Main.java:24: error: cannot find symbol
for(int i =... |
s604513261 | p03805 | Java | import java.util.*;
public class Main {
int[] p = new int[10];
int count = 0;
int[][] edge;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
edge = new int[N][N];
for(int i = 0; i < M; i++) {
int a = sc.nextInt()... | Main.java:11: error: non-static variable edge cannot be referenced from a static context
edge = new int[N][N];
^
Main.java:15: error: non-static variable edge cannot be referenced from a static context
edge[a - 1][b - 1] = 1;
^
Main.java:16: error: non-static variable edge cannot be referenced from ... |
s123851131 | p03805 | Java | import java.util.*;
public class Main {
int[] p = new int[10];
int count = 0;
int[][] edge;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
edge = new int[N][N];
for(int i = 0; i < M; i++) {
int a = sc.nextInt()... | Main.java:19: error: invalid method declaration; return type required
dfs(1, (1 << N) - 2);
^
Main.java:19: error: illegal start of type
dfs(1, (1 << N) - 2);
^
Main.java:20: error: <identifier> expected
System.out.println(count);
^
Main.java:20: error: <identifier> expected
System.o... |
s630239915 | p03805 | Java | import java.util.*;
public class Main {
int[] p = new int[10];
int count = 0;
int[][] edge;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
edge = new int[N][N];
for(int i = 0; i < M; i++) {
int a = sc.nextInt()... | Main.java:19: error: invalid method declaration; return type required
dfs(1, (1 << N) - 2);
^
Main.java:19: error: illegal start of type
dfs(1, (1 << N) - 2);
^
Main.java:20: error: <identifier> expected
System.out.println(count);
^
Main.java:20: error: <identifier> expected
System.o... |
s690295591 | p03805 | Java | import java.util.*;
public class Main {
int[] p;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
p = new int[N];
int[][] edge = new int[N][N];
for(int i = 0; i < M; i++) {
int a = sc.nextInt();
int b = sc.... | Main.java:18: error: <identifier> expected
System.out.println(dfs(1, (1 << N) - 2));
^
Main.java:18: error: <identifier> expected
System.out.println(dfs(1, (1 << N) - 2));
^
Main.java:20: error: unnamed classes are a preview feature and are disabled by default.
... |
s937914837 | p03805 | Java | import java.util.*;
public class Main {
int[] p = new int[N];
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int[][] edge = new int[N][N];
for(int i = 0; i < M; i++) {
int a = sc.nextInt();
int b = sc.nextInt();
edge[a - 1][b - 1] = 1;
edge[b - 1][a - 1] = ... | Main.java:9: error: illegal start of type
for(int i = 0; i < M; i++) {
^
Main.java:9: error: > or ',' expected
for(int i = 0; i < M; i++) {
^
Main.java:9: error: <identifier> expected
for(int i = 0; i < M; i++) {
^
Main.java:15: error: <identifier> expected
Sys... |
s542392734 | p03805 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int[][] edge = new int[N][N];
for(int i = 0; i < M; i++) {
int a = sc.nextInt();
int b = sc.nextInt();
edge[a - 1][b ... | Main.java:17: error: illegal start of expression
public void dfs(int pos, int mask) {
^
Main.java:35: error: <identifier> expected
System.out.println(dfs(1, (1 << N) - 2));
^
Main.java:35: error: <identifier> expected
System.out.println(dfs(1, (1 << N) - 2));
... |
s128899305 | p03805 | Java | import java.util.ArrayList;
import java.util.Scanner;
/**
* Created by guoxiang.li on 2017/02/13.
*/
public class Main {
private int count=0;
private ArrayList[] graph;
boolean[] visited;
public int undirectedGraphTraversalWays(int[][] nums,int n){
graph=new ArrayList[n];
for(int i=... | Main.java:74: error: <identifier> expected
sol=new ();
^
1 error
|
s844646214 | p03805 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int[][] edge = new int[N][N];
for(int i = 0; i < M; i++) {
int a = sc.nextInt();
int b = sc.nextInt();
edge[a - 1][b ... | Main.java:17: error: illegal start of expression
void dfs(int pos, int mask) {
^
Main.java:17: error: ';' expected
void dfs(int pos, int mask) {
^
Main.java:17: error: <identifier> expected
void dfs(int pos, int mask) {
^
Main.java:17: error: ';' expected
void dfs(in... |
s906117833 | p03805 | C++ | #include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
typedef struct edge{
int u,v;
} EDGE;
int search(int n,int visited[],int node[n][n],int position){
int node_local[n][n];
int visited_local[n];
memcpy(node_local,node,sizeof(int... | a.cc:13:42: error: use of parameter outside function body before ']' token
13 | int search(int n,int visited[],int node[n][n],int position){
| ^
a.cc:13:45: error: use of parameter outside function body before ']' token
13 | int search(int n,int visited[],int node[n]... |
s846581120 | p03805 | C++ | #include <string>
#include <sstream>
#include <iostream>
#include <vector>
#include <math.h>
#include <algorithm>
#include <functional>
#include <map>
#include <climits>
#include <queue>
using namespace std;
#define ll long long
class Main {
public:
int rec(int n, vector<pair<int, int> >& edges, vector<bool>& prevs... | /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
|
s814565829 | p03805 | Java | import java.util.*;
public class Main{
static int result=0;
static int N;
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
N= sc.nextInt();
int M=sc.nextInt();
int[] a=new int[M];
int[] b=new int[M];
for(int i=0;i<M;i++){
a[i]=sc.nextInt()-1;
b[i]=sc.nextInt()-1;
}
... | Main.java:18: error: reached end of file while parsing
}
^
1 error
|
s801740232 | p03805 | C++ | import java.util.*;
public class Main{
static int result=0;
static int N;
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
N= sc.nextInt();
int M=sc.nextInt();
int[] a=new int[M];
int[] b=new int[M];
for(int i=0;i<M;i++){
a[i]=sc.nextInt()-1;
b[i]=sc.nextInt()-1;
}
... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
2 | public class Main{
| ^~~~~~
|
s934521912 | p03805 | C++ | #include <algorithm>
#include <bitset>
#include <cassert>
#include <deque>
#include <fstream>
#include <iostream>
#include <map>
#include <math.h>
#include <memory>
#include <queue>
#include <sstream>
#include <stdio.h>
#include <string>
#include <vector>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define RE... | a.cc: In function 'void dfs(int, int)':
a.cc:54:15: error: reference to 'end' is ambiguous
54 | if (flag == end) {
| ^~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bitset:52,
from a.cc:2:
/usr/include/c++/14/bits/range_access.... |
s583591434 | p03805 | C++ | #include <algorithm>
#include <bitset>
#include <cassert>
#include <deque>
#include <fstream>
#include <iostream>
#include <map>
#include <math.h>
#include <memory>
#include <queue>
#include <sstream>
#include <stdio.h>
#include <string>
#include <vector>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define RE... | a.cc: In function 'void dfs(int, unsigned char)':
a.cc:54:15: error: reference to 'end' is ambiguous
54 | if (flag == end) {
| ^~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bitset:52,
from a.cc:2:
/usr/include/c++/14/bits/ran... |
s968324486 | p03805 | C++ | #include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <typeinfo>
#include <fstream>
#include <limits>
using namespace std;
template<class T = int,T divided_by = 10>
constexpr T PINF(){ return std::nu... | a.cc: In function 'int main()':
a.cc:44:5: error: 'iota' was not declared in this scope
44 | iota(nodes.begin(), nodes.end(), 1); // v に 1, 2, ... N を設定
| ^~~~
|
s524729371 | p03805 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int N, M;
cin>> N>> M;
int g[10][10];
for(int i=0; i<N; i++){
for(int j=0; j<N; j++){
g[i][j]=0;
}
}
for(int i=0; i<M; i++){
int a, b;
cin>> a>> b;
a--; b--;
// g[a].push_back(b);
// ... | a.cc: In function 'int main()':
a.cc:25:4: error: 'vector' was not declared in this scope
25 | vector<int> _v;
| ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
2 | #include<algorithm>
+++ |+#include <vector>
3 |
a.cc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.