submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s036066766 | 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 | }
| ^
|
s194547623 | 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 | }
| ^
|
s054301174 | 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:58:7: error: stray '#' in program
58 | pr#include <bits/stdc++.h>
| ^
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 [-Wretu... |
s741553611 | p03805 | C++ | #include <bits/stdc++.h>
#define ll long long
using namespace std;
constant int 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]... | a.cc:5:1: error: 'constant' does not name a type; did you mean 'const'?
5 | constant int MAX_V = 8;
| ^~~~~~~~
| const
a.cc:7:16: error: 'MAX_V' was not declared in this scope
7 | vector<int> G[ MAX_V ] ;
| ^~~~~
a.cc:8:15: error: 'MAX_V' was not declared in this scope
8 | b... |
s396073375 | p03805 | C++ | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int 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:7:16: error: size of array 'G' is not an integral constant-expression
7 | vector<int> G[ MAX_V ] ;
| ^~~~~
a.cc:8:15: error: size of array 'visited' is not an integral constant-expression
8 | bool visited[ MAX_V ] ;
| ^~~~~
a.cc:9:9: error: size of array 'nt' is not... |
s515964708 | p03805 | C++ | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int 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:7:15: error: size of array 'G' is not an integral constant-expression
7 | vector<int> G[MAX_V];
| ^~~~~
a.cc:8:14: error: size of array 'visited' is not an integral constant-expression
8 | bool visited[MAX_V];
| ^~~~~
a.cc:9:8: error: size of array 'nt' is not an inte... |
s821475981 | p03805 | C++ | #include <bits/stdc++.h>
#define ll long long
using namespace std;
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;
return v;
... | a.cc:5:15: error: 'MAX_V' was not declared in this scope
5 | vector<int> G[MAX_V];
| ^~~~~
a.cc:6:14: error: 'MAX_V' was not declared in this scope
6 | bool visited[MAX_V];
| ^~~~~
a.cc:7:8: error: 'MAX_V' was not declared in this scope
7 | int nt[MAX_V];
| ... |
s023175107 | p03805 | C++ | /*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int MAX = 510000;
const int MOD = 1000000007;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define Rep(i, n) for(ll i = 1; i < (n); i++)
#define ALL(a) (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(... | a.cc: In function 'int main()':
a.cc:145:11: error: no matching function for call to 'std::vector<std::vector<long long int> >::assign(ll&, std::vector<int>)'
145 | G.assign(n,vector<int>());
| ~~~~~~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
from /usr/include/... |
s196368221 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
const int max = 8;
bool g[max][max];
int dfs(int k, int n, bool vis[])
{
bool check = true;
for(int i = 0; i < n; i++)
if(vis[i] == false)
check = false;
if(check)
return 1;
int res = 0;
for(int i = 0; i < n; i++)
{
if(g[k][i] == f... | a.cc:5:8: error: reference to 'max' is ambiguous
5 | bool g[max][max];
| ^~~
In file included from /usr/include/c++/14/algorithm:61,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates ar... |
s099762987 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
int n,m,a,b,ans;
vector<int> path[10];
bool reached[10];
void dfs(int x){
reached[x] = true;
int c = 0;
for(int i=0;i<n;++i)
if(reached[i]) c++;
if(c==n){
ans++;
return;
}
for(auto &i:path[x]){
if(reaced[i]) continue;
dfs(i);
reached[i] = ... | a.cc: In function 'void dfs(int)':
a.cc:16:8: error: 'reaced' was not declared in this scope; did you mean 'reached'?
16 | if(reaced[i]) continue;
| ^~~~~~
| reached
|
s824849255 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
int n,m,a,b,ans;
bool reached[10];
void dfs(int x){
reached[x] = true;
int c = 0;
for(int i=0;i<n;++i)
if(reached[i]) c++;
if(c==n){
ans++;
return;
}
for(auto &i:path[x]){
if(reaced[i]) continue;
dfs(i);
reached[i] = false;
}
}
int main... | a.cc: In function 'void dfs(int)':
a.cc:14:15: error: 'path' was not declared in this scope; did you mean 'std::filesystem::__cxx11::path'?
14 | for(auto &i:path[x]){
| ^~~~
| std::filesystem::__cxx11::path
In file included from /usr/include/c++/14/filesystem:52,
... |
s888568021 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
int n,m,a,b,ans;
bool reaced[10];
void dfs(int x){
reached[x] = true;
int c = 0;
for(int i=0;i<n;++i)
if(reached[i]) c++;
if(c==n){
ans++;
return;
}
for(auto &i:path[x]){
if(reaced[i]) continue;
dfs(i);
reached[i] = false;
}
}
int main(... | a.cc: In function 'void dfs(int)':
a.cc:6:3: error: 'reached' was not declared in this scope; did you mean 'reaced'?
6 | reached[x] = true;
| ^~~~~~~
| reaced
a.cc:14:15: error: 'path' was not declared in this scope; did you mean 'std::filesystem::__cxx11::path'?
14 | for(auto &i:path[x]){
... |
s636954873 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
int n,m,a,b,ans;
bool reaced[10];
void dfs(x){
reached[x] = true;
int c = 0;
for(int i=0;i<n;++i)
if(reached[i]) c++;
if(c==n){
ans++;
return;
}
for(auto &i:path[x]){
if(reaced[i]) continue;
dfs(i);
reached[i] = false;
}
ans = 0;
for... | a.cc:5:6: error: variable or field 'dfs' declared void
5 | void dfs(x){
| ^~~
a.cc:5:10: error: 'x' was not declared in this scope
5 | void dfs(x){
| ^
a.cc: In function 'int main()':
a.cc:33:22: error: no matching function for call to 'std::vector<std::vector<int> >::push_back(int&)'
... |
s840311267 | 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;
for(int i=0;i<N;i++){
if(graph[v][i]==false)continue;
if(v... | a.cc: In function 'int main()':
a.cc:33:40: error: 'fasle' was not declared in this scope
33 | for(int i=0;i<N;i++)visited[i]=fasle;
| ^~~~~
|
s771908278 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
int main(){
int n,m;
cin >> n >> m;
vector<vector<bool>> g[10][10];
for(int i=0;i<m;i++){
int from,to;
cin >> from >> to;
from--;
to--;
g[from][to]=true;
g[to][from]=true;
}
vector<int> p(n);
for(int i=0;i<n;i... | a.cc: In function 'int main()':
a.cc:15:17: error: no match for 'operator=' (operand types are 'std::vector<std::vector<bool> >' and 'bool')
15 | g[from][to]=true;
| ^~~~
In file included from /usr/include/c++/14/vector:72,
from /usr/include/c++/14/functional:64,
... |
s923515708 | p03805 | C++ | int main() {
int n, m;
cin >> n >> m;
vector<vector<bool>> check(n, vector<bool>(m, false));
for (int i = 0; i < m; i++) {
int a, b; cin >> a >> b; a--; b--;
check[a][b] = check[b][a] = true;
}
vector<int> ord(n);
for (int i = 0; i < n; i++) {
ord[i] = i;
}
int ans = 0;
do {
if (o... | a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
3 | cin >> n >> m;
| ^~~
a.cc:5:3: error: 'vector' was not declared in this scope
5 | vector<vector<bool>> check(n, vector<bool>(m, false));
| ^~~~~~
a.cc:5:17: error: expected primary-expression before 'bo... |
s623072197 | p03805 | C++ | #include <iostream>
#include <vector>
#include <numeric>
using namespace std;
using Graph = vector<vector<int>>;
int ans=0;
int N,M;
// 深さ優先探索
void dfs(const Graph &G, int v,vector<int> seen) {
seen[v] = 1; // v を訪問済にする
if(accumulate(seen.begin(),seen.end(),0)==N)ans++;
// v から行ける各頂点 next_v について
for (a... | a.cc: In function 'void dfs(const Graph&, int, std::vector<int>)':
a.cc:16:37: error: expected primary-expression before 'seen'
16 | dfs(G, next_v, vector<bool> seen); // 再帰的に探索
| ^~~~
|
s544903534 | p03805 | C++ | #include <iostream>
#include <vector>
#include <numeric>
using namespace std;
using Graph = vector<vector<int>>;
int ans=0;
int N,M;
// 深さ優先探索
void dfs(const Graph &G, int v,vector<int> seen) {
seen[v] = 1; // v を訪問済にする
if(accumulate(seen.begin(),seen.end(),0)==N)ans++;
// v から行ける各頂点 next_v について
for (a... | a.cc: In function 'void dfs(const Graph&, int, std::vector<int>)':
a.cc:16:37: error: expected primary-expression before 'seen'
16 | dfs(G, next_v, vector<bool> seen); // 再帰的に探索
| ^~~~
a.cc: In function 'int main()':
a.cc:34:5: error: 'seen' was not declared in this ... |
s076937794 | p03805 | C++ | #include <iostream>
#include <vector>
#include <numeric>
using namespace std;
using Graph = vector<vector<int>>;
int ans=0;
// 深さ優先探索
void dfs(const Graph &G, int v,vector<int> seen) {
seen[v] = 1; // v を訪問済にする
if(accumulate(seen.begin(),seen.end(),0)==N)ans++;
// v から行ける各頂点 next_v について
for (auto next_... | a.cc: In function 'void dfs(const Graph&, int, std::vector<int>)':
a.cc:11:47: error: 'N' was not declared in this scope
11 | if(accumulate(seen.begin(),seen.end(),0)==N)ans++;
| ^
a.cc:15:37: error: expected primary-expression before 'seen'
15 | dfs... |
s843098770 | p03805 | C++ | #include <iostream>
#include <vector>
using namespace std;
using Graph = vector<vector<int>>;
int ans=0;
// 深さ優先探索
void dfs(const Graph &G, int v,vector<int> seen) {
seen[v] = 1; // v を訪問済にする
if(accumulate(seen.begin(),seen.end(),0)==N)ans++;
// v から行ける各頂点 next_v について
for (auto next_v : G[v]) {
... | a.cc: In function 'void dfs(const Graph&, int, std::vector<int>)':
a.cc:10:8: error: 'accumulate' was not declared in this scope
10 | if(accumulate(seen.begin(),seen.end(),0)==N)ans++;
| ^~~~~~~~~~
a.cc:10:47: error: 'N' was not declared in this scope
10 | if(accumulate(seen.begin(),seen.end(... |
s939125015 | p03805 | Java | import java.util.*;
public class Main {
static int[][] dp;
static Node[] v;
static ArrayList<Integer> edges[];
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = Integer.parseInt(sc.next()), M = Integer.parseInt(sc.next());
edges=new ArrayList[N];
for(int i=0;i<N;i++) edg... | Main.java:5: error: cannot find symbol
static Node[] v;
^
symbol: class Node
location: class Main
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
|
s653308137 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
//入力を受け取る
int N ;
cin >> N ;
int M ;
cin >> M;
vector<int> S;
for(int i=0;i < 2M;i++){
cin >> S.at(i)
}
//テストコード
for(int j=0;j<M; j++){
cout << S.at(2j);
cout << S.at(2j+1) << endl;
}
} | a.cc: In function 'int main()':
a.cc:15:17: error: unable to find numeric literal operator 'operator""M'
15 | for(int i=0;i < 2M;i++){
| ^~
a.cc:16:19: error: expected ';' before '}' token
16 | cin >> S.at(i)
| ^
| ;
17 | }
| ~ ... |
s583827763 | p03805 | C++ | #include <bits/stdc++.h>
#include <algorithm>
using namespace std;
bool abc[8][8];
int dfs(int a,int b,bool c[8]){
bool abcd=true;
for(int i=0;i<b;i++){
if(c[i]==false)
abcd=false;
}
if(abcd)
return 1;
int d=0;
for(int i=0;i<b;i++){
if(abc[a][i]==false)continue;
if(c[i])contin... | a.cc: In function 'int dfs(int, int, bool*)':
a.cc:24:14: error: 'n' was not declared in this scope
24 | d+=dfs(i,n,c);
| ^
|
s015739846 | p03805 | C++ | #include <bits/stdc++.h>
#include <algorithm>
using namespace std;
bool abc[8][8];
int dfs(int a,int b,bool c[8]){
bool abcd=true;
for(int i=0;i<b;i++){
if(c[i]==false)
abcd=false;
}
if(abcd)
return 1;
int d=0;
for(int i=0;i<b;i++){
if(abc[a][i]==false)continue;
if(c[i])contin... | a.cc: In function 'int dfs(int, int, bool*)':
a.cc:24:14: error: 'n' was not declared in this scope
24 | d+=dfs(i,n,visited);
| ^
a.cc:24:16: error: 'visited' was not declared in this scope
24 | d+=dfs(i,n,visited);
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:46:... |
s306435827 | p03805 | C++ | /*
このコード、と~おれ!
Be accepted!
∧_∧
(。・ω・。)つ━☆・*。
⊂ ノ ・゜+.
しーJ °。+ *´¨)
.· ´¸.·*´¨) ¸.·*¨)
(¸.·´ (¸.·'* ☆
*/
#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#includ... | a.cc: In function 'void printb(unsigned int)':
a.cc:220:52: error: 'CHAR_BIT' was not declared in this scope
220 | unsigned int mask = (int)1 << (sizeof(v) * CHAR_BIT - 1);
| ^~~~~~~~
a.cc:24:1: note: 'CHAR_BIT' is defined in header '<climits>'; this is... |
s601844847 | p03805 | C++ | #include <iostream> | /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
|
s476538031 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
int m[9][9];
int vis[9];
int sum,n;
void dfs(int cot,int num){
if(num==n){
sum++;
return;
}
for(int i=2;i<10;i++){
if(m[cot][i]==1&&vis[i]==0){
vis[i]=1;
dfs(i,num+1);
vis[i]=0;
}
}
}
int mai... | a.cc: In function 'int main()':
a.cc:24:10: error: invalid types 'int[int]' for array subscript
24 | m[a][b]=1;
| ^
a.cc:25:10: error: invalid types 'int[int]' for array subscript
25 | m[b][a]=1;
| ^
|
s716190526 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
int m[9][9];
int vis[9][9];
int sum,n;
void dfs(int cot,int num){
if(num==n){
sum++;
return;
}
for(int i=2;i<10;i++){
if(m[cot][i]==1&&vis[cot][i]==0){
vis[i]=1;
dfs(i,num+1);
vis[i]=0;
}
}
}... | a.cc: In function 'void dfs(int, int)':
a.cc:13:19: error: incompatible types in assignment of 'int' to 'int [9]'
13 | vis[i]=1;
| ~~~~~~^~
a.cc:15:19: error: incompatible types in assignment of 'int' to 'int [9]'
15 | vis[i]=0;
| ~~~~~~^~
a.cc: In funct... |
s093871553 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
int m[9][9];
int vis[9][9];
int sum,n;
void dfs(int cot,int num){
if(num==n){
sum++;
return
}
for(int i=2;i<10;i++){
if(m[cot][i]==1&&vis[cot][i]==0){
vis[i]=1;
dfs(i,num+1);
vis[i]=0;
}
}
}
... | a.cc: In function 'void dfs(int, int)':
a.cc:10:5: error: expected primary-expression before '}' token
10 | }
| ^
a.cc:9:15: error: expected ';' before '}' token
9 | return
| ^
| ;
10 | }
| ~
a.cc:13:19: error: incompatible ... |
s323518326 | p03805 | C++ | #include <iostream>
#include <vector>
using namespace std;
const int max_int = 100;
vector<vector<bool>> G(max_int, vector<bool>(max_int, false));
int visit(int v, int N, vector<bool> visited){
bool all_visited = true;
for(int i = 0; i < visited.size(); i++){
if(visited[i] == false) all_visited = false;
}
... | a.cc: In function 'int main()':
a.cc:41:25: error: could not convert '& visited' from 'std::vector<bool>*' to 'std::vector<bool>'
41 | int ans = visit(0, N, &visited);
| ^~~~~~~~
| |
| std::vector<bool>*
|
s097453857 | p03805 | C++ | #include <iostream>
#include <vector>
using namespace std;
const int max_int = 8;
vector<vector<bool>> G(max_int, vector<bool>(max_int, false));
int visit(int v, int N, vector<bool> visited){
bool all_visited = true;
for(int i = 0; i < visited.size(); i++){
if(visited[i] == false) all_visited false;
}
... | a.cc: In function 'int visit(int, int, std::vector<bool>)':
a.cc:12:40: error: expected ';' before 'false'
12 | if(visited[i] == false) all_visited false;
| ^~~~~~
| ;
|
s626834725 | p03805 | C++ | #include <iostream>
#include <vector>
using namespace std;
const int max_int = 8;
vector<vector<bool>> G(max_int, vector<bool>(max_int, false));
int visit(int v, int N, vector<bool> visited){
bool all_visited = true;
for(int i = 0; i < visited.size(); i++){
if(visited[i] == false) all_visited false;
}
... | a.cc: In function 'int visit(int, int, std::vector<bool>)':
a.cc:12:40: error: expected ';' before 'false'
12 | if(visited[i] == false) all_visited false;
| ^~~~~~
| ;
a.cc:17:3: error: 'else' without a previous 'if'
17 ... |
s678645967 | p03805 | C++ | #include <iostream>
#include <vector>
using namespace std;
const max_int = 8;
vector<vector<bool>> G(max_int, vector<bool>(max_int, false));
int visit(int v, int N, vector<bool> visited){
bool all_visited = true;
for(int i = 0; i < visited.size(); i++){
if(visited[i] == false) all_visited false;
}
if(... | a.cc:6:7: error: 'max_int' does not name a type; did you mean 'u_int'?
6 | const max_int = 8;
| ^~~~~~~
| u_int
a.cc:7:24: error: 'max_int' was not declared in this scope; did you mean 'u_int'?
7 | vector<vector<bool>> G(max_int, vector<bool>(max_int, false));
| ... |
s534765309 | p03805 | C++ | #include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
//桁
int kt(int a){
double b=a;
b=log10(b);
int c=b;
return c+1;
}
int lcm(int a,int b){
int d=a,e=b,f;
if... | a.cc: In function 'int main()':
a.cc:69:9: error: 'M' was not declared in this scope
69 | rep(i,M){
| ^
a.cc:3:32: note: in definition of macro 'rep'
3 | #define rep(i,n) for(int i=0;i<n;++i)
| ^
|
s967312516 | p03805 | C++ | #include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
//桁
int kt(int a){
double b=a;
b=log10(b);
int c=b;
return c+1;
}
int lcm(int a,int b){
int d=a,e=b,f;
if... | a.cc: In function 'int main()':
a.cc:69:7: error: expected unqualified-id before numeric constant
69 | rep(0,M){
| ^
a.cc:3:26: note: in definition of macro 'rep'
3 | #define rep(i,n) for(int i=0;i<n;++i)
| ^
a.cc:69:7: error: expected ';' before numeric constant
6... |
s166156350 | p03805 | C++ | #include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
//桁
int kt(int a){
double b=a;
b=log10(b);
int c=b;
return c+1;
}
int lcm(int a,int b){
int d=a,e=b,f;
if... | a.cc: In function 'void dfs(long long int, long long int)':
a.cc:63:15: error: expected ';' before '}' token
63 | dfs(e,d)
| ^
| ;
64 | }
| ~
a.cc: In function 'int main()':
a.cc:69:7: error: expected unqualified-id before numeric constant
69 ... |
s933660788 | p03805 | C++ | #include<iostream>
#include<vector>
using namespace std;
using graph = vector<vector<int>>;
graph v(1000);
int c = 0;
int n,m;
vector<bool> seen;
void dfs(const graph &v, int q, int depth){
seen[q] = true;
int ok = 0;
for(int i = 0; i < n; i++){
if(seen[i + 1]) ok++;
... | a.cc: In function 'void dfs(const graph&, int, int)':
a.cc:22:29: error: no match for 'operator[]' (operand types are 'std::vector<bool>' and 'const graph' {aka 'const std::vector<std::vector<int> >'})
22 | seen[v] = true;
| ^
In file included from /usr/inclu... |
s277986792 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
vector<int> g[8];
int dfs(int v,int x) {
if (x==(1<<n)-1)
return 1;
int c=0;
for (int u:g[v]) {
if (~x&1<<u)
c+=dfs(u,x|1<<u);
}
return c;
}
int main() {
int m;
cin>>n>>m;
while (m--... | a.cc: In function 'int main()':
a.cc:24:12: error: no match for 'operator>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
24 | cin>v>>u;
| ~~~^~~~~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:24... |
s327258104 | p03805 | C++ | #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;
... | /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
|
s910217429 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
const ll INF=mod*mod;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define all(x) (x).begin(),(x).end()
ll min(ll a,ll b){
if(a>b){
return b;
}
else{
return a;
}
}
ll max(ll a,ll b){
if(... | a.cc:49:10: error: redefinition of 'const ll mod'
49 | const ll mod=1e9+7;
| ^~~
a.cc:4:10: note: 'const ll mod' previously defined here
4 | const ll mod=1e9+7;
| ^~~
a.cc:50:10: error: redefinition of 'const ll INF'
50 | const ll INF=mod*mod;
| ^~~
a.cc:5:10: note... |
s290953362 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
vector<vector<int>>E(100);
int ans=0;
int n,m;
void dfs(int now,int vis){
if(vis==(1<<n)-1){ans++;return;}
for(auto a:E[now]){
if(vis&(1<<a) == 0){
dfs(a,vis|(1<<a));
}
}
return;
}
int main(){
cin>>n>>m;
for(int i=0;i<m;i++){
int a,b;cin>>a>>b;
... | a.cc: In function 'int main()':
a.cc:19:12: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'class std::vector<int>'} has no member named 'pb'
19 | E[--a].pb(--b);
| ^~
a.cc:20:10: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vec... |
s489935316 | p03805 | C++ | #include<iostream>
#include<vector>
using namespace std;
int bfs(int now,int n,vector<int> *v,bool visited[n]){
visited[now] = true;
int path = 0;
//cout << "Now=" << now <<endl;
for(int i=0;i<n;i++){
if(!visited[i]){
break;
}
if(i==n-1){
return 1;
... | a.cc:6:52: error: use of parameter outside function body before ']' token
6 | int bfs(int now,int n,vector<int> *v,bool visited[n]){
| ^
a.cc: In function 'int bfs(...)':
a.cc:7:5: error: 'visited' was not declared in this scope
7 | visited[now] = tru... |
s584868991 | 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;
}
if (all_visited) {
return 1;
}
int ret = 0;
for (... | a.cc: In function 'int dfs(int, int, bool*)':
a.cc:25:5: error: 'visietd' was not declared in this scope; did you mean 'visited'?
25 | visietd[i] = true;
| ^~~~~~~
| visited
|
s458161891 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v).begin(), (v).end()
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define DEBUG
#define i... | a.cc: In function 'int main()':
a.cc:30:11: error: request for member 'assign' in 'graph', which is of non-class type 'bool [10][10]'
30 | graph.assign(n,vector<int>());
| ^~~~~~
|
s984075884 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep for(int i = 0;i<n;i++)
const int MOD = 1000000007;
int n,m, ans;
bool graph[n][n],frag[n];
void dfs(bool a,int b,int c){
if(b == n){
ans += 1; return;
}
for(int i = 0;i<n;i++){
if(a[i] == false and grap... | a.cc:8:15: error: size of array 'graph' is not an integral constant-expression
8 | bool graph[n][n],frag[n];
| ^
a.cc:8:12: error: size of array 'graph' is not an integral constant-expression
8 | bool graph[n][n],frag[n];
| ^
a.cc:8:23: error: size of array 'frag' is not an ... |
s075564100 | p03805 | C++ | #include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
const int MAX = 8;
bool G[MAX][MAX];
int dfs(int v, int n, bool visited[max]) {
bool all_visited = true;
rep(... | a.cc:14:39: error: cannot resolve overloaded function 'max' based on conversion to type 'long unsigned int'
14 | int dfs(int v, int n, bool visited[max]) {
| ^
a.cc:14:28: error: size of array 'visited' has non-integral type '<unresolved overloaded function type>'
14 | ... |
s797455867 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
vector<int> d[10];
struct mode{
int n;
bool has[10];
};
mode dfs[100000];
int main()
{
int n,m,i,j,a,b,top,tmp,count,ans;
bool hast[10];
cin>>n>>m;
for(i=0;i<m;i++)
{
cin>>a>>b
if(b!=1) d[a].push_back(b);
if(a!=1) d[b].push_back(a);
}
top=0,dfs[0].n=1,df... | a.cc: In function 'int main()':
a.cc:20:26: error: expected ';' before 'if'
20 | cin>>a>>b
| ^
| ;
21 | if(b!=1) d[a].push_back(b);
| ~~
|
s718219099 | p03805 | C++ | #include <bits/stdc++.h>
#define infi 2e9
#define infl 5e18
#define MX 100005
#define pi 2*acos(0.0)
#define ll long long
#define rr read()
#define ff first
#define ss second
#define pb push_back
#define pi... | a.cc: In function 'void DFS(int, int, int)':
a.cc:37:9: error: 'v' was not declared in this scope
37 | vis[v]=1;
| ^
a.cc: In function 'int main()':
a.cc:53:10: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
53 | loop(i,m){
| ^
a.cc:15:42: no... |
s181439178 | p03805 | C | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
/* define */
#define Yes(X) puts ( X ? "Yes" : "No")
#define YES(X) puts ( X ? "YES" : "NO")
#define FOR(i, a, b) for ( i = a; i < b ; i++)
#define REP(i, n) for ( i = 0; i < n ; i++)
#define max(a, b) (((a) >... | main.c:35:51: error: 'nmax' undeclared here (not in a function); did you mean 'fmax'?
35 | int n, m, a, b, x = 0, ver[8][8] = { 0 }, visited[nmax] = { 1 };
| ^~~~
| fmax
main.c: In function 'visit':
main.c... |
s791411127 | p03805 | C | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
/* define */
#define Yes(X) puts ( X ? "Yes" : "No")
#define YES(X) puts ( X ? "YES" : "NO")
#define FOR(i, a, b) for ( i = a; i < b ; i++)
#define REP(i, n) for ( i = 0; i < n ; i++)
#define max(a, b) (((a) >... | main.c:36:24: error: variably modified 'ver' at file scope
36 | int n, m, a, b, x = 0, ver[nmax][nmax] = { 0 }, visited[nmax] = { 1 };
| ^~~
main.c:36:24: error: variably modified 'ver' at file scope
main.c:36:49: error: variably modified 'visited' at file scope
36 | int n, m, a, b, x... |
s957798603 | p03805 | C | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
/* define */
#define Yes(X) puts ( X ? "Yes" : "No")
#define YES(X) puts ( X ? "YES" : "NO")
#define FOR(i, a, b) for ( i = a; i < b ; i++)
#define REP(i, n) for ( i = 0; i < n ; i++)
#define max(a, b) (((a) >... | main.c:36:24: error: variably modified 'ver' at file scope
36 | int n, m, a, b, x = 0, ver[nmax][nmax] = { false }, visited[nmax] = { true };
| ^~~
main.c:36:24: error: variably modified 'ver' at file scope
main.c:36:44: error: 'false' undeclared here (not in a function)
36 | int n, m... |
s378565219 | p03805 | C | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
/* define */
#define Yes(X) puts ( X ? "Yes" : "No")
#define YES(X) puts ( X ? "YES" : "NO")
#define FOR(i, a, b) for ( i = a; i < b ; i++)
#define REP(i, n) for ( i = 0; i < n ; i++)
#define max(a, b) (((a) >... | main.c:37:1: error: unknown type name 'bool'
37 | bool ver[nmax][nmax] = { false }, visited[nmax] = { true };
| ^~~~
main.c:7:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
6 | #include <math.h>
+++ |+#include <stdbool.h>
7 |
main.c:37:6... |
s567798063 | p03805 | C++ | #include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
const int nmax=8;
bool graph[nmax][nmax];
i... | a.cc: In function 'int main()':
a.cc:49:2: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
49 | cin >> N >> M;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to ... |
s410903433 | p03805 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
//typedef pair<long long,long long> P;
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
long long c=a%i_7;
if(c>=0)return c;... | a.cc: In function 'int main()':
a.cc:130:15: error: could not convert '(bool*)(& used)' from 'bool*' to 'std::vector<bool>'
130 | ans = dfs(0,used);
| ^~~~
| |
| bool*
|
s900616798 | p03805 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
//typedef pair<long long,long long> P;
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
long long c=a%i_7;
if(c>=0)return c;... | a.cc: In function 'int dfs(int, std::vector<bool>)':
a.cc:106:16: error: request for member 'size' in 'G.std::vector<int>::operator[](((std::vector<int>::size_type)v))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
106 | int adj=G[v].size();
| ... |
s392644729 | p03805 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
//typedef pair<long long,long long> P;
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
long long c=a%i_7;
if(c>=0)return c;... | a.cc: In function 'int dfs(int, std::vector<bool>)':
a.cc:106:28: error: request for member 'size' in 'G.std::vector<int>::operator[](((std::vector<int>::size_type)v))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
106 | for(int i=0;i<(int)(G[v].size());i+... |
s868708326 | p03805 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
//typedef pair<long long,long long> P;
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
long long c=a%i_7;
if(c>=0)return c;... | a.cc: In function 'int dfs(int, std::vector<bool>)':
a.cc:106:27: error: request for member 'size' in 'G.std::vector<int>::operator[](((std::vector<int>::size_type)v))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
106 | for(int i=0;i<(int)G[v].size();i++)... |
s570811391 | p03805 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
//typedef pair<long long,long long> P;
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
long long c=a%i_7;
if(c>=0)return c;... | a.cc: In function 'int dfs(int, std::vector<bool>)':
a.cc:106:22: error: request for member 'size' in 'G.std::vector<int>::operator[](((std::vector<int>::size_type)v))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
106 | for(int i=0;i<G[v].size();i++){
... |
s363541203 | p03805 | C++ | #include<iostream>
#include<cstdio>
#include<vector>
#include<queue>
#include<map>
#include<unordered_map>
#include<stack>
#include<string>
#include<algorithm>
#include<functional>
#include<cstring>
#include<utility>
#include<bits/stdc++.h>
#include<math.h>
using namespace std;
/**** Type Define ****/
typedef long lo... | a.cc:191:4: error: 'll index' redeclared as different kind of entity
191 | ll index;
| ^~~~~
In file included from /usr/include/string.h:462,
from /usr/include/c++/14/cstring:43,
from a.cc:11:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const ... |
s288798632 | 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;
for (int ... | a.cc: In function 'int dfs(int, int, bool*)':
a.cc:21:33: error: expected ';' before ':' token
21 | if (visited[i]) continue:
| ^
| ;
a.cc:21:33: error: expected primary-expression before ':' token
a.cc: In function 'int main()':
a.c... |
s143760022 | p03805 | C++ | #include <iostream>
using namespace std;
const 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;
for (int i = ... | a.cc:4:7: error: 'nmax' does not name a type
4 | const nmax = 8;
| ^~~~
a.cc:5:12: error: 'nmax' was not declared in this scope
5 | bool graph[nmax][nmax];
| ^~~~
a.cc:5:18: error: 'nmax' was not declared in this scope
5 | bool graph[nmax][nmax];
| ^~~~
a.... |
s700404244 | p03805 | C++ | #include <iostream>
#include <string>
#include <vector>
using namespace std;
const N_max = 8;
bool node[N_max][N_max];
int DFS(int v, int N){
bool all_visit = true;
for(int i=0; i<N; i++){
if(visit.at(i) == false) all_visit = false;
}
if(all_visit)return 1;
int ans = 0;
for(int i=0;... | a.cc:6:7: error: 'N_max' does not name a type
6 | const N_max = 8;
| ^~~~~
a.cc:7:11: error: 'N_max' was not declared in this scope
7 | bool node[N_max][N_max];
| ^~~~~
a.cc:7:18: error: 'N_max' was not declared in this scope
7 | bool node[N_max][N_max];
| ... |
s950086426 | p03805 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<vector<int>> G(N, vector<int>(N));
for (int i = 0; i < M; i++) {
int a, b;
cin >> a >> b;
a--; b--;
G[a][b] = G[b][a] = 1;
}
vector<int> v(N);
for (int i =... | a.cc: In function 'int main()':
a.cc:30:14: error: 'next_permutation' was not declared in this scope
30 | } while (next_permutation(v.begin(), v.end()));
| ^~~~~~~~~~~~~~~~
|
s077099237 | p03805 | C++ | #include<bits/stdc++.h>
using namespace std;
const int ms = 10;
int visit[ms];
vector<int> g[ms];
int n,m;
int solve(int node, int p){
visit[node] = 1;
bool f = 0;
for(int i = 1;i<=n;i++){
if(!visit[i])
f = 1;
}
if(!f)
return 1;
int ans = 0;
for(auto it : g[node]){
if(it==p)
c... | a.cc: In function 'int solve(int, int)':
a.cc:9:9: error: reference to 'visit' is ambiguous
9 | visit[node] = 1;
| ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'templat... |
s447783857 | p03805 | C++ | #include<bits/stdc++.h>
#include<iostream>
#include<vector>
#include<stack>
using namespace std;
int n,m;
//接続状況を確認する配列
int connect[n][n];
//既にその頂点を使っているか管理する配列
int visited[n];
int dfs(int now,int depth){
if(visited[now])return 0;
if(depth==n)return 1;
//使用済みフラグを立てる
visited[now]=1;
int ans=0;
//... | a.cc:8:16: error: size of array 'connect' is not an integral constant-expression
8 | int connect[n][n];
| ^
a.cc:8:13: error: size of array 'connect' is not an integral constant-expression
8 | int connect[n][n];
| ^
a.cc:10:13: error: size of array 'visited' is not an inte... |
s525018436 | p03805 | C++ | #include<bits/stdc++.h>
#include<iostream>
#include<vector>
#include<stack>
using namespace std;
int n,m;
//接続状況を確認する配列
int connect[n][n];
//既にその頂点を使っているか管理する配列
int visited[n];
int n,m;
int dfs(int now,int depth){
if(visited[now])return 0;
if(depth==n)return 1;
//使用済みフラグを立てる
visited[now]=1;
int ans... | a.cc:8:16: error: size of array 'connect' is not an integral constant-expression
8 | int connect[n][n];
| ^
a.cc:8:13: error: size of array 'connect' is not an integral constant-expression
8 | int connect[n][n];
| ^
a.cc:10:13: error: size of array 'visited' is not an inte... |
s267909791 | p03805 | C++ | #include<bits/stdc++.h>
#include<iostream>
#include<vector>
#include<stack>
using namespace std;
//接続状況を確認する配列
int connect[n][n];
//既にその頂点を使っているか管理する配列
int visited[n];
int n,m;
int dfs(int now,int depth){
if(visited[now])return 0;
if(depth==n)return 1;
//使用済みフラグを立てる
visited[now]=1;
int ans=0;
/... | a.cc:7:13: error: 'n' was not declared in this scope; did you mean 'yn'?
7 | int connect[n][n];
| ^
| yn
a.cc:7:16: error: 'n' was not declared in this scope; did you mean 'yn'?
7 | int connect[n][n];
| ^
| yn
a.cc:9:13: error: 'n' wa... |
s380219234 | p03805 | C++ | #include<bits/stdc++.h>
#include<iostream>
#include<vector>
#include<stack>
using namespace std;
//接続状況を確認する配列
int connect[n][n];
//既にその頂点を使っているか管理する配列
int visited[n];
int n,m;
int dfs(nit now,int depth){
if(visited[now])return 0;
if(depth==n)return 1;
//使用済みフラグを立てる
visited[now]=1;
int ans=0;
/... | a.cc:7:13: error: 'n' was not declared in this scope; did you mean 'yn'?
7 | int connect[n][n];
| ^
| yn
a.cc:7:16: error: 'n' was not declared in this scope; did you mean 'yn'?
7 | int connect[n][n];
| ^
| yn
a.cc:9:13: error: 'n' wa... |
s623717015 | p03805 | C++ | #include<bits/stdc++.h>
#include<vector>
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;
... | a.cc: In function 'int dfs(int, int, bool*)':
a.cc:10:30: error: expected ';' before '}' token
10 | all_visited=false
| ^
| ;
11 | }
| ~
a.cc:25:16: error: a function-definition is not allo... |
s504808957 | p03805 | C++ | #include <bits/stdc++.h>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
//vector<int> used;
//vector<int> 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(... | a.cc: In function 'int dfs(int, int)':
a.cc:10:7: error: 'used' was not declared in this scope
10 | if(used[now])return 0;
| ^~~~
a.cc:12:4: error: 'used' was not declared in this scope
12 | used[now]=1;
| ^~~~
a.cc:15:10: error: 'connect' was not declared in this scope; did you mean 'c... |
s625502345 | p03805 | C++ | #include <bits/stdc++.h>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
int used[10000];
int connect[10000][10000];
//vector<int> used;
//vector<int> 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;... | a.cc: In function 'int main()':
a.cc:34:4: error: expected ',' or ';' before 'int'
34 | int connect[N][N]={};
| ^~~
|
s370347637 | p03805 | C++ | #include <bits/stdc++.h>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
int used[10000];
int connect[10000][10000];
//vector<int> used;
//vector<int> 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;... | a.cc: In function 'int main()':
a.cc:34:4: error: expected ',' or ';' before 'int'
34 | int connect[N][N]={}
| ^~~
a.cc:35:17: error: expected ';' before '<' token
35 | for(int i=0,i<M;i++){
| ^
| ;
a.cc:35:17: error: expected primary-expression before '<... |
s214202040 | p03805 | C++ | #include <bits/stdc++.h>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
int used[10000];
int connect[10000][10000];
//vector<int> used;
//vector<int> 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;... | a.cc: In function 'int main()':
a.cc:27:17: error: expected ';' before '<' token
27 | for(int i=0,i<M;i++){
| ^
| ;
a.cc:27:17: error: expected primary-expression before '<' token
a.cc:31:8: error: incompatible types in assignment of 'std::vector<int>' to 'int [10000]'
... |
s981149279 | p03805 | C++ | #include <bits/stdc++.h>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
vector<int> used;
vector<int> 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,de... | a.cc: In function 'int dfs(int, int)':
a.cc:15:22: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
15 | if(connect[now][i])ans+=dfs(i,depth+1);
| ^
a.cc: In function 'int main()':
a.cc:22:14: error: class templ... |
s689231940 | p03805 | C++ | #include <bits/stdc++.h>
#include<algorithm>
#include<string>
#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);
... | a.cc:6:8: error: class template argument deduction failed:
6 | vector used;
| ^~~~
a.cc:6:8: error: no matching function for call to 'vector()'
In file included from /usr/include/c++/14/vector:66,
from /usr/include/c++/14/functional:64,
from /usr/include/x86_64-linux-g... |
s109692902 | p03805 | C++ | #include <bits/stdc++.h>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
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... | a.cc:7:8: error: class template argument deduction failed:
7 | vector connect;
| ^~~~~~~
a.cc:7:8: error: no matching function for call to 'vector()'
In file included from /usr/include/c++/14/vector:66,
from /usr/include/c++/14/functional:64,
from /usr/include/x86_64-l... |
s093729082 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
int dfs(vector<vector<int>>&a,vector<int>b,int i,int n){
int counter=0;
for(int k;k<n+1;k++){
counter+=b.at(k);
}
if(b.at(i)==0){
b.at(i)=1;
int sum=0;
for(int j=0;j<a.at(i).size();j++){
sum+=dfs(a,b,a.at(i).at(j));
}
return sum;
}
... | a.cc: In function 'int dfs(std::vector<std::vector<int> >&, std::vector<int>, int, int)':
a.cc:12:15: error: too few arguments to function 'int dfs(std::vector<std::vector<int> >&, std::vector<int>, int, int)'
12 | sum+=dfs(a,b,a.at(i).at(j));
| ~~~^~~~~~~~~~~~~~~~~~~
a.cc:3:5: note: declared ... |
s797815499 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
int dfs(vector<vector<int>>&a,vector<int>b,int i,int n){
if(b.at(i)==0){
b.at(i)=1;
int sum=0;
for(int j=0;j<a.at(i).size();j++){
sum+=dfs(a,f,a.at(i).at(j));
}
return sum;
}
int counter=0;
for(int k;k<n+1;k++){
counter+=b.at(k);
}
... | a.cc: In function 'int dfs(std::vector<std::vector<int> >&, std::vector<int>, int, int)':
a.cc:8:18: error: 'f' was not declared in this scope
8 | sum+=dfs(a,f,a.at(i).at(j));
| ^
a.cc:16:3: error: 'else' without a previous 'if'
16 | else if(b.at(i)==1&&counter==n){
| ^~~~
|
s808717564 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
... | a.cc: In function 'int main()':
a.cc:37:28: error: 'class std::vector<int>' has no member named 'first'
37 | next_permutation(a.first(),a.last());
| ^~~~~
a.cc:37:38: error: 'class std::vector<int>' has no member named 'last'; did you mean 'at'?
37 | next_permutati... |
s250010641 | p03805 | C++ | #include <iostream>
#include <vector>
using namespace std;
vector<vector<int> > edges;
bool isValid(vector<int> v){
if(v[0] != 1)
return false;
for(int i = 0; i< v.size()-1; i++){
if(!edges[v[i]][v[i+1]]){
return false;
}
}
return true;
}
int main() {
int n,m;... | a.cc: In function 'int main()':
a.cc:41:13: error: 'next_permutation' was not declared in this scope
41 | } while(next_permutation(v.begin(), v.end()));
| ^~~~~~~~~~~~~~~~
|
s078115690 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
vector<vector<int>>g;
vector<bool> visited;
int n,m;
void add_edge(int a,int b){
g[a].push_back(b);
g[b].push_back(a);
}
int dfs(int i,int dpt){
int ret=0;
if(dpt==n)return 1;
for(auto&& w:g[i]){
visited[i]=true;
if(!visited[w])ret+=dfs(w,++dpt);
visited[i]=f... | a.cc:19:1: error: extended character is not valid in an identifier
19 | visited[i]=false;
| ^
a.cc:19:1: error: extended character is not valid in an identifier
a.cc: In function 'int dfs(int, int)':
a.cc:19:1: error: '\U00003000\U00003000visited' was not declared in this scope
19 | visited[i]=false... |
s993088910 | p03805 | C++ | #include <bits/stdc++.h>
using namespace std;
vector<vector<int>>g;
vector<bool> visited;
int n,m;
void add_edge(int a,int b){
g[a].push_back(b);
g[b].push_back(a);
}
int dfs(int i,int dpt){
int ret=0;
if(dpt==n)return 1;
visited[i]=true;
for(auto&& w:g[i]){
if(!visited[w])ret+=dfs(w,++dpt);
visited[i]=fa... | a.cc:18:1: error: extended character is not valid in an identifier
18 | visited[i]=false;
| ^
a.cc:18:1: error: extended character is not valid in an identifier
a.cc: In function 'int dfs(int, int)':
a.cc:18:1: error: '\U00003000\U00003000visited' was not declared in this scope
18 | visited[i]=false... |
s624377069 | p03805 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#define REP(i,n) for(i=0;i<n;i++)
int iin() {
int i;
scanf("%d", &i);
return i;
}
long long llin() {
long long i;
scanf("%lld", &i);
return i;
}
double din() {
double i;
scanf("%lf", &i);... | main.c: In function 'main':
main.c:95:17: error: 'N' undeclared (first use in this function)
95 | int visited[N];
| ^
main.c:95:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:97:27: error: passing argument 3 of 'dfs' from incompatible point... |
s531315380 | p03805 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#define REP(i,n) for(i=0;i<n;i++)
int iin() {
int i;
scanf("%d", &i);
return i;
}
long long llin() {
long long i;
scanf("%lld", &i);
return i;
}
double din() {
double i;
scanf("%lf", &i);... | main.c: In function 'main':
main.c:87:15: error: 'N' undeclared (first use in this function)
87 | int table[N][N];
| ^
main.c:87:15: note: each undeclared identifier is reported only once for each function it appears in
|
s234510336 | p03805 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#define REP(i,n) for(i=0;i<n;i++)
int iin() {
int i;
scanf("%d", &i);
return i;
}
long long llin() {
long long i;
scanf("%lld", &i);
return i;
}
double din() {
double i;
scanf("%lf", &i);... | main.c: In function 'dfs':
main.c:77:22: error: 'true' undeclared (first use in this function)
77 | visited[i] = true;
| ^~~~
main.c:6:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
5 | #include <limits.h>
+++ |+#... |
s936044415 | p03805 | C++ | #include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i)
#define repprev(i,a,b) for(ll i=b-1;i>=a;i--)
#define reprev(i,n) repprev(i,0,n)
using namespace std;
#define sz(x)... | a.cc: In function 'int main()':
a.cc:126:10: error: 'n' was not declared in this scope; did you mean 'yn'?
126 | cin >> n >> m;
| ^
| yn
a.cc:126:15: error: 'm' was not declared in this scope; did you mean 'tm'?
126 | cin >> n >> m;
| ^
| tm
|
s207892717 | p03805 | C | #include <stdio.h>
void DFS(int now, int *ans, int n, int visited[], int cango[][n]);
int main(void)
{
int n,m,i,j,ans=0,now=0;
scanf("%d%d", &n,&m);
int a[m], b[m],cango[n][n], visited[n];
for(i=0; i<m; i++) scanf("%d%d", &a[i], &b[i]);
for(i=0; i<n; i++)
{
for(j=0; j<n; j++) cango[i][j... | main.c: In function 'main':
main.c:20:31: error: expected expression before ']' token
20 | DFS(now, &ans, n, visited[], cango[][]);
| ^
main.c: In function 'DFS':
main.c:41:37: error: expected expression before ']' token
41 | DFS(i, ans, n, temp[], cango[][]... |
s492491931 | p03805 | C++ | #include <vector>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <cstdlib>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define REP(i,n) for(int i=0;i<n;i++)
#define SORT(... | a.cc: In function 'int dfs(int, int, bool*)':
a.cc:41:19: error: 'N' was not declared in this scope
41 | ret += dfs(i, N, visited);
| ^
|
s271219947 | p03805 | C++ | #include<iostream>
#include <fstream>
#include <vector>
using namespace std;
int counter = 0;
void findP(vector<int> points);
int n, m;
vector<pair<int, int>> edge;
int main()
{
#ifdef LOCAL
std::ifstream in("input.txt");
std::cin.rdbuf(in.rdbuf());
#endif
cin >> n >> m;
for(int i=0;i<m;i++){
... | a.cc: In function 'void findP(std::vector<int>)':
a.cc:40:64: error: 'count' is not a member of 'std'; did you mean 'cout'?
40 | if(iter.first == tmpPoint[points.size()-1] && std::count(tmpPoint.begin(), tmpPoint.end(), iter.second) == 0){
| ... |
s860624217 | p03805 | C++ | #include <cstdio>
#include <vector>
using namespace std;
const int MAX_N = 8, MAX_M = MAX_N * (MAX_N - 1) / 2;
int N, M, a[MAX_M], b[MAX_M];
vector<int> graph[MAX_N];
bool used[MAX_N];
int dfs(int n) {
used[n] = true;
bool end = true;
for (int i = 0; i < N; i++) {
end &= used[i];
}
if (end) {
used[n] = f... | a.cc: In function 'void solve()':
a.cc:41:9: error: 'memset' was not declared in this scope
41 | memset(used, false, sizeof(used));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <vector>
+++ |+#incl... |
s792915980 | p03805 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> p(n);
iota(p.begin(), p.end(), 0);
int g[11][11];
for (int i = 0; i < m; i++) {
int x, y;
cin >> x >> y;
x--, y--;
g[x][y] = g[y][x]... | a.cc: In function 'int main()':
a.cc:10:5: error: 'iota' was not declared in this scope
10 | iota(p.begin(), p.end(), 0);
| ^~~~
|
s134575434 | p03805 | C++ | #include<bits/stdc++.h>
#include <utility>
using namespace std;
typedef long long ll;
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 = true) return 1;
int ret;
for (int i=0;i<n;i++){
... | a.cc: In function 'int dfs(int, int, bool*)':
a.cc:9:28: error: 'n' was not declared in this scope
9 | for (int i = 0;i < n;i++){
| ^
a.cc:15:24: error: 'n' was not declared in this scope
15 | for (int i=0;i<n;i++){
| ^
a.cc:22:1: warn... |
s641677144 | p03805 | C++ | #include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i)
#define reprrev(i,a,b) for(int i=b-1;i>=a;i--)
#define reprev(i,n) reprrev(i,0,n)
using namespace std;
#define sz(x... | a.cc: In function 'void dfs(int, int, bool*)':
a.cc:83:26: error: return-statement with a value, in function returning 'void' [-fpermissive]
83 | if(all_visited) return 1;
| ^
a.cc:92:15: error: void value not ignored as it ought to be
92 | ret += dfs(i,N,visited);
| ... |
s959477880 | 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;
}
ret = 0;
for (int i=0; i<N; ++i){
... | a.cc: In function 'int dfs(int, int, bool*)':
a.cc:19:3: error: 'ret' was not declared in this scope
19 | ret = 0;
| ^~~
a.cc: In function 'int main()':
a.cc:43:8: error: declaration of 'visited' as array of functions
43 | bool visited[nmax]();
| ^~~~~~~
a.cc:45:3: error: 'visited' was no... |
s878202593 | p03805 | C++ | #include <iostream>
using namespace std;
int main()
{
int n, m;
cin >> n >> m;
int a[50], b[50];
int e[10][10];
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
e[i][j] = 0;
}
}
for(int i = 0; i < m; i++){
cin >> a[i] >> b[i];
a[i]--;
... | a.cc: In function 'int main()':
a.cc:38:11: error: 'next_permutation' was not declared in this scope
38 | while(next_permutation(seq + 1, seq + n));
| ^~~~~~~~~~~~~~~~
|
s295276560 | p03805 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
using namespace std;
typedef long long ll;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
int cnt=0;
int N,M;
bool e[8][8]={false};
int dfs(int v,int N,bool c[8]){
bool ... | a.cc: In function 'int dfs(int, int, bool*)':
a.cc:29:12: error: 'cc' was not declared in this scope; did you mean 'c'?
29 | if(cc[i]) continue;
| ^~
| c
a.cc: In function 'int main()':
a.cc:43:10: error: invalid types 'int[int]' for array subscript
43 | a[b-1][a-... |
s490313711 | p03805 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <tuple>
#include <stack>
using namespace std;
typedef unsigned long ul;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vint;
... | a.cc:22:18: error: expected unqualified-id before 'for'
22 | #define rep(i,n) for(int i=0;i<n;i++)
| ^~~
a.cc:35:1: note: in expansion of macro 'rep'
35 | rep(i,8) vst[i]=false;
| ^~~
a.cc:35:5: error: 'i' does not name a type
35 | rep(i,8) vst[i]=false;
| ^
a.cc:22:30: n... |
s421040530 | p03805 | C++ | #include <iostream>
using namespace std;
constexpr int MAX_N = 8;
int ab[MAX_N+1][MAX_N+1];
int idx[]{1,2,3,4,5,6,7,8};
int main() {
int N, M;
cin >> N >> M;
for (int i{}; i < M; ++i) {
int a, b;
cin >> a >> b;
ab[a][b] = ab[b][a] = true;
}
int ans{};
sort(idx, idx + N); // 昇順にソートしておく必要あり
do... | a.cc: In function 'int main()':
a.cc:17:3: error: 'sort' was not declared in this scope; did you mean 'short'?
17 | sort(idx, idx + N); // 昇順にソートしておく必要あり
| ^~~~
| short
a.cc:28:12: error: 'next_permutation' was not declared in this scope
28 | } while (next_permutation(idx+1, idx + N));
|... |
s025697756 | p03805 | C++ | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
vector<vector<bool>> graph(8, vector<bool>(8));
int DFS(int x,int N,vector<bool> visited){
bool allvisited=true;
for(int i=0;i<N;i++){
if(visited(i) == false){
allvisited=false;
}
if(allvisited){
return 1;
}
}
int... | a.cc: In function 'int DFS(int, int, std::vector<bool>)':
a.cc:10:15: error: no match for call to '(std::vector<bool>) (int&)'
10 | if(visited(i) == false){
| ~~~~~~~^~~
|
s686127653 | p03805 | C++ | #include <bits/stdc++.h>
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define REP(i, n) FOR(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define bit(x) (1L << (x))
using ll = long long;
using namespace std;
using graph = vector<vector<int>>;
int main() {
int n, m; cin >> n >> m;
vector<int> a(m), b(m);
gra... | a.cc: In function 'int main()':
a.cc:35:3: error: expected ',' or ';' before 'cout'
35 | cout << rec(0, vector<bool>(n, false)) << endl;
| ^~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.