submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s239017600
p03856
C++
#include<bits/stdc++.h> using namespace std; #define int long long string divide[4] = {"dream", "dreamer", "erase", "eraser"}; bool dp[100010]; signed main(){ string s; cin >> s; dp[0] = 1; for(int i = 0; i < S.size(); ++i){ if(!dp[i]) continue; for(string s : divide){ ...
a.cc: In function 'int main()': a.cc:13:24: error: 'S' was not declared in this scope 13 | for(int i = 0; i < S.size(); ++i){ | ^ a.cc:23:17: error: 'S' was not declared in this scope 23 | cout << (dp[S.size()] ? "YES" : "NO") << endl; | ^
s303846847
p03856
C++
#include<iostream> #include<cstdio> #include<cstring> #include<cstdlib> #include<cmath> #include<algorithm> //deque/functional/iterator/list/map/memory/numeric/queue/set/stack/utility/vector //#include<bits/stdc++.h> #define ll long long using namespace std; //string a="dream",b="dreamer",c="erase",d="eraser"; int main...
a.cc: In function 'int main()': a.cc:16:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 16 | gets(s); | ^~~~ | getw
s551962233
p03856
C
#include<stdio.h> #include<string.h> int main() { char s[100000]; scanf("%s",s); int a[strlen(s)]= {0},i,j; for(i=0; i<strlen(s); i++) { if(s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m') { a[i]=1,a[i+1]=1,a[i+2]=1,a[i+3]=1,a[i+4]=1; } if(s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i...
main.c: In function 'main': main.c:6:27: error: variable-sized object may not be initialized except with an empty initializer 6 | int a[strlen(s)]= {0},i,j; | ^
s581610326
p03856
C
char A[4][8] = { { 'r','e','m','a','e','r','d'}, { 'm','a','e','r','d' }, { 'r','e','s','a','r','e' }, { 'e','s','a','r','e' } }; int AL[4] = { 7, 5, 6, 5 }; char S[10002];
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s408302045
p03856
C++
#include <bits/stdc++.h> using namespace std; #define forn(i, n) for (ll i = 0; i < (ll) (n); ++i) #define sz(a) static_cast<int>((a).size()) #define pb emplace_back #define mp make_pair #define endl '\n' #define f first #define s second #ifdef SEREZHKA #define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__) #else #define ...
a.cc: In function 'void solve()': a.cc:67:26: error: expected ';' before '}' token 67 | cout << ({"YES", "NO"})[s.empty()] << endl; | ^ | ;
s710516412
p03856
C++
#include<cstdio> #include<map> #include<algorithm> using namespace std; int fa[200005],fb[200005]; map<int,map<int,int> >mp; int fd1(int x) { if(fa[x]==x) return x; return fa[x]=fd1(fa[x]); } int fd2(int x) { if(fb[x]==x) return x; return fb[x]=fd2(fb[x]); } void U1(int x,int y) fa[fd1(x)]=fd1(y); void U2(int x,...
a.cc:18:22: error: expected initializer before 'fa' 18 | void U1(int x,int y) fa[fd1(x)]=fd1(y); | ^~ a.cc:19:22: error: expected initializer before 'fb' 19 | void U2(int x,int y) fb[fd2(x)]=fd2(y); | ^~ a.cc: In function 'int main()': a.cc:28:17: error: 'U1' ...
s208220693
p03856
C++
#include<iostream> #include<iomanip> #include<algorithm> #include<cstring> #include<string> #include<cmath> #include<vector> #include<queue> #include<stack> #include<map> #include<set> using namespace std; const int inf=1e9,dx[]={-1,0,1,0},dy[]={0,-1,0,1}; string s,word[]={"dream","erase","dreamer","eraser"}; pair<int,...
a.cc: In function 'int main()': a.cc:32:9: error: 'mp' was not declared in this scope; did you mean 'p'? 32 | mp["dream"]=true; | ^~ | p
s142316666
p03856
C++
#include<iostream> #include<iomanip> #include<algorithm> #include<cstring> #include<string> #include<cmath> #include<vector> #include<queue> #include<stack> #include<map> #include<set> using namespace std; const int inf=1e9,dx[]={-1,0,1,0},dy[]={0,-1,0,1}; string s,word[]={"dream","erase","dreamer","eraser"}; pair<int,...
a.cc: In function 'int main()': a.cc:32:9: error: 'mp' was not declared in this scope; did you mean 'p'? 32 | mp["dream"]=true; | ^~ | p
s208077390
p03856
C++
#include<bits/stdc++.h> using namespace std; int main(){ map<string,int> mp; mp["maerd"]=5; mp["remae"]=7; mp["esare"]=5; mp["resar"]=6; string s; cin>>s; while(s!=""){ bool ok=false; for(auto p:mp){ if(ok|=(s.substr(0,5)==p.first)) s=s.substr(mp.second); } if(!ok)br...
a.cc: In function 'int main()': a.cc:15:64: error: 'class std::map<std::__cxx11::basic_string<char>, int>' has no member named 'second' 15 | if(ok|=(s.substr(0,5)==p.first)) s=s.substr(mp.second); | ^~~~~~
s805762294
p03856
C++
int main() { std::string s; std::cin >> s; int cou=0; for (int i = 0; i < s.size(); i++){ if (s[i + 0] == 'd'&&s[i + 1] == 'r'&&s[i + 2] == 'e'&&s[i + 3] == 'a'&&s[i + 4] == 'm') { if (s[i + 5] == 'e'&&s[i + 6] == 'r'&&!(s[i + 7] == 'a'&&s[i + 8] == 's'&&s[i + 9] == 'e')) { cou += 7; i += 6; } el...
a.cc: In function 'int main()': a.cc:2:14: error: 'string' is not a member of 'std' 2 | std::string s; | ^~~~~~ a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' +++ |+#include <string> 1 | int main() { a.cc:3:14: e...
s616639283
p03856
C++
int main() { std::string s; std::cin >> s; int cou=0; for (int i = 0; i < s.size(); i++){ if (s[i + 0] == 'd'&&s[i + 1] == 'r'&&s[i + 2] == 'e'&&s[i + 3] == 'a'&&s[i + 4] == 'm') { if (s[i + 5] == 'e'&&s[i + 6] == 'r'&&!(s[i + 7] == 'a'&&s[i + 8] == 's'&&s[i + 9] == 'e')) { cou += 7; i += 6; } el...
a.cc: In function 'int main()': a.cc:2:14: error: 'string' is not a member of 'std' 2 | std::string s; | ^~~~~~ a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' +++ |+#include <string> 1 | int main() { a.cc:3:14: e...
s828784986
p03856
C++
S = input() keys = ('dreameraser', 'dreamererase', 'erase', 'dream', 'dreamer', 'eraser') for key in keys: S = S.replace(key, '') if S == '': print('YES') else: print('NO')
a.cc:3:9: warning: multi-character literal with 11 characters exceeds 'int' size of 4 bytes 3 | keys = ('dreameraser', 'dreamererase', 'erase', 'dream', 'dreamer', 'eraser') | ^~~~~~~~~~~~~ a.cc:3:24: warning: multi-character literal with 12 characters exceeds 'int' size of 4 bytes 3 | keys = ('dr...
s165031124
p03856
C
#include <stdio.h> #include <string.h> int main(void) { int i,j,k,l,lens,m,n,sum,dl,tmp,flag; flag=0; char s[100000]; char d[4][8]={"maerd","renaerd","esare","resare"}; scanf("%s",s); lens=strlen(s); for(i=0;i<=3;i++){ dl=strlen(d[i]); printf("%d",dl); for(j=lens;j>lens-dl;j--){ if(j<0){ flag=1; brea...
main.c: In function 'main': main.c:39:1: error: expected declaration or statement at end of input 39 | } | ^
s806885454
p03856
C++
s=input() while 1: if s[-5:] in ["dream","erase"]: s=s[:-5] elif s[-6:] == "eraser": s=s[:-6] elif s[-7:] == "dreamer": s=s[:-7] elif s == "": print("YES") exit() else: print("NO") exit()
a.cc:1:1: error: 's' does not name a type 1 | s=input() | ^
s025259473
p03856
C++
#ifndef __INTMOD_H__0001__ #define __INTMOD_H__0001__ #include <vector> #include <iostream> #include <cassert> #include <iostream> /* Modulus must be less than 0x80000000, and not be 0. */ template <uint32_t Modulus> class IntMod { typedef int32_t Int; typedef uint32_t UInt; typedef int64_t Long; typedef uint64_t...
a.cc:10:11: error: 'uint32_t' has not been declared 10 | template <uint32_t Modulus> | ^~~~~~~~ a.cc:13:17: error: 'uint32_t' does not name a type 13 | typedef uint32_t UInt; | ^~~~~~~~ a.cc:7:1: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixa...
s985303855
p03856
C++
include<bits/stdc++.h> std::string S; int d1 = 5; int d2 = 7; int e1 = 5; int e2 = 6; int len = 0; bool parse(int i) { if(i >= len) return true; if(S[i] == 'd') { if(S.substr(i, d1) == "dream") { bool r1 = parse(i + d1); if(r1) { return true; } else ...
a.cc:1:1: error: 'include' does not name a type 1 | include<bits/stdc++.h> | ^~~~~~~ a.cc: In function 'bool parse(int)': a.cc:12:8: error: 'S' was not declared in this scope 12 | if(S[i] == 'd') { | ^ a.cc: In function 'int main()': a.cc:41:10: error: 'cin' is not a member of 'std' 41 ...
s431840526
p03856
C++
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using static System.Math; using static System.Console; using static CS_Contest.Utils; namespace CS_Contest { using Li = List<int>; using LLi = List<List<int>>; class Program { static void Main...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.L...
s816753931
p03856
C++
#include<iostream> #include<string> #include<vector> using namespace std; int main(){ string S; cin>>S; int len; bool t=true; for(int i=0 ; i<S.size() ; i+=len){ if(S.substr(i,1)=="e" || S.substr(i,1)=="d" ){ else if(S.substr(i,5)=="erase"){ if(S.substr(i+5,1)=="e")len=5; else if(S.substr(i+5,1)=="...
a.cc: In function 'int main()': a.cc:15:25: error: expected '}' before 'else' 15 | else if(S.substr(i,5)=="erase"){ | ^~~~ a.cc:14:62: note: to match this '{' 14 | if(S.substr(i,1)=="e" || S.substr(i,1)=="d" ){ | ...
s365588348
p03856
C
#include <stdio.h> #include <stdlib.h> #define N 100001 #define YES 1 #define NO 0 char *t[4] = {"dream", "dreamer", "erase", "eraser"}; char *ans[2] = {"NO", "YES"}; int match(char *); int strncmp(char *, char *, int); int strlen(char*); int main(void){ char str[N]; int r; scanf("%s", str); r=match(str); pr...
main.c:12:5: warning: conflicting types for built-in function 'strncmp'; expected 'int(const char *, const char *, long unsigned int)' [-Wbuiltin-declaration-mismatch] 12 | int strncmp(char *, char *, int); | ^~~~~~~ main.c:3:1: note: 'strncmp' is declared in header '<string.h>' 2 | #include <stdlib.h>...
s269066461
p03856
C++
#include<iostream> #include<cstdio> #include<cstring> using namespace std; #define M 100005 char c[M]; int main() { scanf("%s",c); char d1[7]={'d','r','e','a','m','e','r'},e1[6]={'e','r','a','s','e','r'}; int flag=1; for(int i=0;i<strlen(c);) { if(c[i]=='d') { for(in...
a.cc: In function 'int main()': a.cc:54:20: error: 'k' was not declared in this scope 54 | if(k==6) | ^
s050946858
p03856
C++
#include <stdio.h> typedef struct Item { struct Item *next; int to; } Item; #define MAX_NODE (200000) Item *train[MAX_NODE] = {0}, *road[MAX_NODE] = {0}; int parent[MAX_NODE], sizes[MAX_NODE] = {0}; int setted[MAX_NODE] = {0}, resetted[MAX_NODE] = {0}; int ans[MAX_NODE] = {0}; void add(Item* list[], int from, int t...
a.cc: In function 'void add(Item**, int, int)': a.cc:14:26: error: 'malloc' was not declared in this scope 14 | Item *p = (Item*)malloc(sizeof(Item)); | ^~~~~~ a.cc:2:1: note: 'malloc' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>' ...
s623380304
p03856
Java
//package com.regular.arc065; import java.util.Scanner; public class Main1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String input = sc.next(); String []PARTS = {"dream","dreamer","erase","eraser"}; boolean flag = true; boolean able = ...
Main.java:6: error: class Main1 is public, should be declared in a file named Main1.java public class Main1 { ^ 1 error
s474355411
p03856
C++
#include<iostream> using namespace std; int main(){ string S; cin>> S; string t; for(int i=S.size()-1; i>=0; i--){ t=S[i]+t; if(t.size()==5){ if(t=="raser"||t=="eamer"){ ;; }else if(t!="dream"&&t!="erase"){ cout<< "NO"<< endl; return 0; }else{ t=""; } }else if(t.size()==6){ ...
a.cc: In function 'int main()': a.cc:41:2: error: expected '}' at end of input 41 | } | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s464735580
p03856
C++
#include<iostream> using namespace std; int main(){ string S; cin>> S; string t; for(int i=S.size()-1; i>=0; i--){ t=S[i]+t; if(t.size()==5){ if(t=="raser"||t=="eamer"){ ;; }else if(t!="dream"%%t!="erase"){ cout<< "NO"<< endl; return 0; }else{ t=""; } }else if(t.size()==6){ ...
a.cc: In function 'int main()': a.cc:15:45: error: expected primary-expression before '%' token 15 | }else if(t!="dream"%%t!="erase"){ | ^ a.cc:41:2: error: expected '}' at end of input 41 | } | ^ a.cc:5:11: note: to match this '{' ...
s073266297
p03856
C++
#include <iostream> #include <algorithm> #include <map> #include <vector> #include <cstring> using namespace std; typedef long long ll; const int N=1e6+20; const int M=30; char s[M][M]={{"dream"},{"dreamer"},{"erase"},{"eraser"}}; int len[5]; int root,num=0; int Next_n[N][M],end[N];//trie Next[u][id] u结点编号 void inser...
a.cc: In function 'void insert(int)': a.cc:28:9: error: reference to 'end' is ambiguous 28 | end[u]=x;//单词结束标记 | ^~~ 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...
s192290769
p03856
C++
#include<iostream> using namespace std; int main(){ string S; cin>> S; string t; for(int i_S.size()-1; i>=0; i--){ t=S[i]+t; if(t.size()==5){ if(t=="raser"||t=="eamer"){ ;; }else if(t!="dream"%%t!="erase"){ cout<< "NO"<< endl; return 0; }else{ t=""; } }else if(t.size()==6){ ...
a.cc: In function 'int main()': a.cc:10:20: error: expected ';' before '.' token 10 | for(int i_S.size()-1; i>=0; i--){ | ^ | ; a.cc:10:20: error: expected primary-expression before '.' token a.cc:10:31: error: 'i' was not declared in this scope 10 | ...
s760012474
p03856
C++
#include <iostream> #include <algorithm> #include <map> #include <vector> #include <cstring> using namespace std; typedef long long ll; const int N=1e6+20; const int M=30; char s[M][M]={{"dream"},{"dreamer"},{"erase"},{"eraser"}}; int len[5]; int root,num=0; int Next[N][M],end[N];//trie next[u][id] u结点编号 void insert(...
a.cc: In function 'void insert(int)': a.cc:28:9: error: reference to 'end' is ambiguous 28 | end[u]=x;//单词结束标记 | ^~~ 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...
s354289971
p03856
C
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char S[1000000]; scanf("%s", S); int i; for(i = 0; i < strlen(S); i++) { if (S[i] == 'd') { if(S[++i] != 'r') { printf("NO"); return 0; } if(S[++i] != 'e') { printf("NO"); return 0; } if(S[++i] != 'a') { ...
main.c: In function 'main': main.c:62:1: error: expected declaration or statement at end of input 62 | } | ^
s221112233
p03856
C++
#include <iostream> #include <algorithm> #include <map> #include <vector> #include <cstring> using namespace std; typedef long long ll; const int N=1e6+20; const int M=30; char s[M][M]={{"dream"},{"dreamer"},{"erase"},{"eraser"}}; int len[5]; int root,num=0; int next[N][M],end[N];//trie next[u][id] u结点编号 void insert(...
a.cc: In function 'void insert(int)': a.cc:22:21: error: reference to 'next' is ambiguous 22 | if(!next[u][id]) | ^~~~ In file included from /usr/include/c++/14/string:47, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/...
s974303668
p03856
C++
#include <cstdio> #include <cstring> const int maxn=100005; char s[maxn],S[5][10]; int len; bool flag=true; inline bool check(int l,int r,int k){ int lim=r-l; for(int i=0,j=l;i<=lim;i++,j++) if(S[k][i]!=s[j]) return false; return true; } int main() { scanf("%s",s); len=strlen(s); S[1]='dream';S[2]='erase';S[...
a.cc:18:14: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 18 | S[1]='dream';S[2]='erase';S[3]='eraser';S[4]='dreamer'; | ^~~~~~~ a.cc:18:27: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 18 | S[1]='dream';S[2]...
s370333085
p03856
C++
#include <string> #include <vector> #include <cmath> #include <list> #include <set> #include <algorithm> #include <map> #include <iostream> #include <sstream> #include <queue> #include <iomanip> using namespace std; bool dfs(const char* str) { if(strlen(str) == 0) { return true; } else if(str[0] != 'd' && s...
a.cc: In function 'bool dfs(const char*)': a.cc:19:12: error: 'strlen' was not declared in this scope 19 | if(strlen(str) == 0) | ^~~~~~ a.cc:13:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 12 | #include <iomanip> +++ |+#inc...
s472285093
p03856
C++
#include <algorithm> #include <complex> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) #define rrep(i, n) for (int i = (n)-1; i >= 0; i--) using namespace std; typedef long long int lli; typedef pair<lli, lli> P; lli...
a.cc:103:5: error: redefinition of 'lli MOD' 103 | lli MOD = 1000000007; | ^~~ a.cc:14:5: note: 'lli MOD' previously defined here 14 | lli MOD = 1000000007; | ^~~ a.cc:104:6: error: redefinition of 'bool flag' 104 | bool flag = true; | ^~~~ a.cc:15:6: note: 'bool flag' previously d...
s938790824
p03856
C++
#include <cstdio> #include <cstring> char c[120000]; int f[120000]; int i,l; int main() { gets(c+1); l=strlen(c+1); f[0]=1; for (i=1;i<=l;i++) if (((f[i-5]) && (c[i-4]=='d') && (c[i-3]=='r') && (c[i-2]=='e') && (c[i-1]=='a') && (c[i]=='m')) || ((f[i-7]) && (c[i-6]=='d') && (c[i-5]=='r') && (c[i-4]=='e') && (...
a.cc: In function 'int main()': a.cc:10:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 10 | gets(c+1); | ^~~~ | getw
s861393632
p03856
C++
#include <iostream> #include <string> using namespace std; int main(int argc, char* argv[]) { string S; cin>>S; char *p=(char*)S.c_str(); while (*p!='\0'){ if (!memcmp(p,"dreamer",6)){ p+=6; continue; }else if (!memcmp(p,"eraser",6)){ p+=6; continue; }else if (!memcmp(p,"dream",5)){ p+=5; co...
a.cc: In function 'int main(int, char**)': a.cc:10:22: error: 'memcmp' was not declared in this scope 10 | if (!memcmp(p,"dreamer",6)){ | ^~~~~~ a.cc:2:1: note: 'memcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #inclu...
s949473863
p03856
C++
import java.util.Arrays; import java.util.Scanner; public class Main { MyScanner sc = new MyScanner(); Scanner sc2 = new Scanner(System.in); long start = System.currentTimeMillis(); long fin = System.currentTimeMillis(); final int MOD = 1000000007; int[] dx = { 1, 0...
a.cc:2:1: error: 'import' does not name a type 2 | import java.util.Arrays; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import java.util.Scanner; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-t...
s989897625
p03856
C++
#include<iostream> #include<algorithm> #include<vector> #include<string> #include<set> #include<map> #include<assert.h> using namespace std; #define sz(x) (int)(x.size()) #define fi(a, b) for(int i=a;i<b;++i) #define fj(a, b) for(int j=a;j<b;++j) #define mp make_pair #define pb push_back //////////////////// int con...
a.cc: In function 'void solve()': a.cc:42:13: error: 'strlen' was not declared in this scope 42 | n = strlen(s); | ^~~~~~ a.cc:8:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 7 | #include<assert.h> +++ |+#include <cstring> ...
s134959957
p03856
C++
#include <iostream> #include <string> using namespace std; const string ss[] = {"dream", "dreamer", "erase", "eraser"}; bool dp[100005]; int main() { string S; cin >> S; memset(dp, 0, sizeof(dp)); dp[0] = true; for (int pos = 0; pos < S.size(); pos++) { if (!dp[pos]) continue; for (int i = 0; i < 4; i++) { ...
a.cc: In function 'int main()': a.cc:12:9: error: 'memset' was not declared in this scope 12 | memset(dp, 0, sizeof(dp)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cst...
s761869479
p03856
C++
#include <cstdio> #include <cstdlib> #include <cmath> #include <climits> #include <cfloat> #include <map> #include <utility> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <algorithm> #include <functional> #include <sstream> #include <complex> #include <stack> #includ...
a.cc: In function 'int main()': a.cc:51:18: error: 'strlen' was not declared in this scope 51 | length = strlen(str); | ^~~~~~ a.cc:20:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 19 | #include <queue> +++ |+#include <...
s896652916
p03856
C++
#include<bits/stdc++.h> using namespace std; string X[] = { "dream","dreamer","erase","eraser" }; bool check( string &S ) { if( S == "" ) { return true; } for( size_t i = 0; i < 4; i++ ) { if( S.substr( 0, X[i].size() ) == X[i] && check( S.substr( X[i].size() ) ) ) { return true; } } return false; } i...
a.cc: In function 'bool check(std::string&)': a.cc:12:74: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::__cxx11::basic_string<char>' 12 | if( S.substr( 0, X[i].size() ) == X[i] && check( S.substr( X[i].size() ...
s664302599
p03856
C++
#define _USE_MATH_DEFINES #include <algorithm> #include <cstdio> #include <functional> #include <iostream> #include <cfloat> #include <climits> #include <cstdlib> #include <cstring> #include <cmath> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <time.h> #i...
a.cc:20:10: fatal error: testlib.h: No such file or directory 20 | #include "testlib.h" | ^~~~~~~~~~~ compilation terminated.
s380808293
p03857
C++
//////////////////////////////////////////////////////////////////////////////// // Give me AC!!! // //////////////////////////////////////////////////////////////////////////////// #include <iostream> #include <random> #include <cmath> #include <limits> #inc...
a.cc:10:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory 10 | #include <boost/multiprecision/cpp_int.hpp> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s970435664
p03857
C++
#include <bits/stdc++.h> using namespace std; struct UnionFind { vector<int> par; UnionFind(int n) : par(n, -1) { } void init(int n) { par.assign(n, -1); } int root(int x) { if (par[x] < 0) return x; else return par[x] = root(par[x]); } bool issame(int x, int y) { ...
a.cc: In function 'int main()': a.cc:41:7: error: 'struct UnionFind' has no member named 'marge'; did you mean 'merge'? 41 | B.marge(X,Y); | ^~~~~ | merge
s900063549
p03857
C++
#include <iostream> #include<map> using namespace std; const int maxn = 2e6 + 10; typedef pair<int, int> P; int fa[maxn], ma[maxn],ans[maxn]; void init(int n) { for (int i = 0; i <= n; ++i) { fa[i] = i; ma[i] = i; } } int find(int* fa, int x)//找到根节点 { if (fa[x] == x) { return fa[x]; } return fa[x] = find(...
a.cc: In function 'int main()': a.cc:32:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 32 | while (scanf_s("%d%d%d", &n, &k, &l) != EOF) | ^~~~~~~ | scanf
s984894137
p03857
C++
#include<bits./stdc++.h> using namespace std; struct hi{ int a,b; } cnt[200005]; int id[200005],id2[2000005],p[200005] ,n,k,l,i,j,m; int find(int x){ while (x!=id[x]){ id[x]=id[id[x]]; x=id[x]; } return x; } int find2(int x){ while (x!=id2[x]){ id2[x]=id2[id2[x]]; x=id2[x]; } return x; } void connect(...
a.cc:1:9: fatal error: bits./stdc++.h: No such file or directory 1 | #include<bits./stdc++.h> | ^~~~~~~~~~~~~~~~ compilation terminated.
s696469442
p03857
C++
#include<cstdio> #include<vector> #include<queue> #include<string> #include<algorithm> #include<functional> #include<cstring> using namespace std; /**** Type Define ****/ typedef long long ll; typedef pair<ll, ll> P; /**** Const List ****/ const ll INF = ((ll)1 << 31) - 1; const ll DINF = (ll)1e20; const ll UNION...
a.cc:537:1: error: two or more data types in declaration of 'main' 537 | ll | ^~
s241389489
p03857
C++
#include<bits/stdc++.h> #include<math.h> #include <stdio.h> #include<vector> #include<deque> #include<stdlib.h> #include <algorithm> #include<set> #include<map> #include <limits> #include<iomanip> #include<string> #define rep(i,n) for(int i = 0; i < n; i++) typedef long long ll; using namespace std; #define llMAX numer...
In file included from /usr/include/c++/14/map:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152, from a.cc:1: /usr/include/c++/14/bits/stl_multimap.h: In instantiation of 'void std::multimap<_Key, _Tp, _Compare, _Alloc>::insert(_InputIterator, _InputIterator) [with _Input...
s963985984
p03857
C++
#include<bits/stdc++.h> #include<math.h> #include <stdio.h> #include<vector> #include<deque> #include<stdlib.h> #include <algorithm> #include<set> #include<map> #include <limits> #include<iomanip> #include<string> #define rep(i,n) for(int i = 0; i < n; i++) typedef long long ll; using namespace std; #define llMAX nume...
a.cc: In function 'int main()': a.cc:273:19: error: no matching function for call to 'std::multimap<std::pair<int, int>, int>::count(int)' 273 | auto c=m.count((root1(i),root2(i))); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/map:64, from /usr/include...
s569368935
p03857
C++
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef long double f80; // #define int long long #define pii pair<int,int> #define fi first #define se second #define all(x) x.begin(), x.end() #define sz(x) (int)x.size() #define fr(i, a, b) for(int i = a; i <= b; i++) #define pb push_back #defin...
/tmp/ccPXEFAS.o: in function `dfs(int, int, int)': a.cc:(.text+0xe0): relocation truncated to fit: R_X86_64_PC32 against symbol `vis' defined in .bss section in /tmp/ccPXEFAS.o a.cc:(.text+0x104): relocation truncated to fit: R_X86_64_PC32 against symbol `comp' defined in .bss section in /tmp/ccPXEFAS.o a.cc:(.text+0x1...
s775676889
p03857
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.HashMap; import java.util.Objects; import java.util.StringTokenizer; public class Main { public...
Main.java:40: error: package Dreamer does not exist HashMap<pair, Integer> map = new HashMap<Dreamer.pair, Integer>(); ^ 1 error
s439095280
p03857
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.HashMap; import java.util.Objects; import java.util.StringTokenizer; public class Dreamer { publi...
Main.java:12: error: class Dreamer is public, should be declared in a file named Dreamer.java public class Dreamer { ^ 1 error
s526368714
p03857
C++
u#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define pb push_back #define mp make_pair #define all(a) begin(a),end(a) #define FOR(x,val,to) for(int x=(val);x<int((to));++x) #define FORE(x,val,to) for(auto x=(val);x<=(to);++x) #define FORR(x,arr) for(auto &x: ar...
a.cc:1:2: error: stray '#' in program 1 | u#include <bits/stdc++.h> | ^ a.cc:1:1: error: 'u' does not name a type 1 | u#include <bits/stdc++.h> | ^ In file included from /usr/include/c++/14/ext/typelist.h:46, from /usr/include/c++/14/ext/pb_ds/assoc_container.hpp:45, ...
s965360913
p03857
C++
#include<bits/stdc++.h> using namespace std; int par1[200001],par2[200001]; vector<pair<int,int>> idx; map<pair<int,int>,int> cnt; int rep1(int n) { if(par1[n]==n) return n; return par1[n]=rep1(par1[n]); } int rep2(int n) { if(par2[n]==n) return n; return par2[n]=rep2(par2[n]); } int mai...
In file included from /usr/include/c++/14/cassert:44, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:106, from a.cc:1: a.cc: In function 'int main()': a.cc:47:27: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 's...
s076199250
p03857
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <functional> #include <queue> #include <string> #include <cstring> #include <numeric> #include <cstdlib> #include <cmath> #include <map> using namespace std; typedef long long ll; #define INF 10e17 // 4倍しても(4回足しても)long longを溢れない #de...
a.cc: In instantiation of 'Union_Find<T>::_Tp Union_Find<T>::find(_Tp) const [with T = int; _Tp = int]': a.cc:110:21: required from here 110 | a = uf_road.find(i); | ~~~~~~~~~~~~^~~ a.cc:60:21: error: assignment of read-only location '((const Union_Find<int>*)this)->Union_Find<int>::par.std::vecto...
s170571652
p03857
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define tr(container, it) \ for (auto it = container.begin(); it != container.end(); it++) #define scontains(c, x) ((c).find(x) != (c).end()) //O(log n) #define contains(c, x) (find((c).begin(),(c).end(),x) != (c).end()) //O(n) #define pll p...
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s758147844
p03857
C++
#include<bits/stdc++.h> using namespace std; #define ll long long #define MAXN 200010 vector<ll> c(MAXN,1); ll par[MAXN]; // 親 ll deep[MAXN]; // 深さ // in要素で初期化 ll init(ll in){ for(int i=0;i<=in;i++){ par[i]=i; deep[i]=0; } } // 木の根を求める ll find(ll x){ if(par[x]==x){ return x; }else{ return par[...
a.cc: In function 'long long int init(long long int)': a.cc:15:1: warning: no return statement in function returning non-void [-Wreturn-type] 15 | } | ^ a.cc: In function 'long long int initd(long long int)': a.cc:53:1: warning: no return statement in function returning non-void [-Wreturn-type] 53 | } ...
s007509880
p03857
C++
#include<bits/stdc++.h> using namespace std; #define ll long long #define MAXN 200010 vector<ll> c(MAXN,1); ll par[MAXN]; // 親 ll deep[MAXN]; // 深さ // in要素で初期化 ll init(ll in){ for(int i=0;i<=in;i++){ par[i]=i; deep[i]=0; } } // 木の根を求める ll find(ll x){ if(par[x]==x){ return x; }else{ return par[...
a.cc: In function 'long long int init(long long int)': a.cc:15:1: warning: no return statement in function returning non-void [-Wreturn-type] 15 | } | ^ a.cc: In function 'long long int initd(long long int)': a.cc:53:1: warning: no return statement in function returning non-void [-Wreturn-type] 53 | } ...
s388698988
p03857
C++
#include <bits/stdc++.h> using namespace std; int main() { cin >> ; cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:16: error: expected primary-expression before ';' token 8 | cin >> ; | ^
s728759681
p03857
C++
#include<iostream> #include<cstdio> #include<algorithm> #include<map> using namespace std; typedef long long ll; const int N=1000000; int road[N]; int raw[N]; int ans[N]; map<pair<int,int>,int> s; int xz(int x,char c) { if(c=='a') while(road[x]!=x) x=road[x]; if(c=='b') while(raw[x]!=x) x=raw[x]; return x; } boo...
a.cc: In function 'int main()': a.cc:44:28: error: 'a' was not declared in this scope 44 | hb(from,to,a); | ^ a.cc:49:28: error: 'b' was not declared in this scope 49 | hb(from,to,b); | ^
s873146640
p03857
C++
N,K,L=map(int,input().split()) len = [[[] for s in range(N)] for t in range (2)] i=1 j=1 while i <= K: a,b=map(int,input().split()) len[0][a-1].append(b-1) len[0][b-1].append(a-1) i+=1 while j <= L: a,b=map(int,input().split()) len[1][a-1].append(b-1) len[1][b-1].append(a-1) j+=1 def ...
a.cc:2:1: error: 'N' does not name a type 2 | N,K,L=map(int,input().split()) | ^
s758135362
p03857
C++
#include<iostream> #include<algorithm> #include<vector> #include<queue> #include<functional> #include<numeric> #include <unordered_map> using namespace std; long long find(long long x, std::vector<long long>& par) { if (par[x] == x) return x; return par[x] = find(par[x],par); } long long main() { cin.tie(0);...
cc1plus: error: '::main' must return 'int'
s794754177
p03857
C++
#include <iostream> #include <string> #include <algorithm> #include <cstdio> #include <vector> #include <queue> #include <map> #include <numeric> #include <cmath> using namespace std; typedef long long int ll; #define all(x) x.begin(),x.end() const ll mod = 1e9+7; const ll INF = 1e9; const ll MAXN = 1e9; struct un...
a.cc: In function 'int main()': a.cc:79:41: error: expected ';' before '}' token 79 | cout << s[com[i]] << " " | ^ | ; 80 | }printf("\n"); | ~
s599793395
p03857
C++
#include<iostream> using namespace std; const static int MAX_N = 2 * 100000; int N, K, L; bool roads[MAX_N + 1][MAX_N + 1]; int c_roads[MAX_N + 1]; int c_rails[MAX_N + 1]; void rec_roads(int p, int c) { for (int q = p; q <= N; q++) { if (roads[p][q] == 1) { c_roads[q] = c; roads[p][q] = 0; r...
/tmp/ccmJYFZ5.o: in function `rec_roads(int, int)': a.cc:(.text+0x53): relocation truncated to fit: R_X86_64_PC32 against symbol `c_roads' defined in .bss section in /tmp/ccmJYFZ5.o /tmp/ccmJYFZ5.o: in function `rec_rails(int, int)': a.cc:(.text+0x11a): relocation truncated to fit: R_X86_64_PC32 against symbol `c_rails...
s502553952
p03857
C++
#include<iostream> using namespace std; const static int MAX_N = 2 * 100000; int N, K, L; short roads[MAX_N + 1][MAX_N + 1]; int c_roads[MAX_N + 1]; int c_rails[MAX_N + 1]; void rec_roads(int p, int c) { for (int q = p; q <= N; q++) { if (roads[p][q] == 1) { c_roads[q] = c; roads[p][q] = 0; ...
/tmp/ccECphvz.o: in function `rec_roads(int, int)': a.cc:(.text+0x53): relocation truncated to fit: R_X86_64_PC32 against symbol `c_roads' defined in .bss section in /tmp/ccECphvz.o /tmp/ccECphvz.o: in function `rec_rails(int, int)': a.cc:(.text+0x122): relocation truncated to fit: R_X86_64_PC32 against symbol `c_rails...
s609228235
p03857
C++
#include<iostream> using namespace std; const static int MAX_N = 2 * 100000; int N, K, L; short roads[MAX_N + 1][MAX_N + 1]; int c_roads[MAX_N + 1]; int c_rails[MAX_N + 1]; void rec_roads(int p, int c) { for (int q = p; q <= N; q++) { if (roads[p][q] == 1) { c_roads[q] = c; roads[p][q] = 0; ...
/tmp/cc2K85s9.o: in function `rec_roads(int, int)': a.cc:(.text+0x53): relocation truncated to fit: R_X86_64_PC32 against symbol `c_roads' defined in .bss section in /tmp/cc2K85s9.o /tmp/cc2K85s9.o: in function `rec_rails(int, int)': a.cc:(.text+0x122): relocation truncated to fit: R_X86_64_PC32 against symbol `c_rails...
s140407256
p03857
C++
#include<iostream> using namespace std; const static int MAX_N = 2 * 100000; int N, K, L; int roads[MAX_N + 1][MAX_N + 1]; int c_roads[MAX_N + 1]; int c_rails[MAX_N + 1]; void rec_roads(int p, int c) { for (int q = p; q <= N; q++) { if (roads[p][q] == 1) { c_roads[q] = c; roads[p][q] = 0; ro...
/tmp/ccm2UEBA.o: in function `rec_roads(int, int)': a.cc:(.text+0x55): relocation truncated to fit: R_X86_64_PC32 against symbol `c_roads' defined in .bss section in /tmp/ccm2UEBA.o /tmp/ccm2UEBA.o: in function `rec_rails(int, int)': a.cc:(.text+0x130): relocation truncated to fit: R_X86_64_PC32 against symbol `c_rails...
s913088412
p03857
C++
`#include<iostream> using namespace std; const static int MAX_N = 2 * 100000; int N, K, L; int roads[MAX_N + 1][MAX_N + 1]; int c_roads[MAX_N + 1]; int c_rails[MAX_N + 1]; void rec_roads(int p, int c) { for (int q = p; q <= N; q++) { if (roads[p][q] == 1) { c_roads[q] = c; roads[p][q] = 0; r...
a.cc:1:1: error: stray '`' in program 1 | `#include<iostream> | ^ a.cc:1:2: error: stray '#' in program 1 | `#include<iostream> | ^ a.cc:1:3: error: 'include' does not name a type 1 | `#include<iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:35:3: error: 'cin' was not declared ...
s755753946
p03857
C++
#include<iostream> using namespace std; const static int MAX_N = 2 * 100000; int N, K, L; int roads[MAX_N + 1][MAX_N + 1]; int rails[MAX_N + 1][MAX_N + 1]; int c_roads[MAX_N + 1]; int c_rails[MAX_N + 1]; void rec_roads(int p, int c) { for (int q = p; q<=N; q++) { if (roads[p][q] == 1) { c_roads[q] = c; ...
/tmp/ccnK1n7S.o: in function `rec_roads(int, int)': a.cc:(.text+0x55): relocation truncated to fit: R_X86_64_PC32 against symbol `c_roads' defined in .bss section in /tmp/ccnK1n7S.o /tmp/ccnK1n7S.o: in function `rec_rails(int, int)': a.cc:(.text+0x114): relocation truncated to fit: R_X86_64_PC32 against symbol `rails' ...
s231590463
p03857
C++
#include<bits/stdc++.h> #define INF 1e9 #define llINF 1e18 #define MOD 1e9+7 #define pb push_back #define mp make_pair #define F first #define S second #define ll long long using namespace std; #include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(n);i++) #define loop(i,x,n) for(int i=(x);i<(n);i++) #define all(v)...
a.cc: In function 'int main()': a.cc:7:12: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<long long int, long long int> >, std::pair<long long int, long long int> >::value_type' {aka 'struct std::pair<long long int, long long int>'} has no member named 'make_pair' 7 | #define mp make_pair | ...
s326539308
p03857
C++
#include<bits/stdc++.h> #define INF 1e9 #define llINF 1e18 #define MOD 1e9+7 #define pb push_back #define mp make_pair #define F first #define S second #define ll long long using namespace std; #include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(n);i++) #define loop(i,x,n) for(int i=(x);i<(n);i++) #define all(v)...
a.cc:5:13: error: expected unqualified-id before numeric constant 5 | #define MOD 1e9+7 | ^~~ a.cc:18:11: note: in expansion of macro 'MOD' 18 | const int MOD=1e9+7; | ^~~ a.cc:3:13: error: expected unqualified-id before numeric constant 3 | #define INF 1e9 | ...
s109377309
p03857
C++
#include <bits/stdc++.h> using namespace std; vector<int> R, T; int find_node_r(int now){ if(now == R[now]) return now; else{ int ans = find_node_r(R[now]); R[now] = ans; return ans; } } int find_node_t(int now){ if(now == T[now]) return now; else{ int ans = find_n...
a.cc: In function 'int main()': a.cc:49:12: error: 'D' was not declared in this scope 49 | if(D[]) | ^ a.cc:49:14: error: expected primary-expression before ']' token 49 | if(D[]) | ^ a.cc:50:5: error: expected primary-expression before '}' token 50 | } ...
s314529051
p03857
C++
#include <map> #include <cmath> #include <queue> #include <stack> #include <vector> #include <cstdio> #include <string> #include <cstring> #include <sstream> #include <algorithm> using namespace std; int ro[200005], ra[200005], n, k, l; int Find(int *r, int x) { return r[x]==x ? x : r[x]=Find(r, r[x]); } vo...
a.cc:22:5: error: extended character ┊ is not valid in an identifier 22 | ┊ ra[i]=ro[i]=i; | ^ a.cc:35:5: error: extended character ┊ is not valid in an identifier 35 | ┊ scanf("%d%d", &u, &v); | ^ a.cc:36:5: error: extended character ┊ is not valid in an identifier 36 | ┊ ...
s298729644
p03857
C++
#include<bits/stdc++.h> using namespace std; const int N = 2*1e5; int n; int Find(int *f, int x) { if(f[x] == x) return x; else { f[x] = Find(f, f[x]); return f[x]; } } void Merge(int *f, int x, int y) { x = Find(f, x); y = Find(f, y); if(x != y) f[y] = x; } i...
a.cc: In function 'int main()': a.cc:33:34: error: expected ';' before 'init' 33 | scanf("%d %d %d", &n, &k, &l) | ^ | ; 34 | init(); | ~~~~
s920089436
p03857
C++
#include <iostream> #include <math.h> #include <bits/stdc++.h> #define ll long long #define inf 0x3f3f3f3f #define maxn 310000 using namespace std; struct node { int x,y; }; map<pair<int,int>,int>mp; NIT(int a[],int n) { for(int i=1; i<=n; i++) a[i]=i; } int Find(int a[],int x) { return a[x]==x?x:a[...
a.cc:13:1: error: ISO C++ forbids declaration of 'NIT' with no type [-fpermissive] 13 | NIT(int a[],int n) | ^~~ a.cc: In function 'int NIT(int*, int)': a.cc:17:1: warning: no return statement in function returning non-void [-Wreturn-type] 17 | } | ^
s170190599
p03857
C++
#include<iostream> #include <math.h> #include <bits/stdc++.h> #define ll long long #define inf 0x3f3f3f3f #define maxn 310000 using namespace std; struct node { int x,y; }; map<pair<int,int>,int>mp; Init(int a[],int n) { for(int i=1;i<=n;i++) a[i]=i; } int Find(int a[],int x) { return a[x]==x?x:a[x]...
a.cc:13:1: error: ISO C++ forbids declaration of 'Init' with no type [-fpermissive] 13 | Init(int a[],int n) | ^~~~ a.cc: In function 'int Init(int*, int)': a.cc:17:1: warning: no return statement in function returning non-void [-Wreturn-type] 17 | } | ^
s217386469
p03857
C++
#include<iostream> #include <math.h> #include <bits/stdc++.h> #define ll long long #define inf 0x3f3f3f3f #define maxn 310000 using namespace std; struct node { int x,y; }; map<pair<int,int>,int>mp; Init(int a[],int n) { for(int i=1;i<=n;i++) a[i]=i; } int Find(int a[],int x) { return a[x]==x?x:a[x]...
a.cc:13:1: error: ISO C++ forbids declaration of 'Init' with no type [-fpermissive] 13 | Init(int a[],int n) | ^~~~ a.cc: In function 'int Init(int*, int)': a.cc:17:1: warning: no return statement in function returning non-void [-Wreturn-type] 17 | } | ^
s849420513
p03857
C++
#include<iostream> #include <math.h> #include <bits/stdc++.h> #define ll long long #define inf 0x3f3f3f3f #define maxn 310000 using namespace std; struct node { int x,y; }; map<pair<int,int>,int>mp; Init(int a[],int n) { for(int i=1;i<=n;i++) a[i]=i; } int Find(int a[],int x) { return a[x]==x?x:a[x]...
a.cc:13:1: error: ISO C++ forbids declaration of 'Init' with no type [-fpermissive] 13 | Init(int a[],int n) | ^~~~ a.cc: In function 'int Init(int*, int)': a.cc:17:1: warning: no return statement in function returning non-void [-Wreturn-type] 17 | } | ^
s537999187
p03857
C++
#include<iostream> #include <math.h> #include <bits/stdc++.h> #define ll long long #define inf 0x3f3f3f3f #define maxn 310000 using namespace std; struct node { int x,y; }; map<pair<int,int>,int>mp; init(int a[],int n) { for(int i=1;i<=n;i++) a[i]=i; } int Find(int a[],int x) { return a[x]==x?x:a[x]...
a.cc:13:1: error: ISO C++ forbids declaration of 'init' with no type [-fpermissive] 13 | init(int a[],int n) | ^~~~ a.cc: In function 'int init(int*, int)': a.cc:17:1: warning: no return statement in function returning non-void [-Wreturn-type] 17 | } | ^
s154393389
p03857
C++
#include <assert.h> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <climits> #include <algorithm> #include <numeric> #include <functional> #include <iostream> #include <string> #include <array> #include <vector> #include <stack> #include <queue> #include <set> #include <map> #include ...
a.cc: In constructor 'UnionFind<T>::UnionFind(int)': a.cc:39:5: error: 'par' was not declared in this scope; did you mean '__pstl::execution::v1::par'? 39 | par = vector<T>(n, 0); | ^~~ | __pstl::execution::v1::par In file included from /usr/include/c++/14/pstl/glue_algorithm_defs.h:15, ...
s785646120
p03857
C++
#include <map> #include <algorithm> #include <cstdio> #include <iostream> #include <vector> using namespace std; #define REP(i,y) for(int i=0;i<(int)(y);i++) int N,K,L; class UnionFind { vector<int> p; // rank public: UnionFind (int n) : p(n, -1) {} int root(int x) { return p[x] < 0 ? x : p[x] = root(p[x])...
a.cc: In function 'int main()': a.cc:54:13: error: no match for 'operator[]' (operand types are 'std::map<std::pair<int, int>, int>' and 'int') 54 | if (memo[r1][r2]) | ^ In file included from /usr/include/c++/14/map:63, from a.cc:1: /usr/include/c++/14/bits/stl_map.h:504:7: no...
s830697613
p03857
C++
#include <map> #include <algorithm> #include <cassert> #include <climits> #include <complex> #include <cstdio> #include <string> #include <iostream> #include <queue> #include <string> #include <tuple> #include <vector> using namespace std; #define FOR(i,x,y) for(int i=(x);i<(int)(y);i++) #define FORP(i,x,y) for(int i=(...
a.cc:42:1: error: 'unordered_multimap' does not name a type 42 | unordered_multimap<int, int> mp1; | ^~~~~~~~~~~~~~~~~~ a.cc:43:1: error: 'unordered_multimap' does not name a type 43 | unordered_multimap<int, int> mp2; | ^~~~~~~~~~~~~~~~~~ a.cc: In function 'int main()': a.cc:58:5: error: 'mp1' was no...
s703407347
p03857
C++
#include<iostream> #include<algorithm> #include<vector> using namespace std; typedef pair<long long, long long> pii; typedef pair<long long, pair<int, int> > triple; #define REP(i, n) for(int i=0; i<n; i++) int const max_n = 100000; int n, k, l; int c[max_n]; bool road[max_n][max_n]; int par1[max_n], par2[max_n]; in...
/tmp/ccMnmC38.o: in function `main': a.cc:(.text+0x202): relocation truncated to fit: R_X86_64_PC32 against symbol `r1' defined in .bss section in /tmp/ccMnmC38.o a.cc:(.text+0x209): relocation truncated to fit: R_X86_64_PC32 against symbol `par1' defined in .bss section in /tmp/ccMnmC38.o a.cc:(.text+0x257): relocatio...
s083482605
p03857
C++
#include<iostream> #include<string> #include<cmath> #include<queue> #include<map> #include<set> #include<list> #include<iomanip> #include<vector> #include<functional> #include<algorithm> #include<cstdio> #include<unordered_map> using namespace std; //--------------------------------------------------- //ライブラリゾーン!!!! #d...
a.cc: In function 'int main()': a.cc:69:17: error: 'unite' was not declared in this scope; did you mean 'unite2'? 69 | unite(u1,u2); | ^~~~~ | unite2 a.cc:74:17: error: 'unite' was not declared in this scope; did you mean 'unite2'? 74 | u...
s771396985
p03857
C++
#include <assert.h> #include <ctype.h> #include <errno.h> #include <float.h> #include <fstream> #include <iomanip> #include <iostream> #include <set> #include <queue> #include <limits> #include <deque> #include <locale> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #incl...
/tmp/ccGtka3L.o: in function `main': a.cc:(.text+0xfa): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/ccGtka3L.o a.cc:(.text+0x114): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/ccGtka3L.o a.cc:(.text+0x12c): relocation tru...
s578227929
p03857
C++
#include <algorithm> #include <cstdio> #include <iostream> #include <map> #include <cmath> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #include <stdlib.h> #include <stdio.h> #include <bitset> using namespace std; #define FOR(I,A,B) for(int I = (A); I < (B); ++...
a.cc: In function 'void Merge(int, int, int)': a.cc:28:7: error: 'Finf' was not declared in this scope; did you mean 'sinf'? 28 | b = Finf(pv, b); | ^~~~ | sinf a.cc: In function 'int main()': a.cc:44:36: error: expected ';' before '}' token 44 | Map[pii(Find(0,i),Find(1,i))]++ ...
s460626896
p03857
C++
#include<stdio.h> #include<algorithm> #include<map> using namespace std; #define pii pair<int,int> map<pii, int> Map; int n,m,k; int UF[2][201000]; int Find(int pv, int a) { if(UF[pv][a] = a) return a; return UF[pv][a] = Find(pv, UF[pv][a]); } void Merge(int pv, int a, int b) { a = Find(pv, a); b = Finf(pv, b);...
a.cc: In function 'void Merge(int, int, int)': a.cc:15:7: error: 'Finf' was not declared in this scope; did you mean 'Find'? 15 | b = Finf(pv, b); | ^~~~ | Find a.cc: In function 'int main()': a.cc:23:5: error: 'cin' was not declared in this scope 23 | cin>>a>>b; | ^~~ a.cc...
s089134502
p03857
C++
#include<stdio.h> #include<algorithm> #include<map> using namespace std; #define pii pair<int,int> map<pii, int> Map; int n,m,k; int UF[2][201000]; int Find(int pv, int x) { if(UF[pv][a] = a) return a; return UF[pv][a] = Find(pv, UF[pv][a]); } void Merge(int pv, int a, int b) { a = Find(pv, a); b = Finf(pv, b);...
a.cc: In function 'int Find(int, int)': a.cc:10:13: error: 'a' was not declared in this scope 10 | if(UF[pv][a] = a) return a; | ^ a.cc:11:17: error: 'a' was not declared in this scope 11 | return UF[pv][a] = Find(pv, UF[pv][a]); | ^ a.cc: In function 'void Merge(int, i...
s639199889
p03857
C++
#include <algorithm> #include <cstdio> #include <iostream> #include <map> #include <cmath> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #include <stdlib.h> #include <stdio.h> #include <bitset> using namespace std; #define FOR(I,A,B) for(int I = (A); I < (B); ++...
a.cc: In function 'int find(int, int)': a.cc:37:33: error: no matching function for call to 'find(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)' 37 | else return par[i][x] = find(par[i][x]); | ~~~~^~~~~~~~~~~ In file included from /usr/include/c++/14/algorith...
s454371728
p03857
C++
#include <algorithm> #include <cstdio> #include <iostream> #include <map> #include <cmath> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #include <stdlib.h> #include <stdio.h> #include <bitset> using namespace std; #define FOR(I,A,B) for(int I = (A); I < (B); ++...
a.cc: In function 'int find(int, int)': a.cc:37:33: error: no matching function for call to 'find(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)' 37 | else return par[0][x] = find(par[0][x]); | ~~~~^~~~~~~~~~~ In file included from /usr/include/c++/14/algorith...
s498684124
p03857
C++
#include <bits/stdc++.h> #define REP(i,n) for(int i=0;i<(int)(n);i++) #define ALL(x) (x).begin(),(x).end() #define LL long long using namespace std; bool sortpair(const pair<int,int>& a,const pair<int,int>& b){ return a.first==b.first ? a.second<b.second : a.first<b.first; } int pare[2*100000+1]; int rank[2*1000...
a.cc: In function 'void unite(int, int)': a.cc:25:8: error: reference to 'rank' is ambiguous 25 | if(rank[p]>rank[q]){ | ^~~~ 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/algo...
s097409021
p03857
C++
#include <bits/stdc++.h> using namespace std; typedef pair<int,int> P; #define mp make_pair #define RANK rank map <P,int> ans; int N, K, L; int p[200002]; int rank[200002]; int A[200001]; int B[200001]; void init(int n) { for(int i = 0; i < n; i++) { p[i] = i; rank[i] = 0; } } int Find (int x) { if(p...
a.cc: In function 'void init(int)': a.cc:19:5: error: reference to 'rank' is ambiguous 19 | 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++/14/algorithm:60, ...
s469037338
p03857
C++
#include <bits/stdc++.h> using namespace std; typedef pair<int,int> P; #define mp make_pair map <P,int> ans; int N, K, L; int p[200002]; int rank[200002]; int A[200001]; int B[200001]; void init(int n) { for(int i = 0; i < n; i++) { p[i] = i; rank[i] = 0; } } int Find (int x) { if(p[x] == x) return x...
a.cc: In function 'void init(int)': a.cc:18:5: error: reference to 'rank' is ambiguous 18 | 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++/14/algorithm:60, ...
s553269930
p03857
C++
#include <bits/stdc++.h> using namespace std; int N,K,L; int p[200001]; int rank[200001]; map <pair<int,int>,int> ans; int a[200001]; int b[200001]; void init() { for(int i = 0; i < N; i++) { p[i] = i; rank[i] = 0; } } int Find (int x) { if(p[x] == x) return x; return p[x] = Find(p[x]); } void Unio...
a.cc: In function 'void init()': a.cc:15:5: error: reference to 'rank' is ambiguous 15 | 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++/14/algorithm:60, ...
s441229330
p03857
C++
#include <iostream> #include <string> #include <vector> #include <queue> #include <stack> #include <map> #include <algorithm> #include <sstream> #include <cmath> #include <set> #include <iomanip> #include <deque> using namespace std; typedef long long ll; #define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++) #define RRE...
a.cc:27:14: error: expected identifier before '(' token 27 | bool union(int x, int y) { | ^ a.cc:27:15: error: expected unqualified-id before 'int' 27 | bool union(int x, int y) { | ^~~ a.cc:27:15: error: expected ')' before 'int' 27 | bool union(int x, int y) { ...
s945834946
p03857
C++
#pragma region include #include <iostream> #include <iomanip> #include <stdio.h> #include <sstream> #include <algorithm> #include <cmath> #include <complex> #include <string> #include <cstring> #include <vector> #include <tuple> #include <bitset> #include <queue> #include <complex> #include <set> #include <map> #inc...
a.cc: In function 'void solve()': a.cc:50:9: error: 'UnionFind' was not declared in this scope 50 | UnionFind ufA(N),ufB(N); | ^~~~~~~~~ a.cc:55:17: error: 'ufA' was not declared in this scope 55 | ufA.add(x,y); | ^~~ a.cc:61:17: error: 'ufB' was not dec...
s046939779
p03857
C++
#include <bits/stdc++.h> using namespace std; const int MAXN = 200001; typedef pair<int,int> pii; #define mp make_pair int par[MAXN]; int rank[MAXN]; int N, K, L; int A[MAXN], B[MAXN]; map <pii, int> ans; void init(int n) { for(int i = 0; i < n; i++) { par[i] = i; rank[i] = 0; } } int find(int x) { ...
a.cc: In function 'void init(int)': a.cc:17:5: error: reference to 'rank' is ambiguous 17 | 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++/14/algorithm:60, ...
s031223727
p03857
C++
#include <bits/stdc++.h> #define MOD 1000000007 using namespace std; const int size=234567; int N,K,L; int p[size],q[size],r[size],s[size],g1[size],g2[size]; int par[size],rank[size],G[size],H[size]; vector<int> cnt[size]; void init(int n){ for(int i=1; i<=n; i++){ par[i]=i; rank[i]=0; } } i...
a.cc:8:7: error: reference to 'size' is ambiguous 8 | int p[size],q[size],r[size],s[size],g1[size],g2[size]; | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, ...
s331274534
p03857
C++
#include <bits/stdc++.h> #define MOD 1000000007 using namespace std; const int size=234567; int N,K,L,I; int p[size],q[size],r[size],s[size]; vector<int> road[size]; vector<int> rail[size]; vector<int> group[size]; vector<int> Group[size]; int g1[size],g2[size]; bool flag; void dfsroad(int i,int j){ g1[i]=j; ...
a.cc:8:7: error: reference to 'size' is ambiguous 8 | int p[size],q[size],r[size],s[size]; | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a...
s867591906
p03857
C++
#include <iostream> #include <cmath> #include <algorithm> #include <vector> using namespace std; typedef long long int ll; const MOD (1e9+7); const INF (2e9); const MAX_N (20001); int par_road[MAX_N]; int rank_road[MAX_N]; int par_train[MAX_N]; int rank_train[MAX_N]; struct PARENT{ int num;//num 番目の都市は(問題上では1番目...
a.cc:7:7: error: ISO C++ forbids declaration of 'MOD' with no type [-fpermissive] 7 | const MOD (1e9+7); | ^~~ a.cc:8:7: error: ISO C++ forbids declaration of 'INF' with no type [-fpermissive] 8 | const INF (2e9); | ^~~ a.cc:9:7: error: ISO C++ forbids declaration of 'MAX_N' with no type...
s656571434
p03857
C++
z#include <iostream> #include <vector> #include <algorithm> #include <utility> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define vec vector #define ll long long class UnionFind { public: vec<int> p; vec<int> Rank; UnionFind(int n) : p(n), Rank(n, 0) { rep(i, n) p[i] = i; } void...
a.cc:1:2: error: stray '#' in program 1 | z#include <iostream> | ^ a.cc:1:1: error: 'z' does not name a type 1 | z#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...
s769609513
p03857
C++
#include<iostream> #include<unordered_map> #include<cstdio> using namespace std; int par0[200000], rank0[200000], par1[200000], rank1[200000]; int find0(int a) { if (par0[a] == a)return a; return par0[a] = find0(par0[a]); } void unite0(int a, int b) { a = find0(a); b = find0(b); if (rank0[a]>rank0[b]) { par0[b]...
a.cc: In function 'int main()': a.cc:63:38: error: 'd' was not declared in this scope 63 | printf("%d", U[find0(d)][find1(d)]); | ^