submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s424406142
p04044
Java
import java.util.Scanner; public class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int n, l; String ary[] = new String[n]; n = sc.nextInt(); l = sc.nextInt(); for(int i=0; i<n; i++){ ary[i] = sc.next(); } Arrays.sort(ary); String answer = ""; for(int j=0; j<n; j++){ answer += ary[i]; } System.out.println(answer); } }
Main.java:19: error: cannot find symbol Arrays.sort(ary); ^ symbol: variable Arrays location: class Main Main.java:23: error: cannot find symbol answer += ary[i]; ^ symbol: variable i location: class Main 2 errors
s046734550
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[] list = new String[n]; for (int i = 0; i < n; i++) { list[i] = sc.nextInt(); } Arrays.sort(list); String answer = ""; for(int i = 0; i < n; i++) { answer +=list[i]; } System.out.println(answer); } }
Main.java:13: error: incompatible types: int cannot be converted to String list[i] = sc.nextInt(); ^ 1 error
s783159415
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.nectInt(); String[] list = new String[n]; for (int i = 0; i < n; i++) { list[i] = sc.nextInt(); } Arrays.sort(list); String answer = ""; for(int i = 0; i < n; i++) { answer +=list[i]; } System.out.println(answer); } }
Main.java:8: error: cannot find symbol int l = sc.nectInt(); ^ symbol: method nectInt() location: variable sc of type Scanner Main.java:13: error: incompatible types: int cannot be converted to String list[i] = sc.nextInt(); ^ 2 errors
s756496514
p04044
C++
#include <iostream> #include <string> using namespace std; int main() { int n, l; cin >> n >> l; string s[100]; for (int i = 0; i < n; i++) { cin >> s[i]; } sort(s, s + n); string ans = ""; for (int j = 0; j < n; j++) { ans += s[j]; } cout << ans; }
a.cc: In function 'int main()': a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'short'? 14 | sort(s, s + n); | ^~~~ | short
s829655466
p04044
C++
#include <iostream> #include <string> using namespace std; int main() { int n, l; cin >> n >> l; string s[100]; for (int i = 0; i < n; i++) { cin >> s[i]; } sort(s, s + n); string ans = ""; for (int j = 0; j < n; j++) { ans += s[j] } cout << ans; }
a.cc: In function 'int main()': a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'short'? 14 | sort(s, s + n); | ^~~~ | short a.cc:18:16: error: expected ';' before '}' token 18 | ans += s[j] | ^ | ; 19 | } | ~
s927408378
p04044
C++
// Created by liszt on 2019/07/21. #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++){ string s; cin>>s; S[i]=s; } sort(S.begin(),S.end()); for(int i=0;i<n;i++){ cout<<S[i]; } return 0; }
a.cc: In function 'int main()': a.cc:10:14: error: no match for 'operator=' (operand types are 'std::vector<std::__cxx11::basic_string<char> >' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 10 | S[i]=s; | ^ In file included from /usr/include/c++/14/vector:72, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53, from a.cc:2: /usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >]' 210 | vector<_Tp, _Alloc>:: | ^~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/vector.tcc:211:42: note: no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const std::vector<std::__cxx11::basic_string<char> >&' 211 | operator=(const vector<_Tp, _Alloc>& __x) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ In file included from /usr/include/c++/14/vector:66: /usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >]' 766 | operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move()) | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:766:26: note: no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::vector<std::__cxx11::basic_string<char> >&&' 766 | operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move()) | ~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >]' 788 | operator=(initializer_list<value_type> __l) | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:788:46: note: no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::initializer_list<std::__cxx11::basic_string<char> >' 788 | operator=(initializer_list<value_type> __l) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ a.cc:12:12: error: request for member 'begin' in 'S', which is of non-class type 'std::vector<std::__cxx11::basic_string<char> > [n]' 12 | sort(S.begin(),S.end()); | ^~~~~ a.cc:12:22: error: request for member 'end' in 'S', which is of non-class type 'std::vector<std::__cxx11::basic_string<char> > [n]' 12 | sort(S.begin(),S.end()); | ^~~ a.cc:14:13: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >') 14 | cout<<S[i]; | ~~~~^~~~~~ | | | | | std::vector<std::__cxx11::basic_string<char> > | std::ostream {aka std::basic_ostream<char>} 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: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<<(
s214750891
p04044
C++
#include<iostream> #include<algorithm> #include <cassert> #include<string> #include<vector> #include <utility> #include <math.h> #include<cmath> # include <set> # include <iomanip> # include <functional> # include <queue> #include<map> #define INF 1000000009; using namespace std; int gcd(int a, int b) { while (a % b != 0) { int c = 0; c = a % b; a = b; b = c; } return b; } int main() { int ko, naga; cin >> ko >> naga; string manji[108]; for (int i = 0; i < ko; i++) { cin >> manji[i]; } sort(manji, manji + ko); for (int i = 0, i < ko; i++) { cout << manji[i]; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:35:26: error: expected ';' before '<' token 35 | for (int i = 0, i < ko; i++) { | ^~ | ; a.cc:35:27: error: expected primary-expression before '<' token 35 | for (int i = 0, i < ko; i++) { | ^
s882191286
p04044
Java
import java.util.Scanner; import java.util.stream.Collectors; import java.util.stream.IntStream; public class ProblemB { public static void main(String[] args) { try (Scanner scanner = new Scanner(System.in)) { int n = scanner.nextInt(); scanner.nextInt(); System.out.println( IntStream.range(0, n).mapToObj(i -> scanner.next()).sorted().collect(Collectors.joining())); } } }
Main.java:5: error: class ProblemB is public, should be declared in a file named ProblemB.java public class ProblemB { ^ 1 error
s979009346
p04044
C
#include <stdio.h> int main(){ int i,L,n,max=0; char s[101][101]; scanf("%d%d",&n,&L); for(i=0;i<n;i++){ for(int j = 0; j < L; j++){ scanf("%c",s[i][j]); } } sort(s,s+n); for(int i = 0; i < n; i++){ for(int j = 0; j < l; j++){ printf("%s",s[i][j]); } } printf("\n"); return 0; }
main.c: In function 'main': main.c:14:1: error: implicit declaration of function 'sort' [-Wimplicit-function-declaration] 14 | sort(s,s+n); | ^~~~ main.c:16:22: error: 'l' undeclared (first use in this function) 16 | for(int j = 0; j < l; j++){ | ^ main.c:16:22: note: each undeclared identifier is reported only once for each function it appears in
s372310174
p04044
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define MOD 1000000007 #define PI 3.141592653589793 int main(){ int n, l; cin >> n >> l; vector<string> v(n); for(int i = 0; i < n; i++)   cin >> v[i]; sort(v.begin(), v.end()); string ans = ""; for(auto s:v)  ans += s; cout << ans << endl; }
a.cc:14:5: error: extended character   is not valid in an identifier 14 |   cin >> v[i]; | ^ a.cc:14:5: error: extended character   is not valid in an identifier a.cc:18:7: error: extended character   is not valid in an identifier 18 |  ans += s; | ^ a.cc: In function 'int main()': a.cc:14:5: error: '\U00003000\U00003000cin' was not declared in this scope 14 |   cin >> v[i]; | ^~~~~~~ a.cc:18:7: error: '\U00003000ans' was not declared in this scope 18 |  ans += s; | ^~~~~
s644417364
p04044
C++
#include <iostream> #include <string> #include <map> using namespace std; int main(){ int n,l; cin >> n >> l; string s[n]; for (int i=0;i<n;i++) cin >> s[i]; sort(s, s+n); for (int i=0;i<n;i++) cout << s[i]; cout << endl; }
a.cc: In function 'int main()': a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(s, s+n); | ^~~~ | short
s118959556
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,L; cin>>N>>L; vector<string>ch (N); for(int i=0;i<ch.size;i++) cin>>ch.at(i); sort(ch.begin(),ch.end()); for(int i=0;i<ch.size;i++) cout<<ch.at(i); cout<<endl; }
a.cc: In function 'int main()': a.cc:7:20: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; size_type = long unsigned int]' (did you forget the '()' ?) 7 | for(int i=0;i<ch.size;i++) | ~~~^~~~ | () a.cc:10:20: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; size_type = long unsigned int]' (did you forget the '()' ?) 10 | for(int i=0;i<ch.size;i++) | ~~~^~~~ | ()
s583151940
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >>N; vector<string> vec(N); for(int i=0;i<N;i++){ cin >> vec[i]; } sort(vec.begin(),vec.end()) for(int i=0;i<N;i++){ cout << vec[i] << endl; } }
a.cc: In function 'int main()': a.cc:12:30: error: expected ';' before 'for' 12 | sort(vec.begin(),vec.end()) | ^ | ; 13 | for(int i=0;i<N;i++){ | ~~~ a.cc:13:15: error: 'i' was not declared in this scope 13 | for(int i=0;i<N;i++){ | ^
s112830306
p04044
C++
#include<iostream> #include<vector> using namespace std; int main() { int N; cin >>N; vector<string> vec(N); for(int i=0;i<N;i++){ cin >> vec[i]; } sort(vec.begin(),vec.end()); for(int i=0;i<N;i++){ cout << vec[i] << endl; } }
a.cc: In function 'int main()': a.cc:13:3: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort(vec.begin(),vec.end()); | ^~~~ | short
s685213521
p04044
C++
#include<iostream> #include<vector> using namespace std; int main() { int N; cin >>N; vector<string> vec(N); for(int i=0;i<N;i++){ cin >> vec[i]; } sort(vec.begin(),vec.end()); for(int i=0;i<N;i++){ cout << vec[i] << endl; } }
a.cc: In function 'int main()': a.cc:13:3: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort(vec.begin(),vec.end()); | ^~~~ | short
s841032164
p04044
C++
#include<iostream> #include<vector> using namespace std; int main() { vector<string> vec(N); for(int i=0;i<N;i++){ cin >> vec[i]; } sort(vec.begin(),vec.end()); for(int i=0;i<N;i++){ cout << vec[i] << endl; } }
a.cc: In function 'int main()': a.cc:5:22: error: 'N' was not declared in this scope 5 | vector<string> vec(N); | ^ a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(vec.begin(),vec.end()); | ^~~~ | short
s015218059
p04044
C++
#include<bits/stdc++.h> using namespace std; int a,b; string s[50]; int main() { cin>>a>>b; if(a==1){ cout<<"frwgsga"; map<long long,long long>aa; for(int i=0; i<a; i++) { cin>>s[i]; aa[i]=s[i]; } } if(a==100){ for(int i=0;i<=pow(2,63)-1;i++){ if(sqrt(sqrt(i))*sqrt(sqrt(i))*sqrt(sqrt(i))*sqrt(sqrt(i))==i) { cout<<i<<" "; } } } for(int i=0; i<a; i++) { cin>>s[i]; } sort(s,s+a); for(int i=0; i<a; i++) { cout<<s[i]; } }
a.cc: In function 'int main()': a.cc:12:26: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::map<long long int, long long int>::mapped_type' {aka 'long long int'} in assignment 12 | aa[i]=s[i]; | ~~~^ | | | std::string {aka std::__cxx11::basic_string<char>}
s712784437
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(void){ string s[3]; for(int i=0;i<3;i++){ cin>>s[i]; } sort(s.begin(),s.end()); cout<<s[0]<<s[1]<<s[2]<<endl; }
a.cc: In function 'int main()': a.cc:9:16: error: request for member 'begin' in 's', which is of non-class type 'std::string [3]' {aka 'std::__cxx11::basic_string<char> [3]'} 9 | sort(s.begin(),s.end()); | ^~~~~ a.cc:9:26: error: request for member 'end' in 's', which is of non-class type 'std::string [3]' {aka 'std::__cxx11::basic_string<char> [3]'} 9 | sort(s.begin(),s.end()); | ^~~
s198531236
p04044
C++
#include <iostream> using namespace std; int main() { int n,l; string s; cin>>n>>l; vector<string> v; for(int i=0;i<n;i++) { cin>>s; v.push_back(s); } sort(v.begin(),v.end()); for(int i=0;i<n;i++) cout<<v[i]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: 'vector' was not declared in this scope 8 | vector<string> v; | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include <iostream> +++ |+#include <vector> 2 | using namespace std; a.cc:8:22: error: expected primary-expression before '>' token 8 | vector<string> v; | ^ a.cc:8:24: error: 'v' was not declared in this scope 8 | vector<string> v; | ^ a.cc:14:9: error: 'sort' was not declared in this scope; did you mean 'short'? 14 | sort(v.begin(),v.end()); | ^~~~ | short
s750711311
p04044
C
#include <stdio.h> #include <string.h> #include <stdlib.h> int cmp(const void *a,const void *b){ return strcmp(a,b); } int main(){ int n,l; scanf("%d%d",&n,&l); char s[n][l+1]; char temp[l+1]; for(int i=0;i<n;i++)scanf("%s",&s[i]); qsort(s,n,sizeof(s[0]),cmp); } for(int i=0;i<n;i++)printf("%s",s[i]); return 0; }
main.c:15:3: error: expected identifier or '(' before 'for' 15 | for(int i=0;i<n;i++)printf("%s",s[i]); | ^~~ main.c:15:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 15 | for(int i=0;i<n;i++)printf("%s",s[i]); | ^ main.c:15:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token 15 | for(int i=0;i<n;i++)printf("%s",s[i]); | ^~ main.c:16:3: error: expected identifier or '(' before 'return' 16 | return 0; | ^~~~~~ main.c:17:1: error: expected identifier or '(' before '}' token 17 | } | ^
s187451081
p04044
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a, b; cin >> a >> b; vector<string> str(a); for (int i = 0; i < a; i++) { cin >> str[i]; } str.sort(str.begin(), str.end()); for (int i = 0; i < a; i++) { cout << str[i]; } }
a.cc: In function 'int main()': a.cc:10:7: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'sort' 10 | str.sort(str.begin(), str.end()); | ^~~~
s429737572
p04044
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a, b; cin >> a >> b; vector<string> str(a); for (int i = 0; i < a; i++) { cin >> str[i]; } str.sort(); for (int i = 0; i < a; i++) { cout << str[i]; } }
a.cc: In function 'int main()': a.cc:10:7: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'sort' 10 | str.sort(); | ^~~~
s126062307
p04044
C++
#include <bits/stc++.h> using namespace std; int main(){ int a, b; cin >> a >> b; vector<string> str(a); for (int i = 0; i < a; i++) { cin >> str[i]; } str.sort(); for (int i = 0; i < a; i++) { cout << str[i]; } }
a.cc:1:10: fatal error: bits/stc++.h: No such file or directory 1 | #include <bits/stc++.h> | ^~~~~~~~~~~~~~ compilation terminated.
s588861821
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int S ; cin S; for ( char c = 'a';c <= 'z' ; c++){ bool found = false; for (int i=0; i < S.size();i++){ if(s[i]==c){ found true; } } if (! found){ cout << c << endl; return 0; } } cout << "None" << endl; }
a.cc: In function 'int main()': a.cc:6:6: error: expected ';' before 'S' 6 | cin S; | ^~ | ; a.cc:11:25: error: request for member 'size' in 'S', which is of non-class type 'int' 11 | for (int i=0; i < S.size();i++){ | ^~~~ a.cc:12:10: error: 's' was not declared in this scope 12 | if(s[i]==c){ | ^ a.cc:13:14: error: expected ';' before 'true' 13 | found true; | ^~~~~ | ;
s706042366
p04044
C
#include <stdio.h> #include <stdstr.h> int main(){ int n,l; scanf("%d%d",&n,&l); char s[n][l+1]; char temp[l+1]; for(int i=0;i<n;i++)scanf("%s",&s[i]); for(int i=0;i<n;i++)for(int j=0;j<n;j++){ if(0>strcmp(s[j],s[j+1])){ strcpy(temp,s[j]); strcpy(s[j],s[j+1]); strcpy(s[j+1],temp); } } for(int i=0;i<n;i++)printf("%s",s[i]); return 0; }
main.c:2:10: fatal error: stdstr.h: No such file or directory 2 | #include <stdstr.h> | ^~~~~~~~~~ compilation terminated.
s462105130
p04044
C
#include <stdio.h> #include <stdstr.h> int main(){ int n,l; scanf("%d%d",&n,&l); char s[n][l+1]; char temp[l+1]; for(int i=0;i<n;i++)scanf("%s",&s[i]); for(int i=0;i<n;i++)for(int j=0;j<n;j++){ if(0>strcmp(s[j],s[k])){ strcpy(temp,s[j]); strcpy(s[j],s[k]); strcpy(s[k],temp); } } for(int i=0;i<n;i++)printf("%s",s[i]); return 0; }
main.c:2:10: fatal error: stdstr.h: No such file or directory 2 | #include <stdstr.h> | ^~~~~~~~~~ compilation terminated.
s795909211
p04044
C
#include <stdio.h> #include <stdstr.h> int main(){ int n,l; scanf("%d%d",&n,&l); char s[n][l+1]; char temp[l+1]; for(int i=0;i<n;i++)scanf("%s",&s[i]); for(int i=0;i<l;i++)for(int j=0;j<n;j++)for(int k=j+1;k<n;k++){ if((int)s[j][i]>(int)s[k][i]){ strcpy(temp,s[j]); strcpy(s[j],s[k]); strcpy(s[k],temp); } } for(int i=0;i<n;i++)printf("%s",s[i]); return 0; }
main.c:2:10: fatal error: stdstr.h: No such file or directory 2 | #include <stdstr.h> | ^~~~~~~~~~ compilation terminated.
s673757765
p04044
C
#include <stdio.h> int main(){ int n,l; scanf("%d%d",&n,&l); char s[n][l+1]; char temp[l+1]; for(int i=0;i<n;i++)scanf("%s",&s[i]); for(int i=0;i<l;i++)for(int j=0;j<n;j++)for(int k=j+1;k<n;k++){ if((int)s[j][i]>(int)s[k][i]){ temp=s[j]; s[j]=s[k]; s[k]=temp; } } for(int i=0;i<n;i++)printf("%s",s[i]); return 0; }
main.c: In function 'main': main.c:10:11: error: assignment to expression with array type 10 | temp=s[j]; | ^ main.c:11:11: error: assignment to expression with array type 11 | s[j]=s[k]; | ^ main.c:12:11: error: assignment to expression with array type 12 | s[k]=temp; | ^
s762093805
p04044
C
#include <stdio.h> int main(){ int n,l; scanf("%d%d",&n,&l); char s[n][l+1]; char temp[l+1]; for(int i=0;i<n;i++)scanf("%s",&s[i]); for(int i=0;i<l;i++)for(int j=0;j<n;j++)for(int k=j+1;k<n;k++){ if((int)s[j][i]>(int)s[k][i]){ char temp=s[j]; s[j]=s[k]; s[k]=temp; } } for(int i=0;i<n;i++)printf("%s",s[i]); return 0; }
main.c: In function 'main': main.c:10:17: error: initialization of 'char' from 'char *' makes integer from pointer without a cast [-Wint-conversion] 10 | char temp=s[j]; | ^ main.c:11:11: error: assignment to expression with array type 11 | s[j]=s[k]; | ^ main.c:12:11: error: assignment to expression with array type 12 | s[k]=temp; | ^
s330973152
p04044
C
#include <stdio.h> int main(){ int n,l; scanf("%d%d",&n,&l); char s[n][l+1]; for(int i=0;i<n;i++)scanf("%s",&s[i]); for(int i=0;i<l;i++)for(int j=0;j<n;j++)for(int k=j+1;k<n;k++){ if((int)s[j][i]>(int)s[k][i]){ char temp[l+1]=s[j]; s[j]=s[k]; s[k]=temp; } } for(int i=0;i<n;i++)printf("%s",s[i]); return 0; }
main.c: In function 'main': main.c:9:22: error: variable-sized object may not be initialized except with an empty initializer 9 | char temp[l+1]=s[j]; | ^ main.c:10:11: error: assignment to expression with array type 10 | s[j]=s[k]; | ^ main.c:11:11: error: assignment to expression with array type 11 | s[k]=temp; | ^
s890166418
p04044
C
#include <stdio.h> int main(){ int n,l; scanf("%d%d",&n,&l); char s[n][l+1]; for(int i=0;i<n;i++)scanf("%s",&s[i]); for(int i=0;i<l;i++)for(int j=0;j<n;j++)for(int k=j+1;k<n;k++){ if((int)s[j][i]>(int)s[k][i]){ char temp=s[j]; s[j]=s[k]; s[k]=temp; } } for(int i=0;i<n;i++)printf("%s",s[i]); return 0; }
main.c: In function 'main': main.c:9:17: error: initialization of 'char' from 'char *' makes integer from pointer without a cast [-Wint-conversion] 9 | char temp=s[j]; | ^ main.c:10:11: error: assignment to expression with array type 10 | s[j]=s[k]; | ^ main.c:11:11: error: assignment to expression with array type 11 | s[k]=temp; | ^
s880109289
p04044
C
#include <stdio.h> int main(){ int n,l; scanf("%d%d",&n,&l); char s[n][l+1]; for(int i=0;i<n;i++)scanf("%s",&s[i]); for(int i=0;i<l;i++)for(int j=0;j<n;j++)for(int k=j+1;k<n;k++){ if((int)s[j][i]>(int)s[k][i]){ char temp=s[j]; s[j]=s[k]; s[k]=temp; } } for(int i=0;i<n;i++)printf("%s",s[i]); return 0; }
main.c: In function 'main': main.c:9:17: error: initialization of 'char' from 'char *' makes integer from pointer without a cast [-Wint-conversion] 9 | char temp=s[j]; | ^ main.c:10:11: error: assignment to expression with array type 10 | s[j]=s[k]; | ^ main.c:11:11: error: assignment to expression with array type 11 | s[k]=temp; | ^
s363527338
p04044
C
#include <stdio.h> int main(){ int n,l; scanf("%d%d",&n,&l); char s[n][l+1]; for(int i=0;i<n;i++)scanf("%s",&s[i]); for(int i=0;i<l;i++)for(int j=0;j<n;j++)for(inr k=j+1;k<n;k++){ if((int)s[j][i]>(int)s[k][i]){ char temp=s[j][i]; s[j][i]=s[k][i]; s[k][i]=temp; } } for(int i=0;i<n;i++)printf("%s",s[i]); return 0; }
main.c: In function 'main': main.c:7:47: error: unknown type name 'inr'; did you mean 'int'? 7 | for(int i=0;i<l;i++)for(int j=0;j<n;j++)for(inr k=j+1;k<n;k++){ | ^~~ | int
s454079182
p04044
C
#include <stdio.h> int main(){ int n,l; scanf("%d%d",&n,&l); char s[n][l+1]; for(int i=0;i<n;i++)scanf("%s",s[i]); for(int i=0;i<l;i++)for(int j=0;j<n;j++)for(inr k=j+1;k<n;k++){ if((int)s[j][i]>(int)s[k][i]){ char temp=s[j][i]; s[j][i]=s[k][i]; s[k][i]=temp; } } for(int i=0;i<n;i++)printf("%s",s[i]); return 0; }
main.c: In function 'main': main.c:7:47: error: unknown type name 'inr'; did you mean 'int'? 7 | for(int i=0;i<l;i++)for(int j=0;j<n;j++)for(inr k=j+1;k<n;k++){ | ^~~ | int
s479417334
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { string L; cin >> L; vector<int> Si for (int i = 0; i < N; i++) { cin >> Si; } vector<int> vec = {for(int i=0; i <N; i++)}; sort(vec.begin(), vec.end()); for (int i = 0; i < N; i++) { cout << Si << endl; } }
a.cc: In function 'int main()': a.cc:8:6: error: expected initializer before 'for' 8 | for (int i = 0; i < N; i++) { | ^~~ a.cc:8:22: error: 'i' was not declared in this scope 8 | for (int i = 0; i < N; i++) { | ^ a.cc:8:26: error: 'N' was not declared in this scope 8 | for (int i = 0; i < N; i++) { | ^ a.cc:12:22: error: expected primary-expression before 'for' 12 | vector<int> vec = {for(int i=0; i <N; i++)}; | ^~~ a.cc:12:22: error: expected '}' before 'for' 12 | vector<int> vec = {for(int i=0; i <N; i++)}; | ~^~~ a.cc:12:22: error: could not convert '{<expression error>}' from '<brace-enclosed initializer list>' to 'std::vector<int>' 12 | vector<int> vec = {for(int i=0; i <N; i++)}; | ^~~ | | | <brace-enclosed initializer list> a.cc:12:22: error: expected ',' or ';' before 'for' a.cc: At global scope: a.cc:13:9: error: expected constructor, destructor, or type conversion before '(' token 13 | sort(vec.begin(), vec.end()); | ^ a.cc:15:5: error: expected unqualified-id before 'for' 15 | for (int i = 0; i < N; i++) { | ^~~ a.cc:15:21: error: 'i' does not name a type 15 | for (int i = 0; i < N; i++) { | ^ a.cc:15:28: error: 'i' does not name a type 15 | for (int i = 0; i < N; i++) { | ^ a.cc:18:1: error: expected declaration before '}' token 18 | } | ^
s620491479
p04044
C++
#include<iostream> #include <algorithm> #include <string> #include<vector> #include <array> #include<tuple> #include<queue> #include<stack> #include<iomanip> //AtCoderC++.cpp using namespace std; vector<string> split(string& content, char delim) { auto ss = vector<string>(); string s = ""; for (size_t i = 0; i < content.length(); i++) { if (content[i] == delim) { ss.push_back(s); s = ""; continue; } s += content[i]; } if (s != "")ss.push_back(s); return ss; } int main() { size_t N; cin >> N >> N; auto ss = vector<string>(N); for (size_t i = 0; i < N; i++) { cin >> ss[i]; } sort(ss.begin(), ss.end()); for (size_t i = 0; i < N; i++) { cout << ss[i]; } cout << endl;
a.cc: In function 'int main()': a.cc:39:22: error: expected '}' at end of input 39 | cout << endl; | ^ a.cc:29:12: note: to match this '{' 29 | int main() { | ^
s922169347
p04044
C
#include <iostream> #include <vector> using namespace std; int main() { int n, l; cin >> n >> l; vector<string> s; string result; for (int i = 0; i < n; i++) { string str; cin >> str; s.push_back(str); } for (int i = 0; i < n; i++) { for (int j = 0; j < l; j++) { if (result[0] < s[i][j]) { result = result + s[i]; break; } else if (result[0] > s[i][j]) { result = s[i] + result; break; } else { continue; } } } cout << result << endl; return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s019439174
p04044
C++
#include<cstdio> #include<string> #include<algorithm> using namespace std; int main(){ int N, L; scanf("%d %d", &N, &L); string str[100]; for(int i=0; i<N; i++){ char tmp[L]; scanf("%s", tmp); str[i] = tmp; } sort(str, str+N); for(int i = 0; i < N; i++){ string s; s += str[i]; } printf("%s", s.c_str()); return 0; }
a.cc: In function 'int main()': a.cc:23:16: error: 's' was not declared in this scope 23 | printf("%s", s.c_str()); | ^
s517533291
p04044
C++
#include<cstdio> #include<string> #include<algorithm> using namespace std; int main(){ int N, L; scanf("%d %d", &N, &L); string str[100]; for(int i=0; i<N; i++){ char tmp[L]; scanf("%s", tmp); str[i] = tmp; } sort(str, str+N); for(int i = 0; i < N; i++){ char s; s = str[i]; printf("%s", s); } return 0; }
a.cc: In function 'int main()': a.cc:21:14: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char' in assignment 21 | s = str[i]; | ~~~~~^ | | | std::string {aka std::__cxx11::basic_string<char>}
s149038777
p04044
C++
#include<cstdio> #include<string> #include<algorithm> using namespace std; int main(){ int N, L; scanf("%d %d", &N, &L); string str[100]; for(int i=0; i<N; i++){ char tmp[L]; scanf("%s", tmp); str[i] = tmp; } sort(str, str+N); printf("%s", str.c_str()); return 0; }
a.cc: In function 'int main()': a.cc:19:20: error: request for member 'c_str' in 'str', which is of non-class type 'std::string [100]' {aka 'std::__cxx11::basic_string<char> [100]'} 19 | printf("%s", str.c_str()); | ^~~~~
s777417121
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()); for (int i = 0; i < N; i++) { cout << S.at(i); } endl; }
a.cc: In function 'int main()': a.cc:15:7: error: statement cannot resolve address of overloaded function 15 | endl; | ^
s719286491
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()); for (int i = 0; i < N; i++) cout << S.at(i); endl; }
a.cc: In function 'int main()': a.cc:13:7: error: statement cannot resolve address of overloaded function 13 | endl; | ^
s033000715
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()); for (int i = 0; i < N; i++) cout << S.at(i) << endl; }
a.cc: In function 'int main()': a.cc:9:45: error: expected ';' before 'sort' 9 | for (int i = 0; i < N; i++) cin >> S.at(i) | ^ | ; 10 | 11 | sort(S.begin(), S.end()); | ~~~~
s361528977
p04044
C++
#include <bits/stdc++.h> using namespace std; int main(){ stirng str[104]; int y; cin>>y; for(int i=0;i<y;i++){ cin>>str[i]; } sort(str,str+y); for(int i=0;i<y;i++){ cout<<str[i]; } cout<<endl; }
a.cc: In function 'int main()': a.cc:4:9: error: 'stirng' was not declared in this scope 4 | stirng str[104]; | ^~~~~~ a.cc:8:14: error: 'str' was not declared in this scope; did you mean 'std'? 8 | cin>>str[i]; | ^~~ | std a.cc:10:10: error: 'str' was not declared in this scope; did you mean 'std'? 10 | sort(str,str+y); | ^~~ | std
s216273091
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; i++) { cin >> S[i]; } sort(S.begin(), S.end()); string answer; for(int i = 0; i < N; i++) { answer += S[i]; } cout << answer << endl; }
a.cc: In function 'int main()': a.cc:13:10: error: request for member 'begin' in 'S', which is of non-class type 'std::string [N]' {aka 'std::__cxx11::basic_string<char> [N]'} 13 | sort(S.begin(), S.end()); | ^~~~~ a.cc:13:21: error: request for member 'end' in 'S', which is of non-class type 'std::string [N]' {aka 'std::__cxx11::basic_string<char> [N]'} 13 | sort(S.begin(), S.end()); | ^~~
s409387628
p04044
Java
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String[] NLarr = scan.nextLine().split(" "); //N개의 string을 입력받는다 int N = Integer.parseInt(NLarr[0]); //각 string은 L의 길이를 갖는다 int L = Integer.parseInt(NLarr[1]); //N개의 string을 저장할 배열을 생성한다. String[] strArr = new String[N]; String str = ""; //N개의 string을 입력받아 배열을 초기화한다. for(int i=0; i<N;){ str = scan.next().toLowerCase(); if(str.length() == L){ strArr[i] = str; i++; } } scan.close(); //앞자리의 숫자별(오름차순)으로 정렬한다. }*/ Arrays.sort(strArr); //최종 출력 String print=""; for(String _print : strArr){ print += _print; } System.out.println(print); } }
Main.java:32: error: illegal start of type }*/ ^ Main.java:34: error: <identifier> expected Arrays.sort(strArr); ^ Main.java:34: error: <identifier> expected Arrays.sort(strArr); ^ Main.java:39: error: illegal start of type for(String _print : strArr){ ^ Main.java:39: error: ';' expected for(String _print : strArr){ ^ Main.java:39: error: <identifier> expected for(String _print : strArr){ ^ Main.java:43: error: <identifier> expected System.out.println(print); ^ Main.java:43: error: <identifier> expected System.out.println(print); ^ Main.java:45: error: class, interface, enum, or record expected } ^ 9 errors
s704596972
p04044
Java
import java.util.*; import java.lang.StringBuilder; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); String[] line = sc.nextLine().split(" "); int num = Integer.parseInt(line[0]); int length = Integer.parseInt(line[1]); String[] arr = new String[num]; StringBuilder result = new StringBuilder(); for(int i = 0;i < num;i++){ arr[i] = sc.nextLine(); } Arrays.sort(arr); StringBuilder result = new StringBuilder(); for(int i = 0;i < num;i++){ result.append(arr[i]); } System.out.println(result.toString()); } }
Main.java:26: error: variable result is already defined in method main(String[]) StringBuilder result = new StringBuilder(); ^ 1 error
s155073142
p04044
C++
#include <iostream> #include <vector> std::string f(std::vector<std::string> s) { std::sort(s.begin(), s.end()); std::string result = ""; for (int i = 0; i < s.size(); i++) { result.append(s[i]); } return result; } int main() { int n, l; std::cin >> n >> l; std::vector<std::string> s; for (int i = 0; i < n; i++) { std::string tmp; std::cin >> tmp; s.push_back(tmp); } std::string result = f(s); std::cout << result << std::endl; return 0; }
a.cc: In function 'std::string f(std::vector<std::__cxx11::basic_string<char> >)': a.cc:5:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'? 5 | std::sort(s.begin(), s.end()); | ^~~~ | qsort
s392981197
p04044
C++
#include <iostream> #include <algorithm> #include <vector<> using namespace std; int main(){ int n,l; vector<string> s[110]; cin>>n>>l; 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:3:10: fatal error: vector<: No such file or directory 3 | #include <vector<> | ^~~~~~~~~ compilation terminated.
s433165488
p04044
C++
#include <iostream> #include <algorithm> using namespace std; int n,t; string a[101]; int main() { cin>>n>>t; for(int i=0;i<n;i++) cin>>a[i]; sort(a,a+n); for(int i=0;i<n;i++) cout<<b[i]; cout<<endl; }
a.cc: In function 'int main()': a.cc:13:15: error: 'b' was not declared in this scope 13 | cout<<b[i]; | ^
s542043610
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(void) { int n,l; cin>>n>>l; vector<string>v(n) for(int i=0;i<n;i++) cin>>v.at(i); sort(v.begin(),v.end()); for(int j=0;j<n;j++) cout<<v.at(j) cout<<endl; }
a.cc: In function 'int main()': a.cc:9:3: error: expected ',' or ';' before 'for' 9 | for(int i=0;i<n;i++) | ^~~ a.cc:9:15: error: 'i' was not declared in this scope 9 | for(int i=0;i<n;i++) | ^ a.cc:13:18: error: expected ';' before 'cout' 13 | cout<<v.at(j) | ^ | ; 14 | cout<<endl; | ~~~~
s130019906
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(void) { int n,l; cin>>n>>l; vectro<string>v(n) for(int i=0;i<n;i++) cin>>v.at(i); sort(v.begin(),v.end()); for(int j=0;j<n;j++) cout<<v.at(j) cout<<endl; }
a.cc: In function 'int main()': a.cc:8:3: error: 'vectro' was not declared in this scope 8 | vectro<string>v(n) | ^~~~~~ a.cc:8:16: error: expected primary-expression before '>' token 8 | vectro<string>v(n) | ^ a.cc:8:17: error: 'v' was not declared in this scope 8 | vectro<string>v(n) | ^ a.cc:9:15: error: 'i' was not declared in this scope 9 | for(int i=0;i<n;i++) | ^
s473856728
p04044
C++
#include <list> // ヘッダファイルインクルード #include <vector> #include <iostream> using namespace std; // 名前空間指定 int comp_str(string first_str, string second_str, int length){ int res = 1; int count_length = 0; while(count_length != 3){ char first_c = first_string[count_length]; char second_c = second_string[count_length]; if (first_c < second_c) { res = 1; break; } else if (first_c > second_c) { res = 2; break; } } return res; } int main() { int N, L; cin >> N; cin >> L; vector<string> s_v(N, ""); list<string> s_list_sorted; for (int i=0; i<N; i++){ cin >> s_v[i]; } for (int i=0; i<N; i++){ string s_first = s_v[0]; int min_index = 0; for (int j=1; j<N-i; j++){ string s_second = s_v[j]; int comp_res = comp_str(s_first, s_second, L); if (comp_res == 1) { } else if (comp_res == 2) { s_first = s_second; min_index = j; } } s_list_sorted.push_back(s_first); s_v.erase(s_v.begin() + j); } for(auto itr = list_sorted.begin(); itr != v.end(); ++itr) { cout >> *itr; } cout >> "" >> endl; }
a.cc: In function 'int comp_str(std::string, std::string, int)': a.cc:10:20: error: 'first_string' was not declared in this scope; did you mean 'first_str'? 10 | char first_c = first_string[count_length]; | ^~~~~~~~~~~~ | first_str a.cc:11:21: error: 'second_string' was not declared in this scope; did you mean 'second_str'? 11 | char second_c = second_string[count_length]; | ^~~~~~~~~~~~~ | second_str a.cc: In function 'int main()': a.cc:51:29: error: 'j' was not declared in this scope 51 | s_v.erase(s_v.begin() + j); | ^ a.cc:53:18: error: 'list_sorted' was not declared in this scope; did you mean 's_list_sorted'? 53 | for(auto itr = list_sorted.begin(); itr != v.end(); ++itr) { | ^~~~~~~~~~~ | s_list_sorted a.cc:53:46: error: 'v' was not declared in this scope 53 | for(auto itr = list_sorted.begin(); itr != v.end(); ++itr) { | ^ a.cc:56:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [1]') 56 | cout >> "" >> endl; | ~~~~ ^~ ~~ | | | | | const char [1] | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/list:80, 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:56:3: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 56 | cout >> "" >> endl; | ^~~~ In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:3: /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:56:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 56 | cout >> "" >> endl; | ^~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /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:56:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 56 | cout >> "" >> endl; | ^~ /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:56:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 56 | cout >> "" >> endl; | ^~ /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:56:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 56 | cout >> "" >> endl; | ^~ /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:56:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 56 | cout >> "" >> endl; | ^~ /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:56:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 56 | cout >> "" >> endl; | ^~ /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:56:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 56 | cout >> "" >> endl; | ^~ /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 = const char (&)[1]]': a.cc:56:11: required from here 56 | cout >> "" >> endl; | ^~ /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) | ^~~~~~~~
s856986343
p04044
C++
#include <list> // ヘッダファイルインクルード #include <vector> #include <iostream.h> using namespace std; // 名前空間指定 int comp_str(string first_str, string second_str, int length){ int res = 1; int count_length = 0; while(count_length != 3){ char first_c = first_string[count_length]; char second_c = second_string[count_length]; if (first_c < second_c) { res = 1; break; } else if (first_c > second_c) { res = 2; break; } } return res; } int main() { int N, L; cin >> N; cin >> L; vector<string> s_v(N, ""); list<string> s_list_sorted; for (int i=0; i<N; i++){ cin >> s_v[i]; } for (int i=0; i<N; i++){ string s_first = s_v[0]; int min_index = 0; for (int j=1; j<N-i; j++){ string s_second = s_v[j]; int comp_res = comp_str(s_first, s_second, L); if (comp_res == 1) { } else if (comp_res == 2) { s_first = s_second; min_index = j; } } s_list_sorted.push_back(s_first); s_v.erase(s_v.begin() + j); } for(auto itr = list_sorted.begin(); itr != v.end(); ++itr) { cout >> *itr; } cout >> "" >> endl; }
a.cc:3:10: fatal error: iostream.h: No such file or directory 3 | #include <iostream.h> | ^~~~~~~~~~~~ compilation terminated.
s241008208
p04044
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,L; cin >> N >> L; string str[N]; for (int i=0;i<N;i++){ for (int j=0;j<i;j++){ if(str[i]>str[j]){ str[i]=str[j]+str[i]; str[j]=""; } } } for (int i=0;i<N;i++){ cout << str[i] << endl; } ;
a.cc: In function 'int main()': a.cc:19:4: error: expected '}' at end of input 19 | ; | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s064111124
p04044
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,L; cin >> N >> L; string str[N]; for (i=0;i<N;i++){ for (j=0;j<i;j++){ if(str[i]>str[j]){ str[i]=str[j]+str[i]; str[j]=""; } } } for (i=o;i<N;i++){ cout << str[i] << endl; } ;
a.cc: In function 'int main()': a.cc:8:8: error: 'i' was not declared in this scope 8 | for (i=0;i<N;i++){ | ^ a.cc:9:10: error: 'j' was not declared in this scope 9 | for (j=0;j<i;j++){ | ^ a.cc:16:8: error: 'i' was not declared in this scope 16 | for (i=o;i<N;i++){ | ^ a.cc:16:10: error: 'o' was not declared in this scope 16 | for (i=o;i<N;i++){ | ^ a.cc:19:4: error: expected '}' at end of input 19 | ; | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s876988632
p04044
C++
#include<bits/stdc++.h> using namespace std; string a[101]; int n; int main(){ scanf("%d",&n); for(register i=0;i<n;++i) cin>>a[i]; sort(a,a+n); for(register i=0;i<n;++i) cout<<a[i]; return 0; }
a.cc: In function 'int main()': a.cc:7:18: error: 'i' does not name a type 7 | for(register i=0;i<n;++i) | ^ a.cc:7:22: error: expected ';' before 'i' 7 | for(register i=0;i<n;++i) | ^ | ; a.cc:7:22: error: 'i' was not declared in this scope a.cc:10:18: error: 'i' does not name a type 10 | for(register i=0;i<n;++i) | ^ a.cc:10:22: error: expected ';' before 'i' 10 | for(register i=0;i<n;++i) | ^ | ; a.cc:10:22: error: 'i' was not declared in this scope
s690733350
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.begin(), a.end()) for (const string s : a) { cout << s; } cout << endl; }
a.cc: In function 'int main()': a.cc:12:29: error: expected ';' before 'for' 12 | sort(a.begin(), a.end()) | ^ | ; 13 | 14 | for (const string s : a) { | ~~~
s557919939
p04044
C++
#include <iostream> #include <algorithm> #include <string> #include <math.h> #include <stdio.h> #include <set> using namespace std; int main(){ int n, l; cin>>n>>l; char k[n][l+1]; int i; for(i=0; i<n; i++){ cin>>k[i]; } sort(k, k+n); for(i=0; i<n; i++){ cout<<char[i]; } cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:18:9: error: no matching function for call to 'sort(char [n][(l + 1)], char (*)[(l + 1)])' 18 | sort(k, k+n); | ~~~~^~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /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:18:9: note: variable-sized array type 'char (*)[(l + 1)]' is not a valid template argument 18 | sort(k, k+n); | ~~~~^~~~~~~~ /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 a.cc:20:15: error: expected primary-expression before 'char' 20 | cout<<char[i]; | ^~~~
s783431473
p04044
C++
#include <iostream> #include <algorithm> #include <string> #include <math.h> #include <stdio.h> #include <set> using namespace std; int main(){ int n, l; cin>>n>>l; char [n][l+1]; int i; for(i=0; i<n; i++){ cin>>char[i]; } sort(char, char+n); for(i=0; i<n; i++){ cout<<char[i]; } cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:12:10: error: structured binding declaration cannot have type 'char' 12 | char [n][l+1]; | ^~~ a.cc:12:10: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' a.cc:12:11: error: conflicting declaration 'auto n' 12 | char [n][l+1]; | ^ a.cc:10:9: note: previous declaration as 'int n' 10 | int n, l; | ^ a.cc:12:13: error: expected initializer before '[' token 12 | char [n][l+1]; | ^ a.cc:15:14: error: expected primary-expression before 'char' 15 | cin>>char[i]; | ^~~~ a.cc:18:10: error: expected primary-expression before 'char' 18 | sort(char, char+n); | ^~~~ a.cc:18:16: error: expected primary-expression before 'char' 18 | sort(char, char+n); | ^~~~ a.cc:20:15: error: expected primary-expression before 'char' 20 | cout<<char[i]; | ^~~~
s637479202
p04044
C++
#include<bits/stc++.h> using namespace std; int main() { int n,k; cin >> n >> k; string temp; vector<string>v; while(n--){ cin >> temp; v.push_back(temp); } 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.
s605551427
p04044
C++
#include <iostream> #include <string> #include <algorithm> #include <string> 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]; } return 0; }
a.cc: In function 'int main()': a.cc:10:5: error: 'vector' was not declared in this scope 10 | vector<string> S(N); | ^~~~~~ a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 3 | #include <algorithm> +++ |+#include <vector> 4 | #include <string> a.cc:10:18: error: expected primary-expression before '>' token 10 | vector<string> S(N); | ^ a.cc:10:20: error: 'S' was not declared in this scope 10 | vector<string> S(N); | ^
s592696373
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.begin(), s.end()); string T; for (int j = o; j < N; j++) { T += s[i]; } cout << T << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:16: error: 'o' was not declared in this scope 17 | for (int j = o; j < N; j++) { | ^ a.cc:18:12: error: 'i' was not declared in this scope 18 | T += s[i]; | ^
s599661910
p04044
C++
#include<bits/stdio.h> using namespace std; int main () { int n, l; cin >> n >> l; vector<string> v; for (int i = 0;i < n; i++) { string s; cin >> s; v.push_back(s); } sort(v.begin(), v.end()); string ans; for (int i = 0; i < n;i++) { ans = ans + v[i]; } cout << ans << "\n"; }
In file included from a.cc:1: /usr/include/x86_64-linux-gnu/bits/stdio.h:23:3: error: #error "Never include <bits/stdio.h> directly; use <stdio.h> instead." 23 | # error "Never include <bits/stdio.h> directly; use <stdio.h> instead." | ^~~~~ a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope 6 | cin >> n >> l; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include<bits/stdio.h> +++ |+#include <iostream> 2 | using namespace std; a.cc:7:3: error: 'vector' was not declared in this scope 7 | vector<string> v; | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include<bits/stdio.h> +++ |+#include <vector> 2 | using namespace std; a.cc:7:10: error: 'string' was not declared in this scope 7 | vector<string> v; | ^~~~~~ a.cc:2:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' 1 | #include<bits/stdio.h> +++ |+#include <string> 2 | using namespace std; a.cc:7:18: error: 'v' was not declared in this scope 7 | vector<string> v; | ^ a.cc:9:11: error: expected ';' before 's' 9 | string s; | ^~ | ; a.cc:10:12: error: 's' was not declared in this scope 10 | cin >> s; | ^ a.cc:13:3: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort(v.begin(), v.end()); | ^~~~ | short a.cc:14:9: error: expected ';' before 'ans' 14 | string ans; | ^~~~ | ; a.cc:16:5: error: 'ans' was not declared in this scope 16 | ans = ans + v[i]; | ^~~ a.cc:18:3: error: 'cout' was not declared in this scope 18 | cout << ans << "\n"; | ^~~~ a.cc:18:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:18:11: error: 'ans' was not declared in this scope 18 | cout << ans << "\n"; | ^~~
s878998285
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[i]; sort(vec.begin(),vec.end()) for (int i = 0;i < N;++i) cout<<vec[i]; cout<<endl; }
a.cc: In function 'int main()': a.cc:10:30: error: expected ';' before 'for' 10 | sort(vec.begin(),vec.end()) | ^ | ; 11 | for (int i = 0;i < N;++i) | ~~~ a.cc:11:18: error: 'i' was not declared in this scope 11 | for (int i = 0;i < N;++i) | ^
s048393392
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[i]; sort(vec.begin(),vec.end()) for (int i = 0; i < N; ++i) cout<<vec[i]; cout<<endl; }
a.cc: In function 'int main()': a.cc:10:30: error: expected ';' before 'for' 10 | sort(vec.begin(),vec.end()) | ^ | ; 11 | for (int i = 0; i < N; ++i) | ~~~ a.cc:11:19: error: 'i' was not declared in this scope 11 | for (int i = 0; i < N; ++i) | ^
s817496385
p04044
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int N, L; cin >> N >> L; int a[60]; cin >> N >> L; for(int i = 0; i < N; i++)cin>>a[i]; sort(a, a + N); string ans; for(int i = 0; i < n; i++){ ans += a[i]; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:14:22: error: 'n' was not declared in this scope 14 | for(int i = 0; i < n; i++){ | ^
s135427307
p04044
Java
#include<iostream> #include <algorithm> #include <string> #include<math.h> #include<stdio.h> #include<vector> #define rep(i,n)for(int i=0;i<n;i++) //printf("%.yf\n",x); xを小数点以下y桁で using namespace std; int main() { int a, b; cin >> a >> b; vector<string>data(a); rep(i, a) { cin >> data[i]; } sort(data.begin(), data.end()); rep(i, a) { cout << data[i]; } cout << endl; return 0; }
Main.java:1: error: illegal character: '#' #include<iostream> ^ Main.java:2: error: illegal character: '#' #include <algorithm> ^ Main.java:3: error: illegal character: '#' #include <string> ^ Main.java:4: error: illegal character: '#' #include<math.h> ^ Main.java:5: error: illegal character: '#' #include<stdio.h> ^ Main.java:6: error: illegal character: '#' #include<vector> ^ Main.java:7: error: illegal character: '#' #define rep(i,n)for(int i=0;i<n;i++) ^ Main.java:7: error: class, interface, enum, or record expected #define rep(i,n)for(int i=0;i<n;i++) ^ Main.java:7: error: class, interface, enum, or record expected #define rep(i,n)for(int i=0;i<n;i++) ^ Main.java:12: error: not a statement cin >> a >> b; ^ Main.java:13: error: not a statement vector<string>data(a); ^ Main.java:15: error: not a statement cin >> data[i]; ^ Main.java:19: error: not a statement cout << data[i]; ^ Main.java:21: error: not a statement cout << endl; ^ Main.java:10: error: unnamed classes are a preview feature and are disabled by default. int main() { ^ (use --enable-preview to enable unnamed classes) Main.java:13: error: ';' expected vector<string>data(a); ^ Main.java:13: error: ';' expected vector<string>data(a); ^ Main.java:14: error: ';' expected rep(i, a) { ^ Main.java:18: error: ';' expected rep(i, a) { ^ 19 errors
s212803167
p04044
C++
#include<iostream> #include<string> #include<vector> using namespace std; int main() { // 整数の入力 uint64_t N, L; cin >> N >> L; vector<string> s; for (uint64_t i = 0; i < L; ++i) { cin >> s[i]; } sort(s.begin(), s.end()); for (uint64_t i = 0; i < L; ++i) { cout << s[i]; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:3: error: 'uint64_t' was not declared in this scope 8 | uint64_t N, L; | ^~~~~~~~ a.cc:4:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' 3 | #include<vector> +++ |+#include <cstdint> 4 | using namespace std; a.cc:9:10: error: 'N' was not declared in this scope 9 | cin >> N >> L; | ^ a.cc:9:15: error: 'L' was not declared in this scope 9 | cin >> N >> L; | ^ a.cc:11:16: error: expected ';' before 'i' 11 | for (uint64_t i = 0; i < L; ++i) { | ^~ | ; a.cc:11:24: error: 'i' was not declared in this scope 11 | for (uint64_t i = 0; i < L; ++i) { | ^ a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'short'? 14 | sort(s.begin(), s.end()); | ^~~~ | short a.cc:15:16: error: expected ';' before 'i' 15 | for (uint64_t i = 0; i < L; ++i) { | ^~ | ; a.cc:15:24: error: 'i' was not declared in this scope 15 | for (uint64_t i = 0; i < L; ++i) { | ^
s620163812
p04044
C++
#include <iostream> #include <vector> #include <algorithm> #include <iomanip> #include <cmath> using namespace std; typedef long long unsigned int ll; int main() { int a,b,c,d,i,j,k; cin >> a; vector<string> s(a); for(i=0;i<a;i++){ cin >>s[i]; } sort(s.begin(),s.end()); for(auto it=s.begin();it != s.end();it++){ cout << it ; } cout <<endl; return 0; }
a.cc: In function 'int main()': a.cc:22:14: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >') 22 | cout << it ; | ~~~~ ^~ ~~ | | | | | __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, 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 '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, 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 '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, 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 '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, 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 '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, 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 '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, 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 '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, 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 '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, 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 '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, 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 '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, 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 '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, 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 '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, 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 '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, 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 '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, 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 '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, 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
s070963474
p04044
C++
#include <iostream> #include <vector> #include <algorithm> #include <iomanip> #include <cmath> using namespace std; typedef long long unsigned int ll; int main() { int a,b,c,d,i,j,k; cin >> a; vector<string> s(a); for(i=0;i<a;i++){ cin >>s[i]; } sort(s.begin(),s.end()); for(auto it=s.begin();it != s.end();it++){ cout << s[it] ; } cout <<endl; return 0; }
a.cc: In function 'int main()': a.cc:22:18: error: no match for 'operator[]' (operand types are 'std::vector<std::__cxx11::basic_string<char> >' and '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >') 22 | cout << s[it] ; | ^ In file included from /usr/include/c++/14/vector:66, from a.cc:2: /usr/include/c++/14/bits/stl_vector.h:1128:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; reference = std::__cxx11::basic_string<char>&; size_type = long unsigned int]' 1128 | operator[](size_type __n) _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1128:28: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' to 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} 1128 | operator[](size_type __n) _GLIBCXX_NOEXCEPT | ~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:1147:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; const_reference = const std::__cxx11::basic_string<char>&; size_type = long unsigned int]' 1147 | operator[](size_type __n) const _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1147:28: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' to 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} 1147 | operator[](size_type __n) const _GLIBCXX_NOEXCEPT | ~~~~~~~~~~^~~
s453912797
p04044
C++
#include <iostream> #include <vector> #include <algorithm> #include <iomanip> #include <cmath> using namespace std; typedef long long unsigned int ll; int main() { int a,b,c,d,i,j,k; cin >> a; vector<string> s(a); for(i=0;i<n;i++){ cin >>s[i]; } sort(s.begin(),s.end()); for(auto it=s.begin();it != s.end();it++){ cout << s[i] ; } cout <<endl; return 0; }
a.cc: In function 'int main()': a.cc:16:13: error: 'n' was not declared in this scope 16 | for(i=0;i<n;i++){ | ^
s369092751
p04044
Java
#include<iostream> #include<cstdio> #include<cstring> #include <algorithm> using namespace std; int main() { string arr[102]; int n,m; while(scanf("%d%d",&n,&m) != EOF ) { for(int i = 0;i < n;i++) { cin>>arr[i]; } // for(int i = 0;i < n;i++) { // for(int j = 0;j < n;j++) { // if(arr[i]<arr[j]) { // string str = arr[i]; // arr[i] = arr[j]; // arr[j] = str; // } // } // } sort(arr,arr+n); for(int i = 0;i < n;i++) { cout<<arr[i]; } cout<<endl; } return 0; }
Main.java:1: error: illegal character: '#' #include<iostream> ^ Main.java:2: error: illegal character: '#' #include<cstdio> ^ Main.java:3: error: illegal character: '#' #include<cstring> ^ Main.java:4: error: illegal character: '#' #include <algorithm> ^ Main.java:13: error: not a statement cin>>arr[i]; ^ Main.java:26: error: not a statement cout<<arr[i]; ^ Main.java:28: error: not a statement cout<<endl; ^ Main.java:8: error: unnamed classes are a preview feature and are disabled by default. int main() { ^ (use --enable-preview to enable unnamed classes) Main.java:9: error: ']' expected string arr[102]; ^ Main.java:11: error: illegal start of expression while(scanf("%d%d",&n,&m) != EOF ) { ^ Main.java:11: error: illegal start of expression while(scanf("%d%d",&n,&m) != EOF ) { ^ 11 errors
s705656601
p04044
C
#include<stdio.h> #include<stdlib.h> #include<string.h> typedef struct { int num; const char *S[110]; } str; int compare_string(const void *a, const void *b) { /*struct str *A = (struct str *)a; struct str *B = (struct str *)b;*/ return strcmp(*(const str.S **)a, *(const str.S **)b); } /*int main() { struct string[110]; qsort(persons, 3, sizeof(struct Person), compare_person_id); printf("%s,%s,%s", persons[0].person_name, persons[1].person_name, persons[2].person_name); // 表示結果: "Chris,Bob,Ann" } int compare_string(const void *a,const void *b){ return strcmp(*(const char **)a,*(const char **)b); }*/ int main(){ int L,N,i; scanf("%d",&N); scanf("%d",&L); str string[110];/*=(str*)malloc(sizeof(str)*110); string.S=(char*)malloc(sizeof(char)*110); /*char *S[110]=(char*)malloc(110);{"xxx","yyy","zzz"};メモリ確保されていれば動く*/ for(i=0;i<N;i++){ scanf("%s",string[i].S); } qsort(string,N,sizeof(str),compare_string); for(i=0;i<N;i++){ printf("%s",string[i].S); } return 0; }
main.c: In function 'compare_string': main.c:16:34: error: expected ')' before '.' token 16 | return strcmp(*(const str.S **)a, *(const str.S **)b); | ~ ^ | ) main.c:16:9: error: conversion to non-scalar type requested 16 | return strcmp(*(const str.S **)a, *(const str.S **)b); | ^~~~~~ main.c:16:54: error: expected ')' before '.' token 16 | return strcmp(*(const str.S **)a, *(const str.S **)b); | ~ ^ | ) main.c:16:9: error: conversion to non-scalar type requested 16 | return strcmp(*(const str.S **)a, *(const str.S **)b); | ^~~~~~
s562643587
p04044
C
#include<stdio.h> #include<stdlib.h> #include<string.h> typedef struct { int num; const char *S[110]; } str; int compare_string(const void *a, const void *b) { struct str *A = (struct str *)a; struct str *B = (struct str *)b; return strcmp(*(struct char S **)a, *(struct char S **)b); } /*int main() { struct string[110]; qsort(persons, 3, sizeof(struct Person), compare_person_id); printf("%s,%s,%s", persons[0].person_name, persons[1].person_name, persons[2].person_name); // 表示結果: "Chris,Bob,Ann" } int compare_string(const void *a,const void *b){ return strcmp(*(const char **)a,*(const char **)b); }*/ int main(){ int L,N,i; scanf("%d",&N); scanf("%d",&L); str string[110];/*=(str*)malloc(sizeof(str)*110); string.S=(char*)malloc(sizeof(char)*110); /*char *S[110]=(char*)malloc(110);{"xxx","yyy","zzz"};メモリ確保されていれば動く*/ for(i=0;i<N;i++){ scanf("%s",string[i].S); } qsort(string,N,sizeof(str),compare_string); for(i=0;i<N;i++){ printf("%s",string[i].S); } return 0; }
main.c: In function 'compare_string': main.c:16:32: error: expected '{' before 'char' 16 | return strcmp(*(struct char S **)a, *(struct char S **)b); | ^~~~ main.c:16:32: error: two or more data types in declaration specifiers main.c:16:54: error: expected '{' before 'char' 16 | return strcmp(*(struct char S **)a, *(struct char S **)b); | ^~~~ main.c:16:54: error: two or more data types in declaration specifiers
s300679797
p04044
C++
#pragma warning(disable: 4786) #include <iostream> #include <vector> using namespace std; int main() { int N, L; cin >> N >> L; string s[N]; for (int i = 0; i < N; i++) cin >> s[i]; sort(s, s + N); for (int i = 0; i < N; i++) cout << s[i]; cout << "" << endl; }
a.cc: In function 'int main()': a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'short'? 14 | sort(s, s + N); | ^~~~ | short
s308108290
p04044
C++
#pragma warning(disable: 4786) #include <iostream> #include <vector> using namespace std; int main() { int N, L; cin >> N >> L; vector<string> str(N); for (int i = 0; i < N; i++) cin >> str.at(i); sort(str.begin(), str.end() ); for (int i = 0; i < N; i++) cout << str.at(i); cout << "" << endl; }
a.cc: In function 'int main()': a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'short'? 14 | sort(str.begin(), str.end() ); | ^~~~ | short
s327046068
p04044
C++
#include <iostream> #include <vector> using namespace std; int main() { int N, L; cin >> N >> L; vector<string> str(N); for (int i = 0; i < N; i++) cin >> str.at(i); sort(str.begin(), str.end()); for (int i = 0; i < N; i++) cout << str.at(i); cout << "" << endl; }
a.cc: In function 'int main()': a.cc:13:3: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort(str.begin(), str.end()); | ^~~~ | short
s866072716
p04044
C++
#include<iostream> #include<algorithm> #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()); for(int i=0;i<N;i++){ cout<<s[i]; } return 0; }
a.cc: In function 'int main()': a.cc:9:20: error: 'n' was not declared in this scope 9 | vector<string> s(n); | ^
s715597965
p04044
C++
#include <bits/stdc++.h> using namespace std; int main(void) { int N, L; cin >> N >> L; vector<string> ss(N); for (int i = 0; i < N ; i++) cin >> ss.at(i); sort(ss.begin(), ss.end()); for (int i = 0; i < N ; i++) cout << s.at(i); cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:40: error: 's' was not declared in this scope 12 | for (int i = 0; i < N ; i++) cout << s.at(i); | ^
s721392907
p04044
C++
#include <iostream> #include <algorithm> #include <vector> #include <string> #include <map> #include <set> #include <stack> #include <queue> using namespace std; int main() { int n, l; cin >> n >> l; string ans; vector<string> a(n);a for(int i = 0; i < n; i++) { cin >> a[i]; } sort(a.begin(), a.end()); for(int i = 0; i < n; i++) { ans += a[i]; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:15:24: error: expected ';' before 'for' 15 | vector<string> a(n);a | ^ | ; 16 | for(int i = 0; i < n; i++) { | ~~~ a.cc:16:18: error: 'i' was not declared in this scope 16 | for(int i = 0; i < n; i++) { | ^
s884342378
p04044
C++
#include <iostream> #include <algorithm> #include <vector> #include <string> #include <map> #include <set> #include <stack> #include <queue> using namespace std; int main() { int n, l; cin >> n >> l; string ans; vector<string> a(n);a for(int i = 0; i < n; i++) { cin >> a[i]; } sort(a.begin(), a.end()); for(int i = 0; i < n; i++) { ans += a[i]; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:15:24: error: expected ';' before 'for' 15 | vector<string> a(n);a | ^ | ; 16 | for(int i = 0; i < n; i++) { | ~~~ a.cc:16:18: error: 'i' was not declared in this scope 16 | for(int i = 0; i < n; i++) { | ^
s559009154
p04044
C++
#include <bits/stdc++.h> using namespace std; /* REPmacro */ #define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i) #define REPR(i,n) for(int i=((int)(n)-1);i>=0;--i) #define FOR(i,m,n) for(int i=(int)(m);i<(int)(n);++i) /*alias*/ #define ALL(x) (x).begin(),(x).end() #define SZ(x) ((int)(x).size()) #define F first #define S second #define PB push_back #define MP make_pair #define y0 y3487465 #define y1 y8687969 #define j0 j1347829 #define j1 j234892 #define next asdnext #define prev asdprev /*using*/ using ll = long long; using ull = unsigned long long; using unsi = unsigned; using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>; using pii = pair<int, int>; using db = double; using plex = complex<double>; using vs = vector<string>; /*template*/ template<class T>inline bool amax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>inline bool amin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } /* func */ /*struct*/ struct aaa{ aaa(){ cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20); }; }aaaaaaa; /* const */ const int INF = 1001001001; const ll LINF = 1001001001001001001ll; const int MOD = 1e9 + 7; //10^9 const db EPS = 1e-9; const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1}; //#define int ll //#define int long long signed main() { int n,l;cin >> n >> l; vector<string> s(n); REP(i,n) cin >> s[i]; sort(s,s+n); REP(i,l) cout << s[i]; return 0; }
a.cc: In function 'int main()': a.cc:66:11: error: no match for 'operator+' (operand types are 'std::vector<std::__cxx11::basic_string<char> >' and 'int') 66 | sort(s,s+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:66:12: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 66 | sort(s,s+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:66:12: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 66 | sort(s,s+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:66:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 66 | sort(s,s+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:66:12: note: mismatched types 'const _CharT*' and 'std::vector<std::__cxx11::basic_string<char> >' 66 | sort(s,s+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:66:12: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 66 | sort(s,s+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:66:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 66 | sort(s,s+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:66:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 66 | sort(s,s+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:66:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 66 | sort(s,s+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:66:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 66 | sort(s,s+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:66:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 66 | sort(s,s+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:66:12: note: mismatched types 'const _CharT*' and 'std::vector<std::__cxx11::basic_string<char> >' 66 | sort(s,s+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:66:12: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 66 | sort(s,s+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:66:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 66 | sort(s,s+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:66:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 66 | sort(s,s+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:66:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::complex<_Tp>' 66 | sort(s,s+n); | ^ /usr/incl
s008178353
p04044
C++
#include <bits/stdc++.h> using namespace std; /* REPmacro */ #define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i) #define REPR(i,n) for(int i=((int)(n)-1);i>=0;--i) #define FOR(i,m,n) for(int i=(int)(m);i<(int)(n);++i) /*alias*/ #define ALL(x) (x).begin(),(x).end() #define SZ(x) ((int)(x).size()) #define F first #define S second #define PB push_back #define MP make_pair #define y0 y3487465 #define y1 y8687969 #define j0 j1347829 #define j1 j234892 #define next asdnext #define prev asdprev /*using*/ using ll = long long; using ull = unsigned long long; using unsi = unsigned; using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>; using pii = pair<int, int>; using db = double; using plex = complex<double>; using vs = vector<string>; /*template*/ template<class T>inline bool amax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>inline bool amin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } /* func */ /*struct*/ struct aaa{ aaa(){ cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20); }; }aaaaaaa; /* const */ const int INF = 1001001001; const ll LINF = 1001001001001001001ll; const int MOD = 1e9 + 7; //10^9 const db EPS = 1e-9; const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1}; //#define int ll //#define int long long signed main() { int n,l;cin >> n >> l; vector<string> s(n); REP(i,n) cin >> s[i]; sort(ALL(s)); REP(i,k) cout << s[i]; return 0; }
a.cc: In function 'int main()': a.cc:68:9: error: 'k' was not declared in this scope 68 | REP(i,k) | ^ a.cc:5:39: note: in definition of macro 'REP' 5 | #define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i) | ^
s270685967
p04044
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int count = scanner.nextInt(); int length = scanner.nextInt(); List<String> strings = new ArrayList<>(); for (int ix = 0; ix < count; ix++) { strings.add(scanner.next()); } strings.sort(); StringBuilder builder = new StringBuilder(); for (String string : strings) { builder.add(string); } System.out.println(builder); } }
Main.java:14: error: method sort in interface List<E> cannot be applied to given types; strings.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 interface List Main.java:17: error: cannot find symbol builder.add(string); ^ symbol: method add(String) location: variable builder of type StringBuilder 2 errors
s681234454
p04044
Java
import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Scanner; public class B { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int L = sc.nextInt(); List<String> inputs = new ArrayList<String>(); for(int i = 0; i < N; i++) { inputs.add(sc.next()); } Collections.sort(inputs); String output = String.join("", inputs); System.out.println(output); } }
Main.java:7: error: class B is public, should be declared in a file named B.java public class B { ^ 1 error
s578525020
p04044
C++
#include <bits/stdc++.h> #include <math.h> using namespace std; #define cinf(n,x) for(int i=0;i<(n);i++) cin >> x[i]; int main(){ int N,L ; cin >> N >> L ; vector<string> S(n) ; cinf(N,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:9:20: error: 'n' was not declared in this scope 9 | vector<string> S(n) ; | ^
s585900762
p04044
C++
#include <iostream> #include <cstring> using namespace std; int main() { int StringNum, StringLength, i, j, cmp; char s[100][100]; cin >> StringNum >> StringLength; for(i=0; i < StringNum; i++) { cin >> s[i]; } for(i=0; i < StringNum-1; i++) { for(j=0; j < StringNum-1; j++) { cmp = strcmp(s[j], s[j+1]); if(cmp > 0) { swap(s[j], s[j+1]); } } } for(j=0; j < StringNum; j++) { cout << s[j]; } cout << endl; return 0; } ~
a.cc:32:2: error: expected class-name at end of input 32 | ~ | ^
s803996801
p04044
C++
include <iostream> #include <cstring> using namespace std; int main() { int StringNum, StringLength, i, j, cmp; char s[100][100]; cin >> StringNum >> StringLength; for(i=0; i < StringNum; i++) { cin >> s[i]; } for(i=0; i < StringNum-1; i++) { for(j=0; j < StringNum-1; j++) { cmp = strcmp(s[j], s[j+1]); if(cmp > 0) { swap(s[j], s[j+1]); } } } for(j=0; j < StringNum; j++) { cout << s[j]; } cout << endl; return 0; } ~
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:11:9: error: 'cin' was not declared in this scope 11 | cin >> StringNum >> StringLength; | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include <cstring> +++ |+#include <iostream> 3 | a.cc:20:15: error: 'swap' was not declared in this scope 20 | swap(s[j], s[j+1]); | ^~~~ a.cc:26:11: error: 'cout' was not declared in this scope 26 | cout << s[j]; | ^~~~ a.cc:26:11: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:28:9: error: 'cout' was not declared in this scope 28 | cout << endl; | ^~~~ a.cc:28:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:28:17: error: 'endl' was not declared in this scope 28 | cout << endl; | ^~~~ a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 2 | #include <cstring> +++ |+#include <ostream> 3 | a.cc: At global scope: a.cc:32:2: error: expected class-name at end of input 32 | ~ | ^
s913787685
p04044
C++
include <iostream> #include <cstring> using namespace std; int main() { int StringNum, StringLength, i, j, cmp; char s[100][100]; cin >> StringNum >> StringLength; for(i=0; i < StringNum; i++) { cin >> s[i]; } for(i=0; i < StringNum-1; i++) { for(j=0; j < StringNum-1; j++) { cmp = strcmp(s[j], s[j+1]); if(cmp > 0) { swap(s[j], s[j+1]); } } } for(j=0; j < StringNum; j++) { cout << s[j]; } cout << endl; return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:11:9: error: 'cin' was not declared in this scope 11 | cin >> StringNum >> StringLength; | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include <cstring> +++ |+#include <iostream> 3 | a.cc:20:15: error: 'swap' was not declared in this scope 20 | swap(s[j], s[j+1]); | ^~~~ a.cc:26:11: error: 'cout' was not declared in this scope 26 | cout << s[j]; | ^~~~ a.cc:26:11: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:28:9: error: 'cout' was not declared in this scope 28 | cout << endl; | ^~~~ a.cc:28:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:28:17: error: 'endl' was not declared in this scope 28 | cout << endl; | ^~~~ a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 2 | #include <cstring> +++ |+#include <ostream> 3 |
s624170035
p04044
C++
#include <iostream> using namespace std; int main(){ string s[100]; int n, l; cin >> n >> l; for(int i = 0; i < n; i++){ cin >> s[i]; } sort(s, s+n); for(int i = 0; i < n; i++){ cout << s[i]; } cout << endl; }
a.cc: In function 'int main()': a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(s, s+n); | ^~~~ | short
s171785390
p04044
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,N) for(int i=0;i<int(N);++i) #define rep1(i,N) for(int i=1;i<int(N);++i) int main() { int N,L; cin>>N>>L; vector<string> S(N); rep(i,N)cin>>S[i]; sort(all(S)); rep(i,N)cout<<S[i]; cout<<endl; }
a.cc: In function 'int main()': a.cc:11:14: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'? 11 | sort(all(S)); | ^~~ | std::filesystem::perms::all In file included from /usr/include/c++/14/filesystem:51, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200, from a.cc:1: /usr/include/c++/14/bits/fs_fwd.h:158:7: note: 'std::filesystem::perms::all' declared here 158 | all = 0777, | ^~~
s720632520
p04044
C++
#include<iostream> using namespace std; int main() { int n, l; cin >> n >> l; string s[n]; for (int i = 0; i < n; ++i) { cin >> s[i]; } sort(s, s + n); for (int i = 0; i < n; ++i) { cout << s[i]; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:5: error: 'sort' was not declared in this scope; did you mean 'short'? 9 | sort(s, s + n); | ^~~~ | short
s966966663
p04044
C
#include <iostream> using namespace std; int main(){ int n, l; cin >> n; cin >> l; string str[n]; string temp; for(int i = 0; i < n; i++) cin >> str[i]; for(int i = 0; i < n; i++){ for(int j = i + 1; j < n; j++){ if(str[i].compare(str[j]) > 0){ temp = str[i]; str[i] = str[j]; str[j] = temp; } } } for(int i = 0; i < n; i++) cout << str[i]; cout << endl; return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s421623902
p04044
C++
#include <iostream> 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]<<endl; } }
a.cc: In function 'int main()': a.cc:9:6: error: 'vector' was not declared in this scope 9 | vector<string>s(n); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include <iostream> +++ |+#include <vector> 2 | using namespace std; a.cc:9:19: error: expected primary-expression before '>' token 9 | vector<string>s(n); | ^ a.cc:9:20: error: 's' was not declared in this scope 9 | vector<string>s(n); | ^ a.cc:13:6: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort(s.begin(),s.end()); | ^~~~ | short
s804908572
p04044
C
#include <string> #include <iostream> #include <algorithm> #include <vector> using namespace std; int main() { vector<string> str; int N, L; cin >> N >> L; for (int i = 0; i < N; i++){ string str1; cin >> str1; str.push_back(str1); } sort(str.begin(), str.end()); for (int i = 0; i < N; i++) cout << str[i]; return 0; }
main.c:1:10: fatal error: string: No such file or directory 1 | #include <string> | ^~~~~~~~ compilation terminated.
s421558206
p04044
C
#include "pch.h" #include <string> #include <iostream> #include <algorithm> #include <vector> using namespace std; int main() { vector<string> str; int N, L; cin >> N >> L; for (int i = 0; i < N; i++){ string str1; cin >> str1; str.push_back(str1); } sort(str.begin(), str.end()); for (int i = 0; i < N; i++) cout << str[i]; return 0; }
main.c:1:10: fatal error: pch.h: No such file or directory 1 | #include "pch.h" | ^~~~~~~ compilation terminated.
s146469505
p04044
C++
// // ABC042B.cpp // programing // // Created by 毛利源 on 2019/01/29. // #include<iostream> using namespace std; int main(){ int N,L; std::cin >> N>>L; string S[N]; for (int i = 0; i < N; i++) { std::cin >> S[i]; } sort(S,S+N); for(int i=0;i<N;i++){ std::cout << S[i]; } std::cout << '\n'; return 0; }
a.cc: In function 'int main()': a.cc:19:5: error: 'sort' was not declared in this scope; did you mean 'short'? 19 | sort(S,S+N); | ^~~~ | short
s503338979
p04044
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; int main() { int N,L; string S[100]; cin >> N >> L; for (int i = 0; i < N; ++i) cin >> S[i]; sort(S, S + N, shoter<int>()); for (int i = 0; i < N; ++i) cout << S[i]; cout << endl; }
a.cc: In function 'int main()': a.cc:12:20: error: 'shoter' was not declared in this scope 12 | sort(S, S + N, shoter<int>()); | ^~~~~~ a.cc:12:27: error: expected primary-expression before 'int' 12 | sort(S, S + N, shoter<int>()); | ^~~
s747021982
p04044
C++
#include <iostream> #include <vector> #include <cstdlib> #include <cmath> using namespace std; int main (int argc, char const *argv[]) { int N,L; cin>>N>>L; //vector<型の種類> 名前(個数) 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]; } return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:20:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 20 | sort(S.begin(), S.end()); | ^~~~ | sqrt