submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s578439541
p03855
C++
#include "pch.h" #include <iostream> #include <string> #include <algorithm> #include <vector> #include <iomanip> #include <cmath> #include <queue> #include <stack> #include <cstdlib> #include <map> using namespace std; #define rep(i,n) for(int i=0;i<n;i++) #define pie 3.141592653589793238462643383279 #define mod 998244...
a.cc:1:10: fatal error: pch.h: No such file or directory 1 | #include "pch.h" | ^~~~~~~ compilation terminated.
s036480910
p03855
C++
#include<iostream> #include<algorithm> using lint=int64_t; using namespace std; #include<vector> template<typename T> class UnionFind { public: vector<T> parent; vector<T> sz; UnionFind(T n):parent(n),sz(n) { for(int i=0;i<n;i++) parent[i]=i; for(int i=0;i<n;i++) sz[i]=1; } void unite(T a,T b) { ...
a.cc: In function 'int main()': a.cc:64:17: error: 'uf1' was not declared in this scope; did you mean 'uf2'? 64 | uf1.unite(p-1,q-1); | ^~~ | uf2 a.cc:70:20: error: 'uf1' was not declared in this scope; did you mean 'uf2'? 70 | if(uf1.roo...
s625794791
p03855
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; const double EPS = 1e-9; const int INF = 1e9; const int MOD = 1e9+7; const ll LINF = 1e18; typedef vector<int> vi; typedef vector<vector<int>> vvi; typedef vector<vector<ll>> vll; typedef pair<int, int> pi; typedef pair<ll, ll> pll; typedef map<int, in...
a.cc:89:8: error: conversion from 'double' to 'long unsigned int' in a converted constant expression 89 | int p[2*10e5], q[2*10e5], r[2*10e5], s[2*10e5]; | ~^~~~~ a.cc:89:8: error: could not convert '((double)2 * 1.0e+6)' from 'double' to 'long unsigned int' 89 | int p[2*10e5], q[2*10e5], r[2*10e5], s...
s618318388
p03855
C++
#include <algorithm> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <queue> #include <set> #include <stack> #include <unordered_set> #include <utility> #include <vector> using std::cerr; using std::cin; using std::cout; using std::endl; // Manages Union-Find Forest. class UnionFindF...
In file included from /usr/include/c++/14/bits/refwrap.h:39, from /usr/include/c++/14/deque:67, from a.cc:3: /usr/include/c++/14/bits/stl_function.h: In instantiation of 'constexpr bool std::less<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = Node]': /usr/include/c++/14/bit...
s416919084
p03855
C++
#include <algorithm> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <queue> #include <set> #include <stack> #include <unordered_set> #include <utility> #include <vector> using std::cerr; using std::cin; using std::cout; using std::endl; // Manages Union-Find Forest. class UnionFindF...
a.cc: In function 'int main()': a.cc:139:33: error: use of deleted function 'std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset() [with _Value = Node; _Hash = std::hash<Node>; _Pred = std::equal_to<Node>; _Alloc = std::allocator<Node>]' 139 | std::unordered_multiset<Node> set; | ...
s687824487
p03855
C++
#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++) class UnionFind{ public: vector<ll> par; vector<ll> rank; vector<ll> size; UnionFind(ll n){ for(int i = 0; i < n; i++){ ...
a.cc:46:19: error: 'llnt' has not been declared 46 | bool same(llnt x, ll y){ | ^~~~
s400087380
p03855
C++
#include <stdio.h> #include <string> #include <cstring> #include <stdlib.h> #include <math.h> #include <algorithm> #include <vector> #include <set> #include <map> #include <queue> #include <iterator> #pragma warning(disable:4996) typedef long long ll; #define MIN(a, b) ((a)>(b)? (b): (a)) #define MAX(a, b) ((a)<(b)? ...
a.cc: In function 'int main(int, char**)': a.cc:92:46: error: expected ')' before ']' token 92 | zz[make_pair(uf0.find(i), uf1.find(i)]++; | ~ ^ | )
s984039724
p03855
Java
import java.util.Arrays; import java.util.Scanner; public class ABC049D_ { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); int L = sc.nextInt(); DJSet road = new DJSet(N+1); DJSet rail = new D...
Main.java:4: error: class ABC049D_ is public, should be declared in a file named ABC049D_.java public class ABC049D_ { ^ 1 error
s290781325
p03855
C++
#include <bits/stdc++.h> using namespace std; template <> struct hash<pair<int, int>> { size_t operator()(const pair<int, int>& p) const { return hash<int>()(p.first) + hash<int>()(p.second); } }; class UnionFind { public: explicit UnionFind(int n) : vec(n + 1), rank(n + 1) { for (int i = 0; i <= n; ++...
a.cc:5:8: error: explicit specialization of 'template<class _Tp> struct std::hash' outside its namespace must use a nested-name-specifier [-fpermissive] 5 | struct hash<pair<int, int>> { | ^~~~~~~~~~~~~~~~~~~~
s608380321
p03855
C++
#include<bits/stdc++.h> using namespace std; map<pair<int,int>,int>father; #define twy(x,y) father[make_pair(x,y)] #define M 200001 int k1[M],k2[M]; int n,k,l,p,q,r,s; int find1(int x) { return k1[x]==x?k1[x]:k1[x]=find(k1[x]); } int find2(int x) { return k2[x]==x?k2[x]:k2[x]=find(k2[x]); } void kkk1(int x,int ...
a.cc: In function 'int find1(int)': a.cc:10:37: error: no matching function for call to 'find(int&)' 10 | return k1[x]==x?k1[x]:k1[x]=find(k1[x]); | ~~~~^~~~~~~ In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14...
s501599138
p03855
C++
#include<bits/stdc++.h> using namespace std; map<pair<int,int>,int>father; #define twy(x,y) father[make_pair(x,y)] #define M 200001 int k1[M],k2[M]; int n,k,l,p,q,r,s; int find1(int x) { return p1[x]==x?p1[x]:p1[x]=find(p1[x]); } int find2(int x) { return p1[x]==x?p1[x]:p1[x]=find(p1[x]); } void kkk1(int x,int ...
a.cc: In function 'int find1(int)': a.cc:10:12: error: 'p1' was not declared in this scope; did you mean 'y1'? 10 | return p1[x]==x?p1[x]:p1[x]=find(p1[x]); | ^~ | y1 a.cc: In function 'int find2(int)': a.cc:14:12: error: 'p1' was not declared in this scope; did you mean 'y1'? ...
s138850192
p03855
C++
#include <iostream> #include <map> using namespace std; const int N=200000+10; const int INF=10000000; int p1[N],p2[N]; map<pair<int,int>,int>m; inline int find(int x,int *p){ return p[x]==x?x:p[x]=find(p[x],p); } int main() { int n,k,l; int x,y; cin>>n>>k>>l; for(int i=1;i<=n;i++) p1[i]=i,p...
a.cc: In function 'int main()': a.cc:41:40: error: expected ';' before ')' token 41 | cout<<m[make_pair(p1[i],p2[i])])<<' '; | ^ | ;
s225345303
p03855
C++
#include <iostream> #include <map> using namespace std; const int N=200000+10; const int INF=10000000; int p1[N],p2[N]; map<pair<int,int>,int>m; inline int find(int x,int *p){ return p[x]==x?x:p[x]=find(p[x],p); } int main() { int n,k,l; int x,y; cin>>n>>k>>l; for(int i=1;i<=n;i++) p1[i]=i,p...
a.cc: In function 'int main()': a.cc:41:40: error: expected ';' before ')' token 41 | cout<<m[make_pair(p1[i],p2[i])])<<' '; | ^ | ;
s812411257
p03855
C++
#include <iostream> #include <map> using namespace std; const int N=200000+10; const int INF=10000000; int p1[N],p2[N]; map<pair<int,int>,int>m; inline int find(int x,int *p){ return p[x]==x?x:p[x]=find(p[x],p); } int main() { int n,k,l; int x,y; cin>>n>>k>>l; for(int i=1;i<=n;i++) p1[i]=i,p...
a.cc: In function 'int main()': a.cc:41:40: error: expected ';' before ')' token 41 | cout<<m[make_pair(p1[i],p2[i])])<<' '; | ^ | ;
s915908331
p03855
C++
#include<bits/stdc++.h> using namespace std; const int N=1e6+5; struct node{ int t,next; }e[N]; int head[N],cnt; void init(){ memset(head,-1,sizeof(head)); cnt=0; } void add(int u,int v){ e[cnt]=node{v,head[u]}; head[u]=cnt++; } int fa[N]; int father(int x){return x==fa[x]?x:fa[x]=father(fa[x]);} int join(int x,int y){...
a.cc:1:25: warning: extra tokens at end of #include directive 1 | #include<bits/stdc++.h> using namespace std; const int N=1e6+5; struct node{ int t,next; }e[N]; int head[N],cnt; void init(){ memset(head,-1,sizeof(head)); cnt=0; } void add(int u,int v){ e[cnt]=node{v,head[u]}; head[u]=cnt++; } int fa[N]; int father...
s049534667
p03855
C++
#include <bits/stdc++.h> using namespace std; class UnionFind { private: vector<int> parent; vector<int> height; vector<int> m_size; public: UnionFind(int size_) : parent(size_), height(size_, 0), m_size(size_, 1) { for (int i = 0; i < size_; ++i) parent[i] = i; } void init(int size_) { parent.resize(size_)...
a.cc: In function 'int main()': a.cc:57:7: error: 'i' was not declared in this scope 57 | for(i = 0;i < K;i++){ | ^ a.cc:62:7: error: 'i' was not declared in this scope 62 | for(i = 0;i < L;i++){ | ^ a.cc:67:7: error: 'i' was not declared in this scope 67 | for(i = 0;i < N;i++){ ...
s424262750
p03855
C++
#include <bits/stdc++.h> using namespace std; const int N= 1<<5+7; const int INF=INT_MAX; int pre1[MAXN],pre2[MAXN]; int finds(int x,int *pre) { return pre[x] == x? pre[x]:pre[x] = finds(pre[x],pre); } void join(int x,int y,int *pre) { int px = finds(x,pre); int py = finds(y,pre); if( px!=py) { ...
a.cc:5:10: error: 'MAXN' was not declared in this scope 5 | int pre1[MAXN],pre2[MAXN]; | ^~~~ a.cc:5:21: error: 'MAXN' was not declared in this scope 5 | int pre1[MAXN],pre2[MAXN]; | ^~~~ a.cc: In function 'int main()': a.cc:24:9: error: 'pre1' was not declared in this s...
s727726364
p03855
C++
#include<bits/stdc++.h> #define MAX 200005 using namespace std; int p[2][MAX]; int getp(int i, int x){return p[i][x] == x ? x : p[i][x] = getp(i, p[i][x]);} int main(){ int n, k, l, i, j, a, b; map<long long, int> m; scanf("%d%d%d", &n, &k, &l); for(i = 1; i <= n; i++) p[0][i] = p[1][i] = i; for(i = 0; i <...
a.cc: In function 'int main()': a.cc:22:5: error: 'put' was not declared in this scope; did you mean 'putw'? 22 | put(i == n ? "\n" : " "); | ^~~ | putw
s731309216
p03855
C++
#include <iostream> #include <string> #include <algorithm> #include <cassert> #include <vector> #include <map> #include <unordered_map> using namespace std; struct UnionFind { vector<int> data; UnionFind(int size) : data(size, -1) { } bool unionSet(int x, int y) { x = root(x); y = root(y); if (x != y) { if...
a.cc: In function 'void solve()': a.cc:117:44: error: use of deleted function 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map() [with _Key = std::pair<int, int>; _Tp = int; _Hash = std::hash<std::pair<int, int> >; _Pred = std::equal_to<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const s...
s525132966
p03855
C++
#include <iostream> #include <cstdio> #include <queue> #include <cmath> #include <random> #include <fstream> #include <string> #include <tuple> #include <deque> #include <set> #include <map> #define REP(i, N) for(int i = 0; i< N; i++) using namespace std; #define ll long long const int INF = 1 << 29; const ll llINF = ...
a.cc:22:8: error: wrong number of template arguments (1, should be at least 2) 22 | map<int> tunagatteru[MAX_N]; | ^ In file included from /usr/include/c++/14/map:63, from a.cc:11: /usr/include/c++/14/bits/stl_map.h:102:11: note: provided for 'template<class _Key, class _Tp, class _Comp...
s070395547
p03855
Java
import java.io.*; import java.util.*; /** * @author baito */ class UnionFindTree { int[] par; int[] rank; int[] sizes; UnionFindTree(int n) { par = new int[n]; rank = new int[n]; sizes = new int[n]; for (int i = 0; i < n; i++) { par[i] = i; ...
Main.java:117: error: reached end of file while parsing } ^ 1 error
s413288845
p03855
C++
#include<iostream> using ll = long long; #define MAX_N 201010 using namespace std; ll par_way[MAX_N],r_way[MAX_N]; ll par_train[MAX_N],r_train[MAX_N]; void init_way(ll n){ for(ll i=0;i<n;i++){ par_way[i] = i; r_way[i] = 0; } } ll find_way(ll x){ if(par_way[x] == x){ return x; }else{ return par_way[x] ...
a.cc: In function 'bool same(ll, ll)': a.cc:67:66: error: 'find_wat' was not declared in this scope; did you mean 'find_way'? 67 | return (find_train(x) == find_train(y))&&(find_way(x) == find_wat(y)); | ^~~~~~~~ | ...
s837142881
p03855
C++
#include<iostream> #include<cstdio> #include<cmath> #include<cstring> #include<string> #include<stack> #include<queue> #include<vector> #include<algorithm> #include<iomanip> #include<utility> #include<set> #include<map> #include<unordered_set> #include<unordered_map> typedef long long int ll; #define FOR(i,a,b) for(int...
a.cc: In function 'int main()': a.cc:93:17: error: no match for 'operator[]' (operand types are 'std::unordered_map<std::__cxx11::basic_string<char>, int>' and 'int') 93 | cout<< S[i]; | ^ In file included from /usr/include/c++/14/unordered_map:41, from a.cc:15: /usr/in...
s510329274
p03855
C++
#include<cstdio> #include<cstring> #include<vector> #include<queue> #include<stack> #include<algorithm> #include<cmath> #include<climits> #include<string> #include<set> #include<numeric> #include<map> #include<unordered_map> #include<iostream> using namespace std; #define rep(i,n) for(int i = 0;i<((int)(n));i++) #defin...
a.cc: In function 'int main()': a.cc:85:30: error: use of deleted function 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map() [with _Key = std::pair<long long int, long long int>; _Tp = long long int; _Hash = std::hash<std::pair<long long int, long long int> >; _Pred = std::equal_to<std::pair<long lo...
s101518279
p03855
C++
#include <bits/stdc++.h> #define REP(i,n) for (long i=0;i<(n);i++) #define FOR(i,a,b) for (long i=(a);i<(b);i++) #define RREP(i,n) for(long i=n;i>=0;i--) #define RFOR(i,a,b) for(long i=(a);i>(b);i--) #define dump1d_arr(array) REP(i,array.size()) cerr << #array << "[" << (i) << "] ==> " << (array[i]) << endl; #define du...
a.cc:17:62: error: extended character ‘ is not valid in an identifier 17 | #define TO_INT(vec,s) REP(i,s.length()){vec.push_back(s[i] - ‘0’);} | ^ a.cc:17:62: error: extended character ’ is not valid in an identifier a.cc: In function 'int main()': a...
s252897109
p03855
C++
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <stdint.h> #include <string> // C++ Libraries #include <map> #define NUM 200010 unsigned int n, k, l; unsigned int road[NUM][2]; unsigned int rail[NUM][2]; unsigned int check[NUM]; unsigned int passed[NUM]; unsigned int station[NUM]; unsigned int...
a.cc: In function 'int main()': a.cc:110:16: error: 'hash' was not declared in this scope; did you mean 'std::hash'? 110 | mp[hash]++; | ^~~~ | std::hash In file included from /usr/include/c++/14/string_view:50, from /usr/include/c++/14/bits/basic...
s557487742
p03855
C++
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <stdint.h> #include <string> // C++ Libraries #include <map> #define NUM 200010 unsigned int n, k, l; unsigned int road[NUM][2]; unsigned int rail[NUM][2]; unsigned int check[NUM]; unsigned int passed[NUM]; unsigned int station[NUM]; unsigned int...
a.cc: In function 'int main()': a.cc:108:27: error: no matching function for call to 'std::map<std::__cxx11::basic_string<char>, long unsigned int>::find(uint64_t&)' 108 | auto itr = mp.find(hash_num); // "xyz" が設定されているか? | ~~~~~~~^~~~~~~~~~ In file included from /usr/include/c...
s428593351
p03855
C++
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <stdint.h> #include <string> // C++ Libraries #include <map> #define NUM 200010 unsigned int n, k, l; unsigned int road[NUM][2]; unsigned int rail[NUM][2]; unsigned int check[NUM]; unsigned int passed[NUM]; unsigned int station[NUM]; unsigned int...
a.cc: In function 'int main()': a.cc:99:5: error: two or more data types in declaration of 'hash' 99 | uint64_t int hash; | ^~~~~~~~ a.cc:105:9: error: 'hash' was not declared in this scope; did you mean 'std::hash'? 105 | hash = root(i, par_road, rank_road)*(n+2) + root(i, par_rail, rank_rai...
s674612009
p03855
C++
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <stdint.h> #include <string> // C++ Libraries #include <map> #define NUM 200010 unsigned int n, k, l; unsigned int road[NUM][2]; unsigned int rail[NUM][2]; unsigned int check[NUM]; unsigned int passed[NUM]; unsigned int station[NUM]; unsigned int...
a.cc: In function 'int main()': a.cc:80:9: error: 'count' was not declared in this scope 80 | count[i].value=0; | ^~~~~ a.cc:101:5: error: 'u_int64' was not declared in this scope; did you mean 'u_int64_t'? 101 | u_int64 int hash; | ^~~~~~~ | u_int64_t a.cc:103:34: err...
s329136504
p03855
C++
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <stdint.h> #include <string> // C++ Libraries #include <map> #define NUM 200010 unsigned int n, k, l; unsigned int road[NUM][2]; unsigned int rail[NUM][2]; unsigned int check[NUM]; unsigned int passed[NUM]; unsigned int station[NUM]; unsigned int ans...
a.cc:28:1: error: 'node' does not name a type 28 | node root_loc = {0, 0, NULL, NULL}; | ^~~~ a.cc:39:1: error: 'node' does not name a type 39 | node count[NUM]; | ^~~~ a.cc: In function 'int main()': a.cc:80:9: error: 'count' was not declared in this scope 80 | count[i].value=0; | ...
s216930657
p03855
C++
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <stdint.h> #include <string> // C++ Libraries #include <map> #define NUM 200010 unsigned int n, k, l; unsigned int road[NUM][2]; unsigned int rail[NUM][2]; unsigned int check[NUM]; unsigned int passed[NUM]; unsigned int station[NUM]; unsigned int ans...
a.cc: In function 'int main()': a.cc:116:10: error: 'String' is not a member of 'std'; did you mean 'string'? 116 | std::String hash_str; | ^~~~~~ | string a.cc:120:9: error: 'hash_str' was not declared in this scope 120 | hash_str = std::to_string(root(i, par_road, rank_ro...
s272391856
p03855
C++
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <stdint.h> // C++ Libraries #include <map> #define NUM 200010 unsigned int n, k, l; unsigned int road[NUM][2]; unsigned int rail[NUM][2]; unsigned int check[NUM]; unsigned int passed[NUM]; unsigned int station[NUM]; unsigned int ans[NUM]; unsigned i...
a.cc: In function 'int main()': a.cc:114:14: error: 'unsigne' was not declared in this scope; did you mean 'unsigned'? 114 | std::map<unsigne long long int, unsigned int> mp; | ^~~~~~~ | unsigned a.cc:114:49: error: wrong number of template arguments (1, should be at least 2)...
s604726589
p03855
C++
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <stdint.h> // C++ Libraries #include <map> #define NUM 200010 unsigned int n, k, l; unsigned int road[NUM][2]; unsigned int rail[NUM][2]; unsigned int check[NUM]; unsigned int passed[NUM]; unsigned int station[NUM]; unsigned int ans[NUM]; unsigned i...
a.cc: In function 'int main()': a.cc:114:14: error: 'unsignedd' was not declared in this scope; did you mean 'unsigned'? 114 | std::map<unsignedd long long int, unsigned int> mp | ^~~~~~~~~ | unsigned a.cc:114:51: error: wrong number of template arguments (1, should be at lea...
s739550854
p03855
C
#include <stdio.h> #include <stdlib.h> #include <math.h> #define NUM 200010 unsigned int n, k, l; unsigned int road[NUM][2]; unsigned int rail[NUM][2]; unsigned int check[NUM]; unsigned int passed[NUM]; unsigned int station[NUM]; unsigned int ans[NUM]; unsigned int road_category[NUM]; unsigned int rail_category[NUM...
main.c: In function 'unite': main.c:136:9: error: 'count' undeclared (first use in this function) 136 | count[y] = count[x] + count[y] + 1; | ^~~~~ main.c:136:9: note: each undeclared identifier is reported only once for each function it appears in
s340007069
p03855
C++
#include<iostream> #include<cstdio> #include<cstdlib> #include<algorithm> #include<vector> #include<string> #include<sstream> #include<iomanip> #include<utility> #include<cmath> #include<set> #include<list> #include<queue> #include<stack> #include<deque> #include<map> #include<set> #include<cstring> #include<iterator> ...
a.cc: In function 'void init(int)': a.cc:74:9: error: reference to 'rank' is ambiguous 74 | rank[i] = 0; | ^~~~ In file included from /usr/include/c++/14/bits/move.h:37, from /usr/include/c++/14/bits/exception_ptr.h:41, from /usr/include/c++/14/exception:166, ...
s043904382
p03855
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<ll, ll> LP; #define pb push_back #define rep(i, a, n) for(int i = (a); i < (n); i++) #define dep(i, a, n) for(int i = (a); i >= (n); i--) #define mod (ll)1e9+7 __attribute__((constructor)) void initial() { ci...
a.cc: In function 'void unite(int, int, int*)': a.cc:32:6: error: reference to 'rank' is ambiguous 32 | if(rank[x] < rank[y]) { | ^~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14...
s629932710
p03855
C++
#include <algorithm> #include <vector> #include <queue> #include <cstring> using namespace std; const int MAXn = 2 * 100 * 1000 + 13; vector<int> adj1[MAXn], adj2[MAXn], news; int ans[MAXn], cmp[MAXn], cmp2[MAXn], cnt, cls; bool mark1[MAXn], mark2[MAXn]; void bfs1(int r = 0){ news.clear(); queue<int> q; q.push(r)...
a.cc: In function 'int main()': a.cc:56:9: error: 'cin' was not declared in this scope 56 | cin >> n >> k >> l; | ^~~ a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 4 | #include <cstring> +++ |+#include <iostream> ...
s837365130
p03855
C++
#include <iostream> #include <algorithm> #include <vector> #include <queue> #include <cstring> using namespace std; const int MAXn = 2 * 100 * 1000 + 13; vector<int> adj1[MAXn], adj2[MAXn], news; int ans[MAXn], cmp[MAXn], cmp2[MAXn], cnt, cls; bool mark1[MAXn], mark2[MAXn]; void bfs1(int r = 0){ news.clear(); queu...
a.cc: In function 'int main()': a.cc:64:38: error: expected '}' at end of input 64 | adj1[y].push_back(x); | ^ a.cc:58:35: note: to match this '{' 58 | for(int i = 0; i < k; i++){ | ^ a.cc:64:38: error: expe...
s517269813
p03855
C++
#include<bits/stdc++.h> using namespace std; const int MAX_N=200000; int par[MAX_N+1], par2[MAX_N+1]; int rank[MAX_N+1], rank2[MAX_N+1]; void init(int n){ for(int i=0;i<n;i++){ par[i]=i; rank[i]=0; par2[i]=i; rank2[i]=0; } } int find(...
a.cc: In function 'void init(int)': a.cc:14:17: error: reference to 'rank' is ambiguous 14 | rank[i]=0; | ^~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/1...
s718852774
p03855
C++
#include<bits/stdc++.h> using namespace std; const int MAX_N=200000; int par[MAX_N+1], par2[MAX_N+1]; int rank[MAX_N+1], rank2[MAX_N+1]; void init(int n){ for(int i=0;i<n;i++){ par[i]=i; rank[i]=0; par2[i]=i; rank2[i]=0; } } int find(i...
a.cc: In function 'void init(int)': a.cc:13:17: error: reference to 'rank' is ambiguous 13 | rank[i]=0; | ^~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/1...
s204176445
p03855
C++
#include <bits/stdc++.h> using namespace std; #define MAX_N 200002 class union_find { private: int par[MAX_N]; public: void init(int n) { for(int i=0;i<n;i++) { par[i]=i; } } int FIND(int x) { if(par[x]==x) { return x; ...
a.cc:50:33: error: use of deleted function 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map() [with _Key = std::pair<int, int>; _Tp = int; _Hash = std::hash<std::pair<int, int> >; _Pred = std::equal_to<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >]' 50 ...
s809596767
p03855
Java
import java.util.*; import java.lang.*; import java.io.*; import java.math.BigDecimal; public class BC49D { public static void main (String[] args) throws java.lang.Exception { InputReader in = new InputReader(System.in); PrintWriter w = new PrintWriter(System.out); int n = in.nextInt(), k...
Main.java:6: error: class BC49D is public, should be declared in a file named BC49D.java public class BC49D { ^ 1 error
s319262623
p03855
C++
#include<bits/stdc++.h> #define N 222222 #define LL long long using namespace std; int T,n,i;bool f[N];char s[N]; int fd(int x){return F[x]==x?x:F[x]=fd(F[x]);} void uni(int x,int y){ x=fd(x);y=fd(y); if(x!=y)F[x]=y; } int main(){ scanf("%d%d%d",&n,&m,&k); for(i=1;i<=n;i++)F[i]=i; for(i=1;i<=m;i++)scanf("%d%d",&x,...
a.cc: In function 'int fd(int)': a.cc:6:22: error: 'F' was not declared in this scope 6 | int fd(int x){return F[x]==x?x:F[x]=fd(F[x]);} | ^ a.cc: In function 'void uni(int, int)': a.cc:9:17: error: 'F' was not declared in this scope 9 | if(x!=y)F[x]=y; | ...
s957130082
p03855
C++
#include<bits/stdc++.h> #define N 222222 #define LL long long using namespace std; int T,n,i;bool f[N];char s[N]; int fd(int x){return F[x]==x?x:F[x]=fd(F[x]);} void uni(int x,int y){ x=fd(x);y=fd(y); if(x!=y)F[x]=y; } int main(){ scanf("%d%d%d",&n,&m,&k); for(i=1;i<=n;i++)F[i]=i; for(i=1;i<=m;i++)scanf("%d%d",&x,...
a.cc: In function 'int fd(int)': a.cc:6:22: error: 'F' was not declared in this scope 6 | int fd(int x){return F[x]==x?x:F[x]=fd(F[x]);} | ^ a.cc: In function 'void uni(int, int)': a.cc:9:17: error: 'F' was not declared in this scope 9 | if(x!=y)F[x]=y; | ...
s712009170
p03855
C
/* D - 連結 / Connectivity <http://abc049.contest.atcoder.jp/tasks/arc065_b> [Tips] ・隣接行列を使ってみる<http://www.geocities.jp/m_hiroi/linux/clang16.html> */ #include <stdio.h> #include <stdlib.h> int main(int argc, char const *argv[]) { int N,K,L; int p,q,r,s; unsigned char **k,**l; unsigned char *k_label,*l...
main.c: In function 'main': main.c:42:3: error: implicit declaration of function 'PrintMatrix' [-Wimplicit-function-declaration] 42 | PrintMatrix(k,N); | ^~~~~~~~~~~ main.c:91:3: error: implicit declaration of function 'PrintLabel' [-Wimplicit-function-declaration] 91 | PrintLabel(k_label,N); | ...
s061879870
p03855
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); int L = sc.nextInt(); int[] connected1 = new int[N]; int[] connected2 = new int[N]; int[][] edge1 = new int[N][N]; int[][] ...
Main.java:63: error: incompatible types: HashMap<int[][],Integer> cannot be converted to HashMap<ArrayList<Integer>,Integer> HashMap<ArrayList<Integer>, Integer> map = new HashMap<int[][], Integer>(); ^ 1 error
s065614839
p03855
C++
#include<cstdio> #include<set> using namespace std; int fa[2][200010],rank[2][200010]; int findroot(bool op,int x) { return x==fa[op][x] ? x : fa[op][x]=findroot(op,fa[op][x]); } void Union(bool op,int U,int V) { if(rank[op][U]<rank[op][V]) fa[op][U]=V; else { fa[op][V]=U; if(rank[op][U]==rank[op][V]) ...
a.cc: In function 'void Union(bool, int, int)': a.cc:11:12: error: reference to 'rank' is ambiguous 11 | if(rank[op][U]<rank[op][V]) | ^~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64, from /u...
s746738273
p03855
C
#include <iostream> #include <algorithm> #define N 100007 using namespace std; int n,k,l,p,q,r,s,f1[N],f2[N],a[N],cnt[N],ans[N]; int find1(int x){return f1[x]==x ? x:f1[x]=find1(f1[x]);} int find2(int x){return f2[x]==x ? x:f2[x]=find2(f2[x]);} bool cmp(int x,int y){return f1[x]<f1[y];} int main(){ scanf("%d%d%d",&n,&...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s614682400
p03855
C
#include <cstdio> #include <iostream> #include <algorithm> #define N 100007 using namespace std; int n,k,l,p,q,r,s,f1[N],f2[N],a[N],cnt[N],ans[N]; int find1(int x){return f1[x]==x ? x:f1[x]=find1(f1[x]);} int find2(int x){return f2[x]==x ? x:f2[x]=find2(f2[x]);} bool cmp(int x,int y){return f1[x]<f1[y];} int main(){ s...
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s704306825
p03855
C++
#define _CRT_SECURE_NO_WARNINGS #include <cstdio> using namespace std; template<class T> void gc(T &x) { int s, k, m = 0; x = 0; k = getchar_unlocked(); if (k == '-') s = 1; else if ('0' <= k && k <= '9') x = k - '0'; while (true) { k = getchar_unlocked(); if (k < '0' ...
a.cc: In function 'void pc_llu(T)': a.cc:94:31: error: 'n' was not declared in this scope 94 | output_buffer[--i] = (n % 10) + '0'; | ^ a.cc:97:12: error: 'n' was not declared in this scope 97 | while (n); | ^
s663917504
p03855
C++
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <iostream> #include <iterator> #include <vector> namespace Program { using namespace std; class Solver { private: const char *blk = " "; const char *nll = "\0"; int N, K, L; int p, q; int r, s; ...
a.cc: In function 'int main()': a.cc:114:20: error: '_CRTDBG_ALLOC_MEM_DF' was not declared in this scope 114 | _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | ^~~~~~~~~~~~~~~~~~~~ a.cc:115:11: error: '_CRTDBG_DELAY_FREE_MEM_DF' was not declared in this scope 115 | | _CRTDBG_DELAY_FREE_ME...
s631673028
p03855
C++
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <iostream> #include <vector> namespace Program { using namespace std; class Solver { private: const char *blk = " "; const char *nll = "\0"; int N, K, L; int p, q; int r, s; // i2g[i] := アイテ...
a.cc: In member function 'void Program::Solver::Solve()': a.cc:82:23: error: 'i' was not declared in this scope 82 | cout << ((i != 0) ? blk : nll) << 1; | ^
s308989088
p03855
C++
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <iostream> #include <vector> namespace Program { using namespace std; class Solver { private: const char *blk = " "; const char *nll = "\0"; int N, K, L; int p, q; int r, s; // i2g[i] := アイテ...
a.cc: In member function 'void Program::Solver::Solve()': a.cc:97:54: error: 'cnt' cannot be used as a function 97 | cout << ((i != 0) ? blk : nll) << cnt(); | ~~~^~
s768076654
p03855
C++
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <vector> namespace Program { using namespace std; class Solver { private: const char *blk = " "; const char *nll = "\0"; int N, K, L; int p, q; int r, s; // i2g[i] := アイテム i の所属するグループの番号 ...
a.cc: In function 'int main()': a.cc:102:20: error: '_CRTDBG_ALLOC_MEM_DF' was not declared in this scope 102 | _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | ^~~~~~~~~~~~~~~~~~~~ a.cc:103:11: error: '_CRTDBG_DELAY_FREE_MEM_DF' was not declared in this scope 103 | | _CRTDBG_DELAY_FREE_ME...
s911317026
p03855
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,x,y) for(int i=(x);i<(y);++i) #define debug(x) #x << "=" << (x) #ifdef DEBUG #define _GLIBCXX_DEBUG #define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl #else #define print(x) #endif const int inf=1e9; const int64_t inf64=1e18; c...
a.cc: In function 'void solve()': a.cc:89:38: error: use of deleted function 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map() [with _Key = std::pair<int, int>; _Tp = int; _Hash = std::hash<std::pair<int, int> >; _Pred = std::equal_to<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const st...
s306535730
p03855
C++
#include <stdio.h> #include <stdlib.h> #define YES 1 #define NO -1 typedef struct { short *road, *rail; } node_t; node_t *create_node(int n) { int i, j; node_t *node; node = malloc(sizeof(node_t) * n); for(i = 0; i < n; i++) { node[i].road = malloc(sizeof(short) * n); node[i].rail = malloc(sizeof...
a.cc: In function 'node_t* create_node(int)': a.cc:16:16: error: invalid conversion from 'void*' to 'node_t*' [-fpermissive] 16 | node = malloc(sizeof(node_t) * n); | ~~~~~~^~~~~~~~~~~~~~~~~~~~ | | | void* a.cc:19:26: error: invalid conversion from 'void*' t...
s871232498
p03855
C++
#include <iostream> #include <cstdio> #include <vector> #define MP make_pair using namespace std; const int MAX_N = 1000; int par[MAX_N]; void init(int n) { for(int i=0; i < n;i++) par[i] = i; } int find(int x) { if(par[x] == x) return x; else return par[x] = find(par[x]); } bool same(int x, int y...
a.cc: In function 'int main()': a.cc:66:13: error: 'count' was not declared in this scope 66 | cout << count(v.begin(), v.end(), v[i]); | ^~~~~
s631062863
p03855
C
#include <stdio.h> int N, K, L; int road_dad[200001] = {0}; int train_dad[200001] = {0}; int find(int x, int y, int select)//select == 1: road, ==0: train { int i, j; int *dad; i = x; j = y; dad = (select ? road_dad: train_dad); while(dad[i] > 0) i = dad[i]; while(dad[j] > 0) ...
main.c: In function 'union_city': main.c:53:5: error: implicit declaration of function 'If' [-Wimplicit-function-declaration] 53 | If(i != j){ | ^~ main.c:53:15: error: expected ';' before '{' token 53 | If(i != j){ | ^ | ;
s013164684
p03855
C++
#include <iostream> using namespace std; const int MAX_N=20000; class UnionFind{ public: UnionFind(){ for(int i=0;i<MAX_N;i++){ this->par[i]=i; this->d[i]=0; } } UnionFind(int n){ for(int i=0;i<n;i++){ this->par[i]=i; this->d[i]=0; } } int find(int x){ if(par[...
a.cc: In function 'int main()': a.cc:70:3: error: 'vector' was not declared in this scope 70 | vector<int> ans(N,1); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include <iostream> +++ |+#include <vector> 2 | u...
s908970199
p03855
C++
#include <iostream> #include <vector> #include <map> using namespace std; class UnionFind { private: vector<int> par, rank; int count; public: UnionFind(int n) : par(n), rank(n), count(0) { for (int i = 0; i < n; i++) par[i] = i; } int find(int p) { while(p != par[p]) { ...
a.cc: In function 'int main()': a.cc:63:32: error: 'g1' was not declared in this scope 63 | cout << nums[make_pair(g1[i], g2[i])]; | ^~ a.cc:63:39: error: 'g2' was not declared in this scope 63 | cout << nums[make_pair(g1[i], g2[i])]; | ...
s113625000
p03855
C
#include <stdio.h> int train[200001][200001] = {0}; int road[200001][200001] = {0}; int visited_by_train[200001]; int visited_by_road[200001]; int num = 1; int N, K, L; void visit_train(int n) { int i; visited_by_train[n] = num; for(i = 1; i <= N; i++){ if(train[n][i] && !visited_by_train[i]){...
/tmp/ccRXhjMs.o: in function `visit_train': main.c:(.text+0x22): relocation truncated to fit: R_X86_64_PC32 against symbol `visited_by_train' defined in .bss section in /tmp/ccRXhjMs.o main.c:(.text+0x6d): relocation truncated to fit: R_X86_64_PC32 against symbol `visited_by_train' defined in .bss section in /tmp/ccRXh...
s577632028
p03855
C++
#include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<string> #include<cstring> #include<vector> #include<map> #include<list> #include<stack> #include<queue> #include<climits> //llong int_MIN/MAX using namespace std; #define FOR(i,s,e) for(llong int (i)=(s);(i)<(e);(i)++) #define FORR(i,s,...
a.cc: In function 'int main()': a.cc:148:20: error: cannot convert 'std::queue<long long int>::size' from type 'std::queue<long long int>::size_type (std::queue<long long int>::)() const' {aka 'long unsigned int (std::queue<long long int>::)() const'} to type 'long long int' 148 | count = Q2.size; | ...
s193117396
p03855
C++
#http://www.geocities.jp/m_hiroi/light/pyalgo61.html class UF(object): def __init__(self, n): self.table = [None for i in range(n)] def find(self, x): if self.table[x] is None: return x else: self.table[x] = self.find(self.table[x]) return self.table[x...
a.cc:1:2: error: invalid preprocessing directive #http 1 | #http://www.geocities.jp/m_hiroi/light/pyalgo61.html | ^~~~ a.cc:2:17: error: expected initializer before ':' token 2 | class UF(object): | ^ a.cc:27:1: error: expected unqualified-id before 'for' 27 | for i in range(n): ...
s490024273
p03855
C++
#http://www.geocities.jp/m_hiroi/light/pyalgo61.html class UF(object): def __init__(self, n): self.table = [None for i in range(n)] def find(self, x): if self.table[x] is None: return x else: self.table[x] = self.find(self.table[x]) return self.table[x...
a.cc:1:2: error: invalid preprocessing directive #http 1 | #http://www.geocities.jp/m_hiroi/light/pyalgo61.html | ^~~~ a.cc:2:17: error: expected initializer before ':' token 2 | class UF(object): | ^ a.cc:27:1: error: expected unqualified-id before 'for' 27 | for i in range(n): ...
s499371059
p03855
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; int par[100010],rank[100010],par2[100010],rank2[100010]; int find(int x){ if(par[x]==x) return x; return par[x]=find(par[x]); } void uf(int x,int y){ x = find(x); y = find(y); if (x==y) return; if(rank[x]<rank[y]) par[x] = y; ...
a.cc: In function 'void uf(int, int)': a.cc:16:8: error: reference to 'rank' is ambiguous 16 | if(rank[x]<rank[y]) par[x] = y; | ^~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++...
s945821368
p03855
C++
#include <bits/stdc++.h> #define IOS ios_base::sync_with_stdio(0); #define tie cin.tie(0); #define x first #define y second #define ll long long #define mod 666013 using namespace std; int n, road[100100], m, rail[100100], k; int x, a, b; int A[200005]; int find1(int nod) { if (road[nod] == nod) return nod; i...
a.cc: In function 'int main()': a.cc:3:13: error: 'std::istream' {aka 'class std::basic_istream<char>'} has no member named 'cin'; did you mean 'in'? 3 | #define tie cin.tie(0); | ^~~ a.cc:47:13: note: in expansion of macro 'tie' 47 | cin.tie(0); | ^~~
s176478522
p03855
Java
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.util.NoSuchElementException; /** * Created by jaga on 9/22/16. */ public class Main{ public static void solve(PrintWriter out, FastScanner in) { int N = in.nextInt(); int ...
Main.java:17: error: cannot find symbol UnionFindTree tree1 = new UnionFindTree(N); ^ symbol: class UnionFindTree location: class Main Main.java:17: error: cannot find symbol UnionFindTree tree1 = new UnionFindTree(N); ^ symbol: class UnionFindTree l...
s361357189
p03855
C
#include <stdio.h> #include <string.h> #include <stdlib.h> typedef struct list { int n[2]; char k; struct list* next; } LIST; LIST *head; LIST *rt; void list_init() { head = rt = malloc(sizeof(LIST)); } void list_set(int i, int j, char k) { rt->next = malloc(sizeof(LIST)); rt-...
main.c: In function 'main': main.c:82:19: error: 'strt' undeclared (first use in this function); did you mean 'rt'? 82 | int nc = atoi(strt | ^~~~ | rt main.c:82:19: note: each undeclared identifier is reported only once for each function it appears in main.c:82:23...
s646422454
p03855
C++
#include <cstdio> #include <cstring> #include <cstdlib> #include <string> #include <vector> #include <queue> #include <algorithm> #include <functional> #include <iomanip> using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) inline void readInt2(int *a, int *b) { int c, p = 0; char s[20] = ""; for(in...
a.cc: In function 'void init()': a.cc:46:9: error: reference to 'rank' is ambiguous 46 | rank[i] = 0; | ^~~~ In file included from /usr/include/c++/14/bits/char_traits.h:50, from /usr/include/c++/14/string:42, from a.cc:4: /usr/include/c++/14/type_traits:1437:1...
s870998873
p03855
C++
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define mt make_tuple #define ll long long unsigned #define pii pair<int,int> #define tii tuple <int,int,int> #define N 200004 #define mod 2000003 #define X first #define Y second #define eps 0.0000000001 #define all(x) x.begin(),x.end() #define tot(x)...
/tmp/ccGuZPAp.o: in function `df(int)': a.cc:(.text+0xf9): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccGuZPAp.o /tmp/ccGuZPAp.o: in function `dfs(int)': a.cc:(.text+0x245): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/c...
s527255985
p03855
C++
#include <stdio.h> #include <string.h> #include <stdlib.h> int check_tree(char** rt, int nc, int i, char* memo) { int out = 0; for(int j = 0; j < nc; j++) { if(rt[i][j] == 3 && memo[j] == 0) { memo[j] = 1; out += check_tree(rt,nc,j,me...
a.cc: In function 'int main()': a.cc:22:16: error: invalid conversion from 'void*' to 'char**' [-fpermissive] 22 | rt = malloc(sizeof(char*) * 100000); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ | | | void* a.cc:23:53: error: invalid conversion from 'void*' to 'char...
s757794736
p03856
Java
import java.util.*; public static void main(String[] atgs) { Scanner s=new Scanner(System.in); String str=s.nextLine(); str=str.replace("eraser",""); str=str.replace("erase",""); str=str.replace("dreamer",""); str=str.replace("dream",""); if(str.equals("")) System.out.println("true"); else System....
Main.java:4: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] atgs) { ^ (use --enable-preview to enable unnamed classes) 1 error
s943347205
p03856
Java
import java.util.*; public class Main() { public static void main(String[] atgs) { Scanner s=new Scanner(System.in); String str=s.nextLine(); str=str.replace("eraser",""); str=str.replace("erase",""); str=str.replace("dreamer",""); str=str.replace("dream",""); if(str.equals("")) System.out.println...
Main.java:4: error: '{' expected public class Main() ^ 1 error
s087828886
p03856
Java
import java.util.*; public class test { public static void main(String[] atgs) { Scanner s=new Scanner(System.in); String str=s.nextLine(); str=str.replace("eraser",""); str=str.replace("erase",""); str=str.replace("dreamer",""); str=str.replace("dream",""); if(str.equals("")) System.out.println("...
Main.java:4: error: class test is public, should be declared in a file named test.java public class test ^ 1 error
s960097923
p03856
Java
import java.util.*; import java.io.*; import javax.swing.*; import java.text.*; import java.lang.*; public class test { public static void main(String[] atgs) { Scanner s=new Scanner(System.in); String str=s.nextLine(); str=str.replace("eraser",""); str=str.replace("erase",""); str=str.replace("dreamer",""...
Main.java:6: error: class test is public, should be declared in a file named test.java public class test ^ 1 error
s186791938
p03856
Java
public class test { public static void main(String[] atgs) { Scanner s=new Scanner(System.in); String str=s.nextLine(); s=s.replace("eraser",""); s=s.replace("erase",""); s=s.replace("dreamer",""); s=s.replace("dream",""); if(s.equals("")) System.out.println("true"); else System.out.println("fals...
Main.java:2: error: class test is public, should be declared in a file named test.java public class test ^ Main.java:6: error: cannot find symbol Scanner s=new Scanner(System.in); ^ symbol: class Scanner location: class test Main.java:6: error: cannot find symbol Scanner s=new Scanner(System.in); ...
s907981087
p03856
Java
import java.util.*; import javax.swing.*; import java.text.*; public class test { public static void main(String[] atgs) { Scanner s=new Scanner(System.in); String str=s.nextLine(); s=s.replace("eraser",""); s=s.replace("erase",""); s=s.replace("dreamer",""); s=s.replace("dream",""); if(s.length()==0...
Main.java:6: error: class test is public, should be declared in a file named test.java public class test ^ Main.java:12: error: cannot find symbol s=s.replace("eraser",""); ^ symbol: method replace(String,String) location: variable s of type Scanner Main.java:13: error: cannot find symbol s=s.repl...
s202419712
p03856
C++
#include<iostream> #include<string> using namespace std; string s; bool bad=false,allow=false; int main(){ cin >> s; s='%%%%%%%%'+s; s+='%%%%%%%'; for (int i=0;i<s.length();i++){ if (s[i]=='e'){ if ((s[i+1]=='r')&&(s[i+2]=='a')&&(s[i+3]=='s')&&(s[i+4]=='e')){ i+=4; allow=true; }else{ bad=true; ...
a.cc:8:11: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes 8 | s='%%%%%%%%'+s; | ^~~~~~~~~~ a.cc:9:12: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes 9 | s+='%%%%%%%'; | ^~~~~~~~~ a.cc: In functio...
s670685317
p03856
C++
#include<bits/stdc++.h> using namespace std; using ll = long long; using Graph = vector<vector<int>>; const ll mod=1000000007; const int MAX_N = 1000; // n の最大値 // nCk を取得 double nCk(int n, int k) { double res=1.0; for(int i=0; i<n; i++){ res*=0.5;} for(int i=0; i<k; i++){ res*=(double)(n-i); res/=(double)(k-...
a.cc: In function 'int main()': a.cc:32:1: error: expected '}' before 'else' 32 | else if(s.at(i)=='e'&&s.at(i+1)=='r'&&s.at(i+2)=='a'&&s.at(i+3)=='s'&&s.at(i+4)=='e'){ | ^~~~ a.cc:25:81: note: to match this '{' 25 | if(s.at(i)=='d'&&s.at(i+1)=='r'&&s.at(i+2)=='e'&&s.at(i+3)=='a'&&s.at(i+4)=='m'){ | ...
s009282870
p03856
C++
#include <bits/stdc++.h>//復習必須 #include<iostream> #include<vector> #include <cmath> #include <map> #include <algorithm> #include <string> #define rep(i, n) for (int i = 0; i < n; ++i) using ll = long long; using namespace std; #define P pair<int, int> int main () { cin >> s; int flag = 1; for (int i = ...
a.cc: In function 'int main()': a.cc:14:12: error: 's' was not declared in this scope 14 | cin >> s; | ^ a.cc:50:2: error: expected '}' at end of input 50 | } | ^ a.cc:12:13: note: to match this '{' 12 | int main () { | ^
s324363853
p03856
Java
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); String s = sc.next(); int index = 0; while(index < s.length()){ System.out.println(c); if(c == 'd'){ if(inde...
Main.java:9: error: cannot find symbol System.out.println(c); ^ symbol: variable c location: class Main Main.java:10: error: cannot find symbol if(c == 'd'){ ^ symbol: variable c location: class Main Main.java:31: error: cannot find symbo...
s583921594
p03856
C++
#include<bits/stdc++.h> #define rep(i,n)for(int i=0;i<n;++i) #include<string> #include<vector> using namespace std; typedef long long ll; typedef pair<int, int>P; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a ...
a.cc: In function 'int main()': a.cc:72:29: error: expected ';' before '}' token 72 | i-=6 | ^ | ; 73 | } | ~
s228145781
p03856
C++
#include<bits/stdc++.h> #define rep(i,n)for(int i=0;i<n;++i) #include<string> #include<vector> using namespace std; typedef long long ll; typedef pair<int, int>P; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a ...
a.cc: In function 'int main()': a.cc:61:22: error: lvalue required as left operand of assignment 61 | while (i < n && flag = true) { | ~~~~~~^~~~~~~
s817064286
p03856
C
// AtCoder ARC065 C - Daydream // 2019.8.27 bal4u #include <stdio.h> #include <string.h> #define gc() getchar_unlocked() int ins(char *s) { // 文字列の入力 スペース以下の文字で入力終了 char *p = s--; do *++s = gc(); while (*s > ' '); *s = 0; return s - p; } int N; char S[100005]; int main() { int i; N = ins(S); i = 0; ...
main.c: In function 'main': main.c:34:1: error: expected declaration or statement at end of input 34 | } | ^
s683927524
p03856
C++
#include"bits/stdc++.h" #include<boost/multi_array.hpp> #include<boost/optional.hpp> #include<boost/range/irange.hpp> #include<boost/range/algorithm.hpp> #include<boost/range/adaptors.hpp> using namespace std; namespace adaptor = boost::adaptors; #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) #define rep3(i,m,n) for(in...
a.cc:2:9: fatal error: boost/multi_array.hpp: No such file or directory 2 | #include<boost/multi_array.hpp> | ^~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s069808982
p03856
C++
#include<iostream> #include<string> #include<cstdio> #include<cstring> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<deque> #include<ciso646> #include<random> #include<map> #include<set> #include<complex> #include<bitset> #include<stack> #include<un...
a.cc: In function 'void solve()': a.cc:63:27: error: no match for 'operator|=' (operand types are 'std::bitset<100100>::reference' and 'std::bitset<100100>::reference') 63 | dp[i + 5] |= dp[i]; | ~~~~~~~~~~^~~~~~~~ In file included from /usr/include/c++/14/bits/memory_resource.h...
s838088900
p03856
C++
#include <iostream> using namespace std; const string words[] = {"dream", "dreamer", "erase", "eraser"}; int main() { string s, result = "YES"; cin >> s; for (int i = s.size(); i >= 0; ) { bool found = false; for (auto& w : words) { if (i >= w.size() && s.compare(i - w.wize(), ...
a.cc: In function 'int main()': a.cc:12:50: error: 'const class std::__cxx11::basic_string<char>' has no member named 'wize'; did you mean 'size'? 12 | if (i >= w.size() && s.compare(i - w.wize(), w.size(), w) == 0) { | ^~~~ | ...
s296776625
p03856
C++
#include <iostream> using namespace std; const string words[] = {"dream", "dreamer", "erase", "eraser"}; int main() { string s, result = "YES"; cin >> s; for (int i = s.size; i >= 0; ) { bool found = false; for (auto& w : words) { if (i >= w.size() && s.compare(i - w.wize(), w....
a.cc: In function 'int main()': a.cc:9:20: error: cannot convert 'std::__cxx11::basic_string<char>::size' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int' 9 | ...
s657490057
p03856
C++
import java.io.IOException; import java.io.InputStream; import java.util.Arrays; import java.util.NoSuchElementException; import java.util.Scanner; class FastScanner { private final InputStream in = System.in; private final byte[] buffer = new byte[1024]; private int ptr = 0; private int buflen = 0; ...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.IOException; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.io.InputStream; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodu...
s098619344
p03856
C++
//In The Name Of GOD #include <bits/stdc++.h> using namespace std; typedef long long ll ; const int mod = 1000000007; const int inf = 2000000000; const int maxn = 500*1000+500*1000+15; const int MLOG = 18; #define pb push_back #define pp pop_back #define X first #define Y second #define IO ios_base::sync_with_s...
a.cc: In function 'int main()': a.cc:93:12: error: no matching function for call to 'reverse(<unresolved overloaded function type>, std::__cxx11::basic_string<char>::iterator)' 93 | reverse(s.begin, s.end()); | ~~~~~~~^~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, ...
s053128458
p03856
C++
2 0 5 5
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 2 0 | ^
s189995222
p03856
C++
dreamerer#include <bits/stdc++.h> using namespace std; #define endl '\n' #define watch(x) cout<<"->"<<#x<<" : "<<x<<endl; #define min3(a,b,c) min(a,min(b,c)) #define max3(a,b,c) max(a,max(b,c)) #define all(v) (v).begin(),(v).end() typedef long long ll; typedef unsigned long long llu; const double PI = 2*acos(0.0); map...
a.cc:1:10: error: stray '#' in program 1 | dreamerer#include <bits/stdc++.h> | ^ a.cc:1:1: error: 'dreamerer' does not name a type 1 | dreamerer#include <bits/stdc++.h> | ^~~~~~~~~ a.cc:10:21: error: 'acos' was not declared in this scope 10 | const double PI = 2*acos(0.0); | ...
s567505493
p03856
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main(){ string s; cin >> s; for(int i=0;i<s.size();i++){ int f = 0; if(s.substr(i,i+6) == "dreamer" && s.substr(i+5,i+9) != "erase"){ i += 6; f = 1; } ...
a.cc: In function 'int main()': a.cc:19:19: error: expected ';' before 'f' 19 | i += 5 | ^ | ; 20 | f =1; | ~
s109536453
p03856
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main(){ string s; cin >> s; for(int i=0;i<s.size();i++){ int f = 0; if(s.substr(i,i+6) == "dreamer" && s.substr(i+5,i+9) != "erase"){ i += 6; f = 1; } ...
a.cc: In function 'int main()': a.cc:18:50: error: expected primary-expression before ')' token 18 | if(s.substr(i,i+5) == "eraser" && f == 0;){ | ^ a.cc:19:19: error: expected ';' before 'f' 19 | i += 5 | ^ |...
s133620619
p03856
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main(){ string s; cin >> s; fot(int i=0;i<s.size();i++){ int f = 0; if(s.substr(i,i+6) == "dreamer" && s.substr(i+5,i+9) != "erase"){ i += 6; f = 1; } ...
a.cc: In function 'int main()': a.cc:12:9: error: expected primary-expression before 'int' 12 | fot(int i=0;i<s.size();i++){ | ^~~ a.cc:12:17: error: 'i' was not declared in this scope 12 | fot(int i=0;i<s.size();i++){ | ^
s107881739
p03856
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:98:42: error: no match for 'operator==' (operand types are 'std::__cxx11::basic_string<char>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}) 98 | if(s.substr(cur,(int)sub[i].size())==s[i]){ In file included from /usr/include/c++/14/reg...
s938727278
p03856
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:98:35: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsig...
s641901726
p03856
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:98:35: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsig...
s724382761
p03856
C++
#include<stdio.h> #include<string.h> int main() { char c[100006],d[2][6]={"dream","erase"}; long long i,l,n,m,o; gets(c); l=strlen(c); for(i=0;i<l;) { if(c[i]=='d') { for(o=1;o<5;o++) { if(d[0][o]==c[i+o])continue; else break; } if(o<5)break; if(c[i+5]=='e'&&c[i+6]=='r') { if(c[i...
a.cc: In function 'int main()': a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(c); | ^~~~ | getw
s193941652
p03856
C++
include<stdio.h> #include<stdlib.h> #include<iostream> #include<algorithm> #include<cstdio> #include<string> #include<cmath> #include<vector> #include<stack> #include<queue> #include<time.h> #include<set> #include<map> #define FOR(i,a,b) for(ll i=a;i<b;i++) #define REP(i,a,b) for(int i=a;i>b;i--) #define vint vector<in...
a.cc:1:1: error: 'include' does not name a type 1 | include<stdio.h> | ^~~~~~~ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, fr...