submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s544146105 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
bool graph[8][8];
int dfs(int t, int N, bool visited) {
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: In function 'int dfs(int, int, bool)':
a.cc:10:15: error: invalid types 'bool[int]' for array subscript
10 | if(visited[i] == false) {
| ^
a.cc:14:6: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
14 | if(all _visited) {
| ^~~
... |
s034035072 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
bool graph[8][8];
int dfs(int t, int N, bool visited) {
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: In function 'int dfs(int, int, bool)':
a.cc:10:15: error: invalid types 'bool[int]' for array subscript
10 | if(visited[i] == false) {
| ^
a.cc:14:6: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
14 | if(all _visited) {
| ^~~
... |
s158851571 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
bool graph[8][8];
int dfs(int t, int N, bool visited) {
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: In function 'int dfs(int, int, bool)':
a.cc:10:15: error: invalid types 'bool[int]' for array subscript
10 | if(visited[i] == false) {
| ^
a.cc:14:6: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
14 | if(all _visited) {
| ^~~
... |
s616577280 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define all(x)... | a.cc: In function 'int main()':
a.cc:153:33: error: expected ')' before ';' token
153 | } while (next_permutation(v,v+n);
| ~ ^
| )
|
s643879067 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define all(x)... | a.cc: In function 'int main()':
a.cc:136:2: error: 'd' was not declared in this scope
136 | d[n+1][n+1]={{}};
| ^
a.cc:153:33: error: expected ')' before ';' token
153 | } while (next_permutation(v,v+n);
| ~ ^
| )
|
s558807753 | p03805 | C++ | #include "pch.h"
#include <bits/stdc++.h>
using namespace std;
int n;
int counter;
void dfs(vector<vector<int>> &G, int s, int depth, vector<bool> &seen) {
if (depth == n) {
counter++;
return;
}
for (int i = 0; i < G[s].size(); i++) {
if (seen[G[s][i]] == true) {
continue;
}
seen[G[s][i]] = true;
... | a.cc:1:10: fatal error: pch.h: No such file or directory
1 | #include "pch.h"
| ^~~~~~~
compilation terminated.
|
s141074294 | p03805 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
using ll = long long;
using namespace std;
using P = pair<int,int>;
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)... | a.cc: In function 'int main()':
a.cc:54:23: error: invalid conversion from 'int' to 'bool*' [-fpermissive]
54 | cout << dfs(0, n, nmax) << endl;
| ^~~~
| |
| int
a.cc:9:28: note: initializing argument 3 of 'int dfs(int, int, bo... |
s456064444 | p03805 | C++ | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> G(8,vector<int>(8));
vector<bool> visit(8,false);
int ans;
int n, m;
/*
目的: 頂点を受け取り, 条件を満たすかどうかを探索する. 何も返さない.
*/
void dfs(int v){
bool allVisited = true;
for (int i = 0; i < n; i++) if (i != v && visit[i] == false) al... | a.cc: In function 'void dfs(int)':
a.cc:18:47: error: reference to 'visit' is ambiguous
18 | for (int i = 0; i < n; i++) if (i != v && visit[i] == false) allVisited = false;
| ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
... |
s551265440 | p03805 | C++ | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> G(8,vector<int>(8));
vector<bool> visit(8,false);
int ans;
int n, m;
/*
目的: 頂点を受け取り, 条件を満たすかどうかを探索する. 何も返さない.
*/
void dfs(int v){
bool allVisited = true;
for (int i = 0; i < n; i++) if (i != v && !visit[i]) allVisited... | a.cc: In function 'void dfs(int)':
a.cc:18:48: error: reference to 'visit' is ambiguous
18 | for (int i = 0; i < n; i++) if (i != v && !visit[i]) allVisited = false;
| ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
... |
s925160203 | p03805 | C++ |
// delete when proceedig next
#define EXE
#ifdef EXE
// -------------------------------------------------------
#include <iostream>
#include <string>
#include <stdio.h>
#include <cassert>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
int result_num = 0;
int N = 3;
int M = 3;
// pair<int... | a.cc: In function 'int main()':
a.cc:82:16: error: 'sx' was not declared in this scope
82 | cin >> sx >> sy >> tx >> ty;
| ^~
a.cc:82:22: error: 'sy' was not declared in this scope
82 | cin >> sx >> sy >> tx >> ty;
| ^~
a.cc:82:28: error: 'tx' was no... |
s281769646 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
map<int,vector<int>> P;
set<string> RT;
vector<bool> ans;
int count=0;
void prog(int a,vector<bool>T){
T.at(a-1)=true;
if(T==ans){
count++;
return;
}
for(int i:P.at(a)){
if(T.at(i-1))continue;
prog(i,T);
}
}
int main (){
... | a.cc: In function 'void prog(int, std::vector<bool>)':
a.cc:11:9: error: reference to 'count' is ambiguous
11 | count++;
| ^~~~~
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:1:
/us... |
s832522687 | 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();
connectingNumsArray2 = new boolean[N][N];
for(i = 0; i < N; i++){
for(j = 0; j < N; j++){
//... | Main.java:10: error: cannot find symbol
connectingNumsArray2 = new boolean[N][N];
^
symbol: variable connectingNumsArray2
location: class Main
Main.java:11: error: cannot find symbol
for(i = 0; i < N; i++){
^
symbol: variable i
location: class Main
Main.java:11: error: cann... |
s348417751 | p03805 | C++ | #include <iostream>
using namespace std;
bool graph[8][8] = {false};
int dfs(int iterate, bool * visited, int n, int m) {
bool all_visited = true;
for (int i = 0; i < n; i++) {
if (visited[i] == false)
all_visited = false;
}
if (all_visited)
return 1;
int rval = 0;
for (int i = 0; i < n; i... | a.cc: In function 'int dfs(int, bool*, int, int)':
a.cc:17:15: error: 'v' was not declared in this scope
17 | if (graph[v][i] == false) {
| ^
a.cc:24:5: error: 'ret' was not declared in this scope
24 | ret += dfs(i, visited, n, m);
| ^~~
a.cc:26:10: error: 'ret' was not dec... |
s432425272 | 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();
List<Integer> list = new ArrayList<>();
// 全部1つのListに入れちゃう
for(int i = 0 ; i < 2 * M - 1; i++) {
list... | Main.java:17: error: illegal character: '\u3000'
?List<connectingNumsList> connectingNumsListList = new ArrayList<>();
^
Main.java:23: error: illegal start of expression
}
^
2 errors
|
s556417420 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
ll gcd(ll x, ll y) { return (x % y)? gcd(y, x % y): y; } //最大公約数
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; } //最小公倍数
using Graph = vector<vector<ll>>;
ll inf=300000000000000000;
const doubl... | a.cc: In function 'int main()':
a.cc:13:3: error: 'vectro' was not declared in this scope
13 | vectro<vector<int>> k(n,vector<int>(n,-1));
| ^~~~~~
a.cc:13:20: error: expected primary-expression before '>' token
13 | vectro<vector<int>> k(n,vector<int>(n,-1));
| ^~
a.cc:13:23:... |
s819438696 | p03805 | C++ | #include <iostream>
#include <vector>
#include <algorithm> // next_permutation(順列)
#include <numeric>
using namespace std;
bool G[10][10]; // グラフを隣接行列で管理
int main() {
int N, M;
cin >> N >> M;
for ( int i = 0; i < M; i++ ) {
int a, b;
cint >> a >> b;
G[a-1][b-1] == G[b-1][a-1] = true;
}
// ... | a.cc: In function 'int main()':
a.cc:14:5: error: 'cint' was not declared in this scope; did you mean 'uint'?
14 | cint >> a >> b;
| ^~~~
| uint
a.cc:15:17: error: lvalue required as left operand of assignment
15 | G[a-1][b-1] == G[b-1][a-1] = true;
| ~~~~~~~~~~~~^~~~~~~~~~~~... |
s415109725 | p03805 | C++ | #include<bits/stdc++.h>
#define ll long long
#define P pair<int,int>
#define PP pair<P,int>
using namespace std;
int n, m, sum;
vector<vector<int>> g(10);
int dfs(vector<int>v, int x, sum){
if(v.size() == n)return sum;
for(auto i:g[x]){
bool had = false;
for(auto j:v){
if(i == ... | a.cc:11:30: error: 'sum' is not a type
11 | int dfs(vector<int>v, int x, sum){
| ^~~
a.cc: In function 'int dfs(std::vector<int>, int, int)':
a.cc:23:26: error: expected primary-expression before ')' token
23 | return dfs(u ,i, );
| ^
|
s138858670 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
void OnestrokePath(int n,vector<vector<int>> &ABC,vector<bool> &ok,int &ans) {
bool ok2 = true;
for(int i = 0; i < ok.size(); i++) {
if(ok[i] == false && i != n) {
ok2 = false;
}
}
if(ok2) {
ans++;
return;
}
... | a.cc: In function 'void OnestrokePath(int, std::vector<std::vector<int> >&, std::vector<bool>&, int&)':
a.cc:19:22: error: too few arguments to function 'void OnestrokePath(int, std::vector<std::vector<int> >&, std::vector<bool>&, int&)'
19 | OnestrokePath(ABC[n][i],ABC,ok);
| ~~~~~~~~~~~~~^~~~... |
s369154663 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
int ans = 0;
void OnestrokePath(int n,vector<vector<int>> &ABC,vector<bool> &ok) {
bool ok2 = true;
for(int i = 0; i < ok.size(); i++) {
if(ok[i] == false && i != n) {
ok2 = false;
}
}
if(ok2) {
ans+;
return;
}... | a.cc: In function 'void OnestrokePath(int, std::vector<std::vector<int> >&, std::vector<bool>&)':
a.cc:12:13: error: expected primary-expression before ';' token
12 | ans+;
| ^
|
s274338066 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
int ans = 0;
void OnestrokePath(int n,vector<vector<int>> &ABC,vector<bool> &ok) {
bool ok2 = true;
for(int i = 0; i < ok.size(); i++) {
if(ok == false && i != n) {
ok2 = false;
}
}
if(ok2) {
ans+;
return;
}
... | a.cc: In function 'void OnestrokePath(int, std::vector<std::vector<int> >&, std::vector<bool>&)':
a.cc:7:15: error: no match for 'operator==' (operand types are 'std::vector<bool>' and 'bool')
7 | if(ok == false && i != n) {
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/regex:68,
... |
s543984129 | p03805 | C++ | #include<bits/ctdc++.h>
using namespace std;
int main(){
int n,m;
cin >> n >> m;
vector<vector<bool>> graph(n,vector<bool> (n,false));
for(int i = 0; i < m ; ++i){
int a,b;
cin >> a>>b;
graph[a-1][b-1] = graph[b-1][a-1] = true;
}
vector<int> v(n);
for( int i = 0; i<n; ++i) v[i] = i;
int ans ... | a.cc:1:9: fatal error: bits/ctdc++.h: No such file or directory
1 | #include<bits/ctdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s656450696 | p03805 | C++ | #include<bits/stdc++.h>
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]) all_visited=false;
if(all_visited) return 1;
int ret = 0;
for(int i=0;i<N;++i){
if(!graph[v][i] || visi... | a.cc:6:14: error: expected ')' before ';' token
6 | int dfs(int v; int N; bool visited[nmax]){
| ~ ^
| )
a.cc:6:41: error: expected initializer before ')' token
6 | int dfs(int v; int N; bool visited[nmax]){
| ^
a.cc: In function ... |
s145942103 | p03805 | C++ | #include<bits/stdc++.h>
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]) all_visited=false;
if(all_visited) return 1;
int ret = 0;
for(int i=0;i<N;++i){
if(!graph[v][i] || visited... | a.cc:6:14: error: expected ')' before ';' token
6 | int dfs(int v;int N;bool visited[nmax]){
| ~ ^
| )
a.cc:6:39: error: expected initializer before ')' token
6 | int dfs(int v;int N;bool visited[nmax]){
| ^
a.cc: In function 'int m... |
s406847186 | p03805 | C++ | #include<bits/stdc++.h>
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;
break;
}
}
if(all_visited){
return 1;
}
int ret = 0... | a.cc: In function 'int main()':
a.cc:46:23: error: expected ';' before '}' token
46 | visited[i] = false
| ^
| ;
47 | }
| ~
a.cc:51:11: error: 'bfs' was not declared in this scope; did you mean 'ffs'?
51 | cout << bfs(0... |
s739657789 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
bool hantei(vector<int> &j,vector<vector<int>> &A){
for(vector<int> &i:A)
if(i==j)
return true;
return false;
}
int main(){
int N,M;
cin>>N>>M;
vector<vector<int>> A(M,vector<int>(2));
for(vector<int> &i:A){
int j,k;
cin>>j>>k;
i={j-1,k-1... | a.cc: In function 'int main()':
a.cc:25:15: error: cannot bind non-const lvalue reference of type 'std::vector<int>&' to an rvalue of type 'std::vector<int>'
25 | if(!hantei({0,v.at(0)},A))
| ~~~~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
from /usr/inclu... |
s665646223 | p03805 | C++ | // #include <bits/stdc++.h>
// typedef long long int ll;
// using namespace std;
// int dfs(int v, vector<vector<int>> A, vector<int> visit, int &count)
// {
// bool all_flag = 1;
// for (int i = 0; i < visit.size(); i++)
// {
// if (visit[i] == 0)
// {
// all_flag = 0;
// ... | a.cc: In function 'int main()':
a.cc:103:2: error: 'cin' was not declared in this scope
103 | cin >> N >> M;
| ^~~
a.cc:117:2: error: 'cout' was not declared in this scope
117 | cout << dfs(0,N,visited) << endl;
| ^~~~
a.cc:117:30: error: 'endl' was not declared in this scope
117 | cout << dfs(0,... |
s935820819 | p03805 | C++ | #include <bits/stdc++.h>
typedef long long int ll;
using namespace std;
int dfs(int v, vector<vector<int>> A, vector<int> visit, int &count)
{
bool all_flag = 1;
for (int i = 0; i < visit.size(); i++)
{
if (visit[i] == 0)
{
all_flag = 0;
}
}
if (all_flag == 1... | a.cc: In function 'int dfs(int, std::vector<std::vector<int> >, std::vector<int>, int&)':
a.cc:29:13: error: 'stop_flag' was not declared in this scope
29 | stop_flag = 0;
| ^~~~~~~~~
|
s304848968 | p03805 | C++ | #include <bits/stdc++.h>
typedef long long int ll;
using namespace std;
int dfs(int v, vector<vector<int>> A, vector<int> visit, int &count)
{
bool stop_flag = 1;
visit[v] = 1;
for (int w :A[v])
{
if (visit[w] == 0)
{
stop_flag = 0;
dfs(w, A, visit,count);
... | a.cc: In function 'int main()':
a.cc:60:1: error: a function-definition is not allowed here before '{' token
60 | {
| ^
a.cc:86:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
86 | int main()
| ^~
a.cc:86:9: note: remove parentheses to default-initia... |
s251091229 | p03805 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);i++)
typedef long long ll;
using namespace std;
bool G[10][10]; // グラフを隣接行列で管理する。無方向なので対称にする。
int main() {
int N, M; cin >> N >> M;
for (int i = 0; i < M; ++i) {
int a, b; cin >> a >> b; --a, --b; //全部-1してる
G[a][b] = G[b][a] = true; /... | a.cc: In function 'int main()':
a.cc:34:13: error: 'res' was not declared in this scope; did you mean 'rep'?
34 | cout << res << endl;
| ^~~
| rep
|
s644132469 | p03805 | C++ | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using MessagePack;
using MessagePack.Resolvers;
namespace Capp
{
class Program
{
public enum En
{
a
,b
,c
,d
,e
... | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Collections.Generic;
| ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
3 | using System.L... |
s770443689 | p03805 | C | #include<stdio.h>
int n;
int d[8][8];
int u[8];
int f(int now,int len){
if(len == 1){
return 1;
}
u[now] = 1;
int ans = 0;
for(int i = 0;i < n;i ++){
if(u[i] == 0 && d[now][i] != 0){
ans += f(i,len-1);
}
u[now] = 0;
return 0;
}
int main(void){
int m;
scanf("%d %d",&n,&m);
... | main.c: In function 'f':
main.c:36:1: error: expected declaration or statement at end of input
36 | }
| ^
|
s885908431 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin >> n >> m;
vector<vector<bool>> adj(n,vector<bool>(n,false));
vector<int> v(n);
for ( int i = 0; i < m; i++){
int a,b;
cin >> a >> b;
a--; b--;
adj.at(a).at(b) = adj.at(a).at(b) = true;
}
for ( int i = 0; i < n;... | a.cc:35:2: error: expected declaration before '}' token
35 | }}
| ^
|
s747678044 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin >> n >> m;
vector<vector<bool>> adj(n,vector<bool>(n,false));
vector<int> v(n);
for ( int i = 0; i < m; i++){
int a,b;
cin >> a >> b;
a--; b--;
adj.at(a).at(b) = adj.at(a).at(b) true;
}
for ( int i = 0; i < n; ... | a.cc: In function 'int main()':
a.cc:14:38: error: expected ';' before 'true'
14 | adj.at(a).at(b) = adj.at(a).at(b) true;
| ^ ~~~~
| ;
a.cc: At global scope:
a.cc:35:2: error: expected declaration before '}' token
35 | }}
... |
s135428024 | p03805 | C++ | #incliude<bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin >> n >> m;
vector<vector<bool>> adj(n,vector<bool>(n,false));
vector<int> v(n);
for ( int i = 0; i < m; i++){
int a,b;
cin >> a >> b;
a--; b--;
adj.at(a).at(b) = adj.at(a).at(b) true;
}
for ( int i = 0; i < n;... | a.cc:1:2: error: invalid preprocessing directive #incliude; did you mean #include?
1 | #incliude<bits/stdc++.h>
| ^~~~~~~~
| include
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
5 | cin >> n >> m;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in hea... |
s806125951 | p03805 | C++ | nnnnnnnnn | a.cc:1:1: error: 'nnnnnnnnn' does not name a type
1 | nnnnnnnnn
| ^~~~~~~~~
|
s622828817 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
vector<bool> seen;//訪れたか否か
int count1 = 1;//今まで幾つの頂点に訪れたか
int DFS(vector<vector<int>> &G, int v, int N){
bool all_seen = true;//全て訪れたかの判定
for(int i = 0; i < N; i++){
if(!seen[i]){
all_seen = false;
}
}
bool all_seen = true;//全て訪れたかの判定
... | a.cc: In function 'int DFS(std::vector<std::vector<int> >&, int, int)':
a.cc:17:8: error: redeclaration of 'bool all_seen'
17 | bool all_seen = true;//全て訪れたかの判定
| ^~~~~~~~
a.cc:10:8: note: 'bool all_seen' previously declared here
10 | bool all_seen = true;//全て訪れたかの判定
| ^~~~~~~~
|
s872619751 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
vector<bool> seen;//訪れたか否か
int count = 1;//今まで幾つの頂点に訪れたか
int ans = 0;
int DFS(vector<vector<int>> &G, int v, int N){
seen[v] = true;//頂点vは訪れた
if(count == N) ans++;
//vから行ける場所に行く
for(int next_v: G[v]){
//すでに訪れているなら無視
if(seen[next_v]){
c... | a.cc: In function 'int DFS(std::vector<std::vector<int> >&, int, int)':
a.cc:12:6: error: reference to 'count' is ambiguous
12 | if(count == N) ans++;
| ^~~~~
In file included from /usr/include/c++/14/algorithm:86,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
... |
s585412509 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
int N,M;
Graph graph(N);
vector<bool> seen;
int res = 0;
void do_dfs(int root,int times)
{
for(auto i: graph[root])
{
if(root == 1)
{
seen = vector<bool>(N + 1,false);
seen[1] = true;
}
if(seen[i]) continue;
... | a.cc:5:1: error: 'Graph' does not name a type
5 | Graph graph(N);
| ^~~~~
a.cc: In function 'void do_dfs(int, int)':
a.cc:11:17: error: 'graph' was not declared in this scope; did you mean 'isgraph'?
11 | for(auto i: graph[root])
| ^~~~~
| isgraph
a.cc: In fu... |
s001496952 | p03805 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
using namespace std;
#define MAX_N 105
#define MAX_M 11
#define PI 3.14159265359
#define rep(i,n) for(int i=0; i<n; ++i)
#define INF 1001001001
typedef pair<int, int> P;
int main()... | a.cc: In function 'int main()':
a.cc:22:5: error: 'memset' was not declared in this scope
22 | memset(path, 0, sizeof(path));
| ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
8 | #include <set>
+++ |+#include <cstring>
... |
s641727738 | p03805 | C++ | #include "bits/stdc++.h"
#include <unordered_set>
#define rep(i,n) for(int i = 0; i < n; i++)
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define vll vector<vector<long long>>
#define vl vector<long long>
#define vi vector<int>
#define vii vector<vector<int>>
#define pb push_back
#define ... | a.cc:49:33: error: expected class-name before '{' token
49 | class Uniedge : public Baseedge {
| ^
a.cc:61:32: error: expected class-name before '{' token
61 | class Biedge : public Baseedge {
| ^
a.cc: In member function 'void graph<T>::B... |
s882282152 | p03805 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include<limits.h>
#include<iomanip>
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(),v.end()
#define RALL(v) ... | a.cc: In function 'void dfs(int, int)':
a.cc:31:21: error: 'begin' was not declared in this scope; did you mean 'std::begin'?
31 | for(auto a : G[p]){
| ^
| std::begin
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/1... |
s294835236 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
const int INF = 1000000007;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
int main(){
int N, M;
cin >> N >> M;
vector<vector<bool>> G(N, vector<bool>(N, false));
rep(i, M){
int a, b;
cin >> a >> b;
G.at(a-1).at(b... | a.cc: In function 'int main()':
a.cc:30:29: error: 'v' was not declared in this scope
30 | } while (next_permutation(v.begin()+1, v.end()));
| ^
|
s539261623 | p03805 | C++ | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // uint64_t
#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))
#define BUF_SIZE 100
// size: specify sizeof(str)
int get_str(char *str, int size) {
if(!fgets(str, size, stdin)) return -1;
return 0;
}
... | a.cc: In function 'void reversed(int*, int)':
a.cc:46:20: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
46 | int *b = malloc(sizeof(int)*size);
| ~~~~~~^~~~~~~~~~~~~~~~~~
| |
| void*
|
s323928131 | p03805 | C++ | #include <iostream>
#include <sstream>
#include <stack>
#include <iomanip>
#include <string>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <map>
#include <set>
#include <vector>
#include <utility>
#include <queue>
#include <cmath>
#define BEGIN(x) x.begin()
#define END(x) x.end()
#define ALL(x... | a.cc: In function 'int main(int, char**)':
a.cc:79:5: error: 'memset' was not declared in this scope
79 | memset(dp, -1, sizeof dp);
| ^~~~~~
a.cc:15:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
14 | #include <cmath>
+++ |+#include <cs... |
s994835836 | p03805 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i = 0;i < (n);i++)
using namespace std;
bool G[10][10];
int main(){}
int n,m;
cin >> n >> m;
rep(i,m){
int a,b;
cin >> a >> b;
a--; b--;
G[a][b] = G[b][a] = true;
}
vector<int> ord(n);
rep(i,n) ord[i] = i;
int... | a.cc:8:5: error: 'cin' does not name a type
8 | cin >> n >> m;
| ^~~
a.cc:2:18: error: expected unqualified-id before 'for'
2 | #define rep(i,n) for(int i = 0;i < (n);i++)
| ^~~
a.cc:9:5: note: in expansion of macro 'rep'
9 | rep(i,m){
| ^~~
a.cc:9:9: error... |
s908537413 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
const int nmax = 8;
bool G[nmax][nmax];
int DFS(int v, int N, bool has_visited[nmax]) {
bool has_visited_all = true;
for (int i = 0; i < N; i++) {
if (!has_visited[i]) has_visited_all = false;
}
if (has_visited_all) {
return 1;
}
int ret = 0;
for (... | a.cc: In function 'int DFS(int, int, bool*)':
a.cc:22:12: error: 'dfs' was not declared in this scope; did you mean 'ffs'?
22 | ret += dfs(i, N, has_visited);
| ^~~
| ffs
a.cc: In function 'int main()':
a.cc:36:21: error: request for member 'has_visited' in 'N', which is of non-... |
s570141849 | p03805 | C++ | #include <iostream>
using namespace std;
int N, M;
bool G[8][8] = {};
int main() {
cin >> N >> M;
for(int i = 0; i < M; ++i) {
int a, b; cin >> a >> b;
G[a-1][b-1] = G[b-1][a-1] = true;
}
// 全順列を生成
int linked_count = 0;
int p[8] = {0, 1, 2, 3, 4, 5, 6, 7};
do {
bo... | a.cc: In function 'int main()':
a.cc:29:13: error: 'next_permutation' was not declared in this scope
29 | } while(next_permutation(p + 1, p + N)); // N = 3のとき [p+1, p+2] = [p+1, p+3)
| ^~~~~~~~~~~~~~~~
|
s281609923 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina c... | a.cc: In function 'int main()':
a.cc:41:15: error: no match for 'operator==' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::vector<long long int> >, std::vector<long long int> >::value_type' {aka 'std::vector<long long int>'} and 'int')
41 | if(d[s] == 0)
In file included from /usr/include/c... |
s615411953 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina c... | a.cc: In function 'int main()':
a.cc:24:37: error: expected primary-expression before ')' token
24 | vector<vector<ll>> d(n, vector<ll>);
| ^
|
s981900358 | p03805 | C++ | あ | a.cc:1:1: error: '\U00003042' does not name a type
1 | あ
| ^~
|
s715024529 | p03805 | C++ | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
int find_num(int n, int k, vector<int> &inp) {
set<int> num;
if (k=2) {
for (int i=0; i<n; i++) {
for (int j=0; j<n; j++) {
if (i!=j){
num.insert(stoi(to_string(inp.at(i))+to_string(inp.... | a.cc: In function 'int find_num(int, int, std::__debug::vector<int>&)':
a.cc:44:15: error: missing template arguments before '.' token
44 | return set.size();
| ^
|
s205806051 | p03805 | C++ | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
int find_num(int n, int k, vector<int> &inp) {
set<int> num;
if (k=2) {
for (int i=0; i<n; i++) {
for (int j=0; j<n; j++) {
if (i!=j){
num.insert(stoi(to_string(inp.at(i))+to_string(inp.... | a.cc: In function 'int find_num(int, int, std::__debug::vector<int>&)':
a.cc:44:15: error: missing template arguments before '.' token
44 | return set.size();
| ^
a.cc: In function 'int main()':
a.cc:52:19: error: no match for call to '(std::__debug::vector<int>) (int&)'
52 | cin >... |
s438989342 | p03805 | C++ | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
int find_num(int n, int k, vector<int> &inp) {
set<int> num;
if (k=2) {
for (int i=0; i<n; i++) {
for (int j=0; j<n; j++) {
if (i!=j){
num.insert((int)(stoi(inp.at(i))+to_string(inp.at(j... | a.cc: In function 'int find_num(int, int, std::__debug::vector<int>&)':
a.cc:11:42: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
11 | num.insert((int)(stoi(inp.at(i))+to_string(inp.at(j))));
| ... |
s064885025 | p03805 | C++ | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
int find_num(int n, int k, vector<int> &inp) {
set<int> num;
if (k=2) {
for (int i=0; i<n; i++) {
for (int j=0; j<n; j++) {
if (i!=j){
num.insert((int)(to_string(inp.at(i))+to_string(inp... | a.cc: In function 'int find_num(int, int, std::__debug::vector<int>&)':
a.cc:11:32: error: invalid cast from type 'std::__cxx11::basic_string<char>' to type 'int'
11 | num.insert((int)(to_string(inp.at(i))+to_string(inp.at(j))));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~... |
s058417225 | p03805 | C++ | #define _DEBUG 1
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef _DEBUG
#define dump(x) cerr << #x << "=" << x << endl
#define dump2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define dump3(x, y, z) ... | a.cc: In function 'void solve(ll, ll, std::__debug::vector<long long int>, std::__debug::vector<long long int>)':
a.cc:57:1: error: 'ub' was not declared in this scope; did you mean 'b'?
57 | ub
| ^~
| b
|
s079439774 | p03805 | C | #include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
typedef struct element{
int a,b;
}element;
int path(element *a,int i,int pivot){
}
int main(void){
int numvertex,numedge;
int i,j=0;
int count=0;
int pivot;
int *trait;
element *edge;
scanf("%d %d",&numvertex,... | main.c: In function 'main':
main.c:34:24: error: expected expression before ')' token
34 | if()
| ^
|
s284383600 | p03805 | C++ | #include<iostream>
#include<vector>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
int per[8];
vector<int> g[8];
int n;
int m;
bool ispath(int x){
if(x == 0){
if(per[x] != 0){
return false;
}
}
// cout << x << endl;
if (x == n - 1){
return true;... | a.cc: In function 'int main()':
a.cc:49:12: error: 'next_permutation' was not declared in this scope
49 | }while(next_permutation(per, per + n));
| ^~~~~~~~~~~~~~~~
|
s644640745 | p03805 | C++ | #include<iostream>
using namespace std;
int dfs(bool** graph, int v, bool *visited, int N) {
visited[v] = true;
bool visit_a_vertex = false;
bool all_visited = true;
int ret = 0;
for(int i = 0; i < N; i++) {
if(graph[v][i] && !visited[i]) {
visit_a_vertex = true;
ret += dfs... | a.cc: In function 'int main()':
a.cc:33:28: error: cannot convert 'bool*' to 'bool**' in initialization
33 | bool **graph = new bool[N];
| ^
| |
| bool*
|
s135156210 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i =... | a.cc: In function 'int main()':
a.cc:67:25: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
67 | rep(i,n-2) if(G[g[i][i+1]]==0) ok=false;
| ^
|
s374324902 | p03805 | C++ | #include <iostream>
using namespace std;
vector<vector<bool>> graph(8,vector<bool>(8)) ;
int dfs(int v, int N, bool visit[8]){
bool all_Visit = true; // 変数:全て訪問済
// 全て訪問済か確認
for(int i = 0; i < N; i++){
if(visit[i] == false) all_Visit = false;
}
// 全て訪問のとき1を返して加える
if... | a.cc:3:1: error: 'vector' does not name a type
3 | vector<vector<bool>> graph(8,vector<bool>(8)) ;
| ^~~~~~
a.cc: In function 'int dfs(int, int, bool*)':
a.cc:22:12: error: 'graph' was not declared in this scope; did you mean 'isgraph'?
22 | if(graph[v][i] == false) continue; // 判定:入力時に値が入ってない
... |
s301936618 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
int main(){
int N,M;
cin >> N >> M;
vector<int> v;
for(int i = 0; i < N; i++){
v.push_back(i);
}
for(int i = 0; i < M; i++){
int a,b;
cin >> a >> b;
a--;
b--;
G[a].push_back(b);
G[b].push_back(a);... | a.cc: In function 'int main()':
a.cc:20:5: error: 'G' was not declared in this scope
20 | G[a].push_back(b);
| ^
a.cc:27:21: error: 'G' was not declared in this scope
27 | else if(count(G[v[i]].begin(),G[v[i]].end(),v[i + 1]) == 0){
| ^
|
s150823615 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
int main(){
int N,M;
cin >> N >> M;
vector<int> v;
for(int i = 0; i < N; i++){
v.push_back(i);
}
for(int i = 0; i < M; i++){
int a,b;
cin >> a >> b;
a--;
b--;
G[a].push_back(b);
G[b].push_back(a);... | a.cc: In function 'int main()':
a.cc:20:5: error: 'G' was not declared in this scope
20 | G[a].push_back(b);
| ^
a.cc:27:21: error: 'G' was not declared in this scope
27 | else if(count(G[v[i]].begin(),G[v[i]],end(),v[i + 1]) == 0){
| ^
a.cc:27:48: error: no matching ... |
s561700445 | p03805 | C++ | 3
1
2 1
1
1 1
1
2 0 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 3
| ^
|
s638623132 | p03805 | C++ | #include <iostream>
#include <vector>
using namespace std;
typedef pair<int,int> P;
int main(){
int n,m;cin>>n>>m;
vector<P> nya(m);
for(int i = 0; m > i; i++){
cin >> nya[i].first>>nya[i].second;
}
vector<int> Pa(n);
for(int i = 0; n > i; i++){
Pa[i] = i+1;
}
int ans = 0;
do{
bool ad = tr... | a.cc: In function 'int main()':
a.cc:32:10: error: 'next_permutation' was not declared in this scope
32 | }while(next_permutation(Pa.begin(),Pa.end()));
| ^~~~~~~~~~~~~~~~
|
s578370818 | p03805 | C++ | #include <iostream>
#include <vector>
using namespace std;
typedef pair<int,int> P;
int main(){
int n,m;cin>>n>>m;
vector<P> nya(m)
for(int i = 0; m > i; i++){
cin >> nya[i].first>>nya[i].second;
}
vector<int> P(n);
for(int i = 0; n > i; i++){
P[i] = i+1;
}
int ans = 0;
do{
bool ad = true;... | a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'for'
8 | for(int i = 0; m > i; i++){
| ^~~
a.cc:8:22: error: 'i' was not declared in this scope
8 | for(int i = 0; m > i; i++){
| ^
a.cc:32:17: warning: ignoring return value of 'std::vector<_Tp, ... |
s574027007 | p03805 | C++ | #include<iostream>
#include<vector>
#include<queue>
#include<string.h>
#include<algorithm>
#include<stack>
#include<set>
#include<numeric>
using namespace std;
int N,M;
int ans=0;
int graph[8][8];
void dfs(int i,int visited[N]);
int main(){
cin>>N>>M;
for (int m = 0; m < M; m++) {
int a;cin>>a;
int b;ci... | a.cc:16:28: error: size of array 'visited' is not an integral constant-expression
16 | void dfs(int i,int visited[N]);
| ^
a.cc:35:28: error: size of array 'visited' is not an integral constant-expression
35 | void dfs(int i,int visited[N]){
| ^
|
s553543441 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const double PI=3.14159265358979323846;
const int64_t waru = 1000000007;
const in INF=1<<30;
#define vec2(a,y,x) vector<vector<int>> a(y,vector<... | a.cc: In function 'int main()':
a.cc:44:7: error: 'ct' was not declared in this scope; did you mean 'cnt'?
44 | cout<<ct<<endl;
| ^~
| cnt
|
s975898529 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
bool check(vector<int> &p,vector<vector<int>> &v)
{
for(int i=0;i<p.size()-1;i++)
if(v[p[i]][p[i+1]]==0)
return false;
return true;
}
int main()
{
int n,m;
cin>>n>>m;
vector<vector<int>> v(n,vector<int>(n,0));
for(int i=0;i<n;i++)
{
int a,b;
c... | a.cc: In function 'int main()':
a.cc:30:45: error: expected ')' before ';' token
30 | }while(next_permutation(p.begin(),p.end());
| ~ ^
| )
|
s766417275 | p03805 | C++ | #include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),... | a.cc: In function 'int main()':
a.cc:56:32: error: no match for 'operator+' (operand types are 'long long int' and 'vll' {aka 'std::vector<long long int>'})
56 | else if(t[i]==b[j]&&t[i+a]==a[j]){
| ~^~
| | |
| ... |
s955025359 | p03805 | Java | import java.util.*;
public class Main {
static int n;
static int count = 0;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
List<Integer> nodes = new ArrayList<>();
while(sc.hasNext()) {
... | Main.java:29: error: incompatible types: unexpected return value
return count;
^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
|
s946535486 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
const int nmax=8;
bool graph[nmax][nmax];
bool visited[N]={};
int dsp(int viNodes,int nownode,bool visited[],int N){
visited[nownode]=true;
int ret=0;
for(int i=0;i<N;i++){
if(visited[i])continue;
if(!graph[nownode][i])continue;
if(viNod... | a.cc:8:16: error: 'N' was not declared in this scope
8 | bool visited[N]={};
| ^
a.cc: In function 'int main()':
a.cc:40:13: error: 'j' was not declared in this scope
40 | cin>>i>>j;
| ^
|
s032795433 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
const int nmax=8;
bool graph[nmax][nmax];
bool visited[N]={};
bool visited[N]={};
int dsp(int viNodes,int nownode,bool visited[],int N){
visited[nownode]=true;
int ret=0;
for(int i=0;i<N;i++){
if(visited[i])continue;
if(!graph[nownode][i])continu... | a.cc:5:14: error: 'N' was not declared in this scope
5 | bool visited[N]={};
| ^
a.cc:9:16: error: 'N' was not declared in this scope
9 | bool visited[N]={};
| ^
a.cc: In function 'int main()':
a.cc:38:19: error: 'visited' was not declared in this scope
38 | for(i=... |
s641691043 | p03805 | C++ | #include <iostream>
#include <vector>
using namespace std;
bool G[10][10];
int main(){
int N, M; cin >> N >> M;
for(int i=0; i<M; i++){
int a,b; cin >> a >> b; --a, --b;
G[a][b] = G[b][a] = true;
}
vector<int> ord(N);
for(int i=0; i<N; i++){
ord[i] = i;
}
int res ... | a.cc: In function 'int main()':
a.cc:30:12: error: 'next_permutation' was not declared in this scope
30 | }while(next_permutation(ord.begin(), ord.end()));
| ^~~~~~~~~~~~~~~~
|
s288359094 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
using Graph=vector<vector<int>>;
int sum=0;
void dfs(Graph &g,vector<bool> visit,int v){
for(auto nv:g.at(v)){
vector<bool> fin(visit.size(),true);
if(visit==fin){
sum++;
break;
}
if(visit[nv]){
continue;
}
visit[nv]=true;
d... | a.cc: In function 'int main()':
a.cc:28:5: error: 'G' was not declared in this scope
28 | G.at(a-1).push_back(b-1);
| ^
|
s729800246 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
using Graph=vector<vector<int>>;
int sum=0;
void dfs(Graph &g,vector<bool> visit,int v){
for(auto nv:g.at(v)){
vector<bool> fin(visit.size(),true)
if(visit==fin){
sum++;
break;
}
if(visit[nv]){
continue;
}
visit[nv]=true;
df... | a.cc: In function 'void dfs(Graph&, std::vector<bool>, int)':
a.cc:10:5: error: expected ',' or ';' before 'if'
10 | if(visit==fin){
| ^~
a.cc: In function 'int main()':
a.cc:28:5: error: 'G' was not declared in this scope
28 | G.at(a-1).push_back(b-1);
| ^
|
s410096998 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
using Graph=vector<vector<int>>;
int sum=0;
void dfs(Graph &g,vector<bool> visit,int v){
for(auto nv:g.at(v)){
if(visit==make_vector<bool>(visit.size(),true)){
sum++;
break;
}
if(visit[nv]){
continue;
}
visit[nv]=true;
dfs(g,vis... | a.cc: In function 'void dfs(Graph&, std::vector<bool>, int)':
a.cc:9:15: error: 'make_vector' was not declared in this scope
9 | if(visit==make_vector<bool>(visit.size(),true)){
| ^~~~~~~~~~~
a.cc:9:27: error: expected primary-expression before 'bool'
9 | if(visit==make_vector<bool>(... |
s988895434 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
using Graph=vector<vector<int>>;
int sum=0;
void dfs(Graph &g,vector<bool> visit,int v){
for(auto nv:g.at(i)){
if(visit==make_vector<bool>(visit.size(),true)){
sum++;
break;
}
if(visit[nv]){
continue;
}
visit[nv]=true;
dfs(g,vis... | a.cc: In function 'void dfs(Graph&, std::vector<bool>, int)':
a.cc:8:20: error: 'i' was not declared in this scope
8 | for(auto nv:g.at(i)){
| ^
a.cc:9:15: error: 'make_vector' was not declared in this scope
9 | if(visit==make_vector<bool>(visit.size(),true)){
| ... |
s467153606 | p03805 | C++ | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
const int MOD = 1000000007;
const int INF_32 = 1LL << 30;
const int64_t INF_64 = 1LL << 60;
template <class T>
inline bool chmin(T& a, T b)
{
... | a.cc: In function 'int main()':
a.cc:74:7: error: 'using Graph = class std::vector<std::vector<int> >' {aka 'class std::vector<std::vector<int> >'} has no member named 'assing'; did you mean 'assign'?
74 | G.assing(N, vector<int>());
| ^~~~~~
| assign
|
s236943754 | p03805 | C++ | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
const int MOD = 1000000007;
const int INF_32 = 1LL << 30;
const int64_t INF_64 = 1LL << 60;
template <class T>
inline bool chmin(T& a, T b)
{
... | a.cc: In function 'int dfs(int, std::vector<bool>&, int&)':
a.cc:55:41: error: expected ')' before ';' token
55 | for (int i = 0; i < seen.size(); i++;)
| ~ ^
| )
a.cc:55:42: error: expected primary-expression before ')' to... |
s569552741 | p03805 | C++ | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
const int MOD = 1000000007;
const int INF_32 = 1LL << 30;
const int64_t INF_64 = 1LL << 60;
template <class T>
inline bool chmin(T& a, T b)
{
... | a.cc: In function 'int dfs(int, std::vector<bool>&, int&)':
a.cc:55:41: error: expected ')' before ';' token
55 | for (int i = 0; i < seen.size(); i++;)
| ~ ^
| )
a.cc:55:42: error: expected primary-expression before ')' to... |
s649405315 | p03805 | C++ | #include <bits/stdc++.h>
#define ll long long
#define MAX_N 8
using namespace std;
int m,n;
bool G[MAX_N][MAX_N];
bool visited[MAX_N];
int dfs(int u, bool visited2[MAX_N]){
bool flag = true;
for(int i =0; i < n; ++i){
if( !visited2[i] ){
flag = false;
break;
}
}
... | a.cc: In function 'int dfs(int, bool*)':
a.cc:21:20: error: 'i' was not declared in this scope
21 | for(int v = 0; i < n; v++){
| ^
|
s406880417 | p03805 | C++ | #include <bits/stdc++.h>
#define ll long long
#define MAX_N 8
using namespace std;
int m,n;
bool G[MAX_N][MAX_N];
bool visited[MAX_N];
int dfs(int u, bool visited2[MAX_N]){
bool flag = true;
for(int i =0; i < n; ++i){
if( !visited2[i] ){
flag = false;
break;
}
}
... | a.cc: In function 'int dfs(int, bool*)':
a.cc:21:20: error: 'i' was not declared in this scope
21 | for(int v = 0; i < n; v++){
| ^
a.cc: In function 'int main()':
a.cc:34:14: error: expected ';' before ':' token
34 | cin>>n>>m:
| ^
| ;
a.cc:3... |
s796871904 | p03805 | C++ | #include <bits/stdc++.h>
#define ll long long
#define MAX_N 8
using namespace std;
int G[MAX_N][MAX_N];
int n,m;
bool visited[MAX_N];
void dfs(int u, bool visited2[MAX_N]){
bool flag = true;
for(int i = 0; i < n; i++){
if( !visited2[i] ){
flag = false;
break;
}
}
... | a.cc: In function 'void dfs(int, bool*)':
a.cc:18:21: error: return-statement with a value, in function returning 'void' [-fpermissive]
18 | if(flag) return 1;
| ^
a.cc:25:23: error: void value not ignored as it ought to be
25 | res += dfs( v, visited2);
| ... |
s704475698 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
bool flag[10];
int N,M;
vector<vector<int>>G;
int rec(int now){
flag[now]=true;
int cnt=0;
for(int i=1;i<=N;i++){
if(!flag[i])break;
cnt++;
}
if(cnt==N)return 1;
int ans=0;
for(auto e:G[now]){
if(!flag[e]){
ans+=rec(G,e);
flag[e]=false;
... | a.cc: In function 'int rec(int)':
a.cc:17:16: error: cannot convert 'std::vector<std::vector<int> >' to 'int'
17 | ans+=rec(G,e);
| ^
| |
| std::vector<std::vector<int> >
a.cc:6:13: note: initializing argument 1 of 'int rec(int)'
6 | int rec(... |
s584142276 | p03805 | C++ | #include <bits/stdc++.h>
#define ll long long
#define MAX_N 8
#define WHITE 0
#define GRAY 1
#define BLACK 2
using namespace std;
vector<vector<int>> M[MAX_N][MAX_N];
int n,e;
int dfs_visit(int u,int color2[MAX_N]){
bool all_visited = true;
for(int i =0;i<n;i++){
if(color2[i] == WHITE) {
... | a.cc: In function 'int dfs_visit(int, int*)':
a.cc:24:20: error: no match for 'operator==' (operand types are 'std::vector<std::vector<int> >' and 'int')
24 | if(M[u][v] == 0)continue;
| ~~~~~~~ ^~ ~
| | |
| | int
| s... |
s323823950 | p03805 | C++ | #include <bits/stdc++.h>
#define ll long long
#define MAX_N 8
#define WHITE 0
#define GRAY 1
#define BLACK 2
using namespace std;
vector<vector<int>> M[MAX_N][MAX_N];
int n,e;
int dfs_visit(int u,int color2[MAX_N]){
bool all_visited = true;
for(int i =0;i<n;i++){
if(color2[i] == WHITE) {
... | a.cc: In function 'int dfs_visit(int, int*)':
a.cc:24:20: error: no match for 'operator==' (operand types are 'std::vector<std::vector<int> >' and 'int')
24 | if(M[u][v] == 0)continue;
| ~~~~~~~ ^~ ~
| | |
| | int
| s... |
s450217366 | p03805 | C++ | #include <bits/stdc++.h>
#define ll long long
#define MAX_N 8
#define WHITE 0
#define GRAY 1
#define BLACK 2
using namespace std;
vector<int> M[MAX_N][MAX_N];
int n,e;
int dfs_visit(int u,int color2[MAX_N]){
bool all_visited = true;
for(int i =0;i<n;i++){
if(color2[i] == WHITE) {
all_visi... | a.cc: In function 'int dfs_visit(int, int*)':
a.cc:24:20: error: no match for 'operator==' (operand types are 'std::vector<int>' and 'int')
24 | if(M[u][v] == 0)continue;
| ~~~~~~~ ^~ ~
| | |
| | int
| std::vector<int... |
s556960583 | p03805 | C++ | #include <bits/stdc++.h>
#define ll long long
#define MAX_N 8
#define WHITE 0
#define GRAY 1
#define BLACK 2
using namespace std;
int M[8][8];
int n,e;
int dfs_visit(int u,int color2[MAX_N]){
bool all_visited = true;
for(int i =0;i<n;i++){
if(color2[i] == WHITE) {
all_visited = false;
... | a.cc: In function 'int dfs_visit(int, int*)':
a.cc:33:5: error: 'retrn' was not declared in this scope
33 | retrn res;
| ^~~~~
a.cc:32:15: warning: control reaches end of non-void function [-Wreturn-type]
32 | color2[u] = BLACK;
| ^
|
s236909382 | p03805 | C++ | #include <bits/stdc++.h>
#define ll long long
#define MAX_N 8
#define WHITE 0
#define GRAY 1
#define BLACK 2
using namespace std;
int M[8][8];
int n,e;
int dfs_visit(int u,int color2[MAX_N]){
bool all_visited = true;
for(int i =0;i<n;i++){
if(color2[i] == WHITE) {
all_visited = false;
... | a.cc: In function 'int dfs_visit(int, int*)':
a.cc:28:29: error: too few arguments to function 'int dfs_visit(int, int*)'
28 | res += dfs_visit(v);
| ~~~~~~~~~^~~
a.cc:13:5: note: declared here
13 | int dfs_visit(int u,int color2[MAX_N]){
| ^~~~~~~~~
a.cc:33:5: error... |
s241299111 | p03805 | C++ | #include <bits/stdc++.h>
#define ll long long
#define WHITE 0
#define GRAY 1
#define BLACK 2
using namespace std;
int M[8][8];
int n,e;
int dfs_visit(int u,int color2[n]){
bool all_visited = true;
for(int i =0;i<n;i++){
if(color2[i] == WHITE) {
all_visited = false;
break;
... | a.cc:12:32: error: size of array 'color2' is not an integral constant-expression
12 | int dfs_visit(int u,int color2[n]){
| ^
a.cc: In function 'int dfs_visit(int, int*)':
a.cc:27:29: error: too few arguments to function 'int dfs_visit(int, int*)'
27 | res += dfs_v... |
s737910729 | p03805 | C++ | #include <bits/stdc++.h>
#define ll long long
#define WHITE 0
#define GRAY 1
#define BLACK 2
using namespace std;
int M[8][8];
int n,e;
int dfs_visit(int u,int color2[]){
bool all_visited = true;
for(int i =0;i<n;i++){
if(color2[i] == WHITE) {
all_visited = false;
break;
... | a.cc: In function 'int dfs_visit(int, int*)':
a.cc:27:29: error: too few arguments to function 'int dfs_visit(int, int*)'
27 | res += dfs_visit(v);
| ~~~~~~~~~^~~
a.cc:12:5: note: declared here
12 | int dfs_visit(int u,int color2[]){
| ^~~~~~~~~
a.cc:28:13: error: 'c... |
s927181521 | p03805 | C++ | #include <bits/stdc++.h>
#define ll long long
#define WHITE 0
#define GRAY 1
#define BLACK 2
using namespace std;
int M[8][8];
int dfs_visit(int u,int color2){
bool all_visited = true;
for(int i =0;i<n;i++){
if(color2[i] == WHITE) {
all_visited = false;
break;
}
}
... | a.cc: In function 'int dfs_visit(int, int)':
a.cc:13:20: error: 'n' was not declared in this scope
13 | for(int i =0;i<n;i++){
| ^
a.cc:14:18: error: invalid types 'int[int]' for array subscript
14 | if(color2[i] == WHITE) {
| ^
a.cc:22:11: error: invali... |
s670334501 | p03805 | C++ | #include <bits/stdc++.h>
#define ll long long
using namespace std;
#define MAX_V 8
vector<int> G[MAX_V];
int visited[ MAX_V ] ;
int nt[ MAX_V ] ;
int cnt = 0;
int res = 0;
int V,E;
int s,t;
int next(int u){
for(int v = nt[u]; v < G[u].size(); v++){
int nt[u] = v;
if( G[u][v] )return v;
}
... | a.cc: In function 'int next(int)':
a.cc:17:21: error: array must be initialized with a brace-enclosed initializer
17 | int nt[u] = v;
| ^
a.cc: In function 'int dfs()':
a.cc:45:1: warning: no return statement in function returning non-void [-Wreturn-type]
45 | }
| ^
|
s765934052 | p03805 | C++ | #include <bits/stdc++.h>
#define ll long long
using namespace std;
#define MAX_V 8
vector<int> G[MAX_V];
int visited[ MAX_V ] ;
int nt[ MAX_V ] ;
int cnt = 0;
int res = 0;
int V,E;
int s,t;
int next(int u){
for(int v = nt[u]; v < G[u].size(); v++){
int nt[u] = v+1;
if( G[u][v] )return v;
}... | a.cc: In function 'int next(int)':
a.cc:17:22: error: array must be initialized with a brace-enclosed initializer
17 | int nt[u] = v+1;
| ~^~
a.cc: In function 'int dfs()':
a.cc:45:1: warning: no return statement in function returning non-void [-Wreturn-type]
45 | }
| ^
|
s943868866 | p03805 | C++ | #include <bits/stdc++.h>
#define ll long long
using namespace std;
#define MAX_V 8
vector<int> G[MAX_V][MAX_V];
int visited[ MAX_V ] ;
int nt[ MAX_V ] ;
int cnt = 0;
int res = 0;
int V,E;
int s,t;
int next(int u){
for(int j = nt[u]; j < G[u].size(); j++){
int v = G[u][j];
if( visited[v] != 1 )... | a.cc: In function 'int next(int)':
a.cc:16:34: error: request for member 'size' in 'G[u]', which is of non-class type 'std::vector<int> [8]'
16 | for(int j = nt[u]; j < G[u].size(); j++){
| ^~~~
a.cc:17:23: error: cannot convert 'std::vector<int>' to 'int' in initializatio... |
s259028712 | p03805 | C++ | #include <bits/stdc++.h>
#define ll long long
using namespace std;
#define MAX_V 8
vector<vector<int>> G[MAX_V][MAX_V];
int visited[ MAX_V ] ;
int nt[ MAX_V ] ;
int cnt = 0;
int res = 0;
int V,E;
int s,t;
int next(int u){
for(int j = nt[u]; j < G[u].size(); j++){
int v = G[u][j];
if( visited[v... | a.cc: In function 'int next(int)':
a.cc:16:34: error: request for member 'size' in 'G[u]', which is of non-class type 'std::vector<std::vector<int> > [8]'
16 | for(int j = nt[u]; j < G[u].size(); j++){
| ^~~~
a.cc:17:23: error: cannot convert 'std::vector<std::vector<int> ... |
s748662879 | p03805 | C++ | #include <bits/stdc++.h>
#define ll long long
using namespace std;
#define MAX_V 8
vector<vector<<int>> G[MAX_V][MAX_V];
int visited[ MAX_V ] ;
int nt[ MAX_V ] ;
int cnt = 0;
int res = 0;
int V,E;
int s,t;
int next(int u){
for(int j = nt[u]; j < G[u].size(); j++){
int v = G[u][j];
if( visited[... | a.cc:7:19: error: template argument 1 is invalid
7 | vector<vector<<int>> G[MAX_V][MAX_V];
| ^~
a.cc:7:19: error: template argument 2 is invalid
a.cc: In function 'int next(int)':
a.cc:16:34: error: request for member 'size' in 'G[u]', which is of non-class type 'int [8]'
16 | for(int... |
s490884821 | p03805 | C++ | #include <bits/stdc++.h>
#define ll long long
using namespace std;
#define MAX_V 8
vector<int> G[ MAX_V ]
vector<int> visited[ MAX_V ] ;
int nt[ MAX_V ] ;
int cnt = 0;
int res = 0;
int V,E;
int s,t;
int next(int u){
for(int j = nt[u]; j < G[u].size(); j++){
int v = G[u][j];
if( visited[v] != 1... | a.cc:8:1: error: expected initializer before 'vector'
8 | vector<int> visited[ MAX_V ] ;
| ^~~~~~
a.cc: In function 'int next(int)':
a.cc:16:29: error: 'G' was not declared in this scope
16 | for(int j = nt[u]; j < G[u].size(); j++){
| ^
a.cc:18:13: error: 'visited' w... |
s577593785 | p03805 | C++ | #include <bits/stdc++.h>
#define ll long long
using namespace std;
#define MAX_V 8
vector<int> G[ MAX_V ]
int visited[ MAX_V ] ;
int nt[ MAX_V ] ;
int cnt = 0;
int res = 0;
int V,E;
int s,t;
int next(int u){
for(int j = nt[u]; j < G[u].size(); j++){
int v = G[u][j];
if( visited[v] != 1 ){
... | a.cc:8:1: error: expected initializer before 'int'
8 | int visited[ MAX_V ] ;
| ^~~
a.cc: In function 'int next(int)':
a.cc:16:29: error: 'G' was not declared in this scope
16 | for(int j = nt[u]; j < G[u].size(); j++){
| ^
a.cc:18:13: error: 'visited' was not declare... |
s810989923 | p03805 | C++ | #include <bits/stdc++.h>
#define ll long long
using namespace std;
#define MAX_V 8
vector<int> G[ MAX_V ] ;
bool visited[ MAX_V ] ;
int nt[ MAX_V ] ;
int cnt = 0;
int res = 0;
int next(int u){
for(int j = nt[u]; j < G[u].size(); j++){
int v = G[u][j];
if( !visited[v] ){
nt[u] = j;
... | a.cc: In function 'int dfs()':
a.cc:31:19: error: 'V' was not declared in this scope
31 | if(cnt == V)res++;
| ^
a.cc:44:1: warning: no return statement in function returning non-void [-Wreturn-type]
44 | }
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.