submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s041359046
p03659
C++
include <iostream> #include <vector> #include <math.h> using namespace std; int main() { int N; cin >> N; vector<int> data; data.reserve(N); int input; int total = 0; for (int n = 0; n < N; n++) { cin >> input; total += input; data.push_back(input); } int ...
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/vector:62, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu...
s098800017
p03659
Java
import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner scanner=new Scanner(System.in); int n=scanner.nextInt(); int[] l=new int[n]; int[] snuke=new int[n]; for(int i=0;i<n;i++){ ...
Main.java:20: error: ';' expected int sub=0 ^ 1 error
s641293331
p03659
C++
#include <iostream> #include <algorithm> using namespace std; int a[200002]; int f( int l, int r ) { int sum = 0; int i; for ( i = l; i <= r; i++ ) { sum += a[i]; } return sum; } int main() { int n; cin >> n; int i; for ( i = 1; i <= n; i++ ) { cin >>a[i]; } ...
a.cc: In function 'int main()': a.cc:30:15: error: 'INT_MAX' was not declared in this scope 30 | int Min = INT_MAX; | ^~~~~~~ a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 2 | #include <algorithm> +++ |+#include <clim...
s126879702
p03659
C++
#include<iostream> #include<cctype> #include<vector> #include <ctype.h> #include<algorithm> #include<queue> #include<string> #include <math.h> #include <iomanip> using namespace std; long long n, s[200000], ans,a[200000],t=0; int main() { cin >> n; for (size_t i = 0; i < n; i++) { cin >> s[i]; t += s[i]; a[i] ...
a.cc: In function 'int main()': a.cc:26:18: error: expected '}' at end of input 26 | return 0; | ^ a.cc:12:12: note: to match this '{' 12 | int main() { | ^
s212756424
p03659
C++
#include <iostream> using namespace std; int min(int a, int b) { if (a < b)return a; else return b; } int avd(long long int a, long long int b) { if (a < b)return b - a; else return a - b; } int av(long long int a) { if (a > 0)return a; else return -a; } int main() { int N; int a[200010]; long long int...
a.cc: In function 'int main()': a.cc:30:15: error: 'INT_MAX' was not declared in this scope 30 | dif = INT_MAX; | ^~~~~~~ a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #include <iostream> +++ |+#include <climi...
s579172216
p03659
C++
#include <iostream> #include <climits> long long int N; long long int a[200001] = {}; long long int min = INT_MAX; long long int b = 0; long long int c = 0; using namespace std; int main() { cin >> N; for (int i = 1; i <= N; i++) { cin >> a[i]; c += a[i]; } for (int i = 1; i < N; i++) { b += a[i]; c -= a...
a.cc: In function 'int main()': a.cc:21:21: error: reference to 'min' is ambiguous 21 | if (min > abs(b - c))min = abs(b - c); | ^~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from...
s834651142
p03659
C++
#include <iostream> using namespace std; int min(int a, int b) { if (a < b)return a; else return b; } int avd(long long int a, long long int b) { if (a < b)return b - a; else return a - b; } int av(long long int a) { if (a > 0)return a; else return -a; } int main() { int N; int a[200010]; long long int...
a.cc: In function 'int main()': a.cc:30:15: error: 'INT_MAX' was not declared in this scope 30 | dif = INT_MAX; | ^~~~~~~ a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #include <iostream> +++ |+#include <climi...
s751672508
p03659
C++
#include<iostream> #include<cctype> #include<vector> #include <ctype.h> #include<algorithm> #include<queue> #include<string> #include <math.h> #include <iomanip> using namespace std; int n, s[200000], ans; long long a[200000],t=0; int main() { cin >> n; for (size_t i = 0; i < n; i++) { cin >> s[i]; t += s[i]; ...
a.cc: In function 'int main()': a.cc:24:24: error: no matching function for call to 'min(long long int, int&)' 24 | ans=min(abs(abs(a[n - 1]) - abs(2 * a[i])), ans); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, ...
s533301994
p03659
C++
#include<stdio.h> int abs(int a) { if(a>0) return a; else return -a; } int main() { __int64 sum=0; int n,i; __int64 min; __int64 sumz=0,sumy=0; __int64 x[200001]; scanf("%d",&n); for (i=1;i<=n;i++) { scanf("%I64d",&x[i]); sum+=x[i]; } sumy=sum; for(i=1;i<n;i++) { sumz+=x[i]; sumy-=x[i]; if(i==1)...
a.cc: In function 'int main()': a.cc:9:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'? 9 | __int64 sum=0; | ^~~~~~~ | __int64_t a.cc:11:16: error: expected ';' before 'min' 11 | __int64 min; | ^~~~ | ...
s525949632
p03659
Java
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { private final static Scanner sc = new Scanner(System.in); /** * 本処理を実行します。 */ public static void execute() { int n = nextInt(); List<Integer> a = nextInts(n); int size = a.si...
Main.java:79: error: reached end of file while parsing } ^ 1 error
s537653638
p03659
C++
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { ll n,i,j,k,s; cin>>n; s=0; vector<int> a(n+1),b(n+1); for(i=1;i<=n;i++){ cin>>j; b[i]=j+b[i-1]; } ll d=2e9+1; for(i=1;i<=n-1;i++){ d=min(d,abs(b[n]-2*b[i])); } cout<<d; }
a.cc: In function 'int main()': a.cc:17:10: error: no matching function for call to 'min(long long int&, int)' 17 | d=min(d,abs(b[n]-2*b[i])); | ~~~^~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,...
s356041303
p03659
C++
#include <iostream> #include <vector> #include <numeric> #include <cmath> using namespace std; int main(){ int n,s,sum; cin >> n; vector<int>a(n),b(n - 1); for(auto& v : a){ cin >> v; } s = sum = accumulate(a.begin(),a.end(),0); for(int i = 0; i < n - 1; ++i){ sum -= a[i]; b[i] = sum; } int out=INT_MA...
a.cc: In function 'int main()': a.cc:21:17: error: 'INT_MAX' was not declared in this scope 21 | int out=INT_MAX; | ^~~~~~~ a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 4 | #include <cmath> +++ |+#include <clim...
s271653969
p03659
C++
#include<iostream> using namespace std; long long abs(long long x){ if(x < 0){ return -x; } else{ return x; } } int n; long long a[200005], s[200005]; int main(void){ cin >> n; for(int i = 0; i < n; i++){ cin >> a[i]; } for(int i = 0; i < n; i++){ s[i + 1] = a[i] + s[i]; } long lo...
a.cc: In function 'int main()': a.cc:26:19: error: call of overloaded 'abs(long long int)' is ambiguous 26 | m = min(m, abs(2 * s[i] - s[n])); | ~~~^~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/c++/14/ext/string_conversions.h:43, ...
s443626736
p03659
C++
#include <bits/stdc++.h> #define int long long using namespace std; int main() { int n,i,j,k,s; cin>>n; s=0; vector<int> a(n+1),b(n+1); for(i=1;i<=n;i++){ cin>>j; b[i]=j+b[i-1]; } int d=2e9+1; for(i=1;i<=n-1;i++){ d=min(d,abs(b[n]-2*b[i])); } cout<<d; }
cc1plus: error: '::main' must return 'int'
s901372296
p03659
C++
#include <iostream> #include <limits> #include <algorithm> using namespace std; int a[200011]; int f( int l, int r ) { int sum = 0; int i; for ( i = l; i <= r; i++ ) { sum += a[i]; } return sum; } int main() { int n; cin >> n; int i; for ( i = 1; i <= n; i++ ) { c...
a.cc: In function 'int main()': a.cc:31:15: error: 'INT_MAX' was not declared in this scope 31 | int Min = INT_MAX; | ^~~~~~~ a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 3 | #include <algorithm> +++ |+#include <clim...
s014832343
p03659
C++
#include<iostream> using namespace std; long long int abs(long long int x){ if(x < 0){ return -x; } else{ return x; } } int n; long long int a[200005], s[200005]; int main(void){ cin >> n; for(int i = 0; i < n; i++){ cin >> a[i]; } for(int i = 0; i < n; i++){ s[i + 1] = a[i] + s[i]; ...
a.cc: In function 'int main()': a.cc:26:19: error: call of overloaded 'abs(long long int)' is ambiguous 26 | m = min(m, abs(2 * s[i] - s[n])); | ~~~^~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/c++/14/ext/string_conversions.h:43, ...
s967752404
p03659
C++
#include <stdio.h> #include <limits.h> #include <stdlib.h> int abs(int i){ if(i < 0) return -1 * i; return i; } int main(void){ int *c; int n; scanf("%d",&n); c = malloc(sizeof(int) * n); int sum = 0; int i; for(i = 0; i < n;i++){ scanf("%d",&c[i]); sum += c[i]; } int res = INT_M...
a.cc: In function 'int main()': a.cc:17:13: error: invalid conversion from 'void*' to 'int*' [-fpermissive] 17 | c = malloc(sizeof(int) * n); | ~~~~~~^~~~~~~~~~~~~~~~~ | | | void*
s004580509
p03659
C++
#include<cstdio> #include<iostream> #include<algorithm> using namespace std; __int64 str[200005]; int main() { __int64 i,n,min; cin>>n; for (i=0;i<n;i++) cin>>str[i]; sort(str,str+n); min=str[1]-str[0]; for (i=2;i<n;i++) if(str[2]-str[1]<min) min=str[2]-str[1]; cout<<min<<endl; }
a.cc:5:1: error: '__int64' does not name a type; did you mean '__int64_t'? 5 | __int64 str[200005]; | ^~~~~~~ | __int64_t a.cc: In function 'int main()': a.cc:8:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'? 8 | __int64 i,n,min; | ^~~~~~~ | ...
s690598384
p03659
C++
#include<cstdio> #include<iostream> #include<algorithm> using namespace std; __int64 str[200005]; int main() { __int64int i,n,min; cin>>n; for (i=0;i<n;i++) cin>>str[i]; sort(str,str+n); min=str[1]-str[0]; for (i=2;i<n;i++) if(str[2]-str[1]<min) min=str[2]-str[1]; cout<<min<<endl; }
a.cc:5:1: error: '__int64' does not name a type; did you mean '__int64_t'? 5 | __int64 str[200005]; | ^~~~~~~ | __int64_t a.cc: In function 'int main()': a.cc:8:9: error: '__int64int' was not declared in this scope; did you mean '__int64_t'? 8 | __int64int i,n,min; | ^~~~~~~~~~...
s753835070
p03659
C++
#include <iostream> #include <sstream> #include <iomanip> #include <limits> #include <string> #include <vector> #include <queue> #include <stack> #include <map> #include <set> #include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> using namespace std; const int MAXN = 1001000; const int MOD = 100...
a.cc:19:17: error: 'INT_MAX' was not declared in this scope 19 | const int INF = INT_MAX; | ^~~~~~~ a.cc:15:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 14 | #include <cstring> +++ |+#include <climits> 15 |
s403569479
p03659
C++
#include<iostream> using namespace std; long long int abs(long long int x){ if(x < 0){ return -x; } else{ return x; } } int n; long long int a[200005], s[200005]; int main(void){ cin >> n; for(int i = 0; i < n; i++){ cin >> a[i]; } for(int i = 0; i < n; i++){ s[i + 1] = a[i] + s[i]; ...
a.cc: In function 'int main()': a.cc:26:19: error: call of overloaded 'abs(long long int)' is ambiguous 26 | m = min(m, abs(2 * s[i] - s[n])); | ~~~^~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/c++/14/ext/string_conversions.h:43, ...
s710356971
p03659
C++
#include <iostream> #include <vector> #include <queue> #include <string> #include <cstdio> #include <cmath> #include <sstream> #include <algorithm> using namespace std; int main() { int N; cin >> N; vector<long long> card; for (int i = 0; i < N; i++) { long long t; cin >> t; if (i != 0) { card.push_back(...
a.cc: In function 'int main()': a.cc:29:25: error: 'LLONG_MAX' was not declared in this scope 29 | long long min = LLONG_MAX - 1; | ^~~~~~~~~ a.cc:9:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 8 | #include <a...
s236412874
p03659
C++
#include<iostream> using namespace std; int abs(int x){ if(x < 0){ return -x; } else{ return x; } } int n; long long int a[200005], s[200005]; int main(void){ cin >> n; for(int i = 0; i < n; i++){ cin >> a[i]; } for(int i = 0; i < n; i++){ s[i + 1] = a[i] + s[i]; } int m = s[n]; ...
a.cc: In function 'int main()': a.cc:26:12: error: no matching function for call to 'min(int&, long long int)' 26 | m = min(m, abs(2 * s[i] - s[n])); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:4...
s282376081
p03659
C++
//#include<bits/stdc++.h> #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<string> #include<queue> #include<vector> #include<map> #include<stack> #include<cmath> #define lowbit(x) ((x)&(-x)) #define Max(a,b) (a>b?a:b) #define Min(a,b) (a>b?b:a) #define INF 0x3f3f3f3f #define sz size() ...
a.cc:29:9: error: '__int64' does not name a type; did you mean '__int64_t'? 29 | typedef __int64 ll; | ^~~~~~~ | __int64_t a.cc:32:1: error: 'll' does not name a type; did you mean 'all'? 32 | ll a[Max_N]; | ^~ | all a.cc:33:1: error: 'll' does not name a type; did you mean...
s466525431
p03659
C++
#include <iostream> #include <vector> #include <cmath> using namespace std; int main() { long N; long ans = LONG_MAX; cin >> N; vector<int> A(N); vector<long> subSum(N); for (int i = 0; i < N; i++) { cin >> A[i]; if (i > 0) subSum[i] = subSum[i - 1] + A[i]; else subSum[i] = A[i]; } long sum = ...
a.cc: In function 'int main()': a.cc:10:20: error: 'LONG_MAX' was not declared in this scope 10 | long ans = LONG_MAX; | ^~~~~~~~ a.cc:4:1: note: 'LONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 3 | #include <cmath> +++ |+#inc...
s460721801
p03660
C++
#include <bits/stdc++.h> #dedine int long long using namespace std; /* エイリアス */ #define ll long long #define ld long double #define vi vector<int> #define vll vector<ll> #define pii pair<int,int> #define pll pair<ll,ll> #define vpi vector<pii> #define vpll vector<pll> #define endl '\n' #define fi first #define se se...
a.cc:2:2: error: invalid preprocessing directive #dedine; did you mean #define? 2 | #dedine int long long | ^~~~~~ | define
s667506390
p03660
C++
k
a.cc:1:1: error: 'k' does not name a type 1 | k | ^
s656211563
p03660
C++
#include <bits/stdc++.h> #define REP(i, n) for(long long i=0; i<n; i++) #define REPR(i, n) for(long long i=n-1; i>=0; i--) #define FOR(i, m, n) for(long long i=m; i<=n; i++) #define FORR(i, m, n) for(long long i=m; i>=n; i--) #define SORT(v, n) sort(v, v+n); #define VSORT(v) sort(v.begin(), v.end()); #define VSORTR(v) ...
a.cc: In function 'int main()': a.cc:59:58: error: expected ';' before ':' token 59 | if (vis[pp]==0) {que2.push(pp); vis[pp]=1:} | ^ | ;
s911602801
p03660
C++
#include<bits/stdc++.h> using namespace std; #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) (x).begin(),(x).end()...
a.cc: In function 'int main()': a.cc:179:16: error: redeclaration of 'std::queue<int> que' 179 | queue<int> que; | ^~~ a.cc:157:16: note: 'std::queue<int> que' previously declared here 157 | queue<int> que; | ^~~ a.cc:182:5: error: 'dist' was not declared in this sc...
s102252453
p03660
C++
#include<bits/stdc++.h> using namespace std; #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) (x).begin(),(x).end()...
a.cc: In function 'int main()': a.cc:150:10: error: expected unqualified-id before '.' token 150 | UnionFind.tree(n); | ^ a.cc:153:1: error: 'tree' was not declared in this scope; did you mean 'free'? 153 | tree.unite(a[i]-1,b[i]-1);} | ^~~~ | free a.cc:153:28: error: expected '}' at end ...
s649511515
p03660
C++
#include <bits/stdc++.h> #define REP(i,n) for (int i = 0; i <(n); ++i) #define REP2(i,x,n) for (int i = x; i <(n); ++i) #define ALL(v) v.begin(), v.end() #define RALL(v) v.rbegin(), v.rend() using namespace std; using ll = long long; using P = pair<int,int>; static const double PI = acos(-1); static const int INF = 1e9...
a.cc: In function 'int main()': a.cc:77:10: error: 'n' was not declared in this scope 77 | REP(i,n){ | ^ a.cc:2:38: note: in definition of macro 'REP' 2 | #define REP(i,n) for (int i = 0; i <(n); ++i) | ^ a.cc:78:33: error: 'cntf' was not declared in t...
s104359892
p03660
C++
#pragma GCC optimize ("O3") #include <bits/stdc++.h> #define endl "\n" #define sz(x) ((ll)(x).size()) #define pb push_back #define all(x) (x).begin(),(x).end() #define prt(x) cout << (x) #define prtl(x) cout << (x) << endl #define rep(i,a,b) for(ll i=a; i<b; i++) #define rrep(i,a,b) for(ll i=a; i>b; i--) #define mp(a, ...
a.cc: In function 'int main()': a.cc:137:32: error: expected ';' before 'if' 137 | route.insert(v) | ^ | ; 138 | if(sz(route) == m){ | ~~ a.cc:141:18: error: 'else' without a...
s134883512
p03660
C++
use std::io::*; const INF: usize = 1 << 30; fn dfs(v: usize, p: usize, d: &mut Vec<usize>, g: &Vec<Vec<usize>>) { for &nv in g[v].iter() { if nv != p { d[nv] = d[v] + 1; dfs(nv, v, d, &g); } } } fn main() { let mut s: String = String::new(); stdin().read_to_strin...
a.cc:18:14: error: too many decimal points in number 18 | for _ in 1..n { | ^~~~ a.cc:35:14: error: too many decimal points in number 35 | for i in 0..n { | ^~~~ a.cc:1:1: error: 'use' does not name a type 1 | use std::io::*; | ^~~ a.cc:2:10: error: found ':...
s551077838
p03660
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<int> vint; typedef vector<double> vdbl; typedef vector<ll> vll; typedef vector<string> vstr; typedef vector<vector<int> > vvint; typedef vector<pair<int, int> > vpii; typedef vector<...
a.cc: In function 'int main()': a.cc:133:11: error: expected primary-expression before '>' token 133 | if(fc=>sc){ | ^
s500766187
p03660
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; #define rep(i,n) for(int i=0;i<(int)(n);i++) const int INF =1001001001; void dfs(int x, int n, int count, vector<vector<int>> graph, vector<int> &dist, vector<bool> &visit){ visit[x] = true; dist[x] = count; // printf("dist:%d\n",dist[x]); ++...
a.cc: In function 'int main()': a.cc:42:14: error: could not convert 'graph' from 'vector<vector<long long int>>' to 'vector<vector<int>>' 42 | dfs(0,n,0,graph, distA,visit); | ^~~~~ | | | vector<vector<long long int>> a.cc:46:16: error: could not convert '...
s947813024
p03660
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; #define rep(i,n) for(int i=0;i<(int)(n);i++) const int INF =1001001001; const int MAX = 100000; bool graph[MAX][MAX]; int distA[MAX]; int distB[MAX]; bool visit[MAX]; void dfs(int x, int n, int count, bool a){ if(visit[x]) return; visit[x] = true...
a.cc: In function 'void dfs(int, int, int, bool)': a.cc:14:7: error: reference to 'visit' is ambiguous 14 | if(visit[x]) return; | ^~~~~ 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: ...
s100720417
p03660
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; #define rep(i,n) for(int i=0;i<(int)(n);i++) const int INF =1001001001; const int MAX = 100000; bool graph[MAX][MAX]; int distA[MAX]; int distB[MAX]; bool visit[MAX]; void dfs(int x, int n, int count, bool a){ if(visit[x]) return; visit[x] = true...
a.cc: In function 'void dfs(int, int, int, bool)': a.cc:14:7: error: reference to 'visit' is ambiguous 14 | if(visit[x]) return; | ^~~~~ 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: ...
s362457176
p03660
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; #define rep(i,n) for(int i=0;i<(int)(n);i++) const int INF =1001001001; const int MAX = 100000; bool graph[MAX][MAX]; int distA[MAX]; int distB[MAX]; bool visit[MAX]; void dfs(int x, int n, int count, bool a){ if(visit[x]) return; visit[x] = true...
a.cc: In function 'void dfs(int, int, int, bool)': a.cc:14:7: error: reference to 'visit' is ambiguous 14 | if(visit[x]) return; | ^~~~~ 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: ...
s124247273
p03660
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; #define rep(i,n) for(int i=0;i<(int)(n);i++) const int INF =1001001001; const int MAX = 100000; bool graph[MAX][MAX]; int distA[MAX]; int distB[MAX]; bool visit[MAX]; void dfs(int x, int n, int count, bool a){ if(visit[x]) return; visit[x] = true...
a.cc: In function 'void dfs(int, int, int, bool)': a.cc:14:7: error: reference to 'visit' is ambiguous 14 | if(visit[x]) return; | ^~~~~ 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: ...
s136296465
p03660
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; #define rep(i,n) for(int i=0;i<(int)(n);i++) const int INF =1001001001; const int MAX = 100000; bool graph[MAX][MAX]; int distA[MAX]; int distB[MAX]; bool visit[MAX]; void dfs(int x, int n, int count, bool a){ if(visit[x]) return; visit[x] = true...
a.cc: In function 'void dfs(int, int, int, bool)': a.cc:14:7: error: reference to 'visit' is ambiguous 14 | if(visit[x]) return; | ^~~~~ 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: ...
s973163915
p03660
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; #define rep(i,n) for(int i=0;i<(int)(n);i++) const int INF =1001001001; const int MAX = 100000; bool graph[MAX][MAX]; int distA[MAX]; int distB[MAX]; bool visit[MAX]; void dfs(int x, int n, int count, bool a){ if(visit[x]) return; visit[x] = true...
a.cc: In function 'void dfs(int, int, int, bool)': a.cc:14:7: error: reference to 'visit' is ambiguous 14 | if(visit[x]) return; | ^~~~~ 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: ...
s409017467
p03660
C++
import java.io.PrintWriter import java.util.* import java.math.* import java.lang.* import kotlin.comparisons.* val pw = PrintWriter(System.out) val MOD: Long = (1e+9 + 7).toLong() // data class Position(val cur: Int) class Dfs(val n: Int, val edges: Array<MutableList<Int>>) { fun dfs(start: Int, goal: Int): Int { ...
a.cc:137:26: error: too many decimal points in number 137 | for(i in 0..perm.size) { | ^~~~~~~~~~~~ a.cc:148:18: error: too many decimal points in number 148 | val v = (0..n).map { (0..n).map{0L}.toMutableList() }.toMutableList() | ^~~~ a...
s630088549
p03660
C++
#include <algorithm> #include <iostream> #include <iomanip> #include <cassert> #include <cstring> #include <string> #include <vector> #include <random> #include <bitset> #include <queue> #include <cmath> #include <unordered_map> #include <set> #include <map> #define INCANT cin.tie(0), cout.tie(0), ios::sync_with_stdio(...
/tmp/ccr1rEVy.o: in function `main': a.cc:(.text+0x834): relocation truncated to fit: R_X86_64_PC32 against symbol `S' defined in .bss section in /tmp/ccr1rEVy.o a.cc:(.text+0x84d): relocation truncated to fit: R_X86_64_PC32 against symbol `q2' defined in .bss section in /tmp/ccr1rEVy.o a.cc:(.text+0x863): relocation t...
s439398609
p03660
C++
using System; using System.Collections.Generic; using System.IO; using System.Linq; class Program { static void Main(string[] args) { var N = sc.ReadInt(); var g = new List<int>[N]; for (int i = 0; i < N; i++) { g[i] = new List<int>(); } for (int i = ...
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.I...
s905174548
p03660
C++
package main import ( "bufio" "fmt" "os" "strconv" ) var sc = bufio.NewScanner(os.Stdin) func Scanner() string { sc.Scan() return sc.Text() } func main() { buf := make([]byte, 0) sc.Buffer(buf, 1000000007) sc.Split(bufio.ScanWords) n, _ := strconv.Atoi(Scanner()) tree := make([][]int, n) for i := 0; i <...
a.cc:1:1: error: 'package' does not name a type 1 | package main | ^~~~~~~ a.cc:17:1: error: 'func' does not name a type 17 | func main() { | ^~~~
s342513561
p03660
C++
#include <iostream> #include <algorithm> #include <string> #include <vector> using namespace std; int N; vector<int> graph[100010]; int memo[100010]; int solve(int indx, bool fennec) { if (memo[indx] != -1) { return memo[indx]; } memo[indx] = 0; int enemy = N-1; if (!fennec) { enemy ...
a.cc: In function 'int main()': a.cc:50:5: error: 'memset' was not declared in this scope 50 | memset(memo, -1, sizeof(memo)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <vector> +++ |+#include <cstring>...
s678536707
p03660
C++
#include <iostream> #include <string> #include <algorithm> #include <functional> #include <vector> #include <stack> #include <queue> #include <deque> #include <set> #include <map> #include <cstdio> #include <cmath> #include <tuple> #include <iomanip> #include <numeric> #include <unordered_map> #include <sstream> #in...
a.cc: In function 'void solve()': a.cc:81:18: error: expected primary-expression before '<' token 81 | if(dist0[i] =< distN[i]) | ^
s158722467
p03660
C++
using namespace std; int main() { cout << "Snuke" << endl; return 0; }
a.cc: In function 'int main()': a.cc:5:3: error: 'cout' was not declared in this scope 5 | cout << "Snuke" << endl; | ^~~~ a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | a.cc:5:22: error: 'endl' w...
s451603094
p03660
C++
#include<bits/stdc++.h> #define loop(a,b) for(b=0;b<a;b++) #define append push_back vector<int>a[10000]; void dfs(int,int,int,int*); int main(){ // freopen("1.txt","r",stdin); int black[10000]={},white[10000]={}; int n,i; cin>>n; n--; loop(n,i){ int x,y; cin>>x>>y; x--;y--; a[x].append(y); a[y].append(x...
a.cc:4:1: error: 'vector' does not name a type 4 | vector<int>a[10000]; | ^~~~~~ a.cc: In function 'int main()': a.cc:10:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 10 | cin>>n; | ^~~ | std::cin In file included from /usr/include/x86_64-linux...
s854022733
p03660
C++
#include <iostream> #include <fstream> #include <vector> #include <cstring> #include <queue> #include <algorithm> // sort #include <math.h> #define DEBUG 0 #define REP(i, n) for (long long i = 0; i < (n); i++) typedef long long ll; static const ll mod = 1000000007; static const ll INF = 1000000000000000000LL; ...
a.cc: In function 'int main()': a.cc:90:20: error: no match for 'operator-' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'} and 'int') 90 | REP(i, (d[N-1] - 1) / 2) a.cc:11:46: note: in definition of macro 'REP' ...
s996845508
p03660
C++
//#include <tourist> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <iostream> #include <string> #include <iomanip> #include <limits> #include <vector> #include <map> #include <set> #include <stack> #include <list> #include <queue> #include <tuple> #include <deque> #include <algorithm...
a.cc: In function 'int dfsc(int, int)': a.cc:63:11: error: lvalue required as left operand of assignment 63 | if(res/2=count) center=a; | ~~~^~
s520592390
p03660
C++
#include <iostream> #include <cstdio> #include <string> #include <algorithm> #include <utility> #include <cmath> #include <vector> #include <queue> #include <set> #include <map> #define rep(i, n) for(int i = 0; i < n; i++) using namespace std; typedef long long ll; using Graph = vector<vector<ll>>; const ll mod = 10000...
a.cc: In function 'int main()': a.cc:36:13: error: 'root0' was not declared in this scope 36 | Q0.push(root0); | ^~~~~ a.cc:56:13: error: 'rootN' was not declared in this scope 56 | QN.push(rootN); | ^~~~~
s395427459
p03660
C++
#include <iostream> #include <cstdio> #include <string> #include <algorithm> #include <utility> #include <cmath> #include <vector> #include <queue> #include <set> #include <map> #define rep(i, n) for(int i = 0; i < n; i++) using namespace std; typedef long long ll; using Graph = vector<vector<ll>>; const ll mod = 10000...
a.cc: In function 'int main()': a.cc:36:5: error: conflicting declaration 'const ll dist0 [0]' 36 | dist0[root0] = 0; | ^~~~~ a.cc:32:16: note: previous declaration as 'std::vector<long long int> dist0' 32 | vector<ll> dist0(n, -1LL), distN(n, -1LL); | ^~~~~
s689581800
p03660
C++
#include <iostream> #include <cstdio> #include <string> #include <algorithm> #include <utility> #include <cmath> #include <vector> #include <queue> #include <set> #include <map> #define rep(i, n) for(int i = 0; i < n; i++) using namespace std; typedef long long ll; using Graph = vector<vector<ll>>; const ll mod = 10000...
a.cc: In function 'int main()': a.cc:36:5: error: conflicting declaration 'const int dist0 [0]' 36 | dist0[root0] = 0; | ^~~~~ a.cc:32:16: note: previous declaration as 'std::vector<long long int> dist0' 32 | vector<ll> dist0(n, -1), distN(n, -1); | ^~~~~
s432650991
p03660
C++
//どうしてもフェネちゃん VS きすけくん にしたかった.......... /* include */ #include <cstdio> /* using namespace */ using namespace std; /* local var */ vector<int> グラフ[100005]; /* define */ #define loop(i,j) for(int i = 0; i < j; i++) /* typedef */ typedef long long ll; /* function */ void dfs(int マス,int 前回いた場所,int 距離差,in...
a.cc:10:1: error: 'vector' does not name a type 10 | vector<int> グラフ[100005]; | ^~~~~~ a.cc: In function 'void dfs(int, int, int, int*)': a.cc:23:23: error: '\U000030b0\U000030e9\U000030d5' was not declared in this scope 23 | loop(i,sizeof(グラフ[マス])){ | ^~~~~~ a.cc:13:38: ...
s017761360
p03660
C++
//どうしてもフェネちゃん VS きすけくん にしたかった.......... /* include */ #include <cstdio> /* using namespace */ using namespace std; /* local var */ int グラフ[100][100]; /* define */ #define loop(i,j) for(int i = 0; i < j; i++) /* typedef */ typedef long long ll; /* function */ void dfs(int マス,int 前回いた場所,int 距離差,int 距離配列...
a.cc: In function 'int main()': a.cc:43:31: error: request for member 'push_back' in '\U000030b0\U000030e9\U000030d5[\U00009023\U00007d50A]', which is of non-class type 'int [100]' 43 | グラフ[連結A].push_back(連結B); //グラフに辺を追加する この時点では「有向グラフ(AからBにしか行けない)」 | ^~~~~~~~~ a...
s707702623
p03660
C++
//どうしてもフェネちゃん VS きすけくん にしたかった.......... /* include */ #include <cstdio> /* using namespace */ using namespace std; /* local var */ int グラフ[100][100]; /* define */ #define loop(i,j) for(int i = 0; i < j; i++) /* typedef */ typedef long long ll; /* function */ void dfs(int マス,int 前回いた場所,int 距離差,int 距離配列...
a.cc:28:1: error: 'x' does not name a type 28 | x | ^
s417765249
p03660
C++
#include <set> #include "algorithm-lib.hpp" using graph = map<i32, vector<i32>>; void dfs(i32 depth, i32 curr, graph& g, vector<i32>& d) { d[curr] = depth; for (const auto& next : g[curr]) { if (d[next] >= 0) continue; dfs(depth + 1, next, g, d); } } int main() { i32 N; graph g; cin >> N; REP(i, N-1) ...
a.cc:2:10: fatal error: algorithm-lib.hpp: No such file or directory 2 | #include "algorithm-lib.hpp" | ^~~~~~~~~~~~~~~~~~~ compilation terminated.
s904369581
p03660
C++
#include <stdio.h> #include <vector> #include <algorithm> #define FOR(i, a, b) for(int (i) = (a); (i) < (b); ++(i)) #define REP(i, n) FOR(i, 0, n) std::vector<std::vector<int>> Edge; std::vector<int> Dist[2]; std::vector<bool> yet; int main(void){ int n; scanf("%d", &n); Edge.resize(n); FOR(_, 1, n){ ...
a.cc: In function 'int main()': a.cc:25:14: error: 'queue' is not a member of 'std' 25 | std::queue<int> Q; | ^~~~~ a.cc:4:1: note: 'std::queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>' 3 | #include <algorithm> +++ |+#include <queue> 4...
s733807050
p03660
C++
//#include "pch.h" #include "stdafx.h" #include <iostream> #include <queue> #include <vector> #include <algorithm> #include <math.h> #include <string> #include <cstring> using namespace std; /*-----------------------------------------------------------------------------  定義 ------------------------------------------...
a.cc:2:10: fatal error: stdafx.h: No such file or directory 2 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s825821572
p03660
C++
#include <iostream> #include <fstream> #include <string> #include <cmath> #include <cstdio> #include <algorithm> #include <iomanip> #include <vector> #include <utility> #include <numeric> #include <stack> #include <queue> #include <map> #include <set> #include <unordered_map> #include <limits.h> #include <bitset> #defi...
a.cc: In function 'int main()': a.cc:51:14: error: expected primary-expression before '>' token 51 | cout<<(a=>b?"Fennec":"Snuke")<<endl; | ^
s037338165
p03660
C++
#include<iostream> #include<queue> #include<vector> using namespace std; const int MAXN=100000+10; vector<int> edge[MAXN]; int n,cnt[3]; int tree[MAXN]; void bfs() { queue<int> q; q.push(1),q.push(n); while(!q.empty()) { int temp=q.front(); q.pop(); cnt[tree[temp]]++; ...
a.cc: In function 'int main()': a.cc:34:5: error: 'memset' was not declared in this scope 34 | memset(tree,0,sizeof(tree)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<queue> +++ |+#include <cstring> ...
s451582410
p03660
C++
#include<iostream> #include<queue> #include<vector> using namespace std; const int MAXN=100000+10; vector<int> edge[MAXN]; int n,cnt[3]; int tree[MAXN]; void bfs() { queue<int> q; q.push(1),q.push(n); while(!q.empty()) { int temp=q.front(); q.pop(); cnt[tree[temp]]++; ...
a.cc: In function 'int main()': a.cc:34:5: error: 'memset' was not declared in this scope 34 | memset(tree,0,sizeof(tree)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<queue> +++ |+#include <cstring> ...
s182150428
p03660
C++
#include <iostream> #include <vector> #include <queue> using namespace std; const int INF = 1000000000; int N; vector<int> bfs(vector<int> G[N], int s) { queue<int> que; vector<int> dist(N, INF); que.push(s); dist[s] = 0; while (!que.empty()) { int u = que.front(); que.pop(); for (...
a.cc:9:31: error: size of array 'G' is not an integral constant-expression 9 | vector<int> bfs(vector<int> G[N], int s) { | ^
s569660606
p03660
C++
#include<cstdio> #include<cstdlib> #include<algorithm> #include<iostream> #include<queue> #include<vector> #include <bitset> #include<math.h> using namespace std; #define INF 110000000000 #define MOD 1000000007 typedef long long ll; typedef pair<int,int> P; vector<int> V[110000]; int mycount=0; int N,a,b; ll dis[1100...
a.cc: In function 'void dfs(int)': a.cc:22:6: error: 'nx' was not declared in this scope; did you mean 'x'? 22 | if(nx==N) return; | ^~ | x a.cc: At global scope: a.cc:68:13: error: redefinition of 'std::vector<int> V [110000]' 68 | vector<int> V[110000]; | ^ a.cc:15:13: ...
s096160944
p03660
C++
#include <iostream> #include <queue> #include <vector> using namespace std; const int maxn=200010; vector<int>v[maxn]; queue<int> q1,q2; int n,m,col[maxn],g[maxn]; void dfs(int x,int f,int t) { if(x==n-1) return; col[x]=col[f]; g[x]=t; for(int i=0;i<v[x].size();i++) { if(v[x][i]==f)continue; dfs(v[x][i],x,t+...
a.cc:39:1: error: expected initializer before 'using' 39 | using namespace std; | ^~~~~ a.cc:40:26: error: redefinition of 'const int maxn' 40 | const int INF=0x3f3f3f3f,maxn=200010; | ^~~~ a.cc:5:11: note: 'const int maxn' previously defined here 5 | const int maxn=200010...
s480786499
p03660
C++
#include <iostream> #include <queue> #include <vector> using namespace std; const int INF=0x3f3f3f3f,maxn=200010; vector<int>v[maxn]; queue<int> q1,q2; int n,m,col[maxn],g[maxn]; void dfs(int x,int f,int t) { if(x==n-1) return; col[x]=col[f]; g[x]=t; for(int i=0;i<v[x].size();i++) { if(v[x][i]==f)continue; d...
a.cc:39:1: error: expected initializer before 'using' 39 | using namespace std; | ^~~~~ a.cc:40:11: error: redefinition of 'const int INF' 40 | const int INF=0x3f3f3f3f,maxn=200010; | ^~~ a.cc:5:11: note: 'const int INF' previously defined here 5 | const int INF=0x3f3f3f3f,maxn=200010; ...
s709197478
p03660
C++
#include <iostream> #include <queue> #include <vector> using namespace std; const int INF=0x3f3f3f3f,maxn=200010; vector<int>v[maxn]; queue<int> q1,q2; int n,m,col[maxn],g[maxn]; void dfs(int x,int f,int t) { if(x==n-1) return; col[x]=col[f]; g[x]=t; for(int i=0;i<v[x].size();i++) { if(v[x][i]==f)continue; d...
a.cc:39:1: error: expected initializer before 'using' 39 | using namespace std; | ^~~~~ a.cc:40:11: error: redefinition of 'const int INF' 40 | const int INF=0x3f3f3f3f,maxn=200010; | ^~~ a.cc:5:11: note: 'const int INF' previously defined here 5 | const int INF=0x3f3f3f3f,maxn=200010; ...
s852449943
p03660
C++
#include <bits\stdc++.h> #include <queue> using namespace std; const int INF=0x3f3f3f3f,maxn=200010; vector<int>v[maxn]; queue<int> q1,q2; int n,m,col[maxn]; int bfs() { int i; while(1) { int x=q1.front();q1.pop(); col[x]=1; for(i=0;i<v[x].size();i++) { if(col[v[x][i]]==0) q1.push(v[x][i]); } ...
a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory 1 | #include <bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s587197895
p03660
C++
#pragma GCC optimize("Ofast",3,"inline") #include <bits/stdc++.h> using namespace std; typedef long long ll; const MAXN=1<<18; int n; vector<int> e[MAXN]; int cnt[MAXN]; vector<int> vct; int first; void dfs(int v,int pr){ cnt[v]=1; vct.pushback(v); if(v==n-1){ first=vct[((int) vct.size()+1)/2]; } for(int to:e[v]...
a.cc:5:7: error: 'MAXN' does not name a type 5 | const MAXN=1<<18; | ^~~~ a.cc:7:15: error: 'MAXN' was not declared in this scope 7 | vector<int> e[MAXN]; | ^~~~ a.cc:8:9: error: 'MAXN' was not declared in this scope 8 | int cnt[MAXN]; | ^~~~ a.cc: In function '...
s353499416
p03660
C
#include <cstdio> #include <iostream> #include <algorithm> #include <vector> #include <utility> #include <queue> #include <cstring> using namespace std; const long long MOD = 1000000007; typedef long long ll; int main(int argc, const char *argv[]) { vector<int> g[100010]; int n; scanf("%d", &n); int a, b; f...
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s257157965
p03660
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++) 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; return c+i_7; } using namespace st...
a.cc: In function 'int main()': a.cc:130:8: error: 'dist' was not declared in this scope; did you mean 'distN'? 130 | if(dist[i]<=distN[i]){ | ^~~~ | distN
s997335592
p03660
C++
#include<iostream> #include<queue> #include<vector> using namespace std; const int MAXN=100000+10; vector<int> edge[MAXN];//用邻接表来实现树的存储 int n,cnt[3];//cnt用来记录颜色数量 int tree[MAXN];//tree数组储存每个节点的颜色,1是指black,2指white void bfs() { queue<int> q; q.push(1),q.push(n);//Fennec先,Snuke后,所以先后入队 while(!q.empty()) ...
a.cc: In function 'int main()': a.cc:35:5: error: 'memset' was not declared in this scope 35 | memset(tree,0,sizeof(tree)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<queue> +++ |+#include <cstring> ...
s943650043
p03660
C++
//file_name:ABC67_D.cpp #include <bits/stdc++.h> #define fi first #define se second #define rep(i,n) for(int i = 0; i < (n); ++i) #define rrep(i,n) for(int i = 1; i <= (n); ++i) #define drep(i,n) for(int i = (n)-1; i >= 0; --i) #define srep(i,s,t) for (int i = s; i < t; ++i) #define rng(a) a.begin(),a.end() #define max...
a.cc:78:5: error: conflicting declaration 'int INF' 78 | int INF = 1001001001; | ^~~ a.cc:50:11: note: previous declaration as 'const int INF' 50 | const int INF = 1001001001; | ^~~ a.cc: In function 'int main()': a.cc:145:12: error: 'd1' was not declared in this scope; did you mean 'y1'...
s140756482
p03660
C++
#include <iostream> #include <string> #include <algorithm> #include <cstdlib> #include <cmath> #include <queue> #include <vector> #include <set> #include <map> #include <numeric> #include <iomanip> #include <tuple> using namespace std; bool d[100005][100005]; bool used[100005]; int res=0; int dfs(int s,int t,int n){ ...
/tmp/ccJcGYzI.o: in function `dfs(int, int, int)': a.cc:(.text+0x48): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccJcGYzI.o a.cc:(.text+0x67): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccJcGYzI.o a.cc:(.text+0x7...
s053106562
p03660
C++
#include<iostream> #include<queue> #include<vector> using namespace std; const int MAXN=100000+10; vector<int> edge[MAXN];//用邻接表来实现树的存储 int n,cnt[3];//cnt用来记录颜色数量 int tree[MAXN];//tree数组储存每个节点的颜色,1是指black,2指white void bfs() { queue<int> q; q.push(1),q.push(n);//Fennec先,Snuke后,所以先后入队 while(!q.empty()) ...
a.cc: In function 'int main()': a.cc:35:5: error: 'memset' was not declared in this scope 35 | memset(tree,0,sizeof(tree)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<queue> +++ |+#include <cstring> ...
s217914211
p03660
C++
#include<iostream> #include<queue> #include<vector> using namespace std; const int MAXN=100000+10; vector<int> edge[MAXN];//用邻接表来实现树的存储 int n,cnt[3];//cnt用来记录颜色数量 int tree[MAXN];//tree数组储存每个节点的颜色,1是指black,2指white void bfs() { queue<int> q; q.push(1),q.push(n);//Fennec先,Snuke后,所以先后入队 while(!q.empty()) ...
a.cc: In function 'int main()': a.cc:35:5: error: 'memset' was not declared in this scope 35 | memset(tree,0,sizeof(tree)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<queue> +++ |+#include <cstring> ...
s232428205
p03660
C++
#ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #includ...
a.cc: In function 'int main()': a.cc:318:12: error: 'Snuke' was not declared in this scope 318 | COUT(Snuke); | ^~~~~ a.cc:115:24: note: in definition of macro 'COUT' 115 | #define COUT(x) cout<<(x)<<endl | ^ a.cc:322:12: error: 'Fennec' was not declared in this s...
s505230250
p03660
C++
#include<iostream> #include<queue> #include<vector> using namespace std; const int MAXN=100000+10; vector<int> edge[MAXN];//用邻接表来实现树的存储 int n,cnt[3];//cnt用来记录颜色数量 int tree[MAXN];//tree数组储存每个节点的颜色,1是指black,2指white void bfs() { queue<int> q; q.push(1),q.push(n);//Fennec先,Snuke后,所以先后入队 while(!q.empty()) ...
a.cc: In function 'int main()': a.cc:35:5: error: 'memset' was not declared in this scope 35 | memset(tree,0,sizeof(tree)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<queue> +++ |+#include <cstring> ...
s370425069
p03660
C++
#include "bits/stdc++.h" using namespace std; const ll MAX_V = 100100; ll V, E; vector<ll> G[MAX_V]; ll cnt[2], mark[MAX_V]; bool f[2][MAX_V]; void dfs(ll s, ll n) { for (ll i = 0; i < G[s].size(); i++) { ll u = G[s][i]; if(f[n][u]) continue; f[n][u] = true; cnt[n]++; mark[u]++; dfs(u, n); } } int m...
a.cc:4:7: error: 'll' does not name a type 4 | const ll MAX_V = 100100; | ^~ a.cc:6:1: error: 'll' does not name a type 6 | ll V, E; | ^~ a.cc:7:8: error: 'll' was not declared in this scope 7 | vector<ll> G[MAX_V]; | ^~ a.cc:7:10: error: template argument 1 is invalid 7 |...
s331314457
p03660
C++
#include <bits/stdc++.h> //#include <mylib.h> using namespace std; //cin.sync_with_stdio(false); #define FOR(i,a,b) for(int i = (a); i < (b); ++i) #define FOR_EQ(i,a,b) for(int i = (a); i <= (b); ++i) #define FOR_RE(i,a,b) for(int i = (a); i > (b); --i) #define rep(i,n) FOR(i,0,n) #define rep_eq(i,n) FOR_EQ(i,0,n) #de...
/tmp/cc1JGL9w.o: in function `dfs_visit(int, bool)': a.cc:(.text+0x2f): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cc1JGL9w.o a.cc:(.text+0x57): relocation truncated to fit: R_X86_64_PC32 against symbol `dis_F' defined in .bss section in /tmp/cc1JGL9w.o a.cc:(.text...
s849779144
p03660
C++
#include<algorithm> #include<complex> #include<ctype.h> #include<iomanip> #include<iostream> #include<map> #include<math.h> #include<numeric> #include<queue> #include<set> #include<stack> #include<stdio.h> #include<string> #include<string> #include<vector> using namespace std; typedef long long ll; #define FOR(i,a,b)...
a.cc: In function 'int main()': a.cc:78:5: error: 'memcpy' was not declared in this scope 78 | memcpy(d0, d, sizeof(d)); | ^~~~~~ a.cc:12:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 11 | #include<stack> +++ |+#include <cstring> 12 ...
s914277923
p03660
C++
#include <iostream> #include <string> #include <vector> #include <utility> #include <functional> #include <numeric> #include <list> #include <set> #include <map> #define v_exists(elem, v) find(v.begin(),v.end(),elem)!=v.end() #define s_exists(elem, s) s.find(elem)!=s.end() using namespace std; const int MOD = 1000000...
a.cc: In function 'void dfs1(long int, long int)': a.cc:54:25: error: 'dfs' was not declared in this scope; did you mean 'dfs1'? 54 | dfs(adj[s][i], d+1); | ^~~ | dfs1 a.cc: In function 'void dfs2(long int, long int)': a.cc:65:25: er...
s009501549
p03660
C++
#include <iostream> #include <string> #include <vector> #include <utility> #include <functional> #include <numeric> #include <list> #include <set> #include <map> #define v_exists(elem, v) find(v.begin(),v.end(),elem)!=v.end() #define s_exists(elem, s) s.find(elem)!=s.end() using namespace std; const int MOD = 1000000...
a.cc: In function 'void dfs1(long int, long int)': a.cc:54:54: error: 'd_list' was not declared in this scope; did you mean 'va_list'? 54 | dfs(adj[s][i], d+1, visited, d_list); | ^~~~~~ | ...
s279293511
p03660
C++
#include <iostream> using namespace std; int main() { int N; int i,j; int a[1000],b[1000]; for(i=0;i<N;i++){ for(j=0;j<2;j++){ cin>>a[i][j]>>b[i][j]; } } if(N%2){ cout<<"Fennec"<<endl; }else{ cout<<"Snuke"<<endl; } }
a.cc: In function 'int main()': a.cc:10:34: error: invalid types 'int[int]' for array subscript 10 | cin>>a[i][j]>>b[i][j]; | ^ a.cc:10:43: error: invalid types 'int[int]' for array subscript 10 | cin>>a[i][j]>>b[i][j]; |...
s484996497
p03660
C++
#include<iostream> #include<string> #include<algorithm> #include<vector> #include<queue> #include<map> #include<math.h> #include<iomanip> #include<set> #include <numeric> #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i = m;i < n;i++) #define FORR(i...
a.cc: In function 'int main()': a.cc:83:9: error: 'memset' was not declared in this scope 83 | memset(vis1, 0, sizeof(vis1)); memset(visN, 0, sizeof(visN)); | ^~~~~~ a.cc:12:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 11 | #incl...
s573844640
p03660
C++
#include<iostream> #include<string> #include<algorithm> #include<vector> #include<queue> #include<map> #include<math.h> #include<iomanip> #include<set> #include <numeric> #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i = m;i < n;i++) #define FORR(i...
a.cc: In function 'int main()': a.cc:23:15: error: 'memset' was not declared in this scope 23 | #define m0(x) memset(x,0,sizeof(x)) | ^~~~~~ a.cc:80:9: note: in expansion of macro 'm0' 80 | m0(vis1); m0(visN); | ^~ a.cc:12:1: note: 'memset' is defined in header '<cstring>...
s751733648
p03660
C++
#include<iostream> #include<string> #include<algorithm> #include<vector> #include<queue> #include<map> #include<math.h> #include<iomanip> #include<set> #include <numeric> #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i = m;i < n;i++) #define FORR(i...
a.cc: In function 'int main()': a.cc:23:15: error: 'memset' was not declared in this scope 23 | #define m0(x) memset(x,0,sizeof(x)) | ^~~~~~ a.cc:80:9: note: in expansion of macro 'm0' 80 | m0(vis1); m0(visN); | ^~ a.cc:12:1: note: 'memset' is defined in header '<cstring>...
s190505705
p03660
Java
import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Scanner; public class Main { static int n; static List<List<Integer>> list; public static void main(String[] args) { Scanner sc = new Scanner(System.in); n = sc.nextInt(); list = new ArrayList<>(n); for(int i = 0;...
Main.java:38: error: illegal start of expression static int[] dfs(int s, int p, int[] ret) { ^ 1 error
s531969964
p03660
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; vector<int>edge[n]; for(int i=0;i<n-1;i++){ int a,b; cin>>a>>b; a--; b--; edge[a].push_back(b); edge[b].push_back(a); } int black[n]; memset(black,-1,sizeof black); qu...
a.cc:59:2: error: stray '\' in program 59 | }\ | ^
s026006212
p03660
C++
#include<cstdio> #include<iostream> #include<algorithm> #include<cstring> #define N 654321 using namespace std; int n,rt,size[N],fa[N],cnt=0,sum1,sum2; int TOT,EN[N],LA[N],NE[N]; void ADD(int x,int y) { TOT++; EN[TOT]=y; NE[TOT]=LA[x]; LA[x]=TOT; } void DFS(int u,int f) { int i,v; fa[u]=f; size[u]=1; for(i=LA[...
a.cc: In function 'void DFS(int, int)': a.cc:21:9: error: reference to 'size' is ambiguous 21 | size[u]=1; | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41...
s997384956
p03660
C++
#include <iostream> #include <deque> using namespace std; int matrix[100001][100001] = {}; int n; deque<int> path; bool visited[100001] = {}; bool dfs(int current){ //cout << current; path.push_back(current); visited[current]=true; if(current==n)return true; for(int j = 1; j <= n; j++){ if...
/tmp/ccpCCIK1.o: in function `dfs(int)': a.cc:(.text+0x15): relocation truncated to fit: R_X86_64_PC32 against symbol `path' defined in .bss section in /tmp/ccpCCIK1.o a.cc:(.text+0x29): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/ccpCCIK1.o a.cc:(.text+0x36): rel...
s376942239
p03660
C++
#include <iostream> #include <algorithm> #include <functional> #include <vector> #include <queue> #include <stack> #include <set> #include <bitset> #include <cmath> #include <string> #include <fstream> #define FI first #define SE second #define VE vector<int> #define PB push_back #define PA pair<int,int> #define MA mak...
a.cc:47:1: error: expected unqualified-id before '{' token 47 | {int main(){ | ^
s478861444
p03660
C++
#include<queue> #include<stack> #include<map> #include<set> #include<cstdio> #include<vector> #include<iostream> #include<string> #include<algorithm> using namespace std; bool tr[100005][100005]={0}; int n,a,b; int stepfen[100005]={0},stepsnu[100005]={0}; bool spot[1000005]={0}; int main(){ cin>>n; for(int i=1;i<=n;i...
/tmp/ccKOfnNr.o: in function `main': a.cc:(.text+0xf): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccKOfnNr.o a.cc:(.text+0x34): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccKOfnNr.o a.cc:(.text+0x50): relocation trunca...
s059912296
p03660
C++
#include<iostream> #include<string> #include<queue> #include<set> #include<map> #include<vector> #include<algorithm> #include<memory> using namespace std; vector<int> con[100001]; int N; int a[2][100001]; queue<int> q[2]; int main() { cin>>N; for (int i=0;i<N-1;i++) { int x,y; cin>>x>>y; con[x].push_b...
a.cc: In function 'int main()': a.cc:24:3: error: 'memset' was not declared in this scope 24 | memset(a,-1,sizeof(a)); | ^~~~~~ a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 8 | #include<memory> +++ |+#include <cstring> 9 | usin...
s612923199
p03660
C++
#include<iostream> #include<vector> #include<queue> using namespace std; vector<int> sons[100001]; queue<int> q; int da[100001],db[100001]; bool v[100001]; int main(){ int n,a,b,x,u; cin >> n; for(int i=1;i<=n-1;i++){ cin >> a >> b; sons[a].push_back(b); sons[b].push_back(a); } a=1; b=n; memset(v,0,sizeof(v)); for(in...
a.cc: In function 'int main()': a.cc:19:1: error: 'memset' was not declared in this scope 19 | memset(v,0,sizeof(v)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<queue> +++ |+#include <cstring> 4 | using name...
s603233103
p03660
C++
#include<iostream> #include<vector> #include<queue> using namespace std; vector<int> sons[100001]; queue<int> q; int da[100001],db[100001]; bool v[100001]; int main(){ int n,a,b,x,u; cin >> n; for(int i=1;i<=n-1;i++){ cin >> a >> b; sons[a].push_back(b); sons[b].push_back(a); } a=1; b=n; memset(v,0,sizeof(v)); for(in...
a.cc: In function 'int main()': a.cc:19:1: error: 'memset' was not declared in this scope 19 | memset(v,0,sizeof(v)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<queue> +++ |+#include <cstring> 4 | using name...
s018702405
p03660
C++
using System; namespace agc019_b { class Program { static void Main(string[] args) { string s = Console.ReadLine(); long ret = (long)s.Length * (s.Length - 1); for (int i = 0; i < s.Length; i++) { for (int j = 0; j < s.Length; j++)...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:7:26: error: 'string' has not been declared 7 | static void Main(string[] args) | ^~~~~~ a.cc:7:35: error: expected ',' or '...' before 'args' 7 | static...
s005784862
p03660
C++
#include <iostream> #include <ostream> #include <istream> #include <cmath> #include <string> #include <vector> #include <sstream> #include <cstring> #include <cstdio> #include <cstdlib> #include <algorithm> #include <queue> #include <deque> #include <stack> #include <map> #include <vector> #include <set> #define pb pus...
a.cc:35:15: error: 'INT_MAX' was not declared in this scope 35 | const int INF=INT_MAX/2; | ^~~~~~~ a.cc:18:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 17 | #include <set> +++ |+#include <climits> 18 | #define pb push_back
s310240235
p03660
C++
#include<bits/stdc++.h> using namespace std; const int Mod=1e9+7; const int INF=INT_MAX/2; vector<int> bfs(int N,vector<vector<int>>& G,int s) { vector<int> d(N,INF); d[s]=0; queue<int> q; q.push(s); while(q.size()) { int u=q.front(); q.pop(); for(int v:G[u]) { if(d[v]>d[u]+1) { d[v]=d[u]+1; q.pus...
a.cc: In function 'int main()': a.cc:26:14: error: 'i' was not declared in this scope 26 | forn(i,n-1) { | ^ a.cc:26:9: error: 'forn' was not declared in this scope; did you mean 'fork'? 26 | forn(i,n-1) { | ^~~~ | fork a.cc:36:14: error: 'u' was not ...