submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s977364478
p04044
C++
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(n);i++) int main(){ int l,n; cin>>l>>n; vector<string>s(n); rep(i,n)cin>>s[i]; sort(s.begin(),s.end()); string min; rep(i,n) min+=s[i] cout<<min<<endl; return 0; }
a.cc: In function 'int main()': a.cc:13:14: error: expected ';' before 'cout' 13 | min+=s[i] | ^ | ; 14 | cout<<min<<endl; | ~~~~
s868471512
p04044
C++
#include<iostream> #include<string> using namespace std; int main() { int a,b,i; cin>>a>>b; string s[n]; for(i=0;i<n;i++) { cin>>s[i]; } sort(s,s+n); for(i=0;i<n;i++) { cout<<s[i]; } }
a.cc: In function 'int main()': a.cc:8:12: error: 'n' was not declared in this scope 8 | string s[n]; | ^ a.cc:11:12: error: 's' was not declared in this scope 11 | cin>>s[i]; | ^ a.cc:13:8: error: 's' was not declared in this scope 13 | sort(s,s+n); | ^ a.cc:13:3: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort(s,s+n); | ^~~~ | short
s279685017
p04044
C++
#include<iostream> #include<string> using namespace std; int main() { int a,b,i; cin>>n>>l; string s[n]; for(i=0;i<n;i++) { cin>>s[i]; } sort(s,s+n); for(i=0;i<n;i++) { cout<<s[i]; } }
a.cc: In function 'int main()': a.cc:8:8: error: 'n' was not declared in this scope 8 | cin>>n>>l; | ^ a.cc:8:11: error: 'l' was not declared in this scope 8 | cin>>n>>l; | ^ a.cc:12:12: error: 's' was not declared in this scope 12 | cin>>s[i]; | ^ a.cc:14:8: error: 's' was not declared in this scope 14 | sort(s,s+n); | ^ a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'short'? 14 | sort(s,s+n); | ^~~~ | short
s175543059
p04044
Java
import java.util.*; public class Main{ public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int l = sc.nextInt(); String s[] = new String[n]; List<String> list = new ArrayList<>(); for(int i = 0; i < n; i++){ s[i] = sc.next(); list.add(s[i]); } Collections.sort(list); StringBuilder sb = new StringBuilder(); sb = s[0]; for(int i = 1; i < n; i++){ sb.append(s[i]); } System.out.println(sb); } }
Main.java:17: error: incompatible types: String cannot be converted to StringBuilder sb = s[0]; ^ 1 error
s269723208
p04044
C++
#include<iostream> #include<string.h> #include<algorithm> using namespace std; int main() { int N,L,i,; cin>>N>>L; string S[N]; for(i=0;i<N;i++) { cin>>S[i]; } sort(S,S+N); for(i=0;i<N;i++) { cout<<S[i]; } cout<<endl; }
a.cc: In function 'int main()': a.cc:7:15: error: expected unqualified-id before ';' token 7 | int N,L,i,; | ^
s112651061
p04044
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; public class IrohaLovesStrings { public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] s = br.readLine().split("\\s+"); int n = Integer.parseInt(s[0]); int m = Integer.parseInt(s[1]); String[] str = new String[n]; for(int i=0;i<n;i++) str[i] = br.readLine(); Arrays.sort(str); StringBuilder sb = new StringBuilder(); for(int i=0;i<n;i++) sb.append(str[i]); System.out.println(sb); } }
Main.java:5: error: class IrohaLovesStrings is public, should be declared in a file named IrohaLovesStrings.java public class IrohaLovesStrings { ^ 1 error
s855670555
p04044
C
#include<bits/stdc++.h> using namespace std; int main() { long long int n,l,i; cin>>n>>l; vector<string>str(n); for(i=0;i<n;i++) { cin>>str[i]; } sort(str.begin(),str.end()); for(i=0;i<n;i++) { cout<<str[i]; } cout<<endl; return 0; }
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s619397013
p04044
C++
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int,int>; int main() { int N, L; cin >> N >> L; vector<int> s(N); rep (i,N) { cin >> s.at(i); } sort(l.begin(), l.end()); for (int i = 0; i < N; ++i) { cout << s.at(i); } cout << endl; }
a.cc: In function 'int main()': a.cc:16:10: error: 'l' was not declared in this scope 16 | sort(l.begin(), l.end()); | ^
s615585273
p04044
C
#include<stdio.h> #include<string.h> #include<stdlib.h> int main(void){ int l,n; scanf("%d %d",&l,&n); char s[100][101]; char tmp[101]; //**s=malloc(n*sizeof(char*)); /*for(int i=0;i<n;i++){ s[i]=malloc((l+1)*sizeof(char)); } char *tmp; tmp=malloc((l+1)*sizeof(char));*/ for(int i=0;i<n;i++){ scanf("%s",s[i]); } for(int j=0;j<n;j++){ for(int i=0;i=<n-j-1;i++){ if(strcmp(s[i],s[i+1])>0){ strcpy(tmp,s[i]); strcpy(s[i],s[i+1]); strcpy(s[i+1],tmp); } } } for(int i=0;i<n;i++){ printf("%s",s[i]); } printf("\n"); return 0; }
main.c: In function 'main': main.c:19:31: error: expected expression before '<' token 19 | for(int i=0;i=<n-j-1;i++){ | ^
s155114071
p04044
C++
#include<bits/stdc++.h> using namespace std; int main() { long long n,l; cin>>n>>l; stirng s,s1; for(long long i=0;i<n;i++) { cin>>s; s1+=s; } cout<<s1<<endl; }
a.cc: In function 'int main()': a.cc:7:3: error: 'stirng' was not declared in this scope 7 | stirng s,s1; | ^~~~~~ a.cc:10:10: error: 's' was not declared in this scope 10 | cin>>s; | ^ a.cc:11:5: error: 's1' was not declared in this scope; did you mean 'y1'? 11 | s1+=s; | ^~ | y1 a.cc:13:9: error: 's1' was not declared in this scope; did you mean 'y1'? 13 | cout<<s1<<endl; | ^~ | y1
s913541747
p04044
C++
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { string a; int h, j; cin >> h >> j; vector<string> v; for (int i = 0; i < h; i++) { string b; cin >> b; v.push_back(b); } sort(v.begin(), v.end()); for (int i = 0; i < v.size(); i++) { a += b; } cout << a; }
a.cc: In function 'int main()': a.cc:19:14: error: 'b' was not declared in this scope 19 | a += b; | ^
s454283115
p04044
C++
#include<bits/stc++.h> using namespace std; int main() { int t,l; cin>>t>>l; vector<string> v; for(int i=0;i<n;i++) { string s; cin>>s; v.push_back(s); } sort(v.begin(),v.end()); for(auto x:v) cout<<x; }
a.cc:1:9: fatal error: bits/stc++.h: No such file or directory 1 | #include<bits/stc++.h> | ^~~~~~~~~~~~~~ compilation terminated.
s832078453
p04044
C
#include<stdio.h> #include<string.h> int main(){ int N,L; scanf("%d %d",&N,&L); char temp[L+1]; char str[N][L+1]={"dxx","axx","cxx"}; int i,j; for(i=0;i<2;i++){ for(j=2;j>i;j--){ if(strcmp(str[j-1],str[j])>0){ strcpy(temp,str[j-1]); strcpy(str[j-1],str[j]); strcpy(str[j],temp); } } } for(i=0;i<3;i++){ printf("%s",str[i]); } return 0; }
main.c: In function 'main': main.c:9:20: error: variable-sized object may not be initialized except with an empty initializer 9 | char str[N][L+1]={"dxx","axx","cxx"}; | ^
s117179127
p04044
C
#include<stdio.h> #iclude<string.h> int main(){ int N,L; scanf("%d %d",&N,&L); char temp[N]; char str[N]; int i,j; for(i=0;i<N;i++){ scanf("%s",&str[i]); } for(i=0;i<N-1;i++){ for(j=N-1;j>i;j--){ if(strcmp(str[j-1],str[j])>0){ strcpy(temp,str[j-1]); strcpy(str[j-1],str[j]); strcpy(str[j],temp); } } } for(i=0;i<N;i++){ printf("%s",str[i]); } return 0; }
main.c:2:2: error: invalid preprocessing directive #iclude; did you mean #include? 2 | #iclude<string.h> | ^~~~~~ | include main.c: In function 'main': main.c:17:10: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration] 17 | if(strcmp(str[j-1],str[j])>0){ | ^~~~~~ main.c:2:1: note: include '<string.h>' or provide a declaration of 'strcmp' 1 | #include<stdio.h> +++ |+#include <string.h> 2 | #iclude<string.h> main.c:17:20: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 17 | if(strcmp(str[j-1],str[j])>0){ | ~~~^~~~~ | | | char main.c:17:20: note: expected 'const char *' but argument is of type 'char' main.c:17:29: error: passing argument 2 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 17 | if(strcmp(str[j-1],str[j])>0){ | ~~~^~~ | | | char main.c:17:29: note: expected 'const char *' but argument is of type 'char' main.c:18:9: error: implicit declaration of function 'strcpy' [-Wimplicit-function-declaration] 18 | strcpy(temp,str[j-1]); | ^~~~~~ main.c:18:9: note: include '<string.h>' or provide a declaration of 'strcpy' main.c:18:9: warning: incompatible implicit declaration of built-in function 'strcpy' [-Wbuiltin-declaration-mismatch] main.c:18:9: note: include '<string.h>' or provide a declaration of 'strcpy' main.c:18:24: error: passing argument 2 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion] 18 | strcpy(temp,str[j-1]); | ~~~^~~~~ | | | char main.c:18:24: note: expected 'const char *' but argument is of type 'char' main.c:19:19: error: passing argument 1 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion] 19 | strcpy(str[j-1],str[j]); | ~~~^~~~~ | | | char main.c:19:19: note: expected 'char *' but argument is of type 'char' main.c:19:28: error: passing argument 2 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion] 19 | strcpy(str[j-1],str[j]); | ~~~^~~ | | | char main.c:19:28: note: expected 'const char *' but argument is of type 'char' main.c:20:19: error: passing argument 1 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion] 20 | strcpy(str[j],temp); | ~~~^~~ | | | char main.c:20:19: note: expected 'char *' but argument is of type 'char'
s926034348
p04044
C++
#include<iostream> #include<vector> #include<string> #include<math.h> #include<stdio.h> #include<queue> using namespace std; int main() { int a, b; cin >> a >> b; vector<string>name(a); for (int i = 0; i < a; i++) { cin >> name[i]; } sort(name.begin(), name.end()); string x = ""; for (int i = 0; i < a; i++) { x = x + name[i]; } cout << x << endl; }
a.cc: In function 'int main()': a.cc:20:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 20 | sort(name.begin(), name.end()); | ^~~~ | sqrt
s617390266
p04044
C
#include<stdio.h> #include<string.h> int n,l; void swap(char (*str1)[l],char (*str2)[l]){ char temp[l]; strcpy(temp,*str1); strcpy(*str1,*str2); strcpy(*str2,*str1); return ; } int main(){ scanf("%d %d\n",&n,&l); char array[n][l+1]; int i,j; for(i=0;i<n;i++){ scanf("%s\n",*(array+i)); } for(i=0;i<n-1;i++){ int min_i= i; for(j=i+1;j<n;j++){ int d; d= strcmp(array[min_i],array[j]); if(d>0){ min_i = j; } } swap(&array[i],&array[min_i]); } int g = n*(l+1); char final_string[g]= ""; for(i=0;i<n;i++){ final_string = final_string+*(array+i); } printf("%s",final_string); return 0; }
main.c: In function 'main': main.c:30:25: error: variable-sized object may not be initialized except with an empty initializer 30 | char final_string[g]= ""; | ^~ main.c:32:32: error: invalid operands to binary + (have 'char *' and 'char *') 32 | final_string = final_string+*(array+i); | ~~~~~~~~~~~~^ ~~~~~~~~~ | | | | char * char *
s565221457
p04044
C
#include<stdio.h> #include<string.h> void swap(char *string1,char *string2, int (l+1)){ char temp[l+1]; strcpy(temp,*string1); strcpy(*string1,*string2); strcpy(*string2,temp); } int main(){ int n,l; scanf("%d %d\n",&n,&l); int char string[n][l+1]; int i; for(i=0;i<n;i++){ scanf("%s\n",(string+i)); } for(i=0;i<n-1;i++){ int min_i= i; int j; int d; for(j=i+1;j<n;j++){ d= strcmp(string[min_i],string[j]); if(d>0){ min_i=j; } } swap(string[i],string[min_i],(l+1)); } char final_string[n*l + 1]={""}; for(i=0;i<n;i++){ final_string= strcat(final_string,(string+i)); } printf("%s",final_string); return 0; }
main.c:3:46: error: expected ')' before '+' token 3 | void swap(char *string1,char *string2, int (l+1)){ | ^ | ) main.c: In function 'main': main.c:12:7: error: two or more data types in declaration specifiers 12 | int char string[n][l+1]; | ^~~~ main.c:22:23: error: passing argument 1 of 'strcmp' from incompatible pointer type [-Wincompatible-pointer-types] 22 | d= strcmp(string[min_i],string[j]); | ~~~~~~^~~~~~~ | | | int * In file included from main.c:2: /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int *' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:22:37: error: passing argument 2 of 'strcmp' from incompatible pointer type [-Wincompatible-pointer-types] 22 | d= strcmp(string[min_i],string[j]); | ~~~~~~^~~ | | | int * /usr/include/string.h:156:50: note: expected 'const char *' but argument is of type 'int *' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:27:5: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration] 27 | swap(string[i],string[min_i],(l+1)); | ^~~~ main.c:29:30: error: variable-sized object may not be initialized except with an empty initializer 29 | char final_string[n*l + 1]={""}; | ^ main.c:31:46: error: passing argument 2 of 'strcat' from incompatible pointer type [-Wincompatible-pointer-types] 31 | final_string= strcat(final_string,(string+i)); | ~~~~~~~^~~ | | | int (*)[l + 1] /usr/include/string.h:149:70: note: expected 'const char * restrict' but argument is of type 'int (*)[l + 1]' 149 | extern char *strcat (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~ main.c:31:17: error: assignment to expression with array type 31 | final_string= strcat(final_string,(string+i)); | ^
s416595724
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, l; cin >> n >> l; vector<string> vec(n); for (int i = 0; i < n; i++) cin >> vec.at(i); vec.sort(vec.begin(), vec.end()); string ans; for (string x : vec) ans += x; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:11:7: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'sort' 11 | vec.sort(vec.begin(), vec.end()); | ^~~~
s552299106
p04044
C++
/* author : nishi5451 created: 12.08.2020 15:43:34 */ #include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0; i<n; i++) typedef long long ll; int main(){ int n,l; cin >> n >> l; vector<string> s(n); rep(i,n) cin >> s[i]; sort(s.begin(),s.end(),greater<int>() ); rep(i,n) cout << s[i]; cout << endl; return 0; }
In file included from /usr/include/c++/14/bits/stl_algobase.h:71, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:6: /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >; _Iterator2 = __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >; _Compare = std::greater<int>]': /usr/include/c++/14/bits/stl_algo.h:1777:14: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<int> >]' 1777 | if (__comp(__i, __first)) | ~~~~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<int> >]' 1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<int> >]' 1908 | std::__final_insertion_sort(__first, __last, __comp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4805:18: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = greater<int>]' 4805 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:17:9: required from here 17 | sort(s.begin(),s.end(),greater<int>() ); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/predefined_ops.h:158:30: error: no match for call to '(std::greater<int>) (std::__cxx11::basic_string<char>&, std::__cxx11::basic_string<char>&)' 158 | { return bool(_M_comp(*__it1, *__it2)); } | ~~~~~~~^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:49, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/stl_function.h:394:7: note: candidate: 'constexpr bool std::greater<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = int]' 394 | operator()(const _Tp& __x, const _Tp& __y) const | ^~~~~~~~ /usr/include/c++/14/bits/stl_function.h:394:29: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>' to 'const int&' 394 | operator()(const _Tp& __x, const _Tp& __y) const | ~~~~~~~~~~~^~~ /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Val_comp_iter<_Compare>::operator()(_Value&, _Iterator) [with _Value = std::__cxx11::basic_string<char>; _Iterator = __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >; _Compare = std::greater<int>]': /usr/include/c++/14/bits/stl_algo.h:1757:20: required from 'void std::__unguarded_linear_insert(_RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = __gnu_cxx::__ops::_Val_comp_iter<greater<int> >]' 1757 | while (__comp(__val, __next)) | ~~~~~~^~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1785:36: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<int> >]' 1785 | std::__unguarded_linear_insert(__i, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ 1786 | __gnu_cxx::__ops::__val_comp_iter(__comp)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<int> >]' 1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<int> >]' 1908 | std::__final_insertion_sort(__first, __last, __comp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4805:18: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = greater<int>]' 4805 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:17:9: required from here 17 | sort(s.begin(),s.end(),greater<int>() ); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/predefined_ops.h:240:30: error: no match for call to '(std::greater<int>) (std::__cxx11::basic_string<char>&, std::__cxx11::basic_string<char>&)' 240 | { return bool(_M_comp(__val, *__it)); } | ~~~~~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_function.h:394:7: note: candidate: 'constexpr bool std::greater<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = int]' 394 | operator()(const _Tp& __x, const _Tp& __y) const | ^~~~~~~~ /usr/include/c++/14/bits/stl_function.h:394:29: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>' to 'const int&' 394 | operator()(const _Tp& __x, const _Tp& __y) const | ~~~~~~~~~~~^~~ /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_comp_val<_Compare>::operator()(_Iterator, _Value&) [with _Iterator = __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >; _Value = std::__cxx11::basic_string<char>; _Compare = std::greater<int>]': /usr/include/c++/14/bits/stl_heap.h:140:48: required from 'void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Distance = long int; _Tp = __cxx11::basic_string<char>; _Compare = __gnu_cxx::__ops::_Iter_comp_val<greater<int> >]' 140 | while (__holeIndex > __topIndex && __comp(__first + __parent, __value)) | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:247:23: required from 'void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Distance = long int; _Tp = __cxx11::basic_string<char>; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<int> >]' 247 | std::__push_heap(__first, __holeIndex, __topIndex, | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 248 | _GLIBCXX_MOVE(__value), __cmp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:356:22: required from 'void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<int> >]' 356 | std::__adjust_heap(__first, __parent, __len, _GLIBCXX_MOVE(__value), | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 357 | __comp); | ~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1593:23: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<int> >]' 1593 | std::__make_heap(__first, __middle, __comp); | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1868:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = __gnu_cxx::
s491557273
p04044
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) int main() { int N, L; cin >> N >> L; string C; vector<string> vec; rep(i, N) { cin >> C; vec.at(i) = C; } sort(vec.begin(), vec.end()); rep(i, N) { cout << vec.at(i); } endl; }
a.cc: In function 'int main()': a.cc:19:7: error: statement cannot resolve address of overloaded function 19 | endl; | ^
s205875105
p04044
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) int main() { int N, L; cin >> N >> L; string C vector<string> vec; rep(i, N) { cin >> C; vec.at(i) = C; } sort(vec.begin(), vec.end()); rep(i, N) { cout << vec.at(i); } endl; }
a.cc: In function 'int main()': a.cc:10:3: error: expected initializer before 'vector' 10 | vector<string> vec; | ^~~~~~ a.cc:12:12: error: 'C' was not declared in this scope 12 | cin >> C; | ^ a.cc:13:5: error: 'vec' was not declared in this scope 13 | vec.at(i) = C; | ^~~ a.cc:15:8: error: 'vec' was not declared in this scope 15 | sort(vec.begin(), vec.end()); | ^~~ a.cc:19:7: error: statement cannot resolve address of overloaded function 19 | endl; | ^
s064849457
p04044
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) int main() { int N, L; string C vector<string> vec; rep(i, N) { cin >> C; vec.at(i) = C; } sort(vec.begin(), vec.end()); rep(i, N) { cout << vec.at(i); } endl; }
a.cc: In function 'int main()': a.cc:9:3: error: expected initializer before 'vector' 9 | vector<string> vec; | ^~~~~~ a.cc:11:12: error: 'C' was not declared in this scope 11 | cin >> C; | ^ a.cc:12:5: error: 'vec' was not declared in this scope 12 | vec.at(i) = C; | ^~~ a.cc:14:8: error: 'vec' was not declared in this scope 14 | sort(vec.begin(), vec.end()); | ^~~ a.cc:18:7: error: statement cannot resolve address of overloaded function 18 | endl; | ^
s627039074
p04044
C++
#include<bits/stdc++.h> using namespace std; #define debug(n) cerr << #n << ':' << n << endl; #define dline cerr << __LINE__ << endl; using ll = long long; using ull = unsigned long long; template<class T, class U> using P = pair<T,U>; template<class T> using Heap = priority_queue<T>; template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>; template<class T,class U> using umap = unordered_map<T,U>; template<class T> using uset = unordered_set<T>; template<class T> bool ChangeMax(T&a,const T&b){ if(a >= b) return false; a = b; return true; } template<class T> bool ChangeMin(T&a,const T&b){ if(a <= b) return false; a = b; return true; } template<class T, size_t N, class U> void Fill(T (&a)[N], const U&v){ fill((U*)a,(U*)(a+N),v); } template<class T> istream& operator >> (istream&is, vector<T>&v){ for(auto&e:v)is >> e; return is; } int f(int n){ return (n*n+4)/8; } int main(){ int n,l; cin >> n >> l; vector<string> v(n); cin >> v; sort(v.begin(), v.end()); for(int i = 0; i < v; ++i)cout << v[i]; cout << endl; }
a.cc: In function 'int main()': a.cc:47:20: error: no match for 'operator<' (operand types are 'int' and 'std::vector<std::__cxx11::basic_string<char> >') 47 | for(int i = 0; i < v; ++i)cout << v[i]; | ~ ^ ~ | | | | int std::vector<std::__cxx11::basic_string<char> > In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed: a.cc:47:22: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 47 | for(int i = 0; i < v; ++i)cout << v[i]; | ^ /usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed: a.cc:47:22: note: mismatched types 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' and 'int' 47 | for(int i = 0; i < v; ++i)cout << v[i]; | ^ /usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1317 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed: a.cc:47:22: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 47 | for(int i = 0; i < v; ++i)cout << v[i]; | ^ /usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed: a.cc:47:22: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 47 | for(int i = 0; i < v; ++i)cout << v[i]; | ^ /usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1485 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed: a.cc:47:22: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 47 | for(int i = 0; i < v; ++i)cout << v[i]; | ^ /usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed: a.cc:47:22: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 47 | for(int i = 0; i < v; ++i)cout << v[i]; | ^ /usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1660 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed: a.cc:47:22: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 47 | for(int i = 0; i < v; ++i)cout << v[i]; | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed: a.cc:47:22: note: mismatched types 'const std::pair<_T1, _T2>' and 'int' 47 | for(int i = 0; i < v; ++i)cout << v[i]; | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 448 | operator<(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed: a.cc:47:22: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 47 | for(int i = 0; i < v; ++i)cout << v[i]; | ^ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 493 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed: a.cc:47:22: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 47 | for(int i = 0; i < v; ++i)cout << v[i]; | ^ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1694 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed: a.cc:47:22: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 47 | for(int i = 0; i < v; ++i)cout << v[i]; | ^ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1760 | operator<(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed: a.cc:47:22: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 47 | for(int i = 0; i < v; ++i)cout << v[i]; | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 673 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed: a.cc:47:22: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 47 | for(int i = 0; i < v; ++i)cout << v[i]; | ^ /usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 680 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed: a.cc:47:22: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 47 | for(int i = 0; i < v; ++i)cout << v[i]; | ^ /usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed: a.cc:47:22: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'std::basic_string_view<_CharT, _Traits>' 47 | for(int i = 0; i < v; ++i)cout << v[i]; | ^ /usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed: a.cc:47:22: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 47 | for(int i = 0; i < v; ++i)cout << v[i]; | ^ /usr/include/c++/14/bit
s318858481
p04044
C
#include<iostream> #include<string> #include<list> using namespace std; int main(){ int N, L; string input; list<string> ls; list<string>::iterator itr; cin >> N >> L; for (int i=0; i<N; i++){ cin >> input; ls.push_back(input); } ls.sort(); for (itr=ls.begin(); itr!=ls.end(); itr++){ cout << *itr; } return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s218469635
p04044
C
#include<iostream> #include<string> #include<list> using namespace std; int main(){ int N, L; string input; list<string> L; list<string>::iterator itr; cin >> N >> L; for (int i=0; i<N; i++){ cin >> input; L.push_back(input); } L.sort(); for (itr=L.begin(); itr!=L.end(); itr++){ cout << *itr; } return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s113959280
p04044
C
#include<iostream> #include<string> #include<list> using namespace std; int main(){ int N, L; string input; list<string> L; list<string>::iterator itr; cin >> N >> L; for (int i=0; i<N; i++){ cin >> input; L.push_back(input); } L.sort(); for (itr=s.begin(); itr!=s.end(); itr++){ cout << *itr; } return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s044012075
p04044
Java
import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class test1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); ArrayList<String> list = new ArrayList<String>(); int l = sc.nextInt(); int n = sc.nextInt(); String[] B = new String[n]; String c = null; String A = null; String[] d = new String[n]; for(int i = 0;i < n;i++) { A = sc.next(); B[i] = A.substring(0,1); d[i] = A.substring(1,l); list.add(B[i]); Collections.sort(list); } c = list.get(0) + d[0]; for(int j = 1;j < n;j++) { c = c + list.get(j) + d[j]; } System.out.println(c); } }
Main.java:5: error: class test1 is public, should be declared in a file named test1.java public class test1 { ^ 1 error
s842525885
p04044
C
#include <stdio.h> #include <string.h> int main(void) { int n,l,i,j; char s[100][200],tmp[200]; scanf("%d %d",&n,&l); for(i=0;i<n;i++){ scanf("%s",s[i]); for(i=1;i<n;i++){ for(j=1;j<n;j++){ if(strcmp(s[j-1],s[j])>0){ strcpy(tmp,s[j-1]); strcpy(s[j-1],s[j]); strcpy(s[j],tmp); } } } for(i=0;i<n;i++) printf("%s",s[i]); return 0; }
main.c: In function 'main': main.c:22:1: error: expected declaration or statement at end of input 22 | } | ^
s247658254
p04044
C
#include <stdio.h> #include <string.h> int main(void) { int n,l,i,j; char s[100][200],tmp[200]; scanf("%d %d",&n,&l); for(i=0;i<n;i++){ scanf("%s",s[i]); for(i=1;i<n;i++){ for(j=1;j<n;j++){ if(strcmp(s[j-1],s[j])>0){ strcpy(tmp,s[j-1]); strcpy(s[j-1],s[j]); strcpy(s[j],tmp); } } } for(i=0;i<n;i++) printf("%s",moji[i]); return 0; }
main.c: In function 'main': main.c:20:15: error: 'moji' undeclared (first use in this function) 20 | printf("%s",moji[i]); | ^~~~ main.c:20:15: note: each undeclared identifier is reported only once for each function it appears in main.c:22:1: error: expected declaration or statement at end of input 22 | } | ^
s529407942
p04044
C
#include <stdio.h> #include <string.h> int main(void) { int n,l,i,j; char s[100][200],tmp[200]; scanf("%d %d",&n,&l); for(i=0;i<n;i++){ scanf("%s",s[i]); for(i=1;i<n;i++){ for(j=1;j<n;j++){ if(strcmp(moji[j-1],moji[j])>0){ strcpy(tmp,moji[j-1]); strcpy(moji[j-1],moji[j]); strcpy(moji[j],tmp); } } } for(i=0;i<num;i++) printf("%s",moji[i]); return 0; }
main.c: In function 'main': main.c:12:15: error: 'moji' undeclared (first use in this function) 12 | if(strcmp(moji[j-1],moji[j])>0){ | ^~~~ main.c:12:15: note: each undeclared identifier is reported only once for each function it appears in main.c:19:11: error: 'num' undeclared (first use in this function) 19 | for(i=0;i<num;i++) | ^~~ main.c:22:1: error: expected declaration or statement at end of input 22 | } | ^
s311282018
p04044
C
#include <stdio.h> #include <string.h> int main(void) { int n,l,i,j; char s[100][200],tmp[200]; scanf("%d %d",&n,&l); for(i=0;i<n;i++){ scanf("%s",&s[i]); for(i=1;i<n;i++){ for(j=1;j<n;j++){ if(strcmp(moji[j-1],moji[j])>0){ strcpy(tmp,moji[j-1]); strcpy(moji[j-1],moji[j]); strcpy(moji[j],tmp); } } } for(i=0;i<num;i++) printf("%s",moji[i]); return 0; }
main.c: In function 'main': main.c:12:15: error: 'moji' undeclared (first use in this function) 12 | if(strcmp(moji[j-1],moji[j])>0){ | ^~~~ main.c:12:15: note: each undeclared identifier is reported only once for each function it appears in main.c:19:11: error: 'num' undeclared (first use in this function) 19 | for(i=0;i<num;i++) | ^~~ main.c:22:1: error: expected declaration or statement at end of input 22 | } | ^
s738369049
p04044
C++
#include <iostream> #include <string> #include <vector> using namespace std; int main(){ int N, L; cin >> N >> L; vector<string> s(N); for(int i=0;i<N;i++) cin >> s[i]; sort(s.begin(), s.end()); string ans; for(int i=0;i<N;i++) ans+=s[i]; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:12:9: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(s.begin(), s.end()); | ^~~~ | short
s712722604
p04044
C
#include <stdio.h> #include <stdlib.h> void swap(char *data1, char *data2, char *temp) { strcpy(temp, data1); strcpy(data1, data2); strcpy(data2, temp); } int main(void) { int i, j; int size, length; char *temp; char **data; scanf("%d %d", &size, &length); temp = malloc(sizeof(char) * length); data = malloc(sizeof(char *) * size); for (i=0;i<n;i++) { data[i] = malloc(sizeof(char) * length); } for(i = 0; i < size - 1; i++) { for(j = i; j < size-1; j++) { if(strcmp(data[i], data[i+1]) > 0) swap(data[i], data[i+1], temp); } } for (i = 0; i < length; i++) { free(data[i]); } free(data); free(temp); return 0; }
main.c: In function 'swap': main.c:5:3: error: implicit declaration of function 'strcpy' [-Wimplicit-function-declaration] 5 | strcpy(temp, data1); | ^~~~~~ main.c:3:1: note: include '<string.h>' or provide a declaration of 'strcpy' 2 | #include <stdlib.h> +++ |+#include <string.h> 3 | main.c:5:3: warning: incompatible implicit declaration of built-in function 'strcpy' [-Wbuiltin-declaration-mismatch] 5 | strcpy(temp, data1); | ^~~~~~ main.c:5:3: note: include '<string.h>' or provide a declaration of 'strcpy' main.c: In function 'main': main.c:20:14: error: 'n' undeclared (first use in this function) 20 | for (i=0;i<n;i++) { | ^ main.c:20:14: note: each undeclared identifier is reported only once for each function it appears in main.c:26:10: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration] 26 | if(strcmp(data[i], data[i+1]) > 0) swap(data[i], data[i+1], temp); | ^~~~~~ main.c:26:10: note: include '<string.h>' or provide a declaration of 'strcmp'
s276524836
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() {
a.cc: In function 'int main()': a.cc:3:13: error: expected '}' at end of input 3 | int main() { | ~^
s940847891
p04044
Java
public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int l = in.nextInt(); List<String> strings = new ArrayList<>(); for (int i = 0; i < n; i++) { strings.add(in.next()); } Collections.sort(strings); System.out.println(strings.stream().collect(Collectors.joining())); } }
Main.java:3: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:6: error: cannot find symbol List<String> strings = new ArrayList<>(); ^ symbol: class List location: class Main Main.java:6: error: cannot find symbol List<String> strings = new ArrayList<>(); ^ symbol: class ArrayList location: class Main Main.java:10: error: cannot find symbol Collections.sort(strings); ^ symbol: variable Collections location: class Main Main.java:11: error: cannot find symbol System.out.println(strings.stream().collect(Collectors.joining())); ^ symbol: variable Collectors location: class Main 6 errors
s188614615
p04044
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int L = sc.nextInt(); int[] S = new int[N]; for(int i = 0; i < N; i ++){ S[i] = sc.nextLine(); } Arrays.sort(S); for(int i = 0; i < N; i ++){ System.out.print(S[i]); } } }
Main.java:10: error: incompatible types: String cannot be converted to int S[i] = sc.nextLine(); ^ 1 error
s963277358
p04044
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int L = sc.nextInt(); int[] S = new int[N]; for(int i = 0; i < N; i ++){ S[i] = sc.next(); } Arrays.sort(S); for(int i = 0; i < N; i ++){ System.out.print(S[i]); } } }
Main.java:10: error: incompatible types: String cannot be converted to int S[i] = sc.next(); ^ 1 error
s733802215
p04044
C
#include<stdio.h> #include<string.h> #include<stdlib.h> int main(){ int n,l; scanf("%d%d",&n,&l); char string[n+1][l+1]; for(int i=0; i<n; i++){ scanf("%s",string[i]); } for(int i=0; i<n; i++){ for(int j=0; j<n-1-i; j++){ if(strcmp(string[j],string[j+1]) > 0){ char temp[l+1] = { "" }; strcpy(temp,string[j]); strcpy(string[j],string[j+1]); strcpy(string[j+1],temp); } } } for(int i=0; i<n; i++){ printf("%s",string[i]); } }
main.c: In function 'main': main.c:14:26: error: variable-sized object may not be initialized except with an empty initializer 14 | char temp[l+1] = { "" }; | ^
s733780540
p04044
C
#include<stdio.h> #include<string.h> #include<stdlib.h> int main(){ int n,l; scanf("%d%d",&n,&l); char string[n+1][l+1]; for(int i=0; i<n; i++){ scanf("%s",string[i]); } for(int i=0; i<n; i++){ for(int j=0; j<n-1-i; j++){ if(strcmp(string[j],string[j+1]) > 0){ char temp[l+1] = { "" }; strcpy(temp,string[j]); strcpy(string[j],string[j+1]); strcpy(string[j+1],temp); } } } for(int i=0; i<n; i++){ printf("%s",string[[i]); } }
main.c: In function 'main': main.c:14:26: error: variable-sized object may not be initialized except with an empty initializer 14 | char temp[l+1] = { "" }; | ^ main.c:22:25: error: expected expression before '[' token 22 | printf("%s",string[[i]); | ^
s640621106
p04044
C
#icnlude<stdio.h> #include<string.h> #include<stdlib.h> int main(){ int n,l; scanf("%d%d",&n,&l); char string[n+1][l+1]; for(int i=0; i<n; i++){ scanf("%s",string[i]); } for(int i=0; i<n; i++){ for(int j=0; j<n-1-i; j++){ if(strcmp(string[j],string[j+1]) > 0){ char temp[l+1] = { "" }; strcpy(temp,string[j]); strcpy(string[j],string[j+1]); strcpy(string[j+1],temp); } } } for(int i=0; i<n; i++){ printf("%s",string[[i]); } }
main.c:1:2: error: invalid preprocessing directive #icnlude; did you mean #include? 1 | #icnlude<stdio.h> | ^~~~~~~ | include main.c: In function 'main': main.c:6:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 6 | scanf("%d%d",&n,&l); | ^~~~~ main.c:4:1: note: include '<stdio.h>' or provide a declaration of 'scanf' 3 | #include<stdlib.h> +++ |+#include <stdio.h> 4 | int main(){ main.c:6:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 6 | scanf("%d%d",&n,&l); | ^~~~~ main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:14:26: error: variable-sized object may not be initialized except with an empty initializer 14 | char temp[l+1] = { "" }; | ^ main.c:22:6: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 22 | printf("%s",string[[i]); | ^~~~~~ main.c:22:6: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:22:6: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:22:6: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:22:25: error: expected expression before '[' token 22 | printf("%s",string[[i]); | ^
s544656109
p04044
C
#icnlude<stdio.h> #include<string.h> #icnlude<stdlib.h> int main(){ int n,l; scanf("%d%d",&n,&l); char string[n+1][l+1]; for(int i=0; i<n; i++){ scanf("%s",string[i]); } for(int i=0; i<n; i++){ for(int j=0; j<n-1-i; j+){ if(strcmp(string[i],string[i+1]) > 0){ char temp[l+1] = { "" }; strcpy(temp,string[i]); strcpy(string[i],string[i+1]); strcpy(string[i+1],temp); } } } for(int i=0; i<n; i++){ printf("%s",string[[i]); } }
main.c:1:2: error: invalid preprocessing directive #icnlude; did you mean #include? 1 | #icnlude<stdio.h> | ^~~~~~~ | include main.c:3:2: error: invalid preprocessing directive #icnlude; did you mean #include? 3 | #icnlude<stdlib.h> | ^~~~~~~ | include main.c: In function 'main': main.c:6:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 6 | scanf("%d%d",&n,&l); | ^~~~~ main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf' 2 | #include<string.h> +++ |+#include <stdio.h> 3 | #icnlude<stdlib.h> main.c:6:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 6 | scanf("%d%d",&n,&l); | ^~~~~ main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:12:30: error: expected expression before ')' token 12 | for(int j=0; j<n-1-i; j+){ | ^ main.c:14:26: error: variable-sized object may not be initialized except with an empty initializer 14 | char temp[l+1] = { "" }; | ^ main.c:22:6: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 22 | printf("%s",string[[i]); | ^~~~~~ main.c:22:6: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:22:6: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:22:6: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:22:25: error: expected expression before '[' token 22 | printf("%s",string[[i]); | ^
s647448624
p04044
C++
#include<iostream> #include<vector> #include<string> using namespace std; int main(){ int n,l; cin>>n>>l; string s; vector<string> vec; for(int i=0;i<n;i++){ cin>>s; vec.push_back(s); } sort(vec.begin(),vec.end()); cout<<vec; return 0; }
a.cc: In function 'int main()': a.cc:15:3: error: 'sort' was not declared in this scope; did you mean 'short'? 15 | sort(vec.begin(),vec.end()); | ^~~~ | short a.cc:17:7: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >') 17 | cout<<vec; | ~~~~^~~~~ | | | | | std::vector<std::__cxx11::basic_string<char> > | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_os
s014241619
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, L; cin >> N >> L; vector<string> S; for (int i = 0; i < N; i++) { string s; cin >> s; S.push_back(s) } sort(S.begin(), S.end()); for (int i = 0; i < N; i++) { cout << S[i]; } cout << endl; }
a.cc: In function 'int main()': a.cc:13:19: error: expected ';' before '}' token 13 | S.push_back(s) | ^ | ; 14 | } | ~
s374672516
p04044
Java
import java.util.Scanner; import java.util.ArrayList; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int l = scanner.nextInt(); ArrayList<String> word = new ArrayList<>(); // n回データを取得し格納する for(int i = 0; i < n; i++) { word.add(scanner.next()); } // 自然順序(Stringであれば辞書順)にソート word.sort(Comparator.naturalOrder()); // listの中の要素を区切らずに連続して出力 for(String w: word) { System.out.print(w); } } }
Main.java:19: error: cannot find symbol word.sort(Comparator.naturalOrder()); ^ symbol: variable Comparator location: class Main 1 error
s785705307
p04044
Java
import java.util.Scanner; import java.util.ArrayList; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int l = scanner.nextInt(); ArrayList<String> word = new ArrayList<>(); // n回データを取得し格納する for(int i = 0; i < n; i++) { word.add(scanner.next()); } word.sort(); // listの中の要素を区切らずに連続して出力 for(String w: word) { System.out.print(w); } } }
Main.java:18: error: method sort in class ArrayList<E> cannot be applied to given types; word.sort(); ^ required: Comparator<? super String> found: no arguments reason: actual and formal argument lists differ in length where E is a type-variable: E extends Object declared in class ArrayList 1 error
s736976911
p04044
Java
import java.util.Scanner; import java.util.ArrayList; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int l = scanner.nextInt(); ArrayList<String> word = new ArrayList<>(); // n回データを取得し格納する for(int i = 0; i < n; i++) { word.add(scanner.next()); } ArrayList<String> sortedWord = word.sort(); // listの中の要素を区切らずに連続して出力 for(String w: sortedWord) { System.out.print(w); } } }
Main.java:18: error: method sort in class ArrayList<E> cannot be applied to given types; ArrayList<String> sortedWord = word.sort(); ^ required: Comparator<? super String> found: no arguments reason: actual and formal argument lists differ in length where E is a type-variable: E extends Object declared in class ArrayList 1 error
s598925407
p04044
Java
N, L = list(map(int, input().split())) arr_input=[] for i in range(N): input_ = input() if(len(input_)!=L): print("Input length is wrong") exit() arr_input.append(input_) arr_input.sort() print("".join(arr_input))
Main.java:1: error: class, interface, enum, or record expected N, L = list(map(int, input().split())) ^ 1 error
s041739292
p04044
Java
import java.util.*; import java.io.*; public class KindergartenCountingGame { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(),m = in.nextInt();; ArrayList<String> a = new ArrayList<>(n); for (int i = 0; i < n; i++) { String y = in.next(); a.add(y); } Collections.sort(a); for (int i = 0; i < n; i++) { System.out.print(a.get(i)); } System.out.println(); } }
Main.java:4: error: class KindergartenCountingGame is public, should be declared in a file named KindergartenCountingGame.java public class KindergartenCountingGame { ^ 1 error
s895717533
p04044
Java
import java.util.*; public class Main_IrohaLovesStrings { public static void main (String[]args){ Scanner input = new Scanner (System.in); int n = input.nextInt(); int l = input.nextInt(); String [] arr = new String [n]; for (int i = 0; i < arr.length; i++) { arr[i]=input.next(); } Arrays.sort(arr); for (int i = 0; i < arr.length; i++) { System.out.print(arr[i]); } System.out.println(); } }
Main.java:2: error: class Main_IrohaLovesStrings is public, should be declared in a file named Main_IrohaLovesStrings.java public class Main_IrohaLovesStrings { ^ 1 error
s560982371
p04044
C++
#include<bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; using p = pair<int, int>; typedef vector<int> vi; int main() { int l, n; cin >> l >> n; vector<string> s; rep(i, n) rep(j, l) { cin >> s.at(i).at(j); } sort(s.begin(), s.end(), greater<int>()); rep(i, n) rep(j, l) { cout << s.at(i).at(j); } return 0; }
In file included from /usr/include/c++/14/bits/stl_algobase.h:71, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >; _Iterator2 = __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >; _Compare = std::greater<int>]': /usr/include/c++/14/bits/stl_algo.h:1777:14: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<int> >]' 1777 | if (__comp(__i, __first)) | ~~~~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<int> >]' 1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<int> >]' 1908 | std::__final_insertion_sort(__first, __last, __comp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4805:18: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = greater<int>]' 4805 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:17:7: required from here 17 | sort(s.begin(), s.end(), greater<int>()); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/predefined_ops.h:158:30: error: no match for call to '(std::greater<int>) (std::__cxx11::basic_string<char>&, std::__cxx11::basic_string<char>&)' 158 | { return bool(_M_comp(*__it1, *__it2)); } | ~~~~~~~^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:49, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/stl_function.h:394:7: note: candidate: 'constexpr bool std::greater<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = int]' 394 | operator()(const _Tp& __x, const _Tp& __y) const | ^~~~~~~~ /usr/include/c++/14/bits/stl_function.h:394:29: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>' to 'const int&' 394 | operator()(const _Tp& __x, const _Tp& __y) const | ~~~~~~~~~~~^~~ /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Val_comp_iter<_Compare>::operator()(_Value&, _Iterator) [with _Value = std::__cxx11::basic_string<char>; _Iterator = __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >; _Compare = std::greater<int>]': /usr/include/c++/14/bits/stl_algo.h:1757:20: required from 'void std::__unguarded_linear_insert(_RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = __gnu_cxx::__ops::_Val_comp_iter<greater<int> >]' 1757 | while (__comp(__val, __next)) | ~~~~~~^~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1785:36: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<int> >]' 1785 | std::__unguarded_linear_insert(__i, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ 1786 | __gnu_cxx::__ops::__val_comp_iter(__comp)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<int> >]' 1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<int> >]' 1908 | std::__final_insertion_sort(__first, __last, __comp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4805:18: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = greater<int>]' 4805 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:17:7: required from here 17 | sort(s.begin(), s.end(), greater<int>()); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/predefined_ops.h:240:30: error: no match for call to '(std::greater<int>) (std::__cxx11::basic_string<char>&, std::__cxx11::basic_string<char>&)' 240 | { return bool(_M_comp(__val, *__it)); } | ~~~~~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_function.h:394:7: note: candidate: 'constexpr bool std::greater<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = int]' 394 | operator()(const _Tp& __x, const _Tp& __y) const | ^~~~~~~~ /usr/include/c++/14/bits/stl_function.h:394:29: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>' to 'const int&' 394 | operator()(const _Tp& __x, const _Tp& __y) const | ~~~~~~~~~~~^~~ /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_comp_val<_Compare>::operator()(_Iterator, _Value&) [with _Iterator = __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >; _Value = std::__cxx11::basic_string<char>; _Compare = std::greater<int>]': /usr/include/c++/14/bits/stl_heap.h:140:48: required from 'void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Distance = long int; _Tp = __cxx11::basic_string<char>; _Compare = __gnu_cxx::__ops::_Iter_comp_val<greater<int> >]' 140 | while (__holeIndex > __topIndex && __comp(__first + __parent, __value)) | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:247:23: required from 'void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Distance = long int; _Tp = __cxx11::basic_string<char>; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<int> >]' 247 | std::__push_heap(__first, __holeIndex, __topIndex, | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 248 | _GLIBCXX_MOVE(__value), __cmp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:356:22: required from 'void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<int> >]' 356 | std::__adjust_heap(__first, __parent, __len, _GLIBCXX_MOVE(__value), | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 357 | __comp); | ~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1593:23: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<int> >]' 1593 | std::__make_heap(__first, __middle, __comp); | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1868:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = __gnu_cxx::__op
s337334067
p04044
C++
#include<iostream> #include<cstdio> #include<cstring> using namespace std; int N, L; string str[N]; int main(){ scanf("%d %d", &N, &L); for(int i = 1; i < N; i++){ cin >> str[i]; } for(int i = 0; i < N; i++){ string tmp = str[i]; int j = i - 1; while(j >= 0 && str[j] > tmp){ str[j + 1] = str[j]; j--; } str[j+1] = tmp; } for(int i = 0; i < N; i++) cout << str[i]; return 0; }
a.cc:6:12: error: size of array 'str' is not an integral constant-expression 6 | string str[N]; | ^
s375582264
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,m; cin >> n >> m; vector<string> a(n); for ( int i=0; i<n; i++ ) cin >> a[i]; sort(a.begin(),a.end()); string ans=""; for ( int i=0; i<N; i++ ) ans+=a[i]; cout << ans; return 0; }
a.cc: In function 'int main()': a.cc:11:20: error: 'N' was not declared in this scope 11 | for ( int i=0; i<N; i++ ) ans+=a[i]; | ^
s651869859
p04044
C++
#include <bits/stdc++.h> #include <math.h> #define _GLIBCXX_DEBUG using namespace std; int main() { int N,L; cin>>N>>L vector<string> S(N); for(int i=0;i<N;i++){ cin>>S[i]; } sort(S.begin(),S.end()); for(int i=0;i<N;i++){ cout<<S[i]; } }
a.cc: In function 'int main()': a.cc:8:12: error: expected ';' before 'vector' 8 | cin>>N>>L | ^ | ; 9 | 10 | vector<string> S(N); | ~~~~~~ a.cc:12:10: error: 'S' was not declared in this scope 12 | cin>>S[i]; | ^ a.cc:16:8: error: 'S' was not declared in this scope 16 | sort(S.begin(),S.end()); | ^
s360197086
p04044
C++
int N,L; cin >> N >> L; vector<string>S(N); for(int i = 0; i < N; i++) { cin >> S[i]; } sort(S.begin(),S.end()); string ans; for(int i = 0; i < N; i++) { ans += S[i]; }
a.cc:2:5: error: 'cin' does not name a type 2 | cin >> N >> L; | ^~~ a.cc:3:5: error: 'vector' does not name a type 3 | vector<string>S(N); | ^~~~~~ a.cc:4:5: error: expected unqualified-id before 'for' 4 | for(int i = 0; i < N; i++) { | ^~~ a.cc:4:20: error: 'i' does not name a type 4 | for(int i = 0; i < N; i++) { | ^ a.cc:4:27: error: 'i' does not name a type 4 | for(int i = 0; i < N; i++) { | ^ a.cc:7:9: error: expected constructor, destructor, or type conversion before '(' token 7 | sort(S.begin(),S.end()); | ^ a.cc:8:5: error: 'string' does not name a type 8 | string ans; | ^~~~~~ a.cc:9:5: error: expected unqualified-id before 'for' 9 | for(int i = 0; i < N; i++) { | ^~~ a.cc:9:20: error: 'i' does not name a type 9 | for(int i = 0; i < N; i++) { | ^ a.cc:9:27: error: 'i' does not name a type 9 | for(int i = 0; i < N; i++) { | ^
s343732753
p04044
C++
int N,L; cin >> N >> L; vector<string>S(N); for(int i = 0; i < N; i++) { cin >> S[i]; } sort(S.begin(),S.end()); string ans; for(int i = 0; i < N; i++) { ans += S[i]; }
a.cc:2:5: error: 'cin' does not name a type 2 | cin >> N >> L; | ^~~ a.cc:3:5: error: 'vector' does not name a type 3 | vector<string>S(N); | ^~~~~~ a.cc:4:5: error: expected unqualified-id before 'for' 4 | for(int i = 0; i < N; i++) { | ^~~ a.cc:4:20: error: 'i' does not name a type 4 | for(int i = 0; i < N; i++) { | ^ a.cc:4:27: error: 'i' does not name a type 4 | for(int i = 0; i < N; i++) { | ^ a.cc:7:9: error: expected constructor, destructor, or type conversion before '(' token 7 | sort(S.begin(),S.end()); | ^ a.cc:8:5: error: 'string' does not name a type 8 | string ans; | ^~~~~~ a.cc:9:5: error: expected unqualified-id before 'for' 9 | for(int i = 0; i < N; i++) { | ^~~ a.cc:9:20: error: 'i' does not name a type 9 | for(int i = 0; i < N; i++) { | ^ a.cc:9:27: error: 'i' does not name a type 9 | for(int i = 0; i < N; i++) { | ^
s500993699
p04044
C++
#define tst(a, b) for (int i = 1; i <= (b); i++) {cout << (a)[i] << " ";} cout << endl; #define ll long long #define lf long double #define ch char #define F(a) for (int i = 1; i <= (a); i++) #define For(a, b) for (int (a) = 1; (a) <= (b); (a)++) #define Rep(a, b, c) for (int (a) = (b); (a) <= (c); (a)++) #define FD(a) for (int i = (a); i >= 1; i--) #define ForD(a, b) for (int (a) = (b); (a) >= 1; (a)--) #define RepD(a, b, c) for (int (a) = (b); (a) >= (c); (a)--) #define mp(a, b) make_pair((a), (b)) #define pb(a) push_back(a) #define fi first #define se second #define il inline #define reg register #define ret return #define opt operator #define Mem0(a) memset((a), 0, sizeof(a)) #define MemInf(a) memset((a), 115, sizeof(a)) #define Mem(a, n) memset((a), (n), sizeof(a)) #include <cstdio> #include <iostream> #include <bits/stdc++.h> using namespace std; ll N, L; string Str[200]; int main() { cin >> N >> L; for (int i = 1; i <= N; i++) { cin >> Str[i]; } sort(Str + 1, Str + N + 1); for (int i = 1; i <= N; i++) { cout << Str[i]; } return 0; }
In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:24: /usr/include/c++/14/complex:2631:11: error: unexpected keyword; remove space between quotes and suffix identifier 2631 | operator""il(long double __num) | ^~ /usr/include/c++/14/complex:2635:11: error: unexpected keyword; remove space between quotes and suffix identifier 2635 | operator""il(unsigned long long __num) | ^~ /usr/include/c++/14/bits/regex_compiler.h: In member function 'std::__detail::_Compiler<_TraitsT>::_StateSeqT std::__detail::_Compiler<_TraitsT>::_M_pop()': a.cc:17:13: error: expected unqualified-id before 'return' 17 | #define ret return | ^~~~~~ a.cc:17:13: error: expected primary-expression before 'return' 17 | #define ret return | ^~~~~~ a.cc:17:13: error: expected ';' before 'return' a.cc:17:13: error: return-statement with no value, in function returning 'std::__detail::_Compiler<_TraitsT>::_StateSeqT' [-fpermissive]
s503454002
p04044
C++
#define tst(a, b) for (int i = 1; i <= (b); i++) {cout << (a)[i] << " ";} cout << endl; #define ll long long #define lf long double #define ch char #define F(a) for (int i = 1; i <= (a); i++) #define For(a, b) for (int (a) = 1; (a) <= (b); (a)++) #define Rep(a, b, c) for (int (a) = (b); (a) <= (c); (a)++) #define FD(a) for (int i = (a); i >= 1; i--) #define ForD(a, b) for (int (a) = (b); (a) >= 1; (a)--) #define RepD(a, b, c) for (int (a) = (b); (a) >= (c); (a)--) #define mp(a, b) make_pair((a), (b)) #define pb(a) push_back(a) #define fi first #define se second #define il inline #define reg register #define ret return #define opt operator #define Mem0(a) memset((a), 0, sizeof(a)) #define MemInf(a) memset((a), 115, sizeof(a)) #define Mem(a, n) memset((a), (n), sizeof(a)) #include <cstdio> #include <iostream> #include <bits/stdc++.h> using namespace std; inline ll Rd() { ll C = getchar(); ll V = 0; ll Sign = 0; while (C > '9' || C < '0') { Sign |= (C == '-'); C = getchar(); } while (C <= '9' && C >= '0') { V = (V << 1) + (V << 3) + (C ^ '0'); C = getchar(); } Sign && (V = -V); return V; } ll N, L; string Str[100010]; int main() { cin >> N >> L; for (int i = 1; i <= N; i++) { cin >> Str[i]; } sort(Str + 1, Str + N + 1); for (int i = 1; i <= N; i++) { cout << Str[i]; } return 0; }
In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:24: /usr/include/c++/14/complex:2631:11: error: unexpected keyword; remove space between quotes and suffix identifier 2631 | operator""il(long double __num) | ^~ /usr/include/c++/14/complex:2635:11: error: unexpected keyword; remove space between quotes and suffix identifier 2635 | operator""il(unsigned long long __num) | ^~ /usr/include/c++/14/bits/regex_compiler.h: In member function 'std::__detail::_Compiler<_TraitsT>::_StateSeqT std::__detail::_Compiler<_TraitsT>::_M_pop()': a.cc:17:13: error: expected unqualified-id before 'return' 17 | #define ret return | ^~~~~~ a.cc:17:13: error: expected primary-expression before 'return' 17 | #define ret return | ^~~~~~ a.cc:17:13: error: expected ';' before 'return' a.cc:17:13: error: return-statement with no value, in function returning 'std::__detail::_Compiler<_TraitsT>::_StateSeqT' [-fpermissive]
s659107963
p04044
C++
#include<bits/stdc++.h> using namespace std; int main() { int n,l,i; String s[1000]; i=0; cin>> n >> l; for(i=0;i<n;i++) { cin>>s[i]; } sort(s+0,s+l); for(i=0;i<n;i++) { cout<<s[i]; } return 0; }
a.cc: In function 'int main()': a.cc:6:3: error: 'String' was not declared in this scope 6 | String s[1000]; | ^~~~~~ a.cc:11:10: error: 's' was not declared in this scope 11 | cin>>s[i]; | ^ a.cc:14:8: error: 's' was not declared in this scope 14 | sort(s+0,s+l); | ^
s739310595
p04044
C++
#include<bits/stdc++.h> using namespace std; int main() { int n,l,i,s[100]; i=0; cin>> n >> l; for(i=0;i<n;i++) { cin>>s[i]; } sort(a,a+l); for(i=0;i<n;i++) { cout<<s[i]; } return 0; }
a.cc: In function 'int main()': a.cc:13:8: error: 'a' was not declared in this scope 13 | sort(a,a+l); | ^
s203421109
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,L; cin >> N >> L; vector<string>s(N); for(int i=0;i<L;i++){ cin >> s[i]; } sort(s.begin(),s.end()); for(int i=0;i<L;i++) {cout<<s[i];} return 0;
a.cc: In function 'int main()': a.cc:18:10: error: expected '}' at end of input 18 | return 0; | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s191845395
p04044
C
#include <bits/stdc++.h> using namespace std; int main() { int N, L; cin >> N >> L; vector<string> S(N); for (int i = 0; i < N; i++) { cin >> S[i]; sort(S[i].begin(), S[i].end()); } sort(S.begin(), S.end()); for (int i = 0; i < N; i++) { cout << S[i] << flush; } cout << endl; return 0; }
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s545940915
p04044
C++
3 3 dxx axx cxx
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 3 3 | ^
s468258014
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,l; cin >> n >> l; vector<string> data(n) for(int i=0;i<n;i++){ cin >> data.at(i); } sort(data.begin(),data.end()); string sum; for(int i=0;i<n;i++){ sum += data(i); } cout << sum << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: expected ',' or ';' before 'for' 8 | for(int i=0;i<n;i++){ | ^~~ a.cc:8:21: error: 'i' was not declared in this scope 8 | for(int i=0;i<n;i++){ | ^ a.cc:14:20: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)' 14 | sum += data(i); | ~~~~^~~
s489364500
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,l; cin >> n >> l; vector<string> data(n,'') for(int i=0;i<n;i++){ cin >> data.at(i); } sort(data.begin(),data.end()); string sum; for(int i=0;i<n;i++){ sum += data(i); } cout << sum << endl; return 0; }
a.cc:7:31: error: empty character constant 7 | vector<string> data(n,'') | ^~ a.cc: In function 'int main()': a.cc:7:33: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::vector(int&, char)' 7 | vector<string> data(n,'') | ^ In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53, from a.cc:1: /usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate: 'template<class _InputIterator, class> std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with <template-parameter-2-2> = _InputIterator; _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >]' 707 | vector(_InputIterator __first, _InputIterator __last, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:707:9: note: template argument deduction/substitution failed: a.cc:7:33: note: deduced conflicting types for parameter '_InputIterator' ('int' and 'char') 7 | vector<string> data(n,'') | ^ /usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; allocator_type = std::allocator<std::__cxx11::basic_string<char> >]' 678 | vector(initializer_list<value_type> __l, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:678:43: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<std::__cxx11::basic_string<char> >' 678 | vector(initializer_list<value_type> __l, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; std::__type_identity_t<_Alloc> = std::allocator<std::__cxx11::basic_string<char> >]' 659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:659:23: note: no known conversion for argument 1 from 'int' to 'std::vector<std::__cxx11::basic_string<char> >&&' 659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m) | ~~~~~~~~~^~~~ /usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::false_type) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; allocator_type = std::allocator<std::__cxx11::basic_string<char> >; std::false_type = std::false_type]' 640 | vector(vector&& __rv, const allocator_type& __m, false_type) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::true_type) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; allocator_type = std::allocator<std::__cxx11::basic_string<char> >; std::true_type = std::true_type]' 635 | vector(vector&& __rv, const allocator_type& __m, true_type) noexcept | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; std::__type_identity_t<_Alloc> = std::allocator<std::__cxx11::basic_string<char> >]' 624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:624:28: note: no known conversion for argument 1 from 'int' to 'const std::vector<std::__cxx11::basic_string<char> >&' 624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >]' 620 | vector(vector&&) noexcept = default; | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >]' 601 | vector(const vector& __x) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const value_type&, const allocator_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; size_type = long unsigned int; value_type = std::__cxx11::basic_string<char>; allocator_type = std::allocator<std::__cxx11::basic_string<char> >]' 569 | vector(size_type __n, const value_type& __value, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:569:47: note: no known conversion for argument 2 from 'char' to 'const std::vector<std::__cxx11::basic_string<char> >::value_type&' {aka 'const std::__cxx11::basic_string<char>&'} 569 | vector(size_type __n, const value_type& __value, | ~~~~~~~~~~~~~~~~~~^~~~~~~ /usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const allocator_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; size_type = long unsigned int; allocator_type = std::allocator<std::__cxx11::basic_string<char> >]' 556 | vector(size_type __n, const allocator_type& __a = allocator_type()) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:556:51: note: no known conversion for argument 2 from 'char' to 'const std::vector<std::__cxx11::basic_string<char> >::allocator_type&' {aka 'const std::allocator<std::__cxx11::basic_string<char> >&'} 556 | vector(size_type __n, const allocator_type& __a = allocator_type()) | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; allocator_type = std::allocator<std::__cxx11::basic_string<char> >]' 542 | vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector() [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >]' 531 | vector() = default; | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate expects 0 arguments, 2 provided a.cc:8:9: error: expected ',' or ';' before 'for' 8 | for(int i=0;i<n;i++){ | ^~~ a.cc:8:21: error: 'i' was not declared in this scope 8 | for(int i=0;i<n;i++){ | ^ a.cc:14:20: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)' 14 | sum += data(i); | ~~~~^~~
s933856039
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,l; cin >> n >> l; string S[n]={}; for(int i=0;i<n){ cin >> S[i]; } sort(S.begin(),S.end()); cout << S[0]+S[1]+S[2] << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:24: error: expected ';' before ')' token 8 | for(int i=0;i<n){ | ^ | ; a.cc:11:16: error: request for member 'begin' in 'S', which is of non-class type 'std::string [n]' {aka 'std::__cxx11::basic_string<char> [n]'} 11 | sort(S.begin(),S.end()); | ^~~~~ a.cc:11:26: error: request for member 'end' in 'S', which is of non-class type 'std::string [n]' {aka 'std::__cxx11::basic_string<char> [n]'} 11 | sort(S.begin(),S.end()); | ^~~
s950070196
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(){ string S[100]={}; int n,l; cin >> n >> l; for(int i=0;i<n){ cin >> S[i]; } sort(S.begin(),S.end()); cout << S[0]+S[1]+S[2] << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:24: error: expected ';' before ')' token 8 | for(int i=0;i<n){ | ^ | ; a.cc:11:16: error: request for member 'begin' in 'S', which is of non-class type 'std::string [100]' {aka 'std::__cxx11::basic_string<char> [100]'} 11 | sort(S.begin(),S.end()); | ^~~~~ a.cc:11:26: error: request for member 'end' in 'S', which is of non-class type 'std::string [100]' {aka 'std::__cxx11::basic_string<char> [100]'} 11 | sort(S.begin(),S.end()); | ^~~
s165134865
p04044
C++
#include <iostream> using namespace std; int main() { ll N, L; cin >> N >> L; map<string, int> mp; for (int i = 0; i < L; i++) { string s; cin >> s; mp[s] += 1; } string ans = ""; for (auto &e : mp) { for (int i = 0; i < e.second; i++) { ans += e.first; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:6:5: error: 'll' was not declared in this scope 6 | ll N, L; | ^~ a.cc:7:12: error: 'N' was not declared in this scope 7 | cin >> N >> L; | ^ a.cc:7:17: error: 'L' was not declared in this scope 7 | cin >> N >> L; | ^ a.cc:8:5: error: 'map' was not declared in this scope 8 | map<string, int> mp; | ^~~ a.cc:2:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>' 1 | #include <iostream> +++ |+#include <map> 2 | a.cc:8:15: error: expected primary-expression before ',' token 8 | map<string, int> mp; | ^ a.cc:8:17: error: expected primary-expression before 'int' 8 | map<string, int> mp; | ^~~ a.cc:12:9: error: 'mp' was not declared in this scope 12 | mp[s] += 1; | ^~ a.cc:15:20: error: 'mp' was not declared in this scope 15 | for (auto &e : mp) { | ^~
s267977876
p04044
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,l,i; cin >> n >> l; vector<string> s(n); for(i=0;i<n;i++) cin >> s.st(i); sort(s.begin(),s.end()); for(i=0;i<n;i++) cout << s.at(i) << endl; }
a.cc: In function 'int main()': a.cc:9:29: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'st'; did you mean 'at'? 9 | for(i=0;i<n;i++) cin >> s.st(i); | ^~ | at
s181544827
p04044
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,l,i; vector<string> s(n); cin >> n >> l; for(i=0;i<n;i++) cin >> s.st(i); sort(s.begin(),s.end()); for(i=0;i<n;i++) cout << s.at(i) << endl; }
a.cc: In function 'int main()': a.cc:9:29: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'st'; did you mean 'at'? 9 | for(i=0;i<n;i++) cin >> s.st(i); | ^~ | at
s284955271
p04044
C++
#include <bits/stdc++.h> int main(){ int n,l,i; vector<string> s(n); cin >> n >> l; for(i=0;i<n;i++) cin >> s.st(i); sort(s.begin(),s.end()); for(i=0;i<n;i++) cout << s.at(i) << endl; }
a.cc: In function 'int main()': a.cc:6:7: error: 'vector' was not declared in this scope 6 | vector<string> s(n); | ^~~~~~ a.cc:6:7: note: suggested alternatives: In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53, from a.cc:1: /usr/include/c++/14/bits/stl_vector.h:428:11: note: 'std::vector' 428 | class vector : protected _Vector_base<_Tp, _Alloc> | ^~~~~~ /usr/include/c++/14/vector:93:13: note: 'std::pmr::vector' 93 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>; | ^~~~~~ a.cc:6:14: error: 'string' was not declared in this scope 6 | vector<string> s(n); | ^~~~~~ a.cc:6:14: note: suggested alternatives: In file included from /usr/include/c++/14/string:41, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ /usr/include/c++/14/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:6:22: error: 's' was not declared in this scope 6 | vector<string> s(n); | ^ a.cc:8:7: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 8 | cin >> n >> l; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:11:7: error: 'sort' was not declared in this scope; did you mean 'std::sort'? 11 | sort(s.begin(),s.end()); | ^~~~ | std::sort In file included from /usr/include/c++/14/algorithm:86, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here 296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last); | ^~~~ a.cc:12:24: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 12 | for(i=0;i<n;i++) cout << s.at(i) << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:12:43: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 12 | for(i=0;i<n;i++) cout << s.at(i) << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s853248970
p04044
C++
#include <bits/stdc++.h> int main(){ int n,l,i; vector<string> s(); cin >> n >> l; for(i=0;i<n;i++) cin >> s.st(i); sort(s.begin(),s.end()); for(i=0;i<n;i++) cout << s.at(i) << endl; }
a.cc: In function 'int main()': a.cc:6:3: error: 'vector' was not declared in this scope 6 | vector<string> s(); | ^~~~~~ a.cc:6:3: note: suggested alternatives: In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53, from a.cc:1: /usr/include/c++/14/bits/stl_vector.h:428:11: note: 'std::vector' 428 | class vector : protected _Vector_base<_Tp, _Alloc> | ^~~~~~ /usr/include/c++/14/vector:93:13: note: 'std::pmr::vector' 93 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>; | ^~~~~~ a.cc:6:10: error: 'string' was not declared in this scope 6 | vector<string> s(); | ^~~~~~ a.cc:6:10: note: suggested alternatives: In file included from /usr/include/c++/14/string:41, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ /usr/include/c++/14/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:6:18: error: 's' was not declared in this scope 6 | vector<string> s(); | ^ a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 8 | cin >> n >> l; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'? 11 | sort(s.begin(),s.end()); | ^~~~ | std::sort In file included from /usr/include/c++/14/algorithm:86, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here 296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last); | ^~~~ a.cc:12:20: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 12 | for(i=0;i<n;i++) cout << s.at(i) << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:12:39: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 12 | for(i=0;i<n;i++) cout << s.at(i) << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s466849642
p04044
C++
#include <iostream> #include <string> #include <vector> #include <algorythm> using namespace std; int main(void){ int N, L; cin >> N >> L; vector<string> S(N); for(int i=0; i<N; i++) cin >> S[i]; sort((S).begin(), (S).end()); for(int i=0; i<N; i++) cout << S[i]; cout << "\n"; }
a.cc:4:10: fatal error: algorythm: No such file or directory 4 | #include <algorythm> | ^~~~~~~~~~~ compilation terminated.
s624834260
p04044
C++
#include <iostream> #include <string> #include <vector> using namespace std; int main(void){ int N, L; cin >> N >> L; vector<string> S(N); for(int i=0; i<N; i++) cin >> S[i]; sort((S).begin(), (S).end()); for(int i=0; i<N; i++) cout << S[i]; cout << "n"; }
a.cc: In function 'int main()': a.cc:13:3: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort((S).begin(), (S).end()); | ^~~~ | short
s072234506
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,l; cin >> n >> l; vector<string> a(n); for(int i=0;i<n;i++){ cin >> a[i]; } sort(a.being(),a.end()); for(int i=0;i<n;i++){ cout << a[i]; } }
a.cc: In function 'int main()': a.cc:11:10: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'being' 11 | sort(a.being(),a.end()); | ^~~~~
s765287041
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,l; cin >> n >> l; vector<string> a(n); for(int i=0;i<n;i++){ cin >> a[i]; } sort(a,a+n); for(int i=0;i<n;i++){ cout << a[i]; } }
a.cc: In function 'int main()': a.cc:11:11: error: no match for 'operator+' (operand types are 'std::vector<std::__cxx11::basic_string<char> >' and 'int') 11 | sort(a,a+n); | ~^~ | | | | | int | std::vector<std::__cxx11::basic_string<char> > In file included from /usr/include/c++/14/bits/stl_algobase.h:67, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed: a.cc:11:12: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 11 | sort(a,a+n); | ^ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1798 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed: a.cc:11:12: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 11 | sort(a,a+n); | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed: a.cc:11:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 11 | sort(a,a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3616 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed: a.cc:11:12: note: mismatched types 'const _CharT*' and 'std::vector<std::__cxx11::basic_string<char> >' 11 | sort(a,a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed: a.cc:11:12: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 11 | sort(a,a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed: a.cc:11:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 11 | sort(a,a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed: a.cc:11:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 11 | sort(a,a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed: a.cc:11:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 11 | sort(a,a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed: a.cc:11:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 11 | sort(a,a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed: a.cc:11:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 11 | sort(a,a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3719 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed: a.cc:11:12: note: mismatched types 'const _CharT*' and 'std::vector<std::__cxx11::basic_string<char> >' 11 | sort(a,a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3726 | operator+(_CharT __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed: a.cc:11:12: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 11 | sort(a,a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)' 3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed: a.cc:11:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 11 | sort(a,a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)' 3740 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3740:5: note: template argument deduction/substitution failed: a.cc:11:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 11 | sort(a,a+n); | ^ In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/complex:340:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const complex<_Tp>&)' 340 | operator+(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:340:5: note: template argument deduction/substitution failed: a.cc:11:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::complex<_Tp>' 11 | sort(a,a+n); | ^ /usr/incl
s907050254
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,l; cin >> n >> l; vector<string> a(i); for(int i=0;i<n;i++){ cin >> a[i]; } sort(a,a+n); for(int i=0;i<n;i++){ cout << a[i]; } }
a.cc: In function 'int main()': a.cc:6:20: error: 'i' was not declared in this scope 6 | vector<string> a(i); | ^ a.cc:11:11: error: no match for 'operator+' (operand types are 'std::vector<std::__cxx11::basic_string<char> >' and 'int') 11 | sort(a,a+n); | ~^~ | | | | | int | std::vector<std::__cxx11::basic_string<char> > In file included from /usr/include/c++/14/bits/stl_algobase.h:67, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed: a.cc:11:12: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 11 | sort(a,a+n); | ^ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1798 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed: a.cc:11:12: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 11 | sort(a,a+n); | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed: a.cc:11:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 11 | sort(a,a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3616 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed: a.cc:11:12: note: mismatched types 'const _CharT*' and 'std::vector<std::__cxx11::basic_string<char> >' 11 | sort(a,a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed: a.cc:11:12: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 11 | sort(a,a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed: a.cc:11:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 11 | sort(a,a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed: a.cc:11:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 11 | sort(a,a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed: a.cc:11:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 11 | sort(a,a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed: a.cc:11:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 11 | sort(a,a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed: a.cc:11:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 11 | sort(a,a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3719 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed: a.cc:11:12: note: mismatched types 'const _CharT*' and 'std::vector<std::__cxx11::basic_string<char> >' 11 | sort(a,a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3726 | operator+(_CharT __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed: a.cc:11:12: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 11 | sort(a,a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)' 3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed: a.cc:11:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 11 | sort(a,a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)' 3740 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3740:5: note: template argument deduction/substitution failed: a.cc:11:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 11 | sort(a,a+n); | ^ In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/complex:340:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const complex<_Tp>&)' 340 | operator+(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:340:5: note: template argument deduction/substitution failed: a.cc:11:12: note: 'std::vector<std::__cxx11::basic_st
s577791437
p04044
C++
#include<bits/stdc++.h. using namespace std; int main(){ int n,l; cin >> n >> l; int a[n]={}; for(int i=0;i<n;i++){ cin >> a[i]; } sort(a,a+n); for(int i=0;i<n;i++){ cout << a[i]; } }
a.cc:1:24: error: missing terminating > character 1 | #include<bits/stdc++.h. | ^ a.cc:1:9: fatal error: bits/stdc++.h.: No such file or directory 1 | #include<bits/stdc++.h. | ^ compilation terminated.
s972624779
p04044
C++
#include <bits/stdc++.h> using namespace std; int main(){ int t,l; cin>>t>>l; char a[t][l]; for(int i=0;i<t;i++){ cin>>a[i]; } sort(a,a+t); for(int i=0;i<t;i++){ cout<<a[i]; } }
a.cc: In function 'int main()': a.cc:12:13: error: no matching function for call to 'sort(char [t][l], char (*)[l])' 12 | sort(a,a+t); | ~~~~^~~~~~~ In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)' 4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last) | ^~~~ /usr/include/c++/14/bits/stl_algo.h:4762:5: note: template argument deduction/substitution failed: a.cc:12:13: note: variable-sized array type 'char (*)[l]' is not a valid template argument 12 | sort(a,a+t); | ~~~~^~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)' 4793 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last, | ^~~~ /usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:86: /usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)' 292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate expects 4 arguments, 2 provided /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)' 296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate expects 3 arguments, 2 provided
s440392647
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int i,N,L; cin >> N >> L; string S[101]; for(i=0;i<N;i++) { cin >> S[i]; } sort(S, S+n); for(i=0; i<N; i++) { cout << S[i]; } cout << endl; }
a.cc: In function 'int main()': a.cc:13:13: error: 'n' was not declared in this scope 13 | sort(S, S+n); | ^
s395045508
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int i,N,L; cin >> N >> L; vector<string> S[101]; for(i=0;i<N;i++) { cin >> S[i]; } sort(S, S+n); for(i=0; i<N; i++) { cout << S[i]; } cout << endl; }
a.cc: In function 'int main()': a.cc:11:9: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >') 11 | cin >> S[i]; | ~~~ ^~ ~~~~ | | | | | std::vector<std::__cxx11::basic_string<char> > | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _Ch
s034645119
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int i,N,L; cin >> N >> L; vector<string> S; for(i=0;i<N;i++) { S.push_back(i); } sort(S.begin(), S.end()); for(i=0; i<N; i++) { cout << S[i]; } cout << endl; }
a.cc: In function 'int main()': a.cc:11:16: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::push_back(int&)' 11 | S.push_back(i); | ~~~~~~~~~~~^~~ In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53, from a.cc:1: /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]' 1283 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:35: note: no known conversion for argument 1 from 'int' to 'const std::vector<std::__cxx11::basic_string<char> >::value_type&' {aka 'const std::__cxx11::basic_string<char>&'} 1283 | push_back(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]' 1300 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1300:30: note: no known conversion for argument 1 from 'int' to 'std::vector<std::__cxx11::basic_string<char> >::value_type&&' {aka 'std::__cxx11::basic_string<char>&&'} 1300 | push_back(value_type&& __x) | ~~~~~~~~~~~~~^~~
s628649350
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int i,N,L; cin >> N >> L; vector<string> S[101]; for(i=0;i<N;i++) cin >> S[i]; sort(S.begin(), S.end()); for(int i=0; i<N; i++) { cout << S[i]; } }
a.cc: In function 'int main()': a.cc:8:24: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >') 8 | for(i=0;i<N;i++) cin >> S[i]; | ~~~ ^~ ~~~~ | | | | | std::vector<std::__cxx11::basic_string<char> > | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& s
s458917665
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int i,N,L; vector<string> S[N]; cin >> N >> L; for(i=0;i<N;i++) cin >> S[i]; sort(S.begin(), S.end()); for(int i=0; i<N; i++) { cout << S[i]; } }
a.cc: In function 'int main()': a.cc:8:24: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >') 8 | for(i=0;i<N;i++) cin >> S[i]; | ~~~ ^~ ~~~~ | | | | | std::vector<std::__cxx11::basic_string<char> > | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& s
s138041487
p04044
C++
#include<iostream> #include<algorithm> using namespace std; int main () { int N, L; int arr[L]; cin >> N >> L; for (int i = 0; i < N; i ++){ string s; cin >> s; arr[i] = s; } for (int i = 0; i < L; i ++){ cout << i << " " << arr[i] << '\n'; } sort (arr, arr + L); int sum = ""; for (int i = 0; i < N; i ++){ sum += arr[i]; } cout << sum << '\n'; }
a.cc: In function 'int main()': a.cc:12:14: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int' in assignment 12 | arr[i] = s; | ^ | | | std::string {aka std::__cxx11::basic_string<char>} a.cc:18:13: error: invalid conversion from 'const char*' to 'int' [-fpermissive] 18 | int sum = ""; | ^~ | | | const char*
s214330949
p04044
C++
#include<iostream> #include<algorithm> using namespace std; int main () { int N, L; string arr[L]; cin >> N >> L; for (int i = 0; i < N; i ++){ string s; cin >> s; arr[i] = s; } for (int i = 0; i < L; i ++){ cout << i << " " << arr[i] << '\n'; } sort (arr, arr + N); for (int i = 0; i < L; i ++){ cout << i << " " << arr[i] << '\n'; }
a.cc: In function 'int main()': a.cc:20:2: error: expected '}' at end of input 20 | } | ^ a.cc:5:13: note: to match this '{' 5 | int main () { | ^
s672519691
p04044
C++
#include<iostream> #include<algorithm> using namespace std; int main () { int N, L; string arr[L]; cin >> N >> L; for (int i = 0; i < N; i ++){ string s; cin >> s; arr[i] = s; } for (int i = 0; i < L; i ++){ cout << i << " " << arr[i] << '\n'; } sor (arr, arr + N); for (int i = 0; i < L; i ++){ cout << i << " " << arr[i] << '\n'; }
a.cc: In function 'int main()': a.cc:17:3: error: 'sor' was not declared in this scope 17 | sor (arr, arr + N); | ^~~ a.cc:20:2: error: expected '}' at end of input 20 | } | ^ a.cc:5:13: note: to match this '{' 5 | int main () { | ^
s415500053
p04044
C++
#include<bits/stdc++.h> using namespace std; int main() { int n,l; cin>>n>>l; string s; for(int i=0;i<n;i++) { cin>>s; v.push_back(s); } sort(v.begin(),v.end()); for(int i=0;i<v.size();i++) { cout<<v[i]; } }
a.cc: In function 'int main()': a.cc:12:5: error: 'v' was not declared in this scope 12 | v.push_back(s); | ^ a.cc:14:8: error: 'v' was not declared in this scope 14 | sort(v.begin(),v.end()); | ^
s433524023
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,l; cin>>n>>l; string p; vector<string> s(t); for (int i = 0; i < n; i++) { cin>>s[i]; } sort(s.begin(),s.end()); for (int i = 0; i < n; i++) { cout<<s[i]; } cout<<p<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:22: error: 't' was not declared in this scope 9 | vector<string> s(t); | ^
s537772035
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, L; cin >> N >> L; vector<string>data(N); for(int i=0;i<N;i++){ cin >> data.at(i); } sort(data.begin(),data.end()); string s=""; for(int i=0;i<N;i++){ s+=data.at(i) } cout << s << endl; }
a.cc: In function 'int main()': a.cc:14:18: error: expected ';' before '}' token 14 | s+=data.at(i) | ^ | ; 15 | } | ~
s272900057
p04044
C++
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main(){ int N,L; cin >> N >> L; vector<string>s(L); rep(i,L){ cin >> s.at(i); } sort(s.begin(),s.end()); rep(i,L){ cout >> s.at(i); } }
a.cc: In function 'int main()': a.cc:19:10: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'}) 19 | cout >> s.at(i); | ~~~~ ^~ ~~~~~~~ | | | | | __gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type {aka std::__cxx11::basic_string<char>} | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41, from a.cc:1: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:19:5: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 19 | cout >> s.at(i); | ^~~~ In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:19:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> s.at(i); | ^ /usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)' 1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) | ^~~~~~~~ /usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed: a.cc:19:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> s.at(i); | ^ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:19:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> s.at(i); | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:19:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 19 | cout >> s.at(i); | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:19:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 19 | cout >> s.at(i); | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:19:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> s.at(i); | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:19:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 19 | cout >> s.at(i); | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:19:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 19 | cout >> s.at(i); | ^ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = std::__cxx11::basic_string<char>&]': a.cc:19:19: required from here 19 | cout >> s.at(i); | ^ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)' 509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed: a.cc:19:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> s.at(i); | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143: /usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)' 76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed: a.cc:19:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> s.at(i); | ^ /usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)' 106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed: a.cc:19:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> s.at(i); | ^ /usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)' 137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed: a.cc:19:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> s.at(i); | ^ /usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)' 177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:177:5: note: template argument deduction/substitution failed: a.cc:19:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> s.at(i); | ^ /usr/include/c++/14/iomanip:207:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setprecision)' 207 | operator>>(basic_istream<_CharT, _Traits>& _
s600880123
p04044
C++
#include<iostream> #include<algorithm> #include<cmath> #include<vector> #include<map> #include<set> #include<string> #include<queue> #include<stack> #include<iomanip> #define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); using namespace std; #define debug(x) cout<<(#x)<<"="<<(x)<<", "; #define debug1(x) debug(x) cout<<'\n'; #define debug2(x1, x2) debug(x1) debug(x2) cout<<'\n'; #define debug3(x1, x2, x3) debug(x1) debug(x2) debug(x3) cout<<'\n'; #define debug4(x1, x2, x3, x4) debug(x1) debug(x2) debug(x3) debug(x4) cout<<'\n'; #define debug5(x1, x2, x3, x4, x5) debug(x1) debug(x2) debug(x3) debug(x4) debug(x5) cout<<'\n'; #define fcout cout<<fixed<<setprecision(15) #define repp(i,j,k) for(int i=j; i<k; ++i) #define rep(i,j) repp(i,0,j) #define rrep(i,j,k) for(int i=j; i>=k; --i) #define all(x) (x).begin(), (x).end() #define sort(x) sort(x.begin(), x.end()) #define lb(x,val) lower_bound(x.begin(), x.end(), val) #define ub(x,val) upper_bound(x.begin(), x.end(), val) #define pb(x) emplace_back(x); typedef long long int lli; typedef pair<int,int> pii; typedef pair<lli,lli> pll; typedef vector<int> vi; typedef vector<lli> vl; typedef tuple<int, int, lli> tiil; //const lli M=998244353ll; const lli M=1000000007ll; const double D=1.0; int main(){ fast_io int n,l; cin>>n>>l; vector<string> v(n); rep(i,n) cin>>v[i]; sort(v); d=""; rep(i,n){ d+=v[i]; } cout<<d; return 0; }
a.cc: In function 'int main()': a.cc:50:9: error: 'd' was not declared in this scope 50 | d=""; | ^
s595618134
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,l; cin >> n >> l; vector<string> s; for(int i=0;i<n;i++) cin >> s.at(i); sort(s.begin(),s.end()); string ss; for(int i=0;i<n;i++) ss+=a.at(i); cout << ss << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:13: error: 'a' was not declared in this scope 17 | ss+=a.at(i); | ^
s778462529
p04044
C++
#include<bis/stdc++.h> using namespace std; int main(){ int n,l; cin >> n >> l; vector<string> s; for(int i=0;i<n;i++) cin >> s.at(i); sort(s.begin(),s.end()); string ss; for(int i=0;i<n;i++) ss+=a.at(i); cout << ss << endl; return 0; }
a.cc:1:9: fatal error: bis/stdc++.h: No such file or directory 1 | #include<bis/stdc++.h> | ^~~~~~~~~~~~~~ compilation terminated.
s802492878
p04044
C++
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int findSumOfDigits(int n) { int sum = 0; while (n > 0) { sum += n % 10; n /= 10; } return sum; } int main() { int n, l; vector<string> s(n); cin >> n >> l; rep(i, n) cin >> s.at(i); sort(s.begin(), s.end()); rep(i, n) cout << s(i); cout << endl; }
a.cc: In function 'int main()': a.cc:20:22: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)' 20 | rep(i, n) cout << s(i); | ~^~~
s650263388
p04044
C++
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int findSumOfDigits(int n) { int sum = 0; while (n > 0) { sum += n % 10; n /= 10; } return sum; } int main() { int n, l; vector<string> s[n]; cin >> n >> l; rep(i, n) cin >> s[i]; sort(s.begin(), s.end()); rep(i, n) cout << s[i]; cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:18:17: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >') 18 | rep(i, n) cin >> s[i]; | ~~~ ^~ ~~~~ | | | | | std::vector<std::__cxx11::basic_string<char> > | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>
s068051178
p04044
C++
//インクルード(アルファベット順) #include<algorithm>//sort,二分探索,など #include<bitset>//固定長bit集合 #include<cmath>//pow,logなど #include<complex>//複素数 #include<deque>//両端アクセスのキュー #include<functional>//sortのgreater #include<iomanip>//setprecision(浮動小数点の出力の誤差) #include<iostream>//入出力 #include<iterator>//集合演算(積集合,和集合,差集合など) #include<map>//map(辞書) #include<numeric>//iota(整数列の生成),gcdとlcm(c++17) #include<queue>//キュー #include<set>//集合 #include<stack>//スタック #include<string>//文字列 //#include<unordered_map>//イテレータあるけど順序保持しないmap //#include<unordered_set>//イテレータあるけど順序保持しないset #include<utility>//pair #include<vector>//可変長配列 #include<valarray>//なんとなく追加 //メモ:表示桁数を大きくする  cout << fixed << setprecision(20) << cm << endl; using namespace std; typedef long long ll; //マクロ //forループ関係 //引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか //Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる #define REP(i,n) for(ll i=0;i<(ll)(n);i++) #define REPD(i,n) for(ll i=n-1;i>=0;i--) #define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++) #define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--) //xにはvectorなどのコンテナ #define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい #define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく #define MAX(x) *max_element(ALL(x)) //最大値を求める #define MIN(x) *min_element(ALL(x)) //最小値を求める //定数 #define INF 1000000000000 //10^12:極めて大きい値,∞ #define MOD 1000000007 //10^9+7:合同式の法 #define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用) //略記 #define PB push_back //vectorヘの挿入 #define MP make_pair //pairのコンストラクタ #define F first //pairの一つ目の要素 #define S second //pairの二つ目の要素 #define PI acos(-1.0) #define answer(ans) cout<<ans<<endl; #define input(N) cin >> N ; signed main() { int L,N; cin >>L>>N; vector<string> S(N); REP(i,N){ cin >> S[i]; sort(S.begin(),S.end()); REP(i,N){ cout << S[i] ; } }
a.cc: In function 'int main()': a.cc:62:2: error: expected '}' at end of input 62 | } | ^ a.cc:52:15: note: to match this '{' 52 | signed main() { | ^
s852433710
p04044
C++
//インクルード(アルファベット順) #include<algorithm>//sort,二分探索,など #include<bitset>//固定長bit集合 #include<cmath>//pow,logなど #include<complex>//複素数 #include<deque>//両端アクセスのキュー #include<functional>//sortのgreater #include<iomanip>//setprecision(浮動小数点の出力の誤差) #include<iostream>//入出力 #include<iterator>//集合演算(積集合,和集合,差集合など) #include<map>//map(辞書) #include<numeric>//iota(整数列の生成),gcdとlcm(c++17) #include<queue>//キュー #include<set>//集合 #include<stack>//スタック #include<string>//文字列 //#include<unordered_map>//イテレータあるけど順序保持しないmap //#include<unordered_set>//イテレータあるけど順序保持しないset #include<utility>//pair #include<vector>//可変長配列 #include<valarray>//なんとなく追加 //メモ:表示桁数を大きくする  cout << fixed << setprecision(20) << cm << endl; using namespace std; typedef long long ll; //マクロ //forループ関係 //引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか //Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる #define REP(i,n) for(ll i=0;i<(ll)(n);i++) #define REPD(i,n) for(ll i=n-1;i>=0;i--) #define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++) #define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--) //xにはvectorなどのコンテナ #define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい #define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく #define MAX(x) *max_element(ALL(x)) //最大値を求める #define MIN(x) *min_element(ALL(x)) //最小値を求める //定数 #define INF 1000000000000 //10^12:極めて大きい値,∞ #define MOD 1000000007 //10^9+7:合同式の法 #define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用) //略記 #define PB push_back //vectorヘの挿入 #define MP make_pair //pairのコンストラクタ #define F first //pairの一つ目の要素 #define S second //pairの二つ目の要素 #define PI acos(-1.0) #define answer(ans) cout<<ans<<endl; #define input(N) cin >> N ; signed main() { int L,N; cin >>L>>N; vector<string> S(N); REP(i,N){ cin >> S[i;] } sort(S.begin(),S.end()); REP(i,N){ cout << S[i] ; } }
a.cc: In function 'int main()': a.cc:57:15: error: expected ']' before ';' token 57 | cin >> S[i;] | ^ | ] a.cc:57:16: error: expected primary-expression before ']' token 57 | cin >> S[i;] | ^
s282078692
p04044
C++
#include <stdio.h> struct word { char str[L+1]; }; int N,L; struct word words[N+1]; int main() { scanf("%d %d",&N,&L); for (int i=1;i<=N;i++) { scanf("%s",words[i].str); } for (int i=1;i<=N-1;i++) { for (int j=1;j<=N-i;j++) { if (strcmp(words[j].str,words[j+1].str)) swap(j,j+1); } } } void swap(int idx1,int idx2) { struct word tempword; strcpy(tempword.str,words[idx1].str); strcpy(words[idx1].str,words[idx2].str); strcpy(words[idx2].str,tempword.str); }
a.cc:5:18: error: 'L' was not declared in this scope 5 | char str[L+1]; | ^ a.cc:9:20: error: size of array 'words' is not an integral constant-expression 9 | struct word words[N+1]; | ~^~ a.cc: In function 'int main()': a.cc:17:37: error: 'struct word' has no member named 'str' 17 | scanf("%s",words[i].str); | ^~~ a.cc:24:45: error: 'struct word' has no member named 'str' 24 | if (strcmp(words[j].str,words[j+1].str)) | ^~~ a.cc:24:60: error: 'struct word' has no member named 'str' 24 | if (strcmp(words[j].str,words[j+1].str)) | ^~~ a.cc:24:29: error: 'strcmp' was not declared in this scope 24 | if (strcmp(words[j].str,words[j+1].str)) | ^~~~~~ a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <stdio.h> +++ |+#include <cstring> 2 | a.cc:25:33: error: 'swap' was not declared in this scope 25 | swap(j,j+1); | ^~~~ a.cc: In function 'void swap(int, int)': a.cc:33:25: error: 'struct word' has no member named 'str' 33 | strcpy(tempword.str,words[idx1].str); | ^~~ a.cc:33:41: error: 'struct word' has no member named 'str' 33 | strcpy(tempword.str,words[idx1].str); | ^~~ a.cc:33:9: error: 'strcpy' was not declared in this scope 33 | strcpy(tempword.str,words[idx1].str); | ^~~~~~ a.cc:33:9: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' a.cc:34:28: error: 'struct word' has no member named 'str' 34 | strcpy(words[idx1].str,words[idx2].str); | ^~~ a.cc:34:44: error: 'struct word' has no member named 'str' 34 | strcpy(words[idx1].str,words[idx2].str); | ^~~ a.cc:35:28: error: 'struct word' has no member named 'str' 35 | strcpy(words[idx2].str,tempword.str); | ^~~ a.cc:35:41: error: 'struct word' has no member named 'str' 35 | strcpy(words[idx2].str,tempword.str); | ^~~
s934961076
p04044
C++
//B - Iroha Loves Strings (ABC Edition) #include <stdio.h> int N,L; char str[N+1][L+1]; int main() { int i,j; scanf("%d %d",&N,&L); for (i=1;i<=N;i++) { gets(char[i][]); } for (i=1;i<=N-1;i++) { for (j=1;j<=N-i;j++) { if (strcmp(char[j][],char[j+1][])) swap(j,j+1); } } } void swap(int idx1, int idx2) { char temp[L+1]; for (int i=1;i<=L;i++) { temp[i] = str[idx1][i]; } for (int i=1;i<=L;i++) { str[idx1][i] = str[idx2][i]; } for (int i=1;i<=L;i++) { str[idx2][i] = temp[i]; } }
a.cc:5:16: error: size of array 'str' is not an integral constant-expression 5 | char str[N+1][L+1]; | ~^~ a.cc:5:11: error: size of array 'str' is not an integral constant-expression 5 | char str[N+1][L+1]; | ~^~ a.cc: In function 'int main()': a.cc:14:22: error: expected primary-expression before 'char' 14 | gets(char[i][]); | ^~~~ a.cc:14:17: error: 'gets' was not declared in this scope; did you mean 'getw'? 14 | gets(char[i][]); | ^~~~ | getw a.cc:21:36: error: expected primary-expression before 'char' 21 | if (strcmp(char[j][],char[j+1][])) | ^~~~ a.cc:21:46: error: expected primary-expression before 'char' 21 | if (strcmp(char[j][],char[j+1][])) | ^~~~ a.cc:21:29: error: 'strcmp' was not declared in this scope 21 | if (strcmp(char[j][],char[j+1][])) | ^~~~~~ a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <stdio.h> +++ |+#include <cstring> 3 | a.cc:22:33: error: 'swap' was not declared in this scope 22 | swap(j,j+1); | ^~~~
s053967949
p04044
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