submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s776667328
p02248
Java
import java.io.*; import java.util.Iterator; import java.util.LinkedList; public class Main { public static void main(String[] args) { InputStreamReader in = new InputStreamReader(System.in); BufferedReader reader = new BufferedReader(in); LinkedList<int> result = new LinkedList<int>();...
Main.java:9: error: unexpected type LinkedList<int> result = new LinkedList<int>(); ^ required: reference found: int Main.java:9: error: unexpected type LinkedList<int> result = new LinkedList<int>(); ^ required: reference fou...
s079765721
p02248
Java
import java.io.*; import java.lang.Integer; import java.util.Iterator; import java.util.LinkedList; public class Main { public static void main(String[] args) { InputStreamReader in = new InputStreamReader(System.in); BufferedReader reader = new BufferedReader(in); LinkedList<int> resul...
Main.java:10: error: unexpected type LinkedList<int> result = new LinkedList<int>(); ^ required: reference found: int Main.java:10: error: unexpected type LinkedList<int> result = new LinkedList<int>(); ^ required: reference f...
s342603450
p02248
Java
import java.io.*; import java.lang.Integer; import java.util.Iterator; import java.util.LinkedList; public class Main { public static void main(String[] args) { InputStreamReader in = new InputStreamReader(System.in); BufferedReader reader = new BufferedReader(in); LinkedList<Integer> r...
Main.java:17: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal result.add(new Integer(i)); ^ Main.java:20: error: unexpected type Iterator<int> it = result.iterator(); ^ required: reference found: int 1 e...
s025351745
p02248
Java
import java.io.*; public class Main { public static void main(String[] args) { InputStreamReader in = new InputStreamReader(System.in); BufferedReader reader = new BufferedReader(in); try{ String text = reader.readLine(); String word = reader.readLine(); ...
Main.java:10: error: ')' expected if(text.substring(i,i + word.length().str.equals(word)){ ^ 1 error
s928985959
p02248
Java
import java.io.*; public class Main { public static void main(String[] args) { InputStreamReader in = new InputStreamReader(System.in); BufferedReader reader = new BufferedReader(in); try{ String text = reader.readLine(); String word = reader.readLine(); ...
Main.java:11: error: cannot find symbol if (text.charAt(i + j) != word(j)) ^ symbol: method word(int) location: class Main Main.java:14: error: cannot find symbol if(j == word.length()){ ^ symbol: variable j location: class M...
s062667695
p02248
Java
import java.io.*; public class Main { public static void main(String[] args) { InputStreamReader in = new InputStreamReader(System.in); BufferedReader reader = new BufferedReader(in); try{ String text = reader.readLine(); String word = reader.readLine(); ...
Main.java:14: error: cannot find symbol if(j == word.length()){ ^ symbol: variable j location: class Main 1 error
s958468888
p02248
Java
import java.io.*; public class Main { public static void main(String[] args) { InputStreamReader in = new InputStreamReader(System.in); BufferedReader reader = new BufferedReader(in); try{ String text = reader.readLine(); String word = reader.readLine(); ...
Main.java:13: error: ';' expected index = text.indexOf(text, index + 1) ^ 1 error
s448665340
p02248
Java
import java.io.*; public class Main { public static void main(String[] args) { InputStreamReader in = new InputStreamReader(System.in); BufferedReader reader = new BufferedReader(in); try{ String text = reader.readLine(); String word = reader.readLine(); ...
Main.java:56: error: missing return statement } ^ 1 error
s906659071
p02248
Java
import java.io.*; public class Main { public static void main(String[] args) { InputStreamReader in = new InputStreamReader(System.in); BufferedReader reader = new BufferedReader(in); try{ String text = reader.readLine(); String word = reader.readLine(); ...
Main.java:56: error: missing return statement } ^ 1 error
s260547884
p02248
Java
import java.io.*; public class Main { public static void main(String[] args) { InputStreamReader in = new InputStreamReader(System.in); BufferedReader reader = new BufferedReader(in); try{ String text = reader.readLine(); String word = reader.readLine(); ...
Main.java:55: error: missing return statement } ^ 1 error
s740331262
p02248
Java
import java.io.*; public class Main { public static void main(String[] args) { InputStreamReader in = new InputStreamReader(System.in); BufferedReader reader = new BufferedReader(in); try{ String text = reader.readLine(); String word = reader.readLine(); ...
Main.java:55: error: missing return statement } ^ 1 error
s196827681
p02248
Java
import java.io.*; public class Main { public static void main(String[] args) { InputStreamReader in = new InputStreamReader(System.in); BufferedReader reader = new BufferedReader(in); try{ String text = reader.readLine(); String word = reader.readLine(); ...
Main.java:13: error: cannot find symbol int[] skip = new int[pattern.length() + 2]; ^ symbol: variable pattern location: class Main Main.java:18: error: cannot find symbol while (txtCsl != pattern.length() + 1) { ^ symbol: v...
s463739094
p02248
Java
import java.io.*; import java.util.*; public class Algo49{ private static FastScanner sc = new FastScanner(); public static void main(String[] args){ char[] S = sc.next().toCharArray(); char[] P = sc.next().toCharArray(); int n = S.length; int m = P.length; int[] T = new int[m+1]; T[0] = -1; T[1] = 0...
Main.java:4: error: class Algo49 is public, should be declared in a file named Algo49.java public class Algo49{ ^ 1 error
s127365498
p02248
Java
#include <iostream> #include <string> using namespace std; int main() { string s1, s2; cin >> s1 >> s2; for (auto i = s1.begin(); i != s1.end(); ++i) { auto j = s2.begin(); auto k = i; while (j != s2.end() && k != s1.end()) { if (*k != *j) { break; ...
Main.java:1: error: illegal character: '#' #include <iostream> ^ Main.java:2: error: illegal character: '#' #include <string> ^ Main.java:8: error: not a statement cin >> s1 >> s2; ^ Main.java:20: error: not a statement cout << distance(s1.begin(), i) << endl; ...
s151960337
p02248
C
#include<bits/stdc++.h> using namespace std; ?? #define rep(i,n) for(int i=0;i<(n);i++) #define pb push_back #define all(v) (v).begin(),(v).end() typedef vector<int>vint; typedef pair<int,int>pint; ?? typedef unsigned long long ull; const ull p=1000000007; const int SIZE=1000000; ull H[SIZE+1],power[SIZE+1]; char S[SIZ...
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s113625229
p02248
C
#include<stdio.h> #include<string.h> int main(){ int i,j,n,k=0,sum=0,tlen,plen,v[N]; char T[1000000],P[1000]; scanf("%s%s",T,P); tlen=strlen(T); plen=strlen(P); //printf("%d %d\n",tlen,plen); for(i=0;i<tlen;i++){ if(T[i]==P[0]){ j=i+1; n=1; while(n<plen){ if(T[j]!=P[n]) ...
main.c: In function 'main': main.c:5:35: error: 'N' undeclared (first use in this function) 5 | int i,j,n,k=0,sum=0,tlen,plen,v[N]; | ^ main.c:5:35: note: each undeclared identifier is reported only once for each function it appears in
s404697902
p02248
C
#include<stdio.h> #include<string.h> #include<stdlib> #define N 10000 #define M 1000000 int main(){ int A[N]; int a,b; int i,count=0; char T[M]; char P[N]; scanf("%s %s",T, P); a = strlen(T); b = strlen(P); for(i = 0;i < a; i++){ if(strncmp(T+i,P,b) == 0){ A[count] = i; count++; } ...
main.c:3:9: fatal error: stdlib: No such file or directory 3 | #include<stdlib> | ^~~~~~~~ compilation terminated.
s719434070
p02248
C
#include<stdio.h> #include<string.h> #include<stdlib.h> int main(){ int A[N]; int a,b; int i,count=0; char *T; char *P; T = (char* )malloc(sizeof(char) * 1000000); P = (char* )malloc(sizeof(char) * 10000); scanf("%s %s",T, P); a = strlen(T); b = strlen(P); for(i = 0;i < a; i++){ if(strncmp(T+i,P...
main.c: In function 'main': main.c:6:9: error: 'N' undeclared (first use in this function) 6 | int A[N]; | ^ main.c:6:9: note: each undeclared identifier is reported only once for each function it appears in
s863073367
p02248
C
#include<stdio.h> #include<string.h> #include<stdlib.h> int main(){ int a,b; int i,count=0; char *T; char *P; T = (char* )malloc(sizeof(char) * 1000000); P = (char* )malloc(sizeof(char) * 10000); scanf("%s%s",T, P); a = strlen(T); b = strlen(P); for(i = 0;i < a; i++){ if(strncmp(T+i,P,b) == 0){ ...
main.c: In function 'main': main.c:18:7: error: implicit declaration of function 'printF'; did you mean 'printf'? [-Wimplicit-function-declaration] 18 | printF("%d\n",i); | ^~~~~~ | printf main.c:22:1: error: expected declaration or statement at end of input 22 | } | ^
s695620326
p02248
C
#include<stdio.h> #include<string.h> #include<stdlib.h> int main(){ int a,b; int i,count=0; char *T; char *P; T = (char* )malloc(sizeof(char) * 1000000); P = (char* )malloc(sizeof(char) * 10000); scanf("%s%s",T, P); a = strlen(T); b = strlen(P); for(i = 0;i < a; i++){ if(strncmp(T+i,P,b) == 0){ ...
main.c: In function 'main': main.c:18:7: error: implicit declaration of function 'printF'; did you mean 'printf'? [-Wimplicit-function-declaration] 18 | printF("%d\n",i); | ^~~~~~ | printf
s953030019
p02248
C
#include <stdio.h> #include <string.h> int main(){ char A[1000001],B[10001]; int i, k, in, state; scanf("%s",A); scanf("%s",B); in=strlen(A); ln=strlen(B); for(i=0;i<in;i++){ if(strncmp(&A[i],B,k)==0)printf("%d\n",i); } return 0; }
main.c: In function 'main': main.c:11:5: error: 'ln' undeclared (first use in this function); did you mean 'in'? 11 | ln=strlen(B); | ^~ | in main.c:11:5: note: each undeclared identifier is reported only once for each function it appears in
s544989340
p02248
C
#include<stdio.h> #include<string.h> int main() { char s1[1000001]; char s2[10001]; int i, j, k; scanf("%s", s1); scanf("%s", s2); s1len = strlen(s1); s2len = strlen(s2); for (i = 0; i < s1len; i++) { if(strncmp(s2, &s1[i], s2len)==0) printf("%d\n", i); } return ...
main.c: In function 'main': main.c:12:5: error: 's1len' undeclared (first use in this function); did you mean 'strlen'? 12 | s1len = strlen(s1); | ^~~~~ | strlen main.c:12:5: note: each undeclared identifier is reported only once for each function it appears in main.c:13:5: error: 's2len' und...
s828826452
p02248
C++
/*input aabhfgfaagjffasaaabaaazxzxcohxzcohxzcohzcxohizxciaabaaagfaabaaaaasfdasfabaaaaabaaafgsdffdhaabaagffgffhdfaaabaghfdaa aa */ fn read_line() -> String { let mut return_ = format!(""); std::io::stdin().read_line(&mut return_).ok(); return_.pop(); return_ } fn main() { let string: Vec<char> = rea...
a.cc:5:1: error: 'fn' does not name a type 5 | fn read_line() -> String { | ^~ a.cc:12:1: error: 'fn' does not name a type 12 | fn main() { | ^~ a.cc:20:1: error: 'fn' does not name a type 20 | fn kmp_table(pattern: &Vec<char>, m: usize, mut kmp: Vec<usize>) -> Vec<usize> { | ^~ a.cc:41:1: e...
s057961448
p02248
C++
#include <iostream> #include <algorithm> #include <cmath> #include <vector> #include <complex> #include <queue> #include <deque> #include <set> #include <map> #include <unordered_set> #include <unordered_map> #include <iomanip> #include <assert.h> #include <array> #include <cstdio> #include <cstring> #include <random> ...
a.cc:99:61: error: 'shared_ptr' has not been declared 99 | bool same(int a_start, int a_end, int b_start, int b_end, shared_ptr<RollingHash<T>> const& rh) const { | ^~~~~~~~~~ a.cc:99:71: error: expected ',' or '...' before '<' token 99 | bool ...
s521824469
p02248
C++
#include<bits/stdc++.h> #include<iostream> #include<string> #include<vector> using namespace std; void KMP(string T, string P){ int t=T.size(); int p=P.size(); int i,j,k; //????????????????????? vector<int> next(p); i=2; j=0; next[0]=-1; next[1]=0; while(i<p){ if(P[i-1]==P[j]){ next[i]=j+1; i++; ...
a.cc:38:42: error: stray '\' in program 38 | printf(%d\n,i); | ^ a.cc: In function 'void KMP(std::string, std::string)': a.cc:38:40: error: expected primary-expression before '%' token 38 | printf(%d\n,i...
s711539592
p02248
C++
#include<iostream> using namespace std; #include<string> #include<stdio.h> int solve(char* T, char* P, int start) { int n = strlen(T), m = strlen(P); int k = start; int x, y; if(n < m) return -1; while(k <= n - m){ for(x = m - 1; x >= 0; x--){ if(P[x] != T[k + x]) break; ...
a.cc: In function 'int solve(char*, char*, int)': a.cc:8:13: error: 'strlen' was not declared in this scope 8 | int n = strlen(T), m = strlen(P); | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostrea...
s476734014
p02248
C++
#include<iostream> using namespace std; #include<string> #include<stdio.h> #define A 1995455101 // large prime number. #define B 1995455447 // large prime number, bigger than A. int main() { char T[1000000]; scanf("%s", T); int len_T = strlen(T); char P[10000]; scanf("%s", P); int len_P = strlen(P); lon...
a.cc: In function 'int main()': a.cc:11:50: error: 'strlen' was not declared in this scope 11 | char T[1000000]; scanf("%s", T); int len_T = strlen(T); | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#i...
s568498102
p02248
C++
// // Created by ?????°?????? on 2016/06/21. // #include <iostream> #include <string> using namespace std; void KMP(string T, string P){ int t=T.size(); int p=P.size(); int i,j,k; vector<int> next(p); int nex; i=2;j=0 ; if(p == 1){ next[0] = -1; nex = 0; }else{ ...
a.cc: In function 'void KMP(std::string, std::string)': a.cc:14:5: error: 'vector' was not declared in this scope 14 | vector<int> next(p); | ^~~~~~ a.cc:6:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 5 | #include <iostream> +++ |+...
s122902852
p02248
C++
#include <iostream> #include <string> #include <map> #include <algorithm> using namespace std; int main(){ string T, P; cin >> T >> P; map<char, long> skip; for (long i = P.size() - 1; i >= 0; i--){ map<char, long>::iterator itr = skip.find(P[i]); if (itr == skip.end()) skip[P[i]] = (P.size() - 1) - i; } /*...
a.cc: In function 'int main()': a.cc:27:49: error: no matching function for call to 'max(std::map<char, long int>::mapped_type&, int)' 27 | f += max(skip[T[f - i]], 1); | ~~~^~~~~~~~~~~~~~~~~~~ In file included from /usr/inclu...
s240027876
p02248
C++
#include <iostream> #include <string> using namespace std; int main(){ string a,b; cin >> a >> b; int SizeA = a.size(); int SizeB = b.size(); if(SizeA < SizeB) return 0; for (int i = 0; i < SizeA-SizeB +1 ; ++i) { if(a[i]== b[0]){ if(a.substr(i,SizeB) == b) printf("%d\n",i)...
a.cc: In function 'int main()': a.cc:16:5: error: 'reaurn' was not declared in this scope 16 | reaurn 0; | ^~~~~~
s500805982
p02248
C++
#include <iostream> #include <string> #include <cstdio> using namespace std; int main(){ string a,b; cin >> a >> b; int SizeA = a.size(); int SizeB = b.size(); if(SizeA < SizeB) return 0; for (int i = 0; i < SizeA-SizeB +1 ; ++i) { if(a[i]== b[0]){ if(a.substr(i,SizeB) == b...
a.cc: In function 'int main()': a.cc:17:5: error: 'reaurn' was not declared in this scope 17 | reaurn 0; | ^~~~~~
s816546628
p02248
C++
#include <iostream> #include <string> #include <cstdio> #include <vector> using namespace std; int main(){ string a,b; cin >> a >> b; int SizeA = a.size(); int SizeB = b.size(); if(SizeA < SizeB) return 0; for (int i = 0; i < SizeA-SizeB +1 ; ++i) { if(a[i]== b[0]){ if(a.su...
a.cc: In function 'int main()': a.cc:18:5: error: 'reaurn' was not declared in this scope 18 | reaurn 0; | ^~~~~~
s307728414
p02248
C++
#include <iostream> #include <cmath> #include <string> int main(void) { std::sync_with_stdio(false); std::string T; std::string P; std::cin >> T; std::cin >> P; if (T.size() < P.size()) { return 0; } int index = 0; for (int i = 0; i <= T.size() - P.size(); i++) { if (P == T.substr(i, P...
a.cc: In function 'int main()': a.cc:6:8: error: 'sync_with_stdio' is not a member of 'std' 6 | std::sync_with_stdio(false); | ^~~~~~~~~~~~~~~
s023196647
p02248
C++
#include<iostream> #include<vector> #include<string> using namespace std; int main() { string a, b; cin >> a >> b; if (a.length < b.length())goto s; for (int c = 0; c < a.length() - b.length() + 1; c++) { for (int d = 0; d < b.length(); d++) { if (a[c + d] != b[d])break; if (b.length() - 1 == d) { cout << ...
a.cc: In function 'int main()': a.cc:9:15: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsi...
s422074444
p02248
C++
#include<bits/stdc++.h> using namespace std; ?? #define rep(i,n) for(int i=0;i<(n);i++) #define pb push_back #define all(v) (v).begin(),(v).end() typedef vector<int>vint; typedef pair<int,int>pint; ?? typedef unsigned long long ull; const ull p=1000000007; const int SIZE=1000000; ull H[SIZE+1],power[SIZE+1]; char S[SIZ...
a.cc:3:1: error: expected unqualified-id before '?' token 3 | ?? | ^ a.cc:9:1: error: expected unqualified-id before '?' token 9 | ?? | ^ a.cc:11:7: error: 'ull' does not name a type; did you mean 'all'? 11 | const ull p=1000000007; | ^~~ | all a.cc:13:1: error: 'ull' does...
s058491864
p02248
C++
#include<bits/stdc++.h> using namespace std; struct SuffixArray { vector< int > SA; string s; void Build_SA(const string &str) { s = str; SA.resize(s.size()); iota(begin(SA), end(SA), 0); sort(begin(SA), end(SA), [&](const int &a, const int &b) { if(s[a] == s[b]) return (a > b); ...
a.cc: In function 'int main()': a.cc:111:22: error: 'T' was not declared in this scope 111 | for(int i = 0; i < T.size(); i++) { | ^
s911925563
p02248
C++
#include <iostream> #include <list> #include <vector> #include <map> #include <set> #include <queue> #include <stack> #include <numeric> #include <algorithm> #include <string> using namespace std; typedef long long lli; typedef vector<lli> vll; typedef vector<bool> vbl; typedef vector<vector<lli> > mat; typedef vector<...
a.cc: In function 'int main()': a.cc:56:40: error: expected ';' before 'c' 56 | for(lli i = 0;i < a.size()-b.size()c;i++){ | ^ | ; a.cc:56:40: error: 'c' was not declared in this scope a.cc:56:41: error: expected ')' before...
s657213618
p02248
C++
#include<bits/stdc++.h> using namespace std; void bubble(int n,char a[],int b[]){ for(int i=0;i<n-1;i++){ for(int j=n-1;j>=i+1;j--){ if(b[j]<b[j-1]){ swap(b[j],b[j-1]); swap(a[j],a[j-1]); } } } for(int i=0;i<n;i++){ if(i!=n-1) cout << a[i] << b[i] << ' '; else cout << a[i] << b[i...
a.cc: In function 'int main()': a.cc:49:3: error: 'r' was not declared in this scope 49 | r | ^ a.cc:49:4: error: expected '}' at end of input 49 | r | ^ a.cc:36:11: note: to match this '{' 36 | int main(){ | ^
s583128318
p02248
C++
#include <stdio.h> #include <iostream> using namespace std; #define TEXT_T_MAX 1000000 #define TEXT_P_MAX 10000; bool compareText(const char *t1, char const *t2, int len); int main (void) { char t[TEXT_T_MAX + 1] = "\0"; char p[TEXT_P_MAX + 1] = "\0"; cin >> t >> p; int length; for (length = 0; p[length] != '\...
a.cc: In function 'int main()': a.cc:6:25: error: expected ']' before ';' token 6 | #define TEXT_P_MAX 10000; | ^ a.cc:13:16: note: in expansion of macro 'TEXT_P_MAX' 13 | char p[TEXT_P_MAX + 1] = "\0"; | ^~~~~~~~~~ a.cc:13:30: error: expected ';' before...
s206008793
p02248
C++
/*#include <iostream> #include <string> using namespace std; int main(){ ios::sync_with_stdio(false); string a, b; int x, i = 0; cin >> a >> b; for(int i = 0;a[i];i++){ i = a.find(b, i); if(i == -1)break; cout << i << endl; } /*while((x = a.find(b, i)) != -1){ cout << x << endl; i = x + 1; }*/ retu...
a.cc:19:9: error: expected unqualified-id before 'return' 19 | return 0; | ^~~~~~ a.cc:20:1: error: expected declaration before '}' token 20 | }*/ | ^ a.cc:20:3: error: expected unqualified-id before '/' token 20 | }*/ | ^ In file included from /usr/include/c++/14/iosfwd:42,...
s648384655
p02248
C++
#include <iostream> #include <string> #include <vector> #define CLEN 256 using namespace std; template <typename T> std::vector< std::vector<T> > makeMatrix(int row, int col) { std::vector< std::vector<T> > vv(row); for(auto it=vv.begin();it!=vv.end();it++){ (*it).resize(col); } return vv; } ...
a.cc: In function 'std::vector<std::vector<int> > makeBadCTable(std::string)': a.cc:30:1: error: a template declaration cannot appear at block scope 30 | template <typename T> | ^~~~~~~~ a.cc:61:1: error: a function-definition is not allowed here before '{' token 61 | { | ^ a.cc:83:1: error: a functio...
s344450264
p02248
C++
#include<bits/stdc++.h> using namespace std; string S, T; int main() { cin >> S >> T; if (S.size() >= T.size()) { for (int i = 0; i <= S.size() - T.size(); i++) { if (T == S.substr(i, T.size())) { printf("%d\n",i); } } } }
a.cc:1:25: warning: extra tokens at end of #include directive 1 | #include<bits/stdc++.h> using namespace std; string S, T; int main() { cin >> S >> T; if (S.size() >= T.size()) { for (int i = 0; i <= S.size() - T.size(); i++) { if (T == S.substr(i, T.size())) { printf("%d\n",i); } } } } | ...
s190091119
p02249
C
#include <stdio.h> #include <stdlib.h> #include <String.h> #include <math.h> #include <limits.h> /* * ?????????????´¢????????????rolling-hash??? * String????????????????????¨??????Pattern???????????????????????? * ??????????±???????????????°???????????°????????????????????£??¬?????????????????? * */ char String...
main.c:3:10: fatal error: String.h: No such file or directory 3 | #include <String.h> | ^~~~~~~~~~ compilation terminated.
s048930164
p02249
C++
/* * 2D string matching * Approach: 2D fingerprinting */ #include <iostream> #include <string> #include <vector> using namespace std; using ull = unsigned long long; constexpr ull MODULUS = 1e9 + 9; constexpr ull PRIME = 47; int ValueOf(char ch) { if ('0' <= ch && ch <= '9') return ch - '0'; return 10 + ch...
a.cc: In function 'void Match(const std::vector<std::__cxx11::basic_string<char> >&, const std::vector<std::__cxx11::basic_string<char> >&)': a.cc:86:3: error: 'sort' was not declared in this scope; did you mean 'short'? 86 | sort(begin(matches), end(matches)); | ^~~~ | short
s985197550
p02249
C++
/* * 2D string matching * Approach: 2D fingerprinting */ #include <iostream> #include <string> #include <vector> using namespace std; using ull = unsigned long long; constexpr ull MODULUS = 1e9 + 9; constexpr ull PRIME = 47; int ValueOf(char ch) { if ('0' <= ch && ch <= '9') return ch - '0'; return 10 + ch...
a.cc: In function 'void Match(std::vector<std::__cxx11::basic_string<char> >&, std::vector<std::__cxx11::basic_string<char> >&)': a.cc:86:3: error: 'sort' was not declared in this scope; did you mean 'short'? 86 | sort(begin(matches), end(matches)); | ^~~~ | short
s212781307
p02249
C++
#include <bits/stdc++.h> #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) using namespace std; typedef unsigned long long ull; const int max_size=1010; char pattern[max_size][max_size]; char target[max_size][max_size]; ull hash[max_size][max_size],tmp[max_size][max_size]; void calc(char a[max_size][max_size],int n,in...
a.cc: In function 'void calc(char (*)[1010], int, int, int, int)': a.cc:37:25: error: reference to 'hash' is ambiguous 37 | hash[i][j]=e; | ^~~~ In file included from /usr/include/c++/14/string_view:50, from /usr/include/c++/14/bits/basic_string....
s167044482
p02249
C++
#include <stdio.h> #include <stdlib.h> #include <String.h> #include <math.h> #include <limits.h> /* * ?????????????´¢????????????rolling-hash??? * String????????????????????¨??????Pattern???????????????????????? * ??????????±???????????????°???????????°????????????????????£??¬?????????????????? * */ char String...
a.cc:3:10: fatal error: String.h: No such file or directory 3 | #include <String.h> | ^~~~~~~~~~ compilation terminated.
s914797238
p02249
C++
#include<iostream> #include<string> #include<vector> #include <cstdlib> using namespace std; typedef unsigned long long ull; const ull X = 100001; const ull Y = 9973; const int MAX = 105; ull hash1[MAX][MAX]; ull hash2[MAX][MAX]; void hashCalc(int T[MAX][MAX],int H,int W,int R, int C) { //x???X???C??? ull x = 1;...
a.cc:71:32: error: stray '#' in program 71 | t=s[j];#include <cstdlib> | ^ a.cc: In function 'int main()': a.cc:71:33: error: 'include' was not declared in this scope 71 | t=s[j];#include <cstdlib> | ...
s003705864
p02249
C++
#include<iostream> using namespace std; #include<string> #include<stdio.h> #define A 1355471101 // large prime number 1. #define B 1466700101 // large prime number 2. #define M 1522101101 // large prime number 3, larger than A and B. int main() { int i, j, H, W, R, C; string *T; scanf("%d %d", &H, &W)...
a.cc: In function 'int main()': a.cc:76:32: error: 'P' was not declared in this scope 76 | delete [] T; delete [] P; | ^
s569560273
p02249
C++
#include <iostream> #include <cstdio> #include <string> using namespace std; int main(){ long H, W, R, C; string T[1000], P[1000]; cin >> H >> W; for (long i = 0; i < H; i++){ cin >> T[i]; } cin >> R >> C; if (H < R || W < C) return 0; for (long i = 0; i < R; i++){ cin >> P[i]; } for (long i = 0; i < H -...
a.cc: In function 'int main()': a.cc:24:76: error: 'j' was not declared in this scope 24 | if (R == 1) printf("%ld %ld\n", i, j); | ^ a.cc:27:77: error: 'j' was not declared in this scope 27 | ...
s341773383
p02249
C++
#include<bits/stdc++.h> #define HIRA 177771 #define R 1000 using namespace std; typedef unsigned long long ull; ull ab[R][R],cd[R][R]; ull lo[R][R],to[R][R]; string su[R],pu[R]; int main(){ int h1,w1,h11,w11; cin>>h1>>w1; for(int i=0;i<h1;i++)cin>>su[i]; for(int i=0;i<h1;i++) for(int j=0;j<w1;j++)ab[i][...
a.cc: In function 'int main()': a.cc:32:42: error: 'sawabor' was not declared in this scope; did you mean 'sawa'? 32 | for(int i=0;i<w11;i++)bor*=HIRA,bor+=sawabor[j][i],gojob*=HIRA; | ^~~~~~~ | sawa a.cc:35:22: error: ...
s659383531
p02249
C++
t = gets.chomp q = gets.to_i q.times{ p = gets.chomp if t.index(p) == nil then puts "0" else puts "1" end }
a.cc:1:1: error: 't' does not name a type 1 | t = gets.chomp | ^
s410945607
p02249
C++
#include <iostream> #include <vector> #include <unordered_map> #include <queue> #include <tuple> #include <algorithm> using namespace std; template<typename T> class PMA { private: uint32_t id = 0; public: struct Node { uint32_t id; bool accepted = false; unordered_map<T, Node*> child...
a.cc:13:5: error: 'uint32_t' does not name a type 13 | uint32_t id = 0; | ^~~~~~~~ a.cc:7:1: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' 6 | #include <algorithm> +++ |+#include <cstdint> 7 | a.cc:17:9: error: 'uint32_t' does not ...
s567712127
p02249
C++
#include <iostream> #include <cstdio> #include <vector> #include <unordered_map> #include <queue> #include <tuple> #include <algorithm> using namespace std; template<typename T> class PMA { private: uint32_t id = 0; public: struct Node { uint32_t id; bool accepted = false; unordered_m...
a.cc:14:5: error: 'uint32_t' does not name a type 14 | uint32_t id = 0; | ^~~~~~~~ a.cc:8:1: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' 7 | #include <algorithm> +++ |+#include <cstdint> 8 | a.cc:18:9: error: 'uint32_t' does not ...
s418802993
p02249
C++
#include<iostream> #include<vector> #include<algorithm> #include<string> #include<cctype> #include<cstdio> #include<cassert> using namespace std; struct AhoCorasick { static const int ALPHABET_SIZE = 62, root=0; inline int index(char ch){ if(isupper(ch))return ch-'A'; if(islower(ch)...
a.cc: In function 'std::vector<std::pair<int, int> > bakerBird(const std::vector<std::__cxx11::basic_string<char> >&, const std::vector<std::__cxx11::basic_string<char> >&)': a.cc:107:17: error: 'jtil' was not declared in this scope; did you mean 'til'? 107 | for(int j=0;jtil;j++){ | ^~~~ ...
s838612945
p02250
C
def isEqual(T,P): for i in range(len(T)-len(P)+1): if T[i:i+len(P)] == P: return 1 return 0 T = input() n = int(input()) for i in range(n): P = input() print(isEqual(T,P))
main.c:2:1: error: unknown type name 'def' 2 | def isEqual(T,P): | ^~~ main.c: In function 'isEqual': main.c:2:17: error: expected declaration specifiers before ':' token 2 | def isEqual(T,P): | ^ main.c:2:5: error: type of 'T' defaults to 'int' [-Wimplicit-int] 2 | def isEqual(T...
s272402320
p02250
C
#include <stdio.h> #include <stdlib.h> #include <string.h> #define M 1000000 #define N 1000 int main(){ int i; int j; int num; int str_length; int cmp_length; char *str; char *cmp; str = (char *)malloc(sizeof(char) * M); cmp = (char *)malloc(sizeof(char) * N); scanf("%s",str); str_length = strlen(st...
main.c: In function 'main': main.c:42:3: error: expected declaration or statement at end of input 42 | return 0; | ^~~~~~
s698926968
p02250
C++
#include<iomanip> #include<limits> #include<thread> #include<utility> #include<iostream> #include<string> #include<algorithm> #include<set> #include<map> #include<vector> #include<stack> #include<queue> #include<cmath> #include<numeric> #include<cassert> #include<random> #include<chrono> #include<unordered_map> #includ...
In file included from /usr/include/c++/14/bits/stl_algobase.h:71, from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/iomanip:42, ...
s103898621
p02250
C++
#include "bits/stdc++.h" using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; using vi = vector<int>; using vvi = vector<vector<int>>; using vl = vector<ll>; using vll = vector<vector<ll>>; using pii = pair<int,int>; #define FOR(i,a,b) for(ll i = (a); i < (b); i++) #define ...
a.cc:21:41: error: ISO C++ forbids declaration of 'string' with no type [-fpermissive] 21 | vector<string> make_suffix_array(const &string s){ | ^~~~~~ a.cc:21:48: error: expected ',' or '...' before 's' 21 | vector<string> make_suffix_array(const &string s){ | ...
s482548337
p02250
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <numeric> #include <cstdio> using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); string s,q; cin>>s; s+='$'; int n=s.size(); vector<int>suff(n); iota(suff.begin(),suff.end(),0); { const char *str=s.c_s...
a.cc: In lambda function: a.cc:21:32: error: 'strcmp' was not declared in this scope 21 | return strcmp(str+a,str+b); | ^~~~~~ a.cc:7:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 6 | #inclu...
s797773816
p02250
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <numeric> #include <cstdio> #include <cstring> using namespace std; struct SAComp{ const int h,*g; SAComp(const int h, const int* g) : h(h), g(g) {} bool operator()(const int a, const int b){ return a == b ? false : g[a] != g[b] ...
a.cc: In function 'int main()': a.cc:28:58: error: no matching function for call to 'SAComp::SAComp(int, const char*&)' 28 | sort(suff.begin(),suff.end(),SAComp(0,str)); | ^ a.cc:11:9: note: candidate: 'SAComp::SAComp(int, const int*)' ...
s443731931
p02250
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <numeric> #include <cstdio> #include <cstring> using namespace std; struct SAComp{ const int h,*g; SAComp(const int h, const char* g) : h(h), g(g) {} bool operator()(const int a, const int b){ return a == b ? false : g[a] != g[b]...
a.cc: In constructor 'SAComp::SAComp(int, const char*)': a.cc:11:54: error: cannot convert 'const char*' to 'const int*' in initialization 11 | SAComp(const int h, const char* g) : h(h), g(g) {} | ^ | ...
s582694948
p02250
C++
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <cstdlib> #define REP(i, n) for (int i=0;i<int(n);++i) #define REPV(i, v, n) for (int i=0,tmp=v;i<int(n);++i) #define FOR(i, a, b) for (int i=int(a);i<int(b);++i) #define DWN(i, b, a) for (int i=int(b-1);i>=int(a);--i) using namespa...
a.cc:16:1: error: reference to 'byte' is ambiguous 16 | byte mask[] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 }; | ^~~~ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68, from /usr/include/c++/14/bits/locale_classe...
s222379693
p02250
C++
#include <string> #include <iostream> using namespace std; string S, T; int Q, R, A; char STR[1005]; int main() { cin >> S >> Q; for (int i = 0; i < Q; i++) { scanf("%s", STR); T = S.substr(0, strlen(STR)); R = S.size() - strlen(STR); A = strlen(STR); for (int j = 0; j <= R; j++) { if (j) {...
a.cc: In function 'int main()': a.cc:16:33: error: 'strlen' was not declared in this scope 16 | T = S.substr(0, strlen(STR)); | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #incl...
s570914499
p02250
C++
import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.PriorityQueue; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOExcept...
a.cc:48:17: error: stray '@' in program 48 | @Override | ^ 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 | i...
s320025150
p02250
C++
#include <string> #include <vector> #include <iostream> #include <algorithm> using namespace std; int Q, doubles, lengths, dat[1000009], tmp[1000009], array[1000009]; string S, T; bool compare_suffix(int i, int j) { if (dat[i] == dat[j]) { int ri = (i + doubles <= lengths ? dat[i + doubles] : -1); i...
a.cc: In function 'void suffix_array()': a.cc:17:40: error: 'arrays' was not declared in this scope; did you mean 'array'? 17 | for (int i = 0; i <= lengths; i++) arrays[i] = i, dat[i] = i < lengths ? S[i] : -1; | ^~~~~~ | ...
s660880066
p02250
C++
#include <string> #include <vector> #include <iostream> #include <algorithm> using namespace std; int Q, doubles, lengths, dat[1000009], tmp[1000009], arrays[1000009]; string S, T; bool compare_suffix(int i, int j) { if (dat[i] == dat[j]) { int ri = (i + doubles <= lengths ? dat[i + doubles] : -1); int rj = (j + d...
a.cc: In function 'void suffix_array()': a.cc:19:29: error: request for member 'begin' in 'arrays', which is of non-class type 'int [1000009]' 19 | sort(arrays.begin(), arrays.begin() + lengths + 1, compare_suffix); | ^~~~~ a.cc:19:45: error: request for member 'begi...
s354744421
p02250
C++
#include <string> #include <vector> #include <iostream> #include <algorithm> using namespace std; int Q, doubles, lengths, dat[1000009], tmp[1000009], arrays[1000009]; string S, T; bool compare_suffix(int i, int j) { if (dat[i] == dat[j]) { int ri = (i + doubles <= lengths ? dat[i + doubles] : -1); int rj = (j + d...
a.cc: In function 'int main()': a.cc:27:21: error: too many arguments to function 'void suffix_array()' 27 | suffix_array(S); | ~~~~~~~~~~~~^~~ a.cc:15:6: note: declared here 15 | void suffix_array() { | ^~~~~~~~~~~~
s270636979
p02250
C++
#include <string> #include <vector> #include <iostream> #include <algorithm> using namespace std; int Q, doubles, lengths, dat[1000009], tmp[1000009], arrays[1000009]; string S, T; bool compare_suffix(int i, int j) { if (dat[i] == dat[j]) { int ri = (i + doubles <= lengths ? dat[i + doubles] : -1); int rj = (j + d...
a.cc: In function 'int main()': a.cc:34:38: error: 'flag' was not declared in this scope 34 | if (S1 == T) flag = 1; break; | ^~~~
s042750442
p02250
C++
#include <string> #include <vector> #include <iostream> #include <algorithm> using namespace std; // ------ Function ------ // inline unsigned int __builtin_clz(unsigned int x) { unsigned long r; _BitScanReverse(&r, x); return 31 - r; } // ------ Sparse Table ------ // class SparseTable { vector<vector<int> >st; publi...
a.cc:7:21: error: definition of 'unsigned int __builtin_clz(unsigned int)' ambiguates built-in declaration 'int __builtin_clz(unsigned int)' 7 | inline unsigned int __builtin_clz(unsigned int x) { unsigned long r; _BitScanReverse(&r, x); return 31 - r; } | ^~~~~~~~~~~~~ a.cc: In function '...
s348249848
p02250
C++
#include <string> #include <vector> #include <algorithm> using namespace std; // ------ Function ------ // inline unsigned int __builtin_clz(unsigned int x) { unsigned long r; _BitScanReverse(&r, x); return 31 - r; } // ------ Suffix Array ------ // class SuffixArray { void CreateBeginBucket(vector<int>&v, vector<int...
a.cc:6:21: error: definition of 'unsigned int __builtin_clz(unsigned int)' ambiguates built-in declaration 'int __builtin_clz(unsigned int)' 6 | inline unsigned int __builtin_clz(unsigned int x) { unsigned long r; _BitScanReverse(&r, x); return 31 - r; } | ^~~~~~~~~~~~~ a.cc: In function '...
s271524084
p02250
C++
#include <string> #include <vector> #include <algorithm> using namespace std; // ------ Suffix Array ------ // class SuffixArray { void CreateBeginBucket(vector<int>&v, vector<int>&bucket) { fill(bucket.begin(), bucket.end(), 0); for (int i = 0; i<v.size(); i++)bucket[v[i]]++; int sum = 0; for (int i = 0; i<b...
/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
s643941445
p02250
C++
#include <string> #include <vector> #include <algorithm> // ------ Suffix Array ------ // class SuffixArray { void CreateBeginBucket(vector<int>&v, vector<int>&bucket) { fill(bucket.begin(), bucket.end(), 0); for (int i = 0; i<v.size(); i++)bucket[v[i]]++; int sum = 0; for (int i = 0; i<bucket.size(); i++) { ...
a.cc:7:32: error: 'vector' has not been declared 7 | void CreateBeginBucket(vector<int>&v, vector<int>&bucket) { | ^~~~~~ a.cc:7:38: error: expected ',' or '...' before '<' token 7 | void CreateBeginBucket(vector<int>&v, vector<int>&bucket) { | ...
s408552593
p02250
C++
#include <string> #include <vector> #include <algorithm> using namespace std; // ------ Suffix Array ------ // class SuffixArray { void CreateBeginBucket(vector<int>&v, vector<int>&bucket) { fill(bucket.begin(), bucket.end(), 0); for (int i = 0; i<v.size(); i++)bucket[v[i]]++; int sum = 0; for (int i = 0; i<b...
a.cc: In function 'int main()': a.cc:112:9: error: 'cin' was not declared in this scope 112 | cin >> s >> q; | ^~~ a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 3 | #include <algorithm> +++ |+#include <iostream> 4...
s322837255
p02250
C++
// +------------------------------- // | Suffix Array Library Ver.1.2 // | Author: square1001 // | Required: // | #include <string> // | #include <vector> // | #include <algorithm> // | using namespace std; // +------------------------------- // +------------------------------- // | CEB --> Create End Bucket /...
a.cc:24:21: error: definition of 'unsigned int __builtin_clz(unsigned int)' ambiguates built-in declaration 'int __builtin_clz(unsigned int)' 24 | inline unsigned int __builtin_clz(unsigned int x) { unsigned long r; _BitScanReverse(&r, x); return 31 - r; } | ^~~~~~~~~~~~~ a.cc: In function ...
s721205306
p02250
C++
#include<cstdio> #include<string> #include<algorithm> #define MAX 1000002 int Lv[MAX], A[MAX], newLv[MAX]; int n, k; string T; bool cmp_Lv(const int i, const int j){ return Lv[i] < Lv[j]; } bool cmp(const int i, const int j){ if(Lv[i] != Lv[j]){ return Lv[i] < Lv[j]; } int L_i = (i + k >= n ? -1 : Lv[i + k]); in...
a.cc:9:1: error: 'string' does not name a type; did you mean 'stdin'? 9 | string T; | ^~~~~~ | stdin a.cc: In function 'int main()': a.cc:23:14: error: 'cin' is not a member of 'std' 23 | std::cin >> T; | ^~~ a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; thi...
s299353067
p02250
C++
#include<iostream> #include<cstdio> #include<string> #include<algorithm> #define MAX 1000002 int Lv[MAX], A[MAX], newLv[MAX]; int n, k; string T; bool cmp_Lv(const int i, const int j){ return Lv[i] < Lv[j]; } bool cmp(const int i, const int j){ if(Lv[i] != Lv[j]){ return Lv[i] < Lv[j]; } int L_i = (i + k >= n ? -...
a.cc:10:1: error: 'string' does not name a type; did you mean 'stdin'? 10 | string T; | ^~~~~~ | stdin a.cc: In function 'int main()': a.cc:24:21: error: 'T' was not declared in this scope 24 | std::cin >> T; | ^ a.cc:30:9: error: 'sort' was not declared in this scope...
s233633265
p02250
C++
#include<iostream> #include<cstdio> #include<string> #include<algorithm> int *Lv; int n, k; bool cmp_Lv(const int i, const int j){ return Lv[i] < Lv[j]; } bool cmp(const int i, const int j){ if(Lv[i] != Lv[j]){ return Lv[i] < Lv[j]; } int L_i = (i + k >= n ? -1 : Lv[i + k]); int L_j = (j + k >= n ? -1 : ...
a.cc: In function 'int main()': a.cc:62:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 62 | cin >> P; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ...
s437623829
p02250
C++
#include<bits/stdc++.h> using namespace std; typedef pair<int,int> P; typedef pair< P , int > PP; void suffixArray(char* s,vector<int> &res2){ int len=strlen(s); vector<int> res(len+1); vector< PP > tmp(len+1); res2=vector<int>(len+1); for(int i=0;i<=len;i++)res[i]=s[i]; for(int k=1;k<=len;k*=2){ ...
a.cc: In function 'void suffixArray(char*, std::vector<int>&)': a.cc:33:10: error: return-statement with a value, in function returning 'void' [-fpermissive] 33 | return res2; | ^~~~
s807732121
p02250
C++
#include <bits/stdc++.h> using namespace std; int n, k; string s; vector<int> order; vector<int> tmp; vector<int> sa; bool compare_sa(const int &i, const int &j) { if(order[i] != order[j]) return order[i] < order[j]; else { int ri = i + k <= n ? order[i+k] : -1; int rj = j + k <= n ? order[j+k] : -1; ...
a.cc: In function 'int main()': a.cc:67:27: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<' 67 | for (int i = 0; i < count; ++i) | ~~^~~~~~~
s854716794
p02250
C++
#include<iostream> #include<string> using namespace std; #define MAX_N 1100000 int Rank[MAX_N],x[MAX_N]; int SA[MAX_N];string S,T;int V; bool Compare(int p,int q){ if(Rank[p]<Rank[q])return true; if(Rank[p]>Rank[q])return false; int D1=-1,D2=-1;] if(p+V<=S.size())D1=Rank[p+V]; if(q+V<=S.size())D2=Rank[q+V]; if(D1...
a.cc: In function 'bool Compare(int, int)': a.cc:10:25: error: expected primary-expression before ']' token 10 | int D1=-1,D2=-1;] | ^ a.cc: In function 'void Build()': a.cc:20:25: error: request for member 'begin' in 'SA', which is of non-class type 'int [1100000]' 20 | ...
s003219264
p02250
C++
#include<bits/stdc++.h> using namespace std; #define MAX_N 1100000 int Rank[MAX_N],x[MAX_N]; int SA[MAX_N];char S[MAX_N],T[MAX_N];int V; bool Compare(int p,int q){ if(Rank[p]<Rank[q])return true; if(Rank[p]>Rank[q])return false; int D1=-1,D2=-1; if(p+V<=S.size())D1=Rank[p+V]; if(q+V<=S.size())D2=Rank[q+V]; if(D1<...
a.cc: In function 'bool Compare(int, int)': a.cc:10:19: error: request for member 'size' in 'S', which is of non-class type 'char [1100000]' 10 | if(p+V<=S.size())D1=Rank[p+V]; | ^~~~ a.cc:11:19: error: request for member 'size' in 'S', which is of non-class type 'char [1100000]' 1...
s179904355
p02250
C++
#include <iostream> #include <string> #include <boost/algorithm/searching/knuth_morris_pratt.hpp> int main(){ size_t pos; int n; std::string T; std::cin >> T; std::cin >> n; std::string T = "BANNANABANANAN"; for(int i=0;i<n;i++){ std::string P; cin >> P; std::string::const_iterator se...
a.cc:3:10: fatal error: boost/algorithm/searching/knuth_morris_pratt.hpp: No such file or directory 3 | #include <boost/algorithm/searching/knuth_morris_pratt.hpp> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s801114460
p02250
C++
#include <iostream> #include <cstdio> #include <string> #include <boost/algorithm/searching/boyer_moore.hpp> int main(){ size_t pos; int n; std::string T; std::cin >> T; std::cin >> n; for(int i=0;i<n;i++){ std::string P; std::cin >> P; std::string::const_iterator search_result; sear...
a.cc:4:10: fatal error: boost/algorithm/searching/boyer_moore.hpp: No such file or directory 4 | #include <boost/algorithm/searching/boyer_moore.hpp> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s974405601
p02250
C++
#include <bits/stdc++.h> using namespace std; #define int long long typedef long long ll; typedef unsigned long long ull; typedef unsigned __int128 HASH; typedef pair<int,int> pii; typedef pair<ll, ll> pll; typedef pair<ull, ull> pullull; typedef pair<ll,int> plli; typedef pair<double, int> pdbi; typedef pair<int,pii>...
a.cc: In member function 'bool SuffixArray::match(const std::string&)': a.cc:121:32: error: 'idx' was not declared in this scope 121 | return text.compare(sa[idx], pt.length(), pt) == 0 ? true : false; | ^~~
s833193906
p02250
C++
#include <iostream> #include <algorithm> // next_permutation #include <iomanip> #include <cmath> #include <vector> #include <sstream> #include <string> #include <cstring> //memcpy #include <cstdio> #include <stack> #include <queue> #include <list> #include <numeric> //accumulate //#include <map> //#include <unordered_m...
a.cc: In function 'void display_DFS(PMA*)': a.cc:186:13: error: 'struct PMA' has no member named 'str' 186 | disp(r->str); | ^~~ a.cc:45:52: note: in definition of macro 'disp' 45 | #define disp(A) dout << #A << " = " << setw(3) << (A) << endl | ...
s680478164
p02250
C++
/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
s902508860
p02250
C++
#include <bits/stdc++.h> #define VARNAME(x) #x #define show(x) cerr << #x << " = " << x << endl using namespace std; using ll = long long; using ld = long double; constexpr ll MOD = 1000000007LL; template <typename T> constexpr T INF = numeric_limits<T>::max() / 10; class SuffixArray { private: // static c...
a.cc: In function 'int main()': a.cc:231:18: error: 'match' was not declared in this scope; did you mean 'rpmatch'? 231 | cout << (match(S, P, sa) ? 1 : 0) << endl; | ^~~~~ | rpmatch
s363086815
p02250
C++
#include<iostream> #include<cstdio> #include<algorithm> #include<cstdlib> #include<cstring> using namespace std; int n,sa[1<<20],r[1<<20],tmp[1<<20]; char s[1<<20]; int k; bool comp(int i,int j) { if(r[i]!=r[j])return r[i]<r[j]; else { int ri=i+k<=n?r[i+k]:-1; int rj=j+k<=n?r[j+k]:-1; return ri<rj; } } void c...
a.cc:58:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 58 | main() | ^~~~ a.cc: In function 'int main()': a.cc:60:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 60 | gets(s); | ^~~~ | getw
s071909815
p02250
C++
from collections import defaultdict from math import floor, log class NoMatch(Exception): pass class IndexMatch: MAX_KEYLEN = 13 def __init__(self, text): self.text = text self.keylen = self._select_keylen() self._create_index() def _select_keylen(self): chars = se...
a.cc:72:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes 72 | if __name__ == '__main__': | ^~~~~~~~~~ a.cc:1:1: error: 'from' does not name a type 1 | from collections import defaultdict | ^~~~
s138170170
p02252
C
#include <stdio.h> #include <stdlib.h> typedef struct weight_ { int Num; int Wei; double OneNum; }wgt; int main() { int N,W; double d1,d2,tmp=0; scanf("%d %d",&N,&W); wgt box; wgt *X = malloc(sizeof(wgt)*N); for(int i=0;i<N;i++) { scanf("%lf%lf",&d1,&d2); X[i].N...
main.c: In function 'main': main.c:50:1: error: expected declaration or statement at end of input 50 | } | ^
s925280491
p02255
Java
import java.util.*; public class Main() { public static void main(String[] args) { int total; Scanner inp = new Scanner(System.in); total = inp.nextInt(); int[] a = new int[total]; Scanner inp2 = new Scanner(System.in); for (int k = 0; k < total; k++) { ...
Main.java:3: error: '{' expected public class Main() { ^ 1 error
s971475079
p02255
Java
import java.util.*; import java.util.scanner; public class Main { public static void main(String[] args) { int total; Scanner inp = new Scanner(System.in); total = inp.nextInt(); int[] a = new int[total]; Scanner inp2 = new Scanner(System.in); for (int k = 0; k ...
Main.java:2: error: cannot find symbol import java.util.scanner; ^ symbol: class scanner location: package java.util 1 error
s263862532
p02255
Java
import java.util.Scanner; public class test{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int n=sc.nextInt(); int ary[]= new int[n]; int a,b; for (int i=0;i<n;++i){ ary[i]=sc.nextInt(); } for (int i=0;i<n;++i){ for (int j=i;j>0;--j){ a= Math.min(ary[j],ary[j-1]...
Main.java:3: error: class test is public, should be declared in a file named test.java public class test{ ^ 1 error
s981548205
p02255
Java
import java.util.Scanner; public class test{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int n=sc.nextInt(); int ary[]= new int[n]; int a,b; for (int i=0;i<n;++i){ ary[i]=sc.nextInt(); } for (int i=0;i<n;++i){ for (int j=i;j>0;--j){ a= Math.min(ary[j],ary[j-1]...
Main.java:3: error: class test is public, should be declared in a file named test.java public class test{ ^ 1 error
s957647238
p02255
Java
public class InsertionSort{ public static void main(String [] args){ for(int i = 0; i < args.length; i++) System.out.println(args[i]); } }
Main.java:1: error: class InsertionSort is public, should be declared in a file named InsertionSort.java public class InsertionSort{ ^ 1 error
s440922762
p02255
Java
public static void main(String [] args){ for(int i = 0; i < args.length; i++) System.out.println(args[i]); }
Main.java:2: error: unnamed classes are a preview feature and are disabled by default. public static void main(String [] args){ ^ (use --enable-preview to enable unnamed classes) 1 error
s848868391
p02255
Java
import java.util.Scanner; public class InsertionSort { public static void main(String argv[]) { Scanner in = new Scanner(System.in); int length = in.nextInt(); int array[] = new int[length]; for (int i = 0; i < length; i++) { array[i] = in.nextInt(); } print(array); int reference, next; for (...
Main.java:3: error: class InsertionSort is public, should be declared in a file named InsertionSort.java public class InsertionSort { ^ 1 error
s347038930
p02255
Java
package AIZU; import java.util.Scanner; public class InsertionSort { public static void main(String [] args) { Scanner scan = new Scanner(System.in); while(scan.hasNext()) System.out.println(scan.next()); } }
Main.java:5: error: class InsertionSort is public, should be declared in a file named InsertionSort.java public class InsertionSort { ^ 1 error
s574250936
p02255
Java
import java.util.Scanner; public class InsertionSort { public static void main(String [] args) { Scanner scan = new Scanner(System.in); while(scan.hasNext()) System.out.println(scan.next()); } }
Main.java:3: error: class InsertionSort is public, should be declared in a file named InsertionSort.java public class InsertionSort { ^ 1 error