submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s653351047
p04044
C++
3 3 dxx axx cxx
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 3 3 | ^
s883281545
p04044
C++
#include<iostream> using namespace std; int main() { int n, l; cin >> n >> l; string str[100]; for (int i = 0; i < n; ++i) { string s; cin >> s; str[i] = s; } sort(str, str + n); for (int i = 0; i < n; ++i) { cout << str[i]; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(str, str + n); | ^~~~ | short
s585820849
p04044
C++
#include <iostream> #include <bits/stdc++.h> #include <vector> #include <string> using namespace std; int main(){ int N, L; cin >> N >> K; vector<string> vec(101, ""); string ans = ""; for(int i = 0; i < N; i++) cin >> vec[i]; sort(vec.begin(), vec.end()); for(int i = 0;i < N; i++) ans += vec[i]; cout << ans; }
a.cc: In function 'int main()': a.cc:12:15: error: 'K' was not declared in this scope 12 | cin >> N >> K; | ^
s760991779
p04044
C++
#include <iostream> #include <string> using namespace std; int n, l; string s[100]; int main() { cin >> n >> l; int i; for (i = 0; i < n; i++) cin >> s[i]; sort(s, s + n); for (i = 0; i < n; i++) cout << s[i]; cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:13:9: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort(s, s + n); | ^~~~ | short
s921411105
p04044
C++
#include <bits/stdc++.h> using namespace std; int main (){ int N,L; cin >> N >> L; vector<string> s(N); for (string 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); } }
a.cc: In function 'int main()': a.cc:9:25: error: no match for 'operator<' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 9 | for (string i = 0; i < N; i++) { | ~ ^ ~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed: a.cc:9:27: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 9 | for (string i = 0; i < N; i++) { | ^ /usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed: a.cc:9:27: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 9 | for (string i = 0; i < N; i++) { | ^ /usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1317 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed: a.cc:9:27: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 9 | for (string i = 0; i < N; i++) { | ^ /usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed: a.cc:9:27: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 9 | for (string i = 0; i < N; i++) { | ^ /usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1485 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed: a.cc:9:27: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 9 | for (string i = 0; i < N; i++) { | ^ /usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed: a.cc:9:27: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 9 | for (string i = 0; i < N; i++) { | ^ /usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1660 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed: a.cc:9:27: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 9 | for (string i = 0; i < N; i++) { | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed: a.cc:9:27: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 9 | for (string i = 0; i < N; i++) { | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 448 | operator<(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed: a.cc:9:27: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | for (string i = 0; i < N; i++) { | ^ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 493 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed: a.cc:9:27: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | for (string i = 0; i < N; i++) { | ^ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1694 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed: a.cc:9:27: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | for (string i = 0; i < N; i++) { | ^ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1760 | operator<(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed: a.cc:9:27: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | for (string i = 0; i < N; i++) { | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 673 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed: a.cc:9:27: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 9 | for (string i = 0; i < N; i++) { | ^ /usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 680 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed: a.cc:9:27: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 9 | for (string i = 0; i < N; i++) { | ^ /usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed: a.cc:9:27: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 9 | for (string i = 0; i < N; i++) { | ^ /usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3874 | operator<(const basic_string<_CharT, _Traits,
s482783826
p04044
C
#include<stdio.h> int l; int han(char* a,char* b){ int i; for(i=0;i<l;i++){ if(a[i]>b[i])return -1; if(a[i]<b[i])return 1; } return 0; } int main(){ int n,i;scanf("%d%d",&n,&l); char s[100][101]; for(i=0;i<n;i++){ scanf("%s",s[i]); } int ans[100]; for(i=0;i<n;i++)ans[i]=i; for(i=0;i<n;i++){ for(j=0;j<n;i++){ if(han(s[ans[i]],s[ans[j])==-1){ int tmp=i; i=j; j=tmp; } } } for(i=0;i<n;i++)printf("%s",s[ans[i]]); return 0; }
main.c: In function 'main': main.c:21:9: error: 'j' undeclared (first use in this function) 21 | for(j=0;j<n;i++){ | ^ main.c:21:9: note: each undeclared identifier is reported only once for each function it appears in main.c:22:32: error: expected ']' before ')' token 22 | if(han(s[ans[i]],s[ans[j])==-1){ | ^ | ]
s436302480
p04044
C++
#include <iostream> #include <string> #include <algorithm> 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++){ bb += S[i]; } string bb=""; for(int i=0;i<N;i++){ bb += S[i]; } cout << bb << endl; }
a.cc: In function 'int main()': a.cc:15:9: error: 'bb' was not declared in this scope 15 | bb += S[i]; | ^~
s119047100
p04044
C++
#include <stdio.h> #include <iostream> #include <string.h> int main(){ int N, L; std::cin >> N >> L; std::string str[100] = {}; for(int i=0;i<N;i++){ std::cin >> str[i]; } sort(str, str+N); for(int i=0;i<N;i++){ std::cout << str[i]; } std::cout << std::endl; }
a.cc: In function 'int main()': a.cc:14:5: error: 'sort' was not declared in this scope; did you mean 'short'? 14 | sort(str, str+N); | ^~~~ | short
s097586589
p04044
Java
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int l = sc.nextInt(); // 使用しない String[] s = new String[n]; for (int i = 0; i < s.length; i++) { s[i] = sc.next(); } sc.close(); Arrays.sort(s); String sum = ""; for (String str : s) { sum += str; } System.out.println(sum); }
Main.java:26: error: reached end of file while parsing } ^ 1 error
s298807723
p04044
C++
#include <iostream> #include <utility> #include <vector> using namespace std; int main(){ int N,L; cin >> N >> L; vector<vector<char>> words; for(int i=0;i<N;i++){ for(int j=0;j<L;j++{ cin >> words.at(i).at(j); } } for(int i=1;i<N;i++){ for(int j=0;j<L;j++){ if (words.at(i-1).at(j)>words.at(i).at(j)){ std::swap(words.at(i-1),words.at(i)); } } } for(int i=0;i<N;i++){ for(int j=0;j<L;j++){ cout << words.at(i).at(j); } } }
a.cc: In function 'int main()': a.cc:11:27: error: expected ')' before '{' token 11 | for(int j=0;j<L;j++{ | ~ ^ | )
s962817167
p04044
C++
#include <iostream> #include <utility> #include <vector> using namespace std; int main(){ int N,L; cin >> N >> L; vector<vector<char>> words; for(int i=0;i<N;i++){ cin >> words.at(i) } for(int i=1;i<N;i++){ for(int j=0;j<L;j++){ if (words.at(i-1).at(j)>words.at(i).at(j)){ std::swap(words.at(i-1),words.at(i)); } } } for(int i=0;i<N;i++){ for(int j=0;j<L;j++){ cout << words.at(i).at(j); } } }
a.cc: In function 'int main()': a.cc:11:13: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type' {aka 'std::vector<char>'}) 11 | cin >> words.at(i) | ~~~ ^~ ~~~~~~~~~~~ | | | | | __gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type {aka std::vector<char>} | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type' {aka 'std::vector<char>'} to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type' {aka 'std::vector<char>'} to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type' {aka 'std::vector<char>'} to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type' {aka 'std::vector<char>'} to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type' {aka 'std::vector<char>'} to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type' {aka 'std::vector<char>'} to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type' {aka 'std::vector<char>'} to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type' {aka 'std::vector<char>'} to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type' {aka 'std::vector<char>'} to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type' {aka 'std::vector<char>'} to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type' {aka 'std::vector<char>'} to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type' {aka 'std::vector<char>'} to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type' {aka 'std::vector<char>'} to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type' {aka 'std::vector<char>'} to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type' {aka
s148884849
p04044
C++
#include <iostream> #include <utility> using namespace std; int main(){ int N,L; cin >> N >> L; string word; vector<string> words; for(int i=0;i<N;i++){ cin >> word; words(i)=word; } for(int i=1;i<N;i++){ for(int j=0;j<L;j++){ if ('words[i-1][j]'>'words[i][j]'){ std::swap(words[i-1],words[i]); } } } for(int i=0;i<N;i++){ cout << words[i] << endl; } }
a.cc:16:17: warning: multi-character literal with 13 characters exceeds 'int' size of 4 bytes 16 | if ('words[i-1][j]'>'words[i][j]'){ | ^~~~~~~~~~~~~~~ a.cc:16:33: warning: multi-character literal with 11 characters exceeds 'int' size of 4 bytes 16 | if ('words[i-1][j]'>'words[i][j]'){ | ^~~~~~~~~~~~~ a.cc: In function 'int main()': a.cc:9:5: error: 'vector' was not declared in this scope 9 | vector<string> words; | ^~~~~~ a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 2 | #include <utility> +++ |+#include <vector> 3 | using namespace std; a.cc:9:18: error: expected primary-expression before '>' token 9 | vector<string> words; | ^ a.cc:9:20: error: 'words' was not declared in this scope; did you mean 'word'? 9 | vector<string> words; | ^~~~~ | word
s580800167
p04044
C++
#include <iostream.h> #include <utility.h> using namespace std; int main(){ int N,L; cin >> N >> L; string word; vector<string> words; for(int i=0;i<N;i++){ cin >> word; words(i)=word; } for(int i=1;i<N;i++){ for(int j=0;j<L;j++){ if ('words[i-1][j]'>'words[i][j]'){ std::swap(words[i-1],words[i]); } } } for(int i=0;i<N;i++){ cout << words[i] << endl; } }
a.cc:1:10: fatal error: iostream.h: No such file or directory 1 | #include <iostream.h> | ^~~~~~~~~~~~ compilation terminated.
s964751365
p04044
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int L = sc.nextInt(); String[] S = new String[N]; for(int i=0; i<N; i++){ S[i] = sc.next(); } Arrays.sort(S); StringBuilder string = new StringBuilder(); for(i=0; i<N; i++){ string.append(S[i]); } System.out.println(string); } }
Main.java:13: error: cannot find symbol for(i=0; i<N; i++){ ^ symbol: variable i location: class Main Main.java:13: error: cannot find symbol for(i=0; i<N; i++){ ^ symbol: variable i location: class Main Main.java:13: error: cannot find symbol for(i=0; i<N; i++){ ^ symbol: variable i location: class Main Main.java:14: error: cannot find symbol string.append(S[i]); ^ symbol: variable i location: class Main 4 errors
s968949111
p04044
Java
import java.util.*; public class Main(){ public static void(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int L = sc.nextInt(); String[] S = new String[N]; for(int i=0; i<N; i++){ S[i] = sc.next(); } Arrays.sort(S); StringBuilder string = new StringBuilder(); for(i=0; i<N; i++){ string.append(S[i]); } System.out.println(string); } }
Main.java:2: error: '{' expected public class Main(){ ^ Main.java:3: error: <identifier> expected public static void(String[] args){ ^ 2 errors
s238927067
p04044
C++
#include <iostream> #include <fstream> #include <stdio.h> #include <math.h> #include <time.h> #include <string> #include <tuple> #include <vector> #include <map> #include <list> #include <set> #include <stack> #include <queue> #include <cstdlib> #include <algorithm> #include <random> #include <cassert> using namespace std; #define LL long long #define MP(a, b) make_pair(a, b) #define MMP(a, b, c) make_pair(make_pair(a, b), c) #define MAX 1000000000 #undef INT_MIN #undef INT_MAX #define INT_MIN -2147483648 #define INT_MAX 2147483647 #define LL_MIN -9223372036854775808 #define LL_MAX 9223372036854775807 #define PI 3.14159265359 int main(){ iostream::sync_with_stdio(false); int N,L: cin >> N >> L; vector<string> s; for(int i=0; i<N; i++){ string tmp; cin >> tmp; s.push_back(tmp); } sort(s.begin(), s.end()); for(int i=0; i<N; i++) cout << s[i]; cout << endl; return 0; } /* #include <iostream> #include <fstream> #include <stdio.h> #include <math.h> #include <time.h> #include <string> #include <tuple> #include <vector> #include <map> #include <list> #include <set> #include <stack> #include <queue> #include <cstdlib> #include <algorithm> #include <random> #include <cassert> using namespace std; #undef INT_MIN #undef INT_MAX #define INT_MIN -2147483648 #define INT_MAX 2147483647 #define LL_MIN -9223372036854775808 #define LL_MAX 9223372036854775807 #define PI 3.14159265359 int main(){ iostream::sync_with_stdio(false); return 0; } */
a.cc: In function 'int main()': a.cc:34:12: error: found ':' in nested-name-specifier, expected '::' 34 | int N,L: | ^ | :: a.cc:34:11: error: 'L' has not been declared 34 | int N,L: | ^ a.cc:35:9: error: qualified-id in declaration before '>>' token 35 | cin >> N >> L; | ^~
s148464040
p04044
Java
import java.util.*; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long x = sc.nextInt(); List<Long> sweet = new ArrayList<Long>(); for(int i=0;i<N;i++) { long a=sc.nextInt(); sweet.add(a); } Collections.sort(sweet); int num=0; for(int i=0;i<n;i++) { if(x - sweet.get(num) >= 0) { x = x - sweet.get(num); num++; } else { break; } } if(x > 0) { num -= 1; } System.out.println(num); } }
Main.java:20: error: cannot find symbol for(int i=0;i<n;i++) ^ symbol: variable n location: class Main 1 error
s726500576
p04044
C++
#include<bits/stdc++.h> using namesapce std; int main() { int n,l; cin>>n>>l; string a[n+2]; for(int i=0;i<n;i++) { cin>>a[i]; } sort(a,a+n); for(int i=0;i<n;i++) { cout<<a[i]; } }
a.cc:2:7: error: expected nested-name-specifier before 'namesapce' 2 | using namesapce std; | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin>>n>>l; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:7:5: error: 'string' was not declared in this scope 7 | string a[n+2]; | ^~~~~~ a.cc:7:5: note: suggested alternatives: In file included from /usr/include/c++/14/string:41, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ /usr/include/c++/14/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:10:14: error: 'a' was not declared in this scope 10 | cin>>a[i]; | ^ a.cc:12:10: error: 'a' was not declared in this scope 12 | sort(a,a+n); | ^ a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'std::sort'? 12 | sort(a,a+n); | ^~~~ | std::sort In file included from /usr/include/c++/14/algorithm:86, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here 296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last); | ^~~~ a.cc:15:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 15 | cout<<a[i]; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~
s869268352
p04044
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; import java.util.StringTokenizer; public class AtCoderAbc042A { public static void main(String[] args)throws Exception { BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer tokenizer = new StringTokenizer(input.readLine()); int n = Integer.parseInt(tokenizer.nextToken()); String [] a = new String[n]; for (int i = 0; i < a.length; i++) { a[i] = input.readLine(); } Arrays.sort(a); StringBuilder out = new StringBuilder(); for (int i = 0; i < n; i++) { out.append(a[i]); } System.out.println(out); } }
Main.java:6: error: class AtCoderAbc042A is public, should be declared in a file named AtCoderAbc042A.java public class AtCoderAbc042A { ^ 1 error
s843605044
p04044
C
#include<stdio.h> #include<string.h> int main(void) { int N,L; char moji[110][110],stock[110]; scanf("%d%d",&N,&L); for(int m = 0;m < N;m++) { scanf("%s",moji[m]); } for(int i = 0;i < N;i++) { for(int j = 0;j < N - 1;j++) { if(strcmp(moji[j],moji[j+1]) >= 0) { strcpy(stock,moji[j]); strcpy(moji[j],moji[j+1]); strcpy(moji[j+1],stcok); } } } for(int n = 0;n < N;n++){printf("%s",moji[n]);} return 0; }
main.c: In function 'main': main.c:23:29: error: 'stcok' undeclared (first use in this function); did you mean 'stock'? 23 | strcpy(moji[j+1],stcok); | ^~~~~ | stock main.c:23:29: note: each undeclared identifier is reported only once for each function it appears in
s433977595
p04044
C
#include<stdio.h> #include<string.h> int main(void) { int N,L; char moji[110][110],stock[110]; scanf("%d%d",&N,&L); for(int m = 0;m < N;m++) { scanf("%s",moji[m]); } for(int i = 0;i < N;i++) { for(int j = 0;j < N - 1;j++) { if(strcmp(moji[j],moji[j+1] >= 0)) { strcpy(stock,moji[j]); strcpy(moji[j],moji[j+1]); strcpy(moji[j+1],stcok); } } } for(int n = 0;n < N;n++){printf("%s",moji[n]);} return 0; }
main.c: In function 'main': main.c:19:35: error: passing argument 2 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 19 | if(strcmp(moji[j],moji[j+1] >= 0)) | ~~~~~~~~~~^~~~ | | | int In file included from main.c:2: /usr/include/string.h:156:50: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:23:29: error: 'stcok' undeclared (first use in this function); did you mean 'stock'? 23 | strcpy(moji[j+1],stcok); | ^~~~~ | stock main.c:23:29: note: each undeclared identifier is reported only once for each function it appears in
s656606267
p04044
C
#include<stdio.h> #include<string.h> int main(void) { int N,L; char moji[110][110],stock[110]; scanf("%d%d",&N,&L); for(int m = 0;m < N;m++) { scanf("%s",moji[m]); } for(int i = 0;i < N;i++) { for(int j = 0;j < N - 1;j++) { if(strcmp(moji[j],moji[j+1] >= 0) { strcpy(stock,moji[j]); strcpy(moji[j],moji[j+1]); strcpy(moji[j+1],stcok); } } } for(int n = 0;n < N;n++){printf("%s",moji[n]);} return 0; }
main.c: In function 'main': main.c:19:35: error: passing argument 2 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 19 | if(strcmp(moji[j],moji[j+1] >= 0) | ~~~~~~~~~~^~~~ | | | int In file included from main.c:2: /usr/include/string.h:156:50: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:19:40: error: expected ')' before '{' token 19 | if(strcmp(moji[j],moji[j+1] >= 0) | ~ ^ | ) 20 | { | ~ main.c:25:5: error: expected expression before '}' token 25 | } | ^
s634858128
p04044
C
#include<stdio.h> #include<string.h> main() {int N,L,i,j; char a[105][105]; char c[105]; scanf("%d",&N); for(int i=1;i<N;i++) {for(int j=1;j<L;j++) scanf("%s",a[j]); } for(int i=1;i<N;i++) {for(int j=1;j<N-i;j++) if(strcmp(a[j],a[j+1])>0) { strcpy(c,a[j+1]); strcpy(a[j+1],a[j]); strcpy(a[j],c); } for(int i=1;i<N;i++) {printf("%s",a[i]); }printf("\n"); }
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int] 3 | main() | ^~~~ main.c: In function 'main': main.c:26:33: error: expected declaration or statement at end of input 26 | } | ^
s895884714
p04044
C
#include<stdio.h> #include<string.h> main() {int N,L,i,j; char a[105][105]; char c[105]; scanf("%d",&N); for(int i=1;i<N;i++) {for(int j=1;j<L;j++) scanf("%s",a[j]); } for(int i=1;i<N;i++) {for(int j=1;j<N-i;j++) if(stcmp(a[j],a[j+1])>0) { strcpy(c,a[j+1]); strcpy(a[j+1],a[j]); strcpy(a[j],c); } for(int i=1;i<N;i++) {printf("%s",a[i]); }printf("\n") return 0;
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int] 3 | main() | ^~~~ main.c: In function 'main': main.c:14:36: error: implicit declaration of function 'stcmp'; did you mean 'strcmp'? [-Wimplicit-function-declaration] 14 | if(stcmp(a[j],a[j+1])>0) | ^~~~~ | strcmp main.c:22:22: error: expected ';' before 'return' 22 | }printf("\n") | ^ | ; 23 | 24 | return 0; | ~~~~~~ main.c:24:33: error: expected declaration or statement at end of input 24 | return 0; | ^~~~~~ main.c:24:33: error: expected declaration or statement at end of input
s970301153
p04044
C
#include<stdio.h> #include<string.h> main() {int N,L,i,j; char a[105][105]; char c[105]; scanf("%d",&N); for(int i=1;i<N;i++) {for(int j=1;j<L;j++) scanf("%s",str[j]); } for(int i=1;i<N;i++) {for(int j=1;j<N-i;j++) if(stcmp(a[j],a[j+1])>0) { strcpy(c,a[j+1]); strcpy(a[j+1],a[j]); strcpy(a[j],c); } for(int i=1;i<N;i++) {printf("%s",a[i]); }printf("\n") return 0; }
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int] 3 | main() | ^~~~ main.c: In function 'main': main.c:10:20: error: 'str' undeclared (first use in this function) 10 | scanf("%s",str[j]); | ^~~ main.c:10:20: note: each undeclared identifier is reported only once for each function it appears in main.c:14:36: error: implicit declaration of function 'stcmp'; did you mean 'strcmp'? [-Wimplicit-function-declaration] 14 | if(stcmp(a[j],a[j+1])>0) | ^~~~~ | strcmp main.c:22:22: error: expected ';' before 'return' 22 | }printf("\n") | ^ | ; 23 | 24 | return 0; | ~~~~~~ main.c:25:33: error: expected declaration or statement at end of input 25 | } | ^
s492489282
p04044
C++
#include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using namespace std; char a[1005]; char c[1005]; int main() {int N,L,i,j; scanf("%d %d",&N,&L); for(int i=1;i<=N;i++) scanf("%s",a[i]); for(int i=1;i<N;i++) {for(int j=1;j<N-i;j++) if(strcmp(a[j],a[j+1])>0) { strcpy(c,a[j+1]); strcpy(a[j+1],a[j]); strcpy(a[j],c); } } for(int i=1;i<N;i++) {printf("%s",a[i]); } printf("\n"); return 0; }
a.cc: In function 'int main()': a.cc:18:46: error: invalid conversion from 'char' to 'const char*' [-fpermissive] 18 | if(strcmp(a[j],a[j+1])>0) | ~~~^ | | | char In file included from /usr/include/c++/14/cstring:43, from a.cc:2: /usr/include/string.h:156:32: note: initializing argument 1 of 'int strcmp(const char*, const char*)' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ a.cc:18:53: error: invalid conversion from 'char' to 'const char*' [-fpermissive] 18 | if(strcmp(a[j],a[j+1])>0) | ~~~~~^ | | | char /usr/include/string.h:156:50: note: initializing argument 2 of 'int strcmp(const char*, const char*)' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ a.cc:19:39: error: invalid conversion from 'char' to 'const char*' [-fpermissive] 19 | { strcpy(c,a[j+1]); | ~~~~~^ | | | char /usr/include/string.h:141:70: note: initializing argument 2 of 'char* strcpy(char*, const char*)' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~ a.cc:20:37: error: invalid conversion from 'char' to 'char*' [-fpermissive] 20 | strcpy(a[j+1],a[j]); | ~~~~~^ | | | char /usr/include/string.h:141:39: note: initializing argument 1 of 'char* strcpy(char*, const char*)' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~^~~~~~ a.cc:20:42: error: invalid conversion from 'char' to 'const char*' [-fpermissive] 20 | strcpy(a[j+1],a[j]); | ~~~^ | | | char /usr/include/string.h:141:70: note: initializing argument 2 of 'char* strcpy(char*, const char*)' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~ a.cc:21:35: error: invalid conversion from 'char' to 'char*' [-fpermissive] 21 | strcpy(a[j],c); | ~~~^ | | | char /usr/include/string.h:141:39: note: initializing argument 1 of 'char* strcpy(char*, const char*)' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~^~~~~~
s113284933
p04044
C++
#include <iostream> #include <vector> #include <algorithm> #include <numeric> #include <string> using namespace std; int main() { int L, N; cin >> N >> L; vector<string> s(N); for (int i = 0; i < N; ++i) { cin >> s[i]; } sort(s.begin(), s.end(), [](string s1, string s2) { return strcmp(s1.c_str(), s2.c_str()) < 0; }); for (auto &_s : s) { cout << _s; } cout << endl; return 0; }
a.cc: In lambda function: a.cc:19:16: error: 'strcmp' was not declared in this scope 19 | return strcmp(s1.c_str(), s2.c_str()) < 0; | ^~~~~~ a.cc:5:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <numeric> +++ |+#include <cstring> 5 | #include <string>
s117302776
p04044
C++
#include <iostream> #include <algorithm> #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); for(int i = 0; i < n; i++){ cout << s[i]; } return 0; }
a.cc: In function 'int main()': a.cc:8:16: error: found ':' in nested-name-specifier, expected '::' 8 | cin >> n >> l: | ^ | :: a.cc:8:15: error: 'l' is not a class, namespace, or enumeration 8 | cin >> n >> l: | ^ a.cc:10:41: error: 's' was not declared in this scope 10 | for (int i = 0 ; i < n; i++) { cin >> s[i]; } | ^ a.cc:11:8: error: 's' was not declared in this scope 11 | sort(s, s + n); | ^
s758327918
p04044
C++
#include <iostream> #include <string> #include <vector> #include<algrithm> typedef unsigned int UINT; using namespace std; int main(void) { int N, L; cin >> N >> L; vector<string> mas(L); for (string & s : mas) { cin >> s; } sort(mas.begine(), mas.end()); string ans = ""; for (string s : mas) { ans += s; } cout << ans << endl; return 0; }
a.cc:4:9: fatal error: algrithm: No such file or directory 4 | #include<algrithm> | ^~~~~~~~~~ compilation terminated.
s047055003
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,l; cin>>n>>l; string a[n]; for(i=0;i<n;i++){ cin>>a[i]; } sort(a,a+n); for(i=0;i<n;i++) { cout<<a[i]<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:7:9: error: 'i' was not declared in this scope 7 | for(i=0;i<n;i++){ | ^ a.cc:11:9: error: 'i' was not declared in this scope 11 | for(i=0;i<n;i++) | ^
s555415024
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,l; cin>>n>>l; string a[n]; for(i=0;i<n;i++){ cin>>a[i]; } sort(a,a+n); for(i=0;i<n;i++) { cout<<a[i]<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:7:9: error: 'i' was not declared in this scope 7 | for(i=0;i<n;i++){ | ^ a.cc:11:9: error: 'i' was not declared in this scope 11 | for(i=0;i<n;i++) | ^
s628800617
p04044
C++
#include <iostream> #include <algorithm> #include <string> using namespace std; int main(){ int len, n; cin >> len >> n; string s[n]; for(int i = 0; i < n; i++){ cin >> s[i]; } sort(s.begin(), s.end()); for(int i = 0; i < n; i++){ cout << s[i]; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:16:10: error: request for member 'begin' in 's', which is of non-class type 'std::string [n]' {aka 'std::__cxx11::basic_string<char> [n]'} 16 | sort(s.begin(), s.end()); | ^~~~~ a.cc:16:21: error: request for member 'end' in 's', which is of non-class type 'std::string [n]' {aka 'std::__cxx11::basic_string<char> [n]'} 16 | sort(s.begin(), s.end()); | ^~~
s534215454
p04044
C++
N, L = map(int, input().split()) s = [0 for i in range(N)] for i in range(N): s[i] = input() s.sort() output = "" for i in range(L): output += s[i] print(output)
a.cc:1:1: error: 'N' does not name a type 1 | N, L = map(int, input().split()) | ^
s770891640
p04044
C++
N,L=map(int,input().split()) l=[] for i in range(N): l.append(input()) print("".join(sorted(l)))
a.cc:1:1: error: 'N' does not name a type 1 | N,L=map(int,input().split()) | ^
s732227734
p04044
C++
#include<iostream> #include<string> #include<math.h> #include<algorithm> #include<vector> using namespace std; typedef long long ll; #define N (1000000000+7) int main(void) { int n, l; cin >> n >> l; vector<string>s(n); for (int i = 0;i < n;i++)cin >> s[i]; sort(s.begin(), s.end()); for (int i = 0;i < n;i++)cout << s[i]; cout << endl; re
a.cc: In function 'int main()': a.cc:19:9: error: 're' was not declared in this scope 19 | re | ^~ a.cc:19:11: error: expected '}' at end of input 19 | re | ^ a.cc:11:16: note: to match this '{' 11 | int main(void) { | ^
s339786673
p04044
C++
#include <iostream> #include <stdlib.h> #include <string> int comp(const void *a, const void *b) { return strcmp((char*)a,(char*)b); } #define MAX 1000 using namespace std; int main() { int N, L; string str[MAX], result; cin >> N >> L; for(int i = 0; i < N; i++) cin >> str[i]; qsort(str, N, sizeof(str[0]), comp); for(int i = 0; i < N; i++) result += str[i]; cout << result << endl; }
a.cc: In function 'int comp(const void*, const void*)': a.cc:5:10: error: 'strcmp' was not declared in this scope 5 | { return strcmp((char*)a,(char*)b); } | ^~~~~~ a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <stdlib.h> +++ |+#include <cstring> 3 | #include <string>
s475053134
p04044
C++
#include <iostream> #include <stdlib.h> int comp(const void *a, const void *b) { return strcmp((char*)a,(char*)b); } #define MAX 1000 using namespace std; int main() { int N, L; string str[MAX], result; cin >> N >> L; for(int i = 0; i < N; i++) cin >> str[i]; qsort(str, N, sizeof(str[0]), comp); for(int i = 0; i < N; i++) result += str[i]; cout << result << endl; }
a.cc: In function 'int comp(const void*, const void*)': a.cc:4:10: error: 'strcmp' was not declared in this scope 4 | { return strcmp((char*)a,(char*)b); } | ^~~~~~ a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <stdlib.h> +++ |+#include <cstring> 3 | int comp(const void *a, const void *b)
s723330246
p04044
C++
#include<cstdio> #include<cstring> #include<algorithm> #include<iostream> using namespace std; const int N = 10005; int s[N]; bool cmp(string a, string b){ return a < b; } int main(){ int n, l; scanf("%d %d", &n, &l); for(int i = 1; i <= n; i++) scanf("%d", &s[i]); sort(s+1, s+1+n, cmp); for(int i = 1; i <= n; i++) printf("%s", s[i]); return 0; }
In file included from /usr/include/c++/14/bits/stl_algobase.h:71, from /usr/include/c++/14/algorithm:60, from a.cc:3: /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = int*; _Iterator2 = int*; _Compare = bool (*)(std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>)]': /usr/include/c++/14/bits/stl_algo.h:1777:14: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(__cxx11::basic_string<char>, __cxx11::basic_string<char>)>]' 1777 | if (__comp(__i, __first)) | ~~~~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(__cxx11::basic_string<char>, __cxx11::basic_string<char>)>]' 1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(__cxx11::basic_string<char>, __cxx11::basic_string<char>)>]' 1908 | std::__final_insertion_sort(__first, __last, __comp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4805:18: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = int*; _Compare = bool (*)(__cxx11::basic_string<char>, __cxx11::basic_string<char>)]' 4805 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:17:9: required from here 17 | sort(s+1, s+1+n, cmp); | ~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/predefined_ops.h:158:30: error: could not convert '* __it1' from 'int' to 'std::__cxx11::basic_string<char>' 158 | { return bool(_M_comp(*__it1, *__it2)); } | ~~~~~~~^~~~~~~~~~~~~~~~ | | | int /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Val_comp_iter<_Compare>::operator()(_Value&, _Iterator) [with _Value = int; _Iterator = int*; _Compare = bool (*)(std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>)]': /usr/include/c++/14/bits/stl_algo.h:1757:20: required from 'void std::__unguarded_linear_insert(_RandomAccessIterator, _Compare) [with _RandomAccessIterator = int*; _Compare = __gnu_cxx::__ops::_Val_comp_iter<bool (*)(__cxx11::basic_string<char>, __cxx11::basic_string<char>)>]' 1757 | while (__comp(__val, __next)) | ~~~~~~^~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1785:36: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(__cxx11::basic_string<char>, __cxx11::basic_string<char>)>]' 1785 | std::__unguarded_linear_insert(__i, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ 1786 | __gnu_cxx::__ops::__val_comp_iter(__comp)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(__cxx11::basic_string<char>, __cxx11::basic_string<char>)>]' 1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(__cxx11::basic_string<char>, __cxx11::basic_string<char>)>]' 1908 | std::__final_insertion_sort(__first, __last, __comp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4805:18: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = int*; _Compare = bool (*)(__cxx11::basic_string<char>, __cxx11::basic_string<char>)]' 4805 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:17:9: required from here 17 | sort(s+1, s+1+n, cmp); | ~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/predefined_ops.h:240:30: error: could not convert '__val' from 'int' to 'std::__cxx11::basic_string<char>' 240 | { return bool(_M_comp(__val, *__it)); } | ~~~~~~~^~~~~~~~~~~~~~ | | | int /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_comp_val<_Compare>::operator()(_Iterator, _Value&) [with _Iterator = int*; _Value = int; _Compare = bool (*)(std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>)]': /usr/include/c++/14/bits/stl_heap.h:140:48: required from 'void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare&) [with _RandomAccessIterator = int*; _Distance = long int; _Tp = int; _Compare = __gnu_cxx::__ops::_Iter_comp_val<bool (*)(__cxx11::basic_string<char>, __cxx11::basic_string<char>)>]' 140 | while (__holeIndex > __topIndex && __comp(__first + __parent, __value)) | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:247:23: required from 'void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = int*; _Distance = long int; _Tp = int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(__cxx11::basic_string<char>, __cxx11::basic_string<char>)>]' 247 | std::__push_heap(__first, __holeIndex, __topIndex, | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 248 | _GLIBCXX_MOVE(__value), __cmp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:356:22: required from 'void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = int*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(__cxx11::basic_string<char>, __cxx11::basic_string<char>)>]' 356 | std::__adjust_heap(__first, __parent, __len, _GLIBCXX_MOVE(__value), | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 357 | __comp); | ~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1593:23: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(__cxx11::basic_string<char>, __cxx11::basic_string<char>)>]' 1593 | std::__make_heap(__first, __middle, __comp); | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1868:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(__cxx11::basic_string<char>, __cxx11::basic_string<char>)>]' 1868 | std::__heap_select(__first, __middle, __last, __comp); | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1884:27: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int*; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(__cxx11::basic_string<char>, __cxx11::basic_string<char>)>]' 1884 | std::__partial_sort(__first, __last, __last, __comp); | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1905:25: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(__cxx11::basic_string<char>, __cxx11::basic_string<char>)>]' 1905 | std::__introsort_loop(__first, __last, | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1907 | __comp); | ~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4805:18: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = int*; _Compare = bool (*)(__cxx11::basic_string<char>, __cxx11::basic_string<char>)]' 4805 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:17:9: required from here 17 | sort(s+1, s+1+n, cmp); | ~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/predefined_ops.h:196:30: error: could not convert '* __it' from 'int' to 'std::__cxx11::basic_string<char>' 196 | { return bool(_M_comp(*__it, __val)); } | ~~~~~~~^~~~~~~~~~~~~~ | | | int
s274382468
p04044
C++
#include<iostream> #include<cstdio> #include<cstring> #include<cmath> using namespace std; int a,n; string b[105]; int main() { //freopen("bfr.in","r",stdin); //freopen("bfr.out","w",stdout); cin>>a>>n; for(int s=0;s<a;s++) { cin>>b[s]; } sort(b,b+a); for(int s=0;s<a;s++) cout<<b[s]; cout<<endl; //fclose(stdin); //fclose(stdout); return 0; }
a.cc: In function 'int main()': a.cc:17:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 17 | sort(b,b+a); | ^~~~ | sqrt
s981675259
p04044
C++
int main() { int n,l; cin >>n>> l; int i,j; char s[100][100]; for (i = 0; i < n; i++) { for (j = 0; j < l; j++) { cin >> s[i][j]; } } int jun[100]; for (i = 0; i < n; i++) { jun[i] = i; } for (i = 1; i < n; i++) { for (j = i - 1; j >= 0; j--) { int k=0; int a; while (s[i][k] == s[j][k]) { k++; if (k = l + 1)k = l; break; } if (k == l); else { if (s[i][k] < s[j][k]) { a = jun[i]; jun[i] = jun[j]; jun[j] = a; } } } } int p[100]; for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { if (jun[j] == i) p[i] = j; } } for (i = 0; i < n; i++) { for (j = 0; j < l; j++) { cout << s[p[i]][j]; } } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:3:9: error: 'cin' was not declared in this scope 3 | cin >>n>> l; | ^~~ a.cc:43:25: error: 'cout' was not declared in this scope 43 | cout << s[p[i]][j]; | ^~~~ a.cc:46:9: error: 'cout' was not declared in this scope 46 | cout << endl; | ^~~~ a.cc:46:17: error: 'endl' was not declared in this scope 46 | cout << endl; | ^~~~
s333539556
p04044
C++
int main() { int n,l; cin >>n>> l; int i,j; char s[100][100]; for (i = 0; i < n; i++) { for (j = 0; j < l; j++) { cin >> s[i][j]; } } int jun[100]; for (i = 0; i < n; i++) { jun[i] = i; } for (i = 1; i < n; i++) { for (j = i - 1; j >= 0; j--) { int k=0; int a; while (s[i][k] == s[j][k]) { k++; if (k = l + 1)k = l; break; } if (k == l); else { if (s[i][k] < s[j][k]) { a = jun[i]; jun[i] = jun[j]; jun[j] = a; } } } } int p[100]; for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { if (jun[j] == i) p[i] = j; } } for (i = 0; i < n; i++) { for (j = 0; j < l; j++) { cout << s[p[i]][j]; } } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:3:9: error: 'cin' was not declared in this scope 3 | cin >>n>> l; | ^~~ a.cc:43:25: error: 'cout' was not declared in this scope 43 | cout << s[p[i]][j]; | ^~~~ a.cc:46:9: error: 'cout' was not declared in this scope 46 | cout << endl; | ^~~~ a.cc:46:17: error: 'endl' was not declared in this scope 46 | cout << endl; | ^~~~
s867333538
p04044
C++
#include<iostream> #include<string> #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[i]; } sort(str.begin(),str.end()); for(int i=0; i<n; i++){ cout << str[i] ; } cout<<endl; }
a.cc: In function 'int main()': a.cc:14:5: error: 'sort' was not declared in this scope; did you mean 'short'? 14 | sort(str.begin(),str.end()); | ^~~~ | short
s288076694
p04044
C++
#include<iostream> #include<algorithm> using namespace std; struct A { char c[101]; }a[101]; int main() { int n,i,j; char x[10]; cin>>n; cin>>x; for(i=0;i<=n-1;i++) cin>>a[i].c; sort(a,a+n); for(i=0;i<=n-1;i++) cout<<a[i].c; cout<<endl; return 0; }
In file included from /usr/include/c++/14/bits/stl_algobase.h:71, from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_less_iter::operator()(_Iterator1, _Iterator2) const [with _Iterator1 = A*; _Iterator2 = A*]': /usr/include/c++/14/bits/stl_algo.h:1777:14: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = A*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1777 | if (__comp(__i, __first)) | ~~~~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = A*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = A*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1908 | std::__final_insertion_sort(__first, __last, __comp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = A*]' 4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:14:6: required from here 14 | sort(a,a+n); | ~~~~^~~~~~~ /usr/include/c++/14/bits/predefined_ops.h:45:23: error: no match for 'operator<' (operand types are 'A' and 'A') 45 | { return *__it1 < *__it2; } | ~~~~~~~^~~~~~~~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:1241:5: note: candidate: 'template<class _IteratorL, class _IteratorR, class _Container> bool __gnu_cxx::operator<(const __normal_iterator<_IteratorL, _Container>&, const __normal_iterator<_IteratorR, _Container>&)' 1241 | operator<(const __normal_iterator<_IteratorL, _Container>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1241:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:45:23: note: 'A' is not derived from 'const __gnu_cxx::__normal_iterator<_IteratorL, _Container>' 45 | { return *__it1 < *__it2; } | ~~~~~~~^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1249:5: note: candidate: 'template<class _Iterator, class _Container> bool __gnu_cxx::operator<(const __normal_iterator<_Iterator, _Container>&, const __normal_iterator<_Iterator, _Container>&)' 1249 | operator<(const __normal_iterator<_Iterator, _Container>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1249:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:45:23: note: 'A' is not derived from 'const __gnu_cxx::__normal_iterator<_Iterator, _Container>' 45 | { return *__it1 < *__it2; } | ~~~~~~~^~~~~~~~ /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Val_less_iter::operator()(_Value&, _Iterator) const [with _Value = A; _Iterator = A*]': /usr/include/c++/14/bits/stl_algo.h:1757:20: required from 'void std::__unguarded_linear_insert(_RandomAccessIterator, _Compare) [with _RandomAccessIterator = A*; _Compare = __gnu_cxx::__ops::_Val_less_iter]' 1757 | while (__comp(__val, __next)) | ~~~~~~^~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1785:36: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = A*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1785 | std::__unguarded_linear_insert(__i, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ 1786 | __gnu_cxx::__ops::__val_comp_iter(__comp)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = A*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = A*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1908 | std::__final_insertion_sort(__first, __last, __comp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = A*]' 4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:14:6: required from here 14 | sort(a,a+n); | ~~~~^~~~~~~ /usr/include/c++/14/bits/predefined_ops.h:98:22: error: no match for 'operator<' (operand types are 'A' and 'A') 98 | { return __val < *__it; } | ~~~~~~^~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1241:5: note: candidate: 'template<class _IteratorL, class _IteratorR, class _Container> bool __gnu_cxx::operator<(const __normal_iterator<_IteratorL, _Container>&, const __normal_iterator<_IteratorR, _Container>&)' 1241 | operator<(const __normal_iterator<_IteratorL, _Container>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1241:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:98:22: note: 'A' is not derived from 'const __gnu_cxx::__normal_iterator<_IteratorL, _Container>' 98 | { return __val < *__it; } | ~~~~~~^~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1249:5: note: candidate: 'template<class _Iterator, class _Container> bool __gnu_cxx::operator<(const __normal_iterator<_Iterator, _Container>&, const __normal_iterator<_Iterator, _Container>&)' 1249 | operator<(const __normal_iterator<_Iterator, _Container>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1249:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:98:22: note: 'A' is not derived from 'const __gnu_cxx::__normal_iterator<_Iterator, _Container>' 98 | { return __val < *__it; } | ~~~~~~^~~~~~~ /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_less_val::operator()(_Iterator, _Value&) const [with _Iterator = A*; _Value = A]': /usr/include/c++/14/bits/stl_heap.h:140:48: required from 'void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare&) [with _RandomAccessIterator = A*; _Distance = long int; _Tp = A; _Compare = __gnu_cxx::__ops::_Iter_less_val]' 140 | while (__holeIndex > __topIndex && __comp(__first + __parent, __value)) | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:247:23: required from 'void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = A*; _Distance = long int; _Tp = A; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 247 | std::__push_heap(__first, __holeIndex, __topIndex, | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 248 | _GLIBCXX_MOVE(__value), __cmp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:356:22: required from 'void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = A*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 356 | std::__adjust_heap(__first, __parent, __len, _GLIBCXX_MOVE(__value), | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 357 | __comp); | ~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1593:23: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = A*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1593 | std::__make_heap(__first, __middle, __comp); | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1868:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = A*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1868 | std::__heap_select(__first, __middle, __last, __comp); | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1884:27: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = A*; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1884 | std::__partial_sort(__first, __last, __last, __comp); | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1905:25: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = A*; _Compare = __gnu_
s958934851
p04044
C++
3 3 dxx axx cxx
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 3 3 | ^
s649928150
p04044
C++
#include<bits/stdc++.h> #include<string> using namespace std; int n, l; cin >> n >> l; int main(){ char s(l); for(int i = 0; i < n; ++i){ cin >> s[i]; sort(s.begin(), s.end(), greater<string>); } cout << *min_element(s) << endl; }
a.cc:5:1: error: 'cin' does not name a type 5 | cin >> n >> l; | ^~~ a.cc: In function 'int main()': a.cc:9:13: error: invalid types 'char[int]' for array subscript 9 | cin >> s[i]; | ^ a.cc:10:12: error: request for member 'begin' in 's', which is of non-class type 'char' 10 | sort(s.begin(), s.end(), greater<string>); | ^~~~~ a.cc:10:23: error: request for member 'end' in 's', which is of non-class type 'char' 10 | sort(s.begin(), s.end(), greater<string>); | ^~~ a.cc:10:45: error: expected primary-expression before ')' token 10 | sort(s.begin(), s.end(), greater<string>); | ^ a.cc:13:23: error: no matching function for call to 'min_element(char&)' 13 | cout << *min_element(s) << endl; | ~~~~~~~~~~~^~~ In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algo.h:5577:12: note: candidate: 'template<class _FIter> constexpr _FIter std::min_element(_FIter, _FIter)' 5577 | inline min_element(_ForwardIterator __first, _ForwardIterator __last) | ^~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:5577:12: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algo.h:5602:5: note: candidate: 'template<class _FIter, class _Compare> constexpr _FIter std::min_element(_FIter, _FIter, _Compare)' 5602 | min_element(_ForwardIterator __first, _ForwardIterator __last, | ^~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:5602:5: note: candidate expects 3 arguments, 1 provided In file included from /usr/include/c++/14/algorithm:86: /usr/include/c++/14/pstl/glue_algorithm_defs.h:516:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::min_element(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Compare)' 516 | min_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp); | ^~~~~~~~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:516:1: note: candidate expects 4 arguments, 1 provided /usr/include/c++/14/pstl/glue_algorithm_defs.h:520:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::min_element(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator)' 520 | min_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last); | ^~~~~~~~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:520:1: note: candidate expects 3 arguments, 1 provided
s381516461
p04044
C++
#include<bits/stdc++.h> #include<string> using namespace std; int n, l; cin >> n >> l; int main(){ string s(n); for(int i = 0; i < n; ++i){ cin >> s[i]; sort(s.begin(), s.end(), greater<string>); } cout << *min_element(s) << endl; }
a.cc:5:1: error: 'cin' does not name a type 5 | cin >> n >> l; | ^~~ a.cc: In function 'int main()': a.cc:7:13: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(int&)' 7 | string 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, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed: In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]': /usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 149 | using _If_sv = enable_if_t< | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:797:30: required from here 797 | template<typename _Tp, typename = _If_sv<_Tp, void>> | ^~~~~~~~ /usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>' 2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 788 | basic_string(const _Tp& __t, size_type __pos, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 765 | basic_string(_InputIterator __beg, _InputIterator __end, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:765:9: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:669:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed: a.cc:7:12: note: cannot convert 'n' (type 'int') to type 'const char*' 7 | string s(n); | ^ /usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 721 | basic_string(basic_string&& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:721:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 716 | basic_string(const basic_string& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:716:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<char>' 711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 682 | basic_string(basic_string&& __str) noexcept | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:682:35: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>&&' 682 | basic_string(basic_string&& __str) noexcept | ~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 624 | basic_string(const _CharT* __s, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:624:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 604 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 586 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 569 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:569:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 552 | basic_string(const basic_string& __str) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:552:40: note: no known conversion for argument 1 from 'int' to 'const std::__cxx11::basic_string<char>&' 552 | basic_string(const basic_string& __str) | ~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:540:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:540:34: note: no known conversion for argument 1 from 'int' to 'const std::allocator<char>&' 540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:527:7: note: candidate: 'std::__cxx11::basic_string<
s437605631
p04044
C++
#include<bits/stdc++.h> #include<string> using namespace std; int n, l; cin >> n >> l; int main(){ string s(n); for(int i = 0; i < n; ++i){ cin >> s[i]; sort(s.begin(), s.end(), greater<string>); } cout << *min_element(s) << endl; }
a.cc:4:11: error: 'cin' does not name a type 4 | int n, l; cin >> n >> l; | ^~~ a.cc: In function 'int main()': a.cc:6:13: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(int&)' 6 | string 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, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed: In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]': /usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 149 | using _If_sv = enable_if_t< | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:797:30: required from here 797 | template<typename _Tp, typename = _If_sv<_Tp, void>> | ^~~~~~~~ /usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>' 2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 788 | basic_string(const _Tp& __t, size_type __pos, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 765 | basic_string(_InputIterator __beg, _InputIterator __end, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:765:9: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:669:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed: a.cc:6:12: note: cannot convert 'n' (type 'int') to type 'const char*' 6 | string s(n); | ^ /usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 721 | basic_string(basic_string&& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:721:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 716 | basic_string(const basic_string& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:716:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<char>' 711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 682 | basic_string(basic_string&& __str) noexcept | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:682:35: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>&&' 682 | basic_string(basic_string&& __str) noexcept | ~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 624 | basic_string(const _CharT* __s, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:624:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 604 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 586 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 569 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:569:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 552 | basic_string(const basic_string& __str) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:552:40: note: no known conversion for argument 1 from 'int' to 'const std::__cxx11::basic_string<char>&' 552 | basic_string(const basic_string& __str) | ~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:540:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:540:34: note: no known conversion for argument 1 from 'int' to 'const std::allocator<char>&' 540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:527:7: note: candidate: 'std::_
s494079330
p04044
C++
#include <iostream> #include <cstdio> #include <string> #include <vector> using namespace std; int main() { int len, num; scanf("%d", &num); scanf("%d", &len); string s; vector<string> vs; for (int i = 0; i < num; i++) { cin >> s; vs.push_back(s); } sort(vs.begin(), vs.end()); for (auto s : vs) { cout << s; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:22:5: error: 'sort' was not declared in this scope; did you mean 'short'? 22 | sort(vs.begin(), vs.end()); | ^~~~ | short
s028462876
p04044
C++
#include<bits/stdc++.h> using namespace std; int n,l; string S[105]; int main() { 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]; return 0; }
a.cc: In function 'int main()': a.cc:10:14: error: 's' was not declared in this scope 10 | cin>>s[i]; | ^ a.cc:12:10: error: 's' was not declared in this scope 12 | sort(s,s+n); | ^
s233770745
p04044
C++
#include<iostream> #include<cstring> #include<algorithm> using namespace std; bool cmp(string a, string b) { return a < b; } int main(){ long i,n,l; cin>>n>>l; string s[n]={}; sort(a,a+n-1,cmp); for (i=0;i<n;i++) cout<<s[i]; return 0; }
a.cc: In function 'int main()': a.cc:13:10: error: 'a' was not declared in this scope 13 | sort(a,a+n-1,cmp); | ^
s739468919
p04044
C++
#! /usr/bin/python3 # 文字列大好きいろはちゃんイージー / Iroha Loves Strings (ABC Edition) """ 1≦N,L≦100 全ての i(1≦i≦N) に対し、Si の長さは L に等しい。 各 i について, Si は全て半角英小文字のみから成る文字列である。 """ test_mode = False N, L = map(int, input().split()) S = [] for i in range(N): S.append(input()) if test_mode: print(S) S.sort() if test_mode: print(S) for i in range(N): print(S[i], end='')
a.cc:1:2: error: invalid preprocessing directive #! 1 | #! /usr/bin/python3 | ^ a.cc:2:3: error: invalid preprocessing directive #\U00006587\U00005b57\U00005217\U00005927\U0000597d\U0000304d\U00003044\U0000308d\U0000306f\U00003061\U00003083\U00003093\U000030a4\U000030fc\U000030b8\U000030fc 2 | # 文字列大好きいろはちゃんイージー / Iroha Loves Strings (ABC Edition) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:4:3: warning: missing terminating " character 4 | """ | ^ a.cc:4:3: error: missing terminating " character a.cc:5:5: error: extended character ≦ is not valid in an identifier 5 | 1≦N,L≦100 | ^ a.cc:5:9: error: extended character ≦ is not valid in an identifier 5 | 1≦N,L≦100 | ^ a.cc:6:14: error: extended character ≦ is not valid in an identifier 6 | 全ての i(1≦i≦N) に対し、Si の長さは L に等しい。 | ^ a.cc:6:14: error: extended character ≦ is not valid in an identifier a.cc:6:21: error: extended character 、 is not valid in an identifier 6 | 全ての i(1≦i≦N) に対し、Si の長さは L に等しい。 | ^ a.cc:6:43: error: extended character 。 is not valid in an identifier 6 | 全ての i(1≦i≦N) に対し、Si の長さは L に等しい。 | ^ a.cc:7:23: error: extended character 。 is not valid in an identifier 7 | 各 i について, Si は全て半角英小文字のみから成る文字列である。 | ^ a.cc:8:3: warning: missing terminating " character 8 | """ | ^ a.cc:8:3: error: missing terminating " character a.cc:24:21: error: empty character constant 24 | print(S[i], end='') | ^~ a.cc:4:1: error: expected unqualified-id before string constant 4 | """ | ^~
s963912123
p04044
C++
#include <iostream> #include <cstring> #include <algorithm> #include <string> using namespace std; int main(void){ int N,L; cin>>N>>L; vector<string> str(N); for(int i=0;i<N;i++){ cin>>str[i]; } sort(str.begin(),str.end()); for(int i=0;i<N;i++){ cout<<str[i]; } return 0; }
a.cc: In function 'int main()': a.cc:9:5: error: 'vector' was not declared in this scope 9 | vector<string> str(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:9:18: error: expected primary-expression before '>' token 9 | vector<string> str(N); | ^ a.cc:9:20: error: 'str' was not declared in this scope; did you mean 'std'? 9 | vector<string> str(N); | ^~~ | std
s274995533
p04044
C++
#include<iostream> #include<algorihm> using namespace std; int main() { int N, L; cin >> N >> L; string A[N]; for (int i = 0; i < N; i++) { cin >> A[N]; } sort(A, A + N); for (int i = 0; i < N; i++) { cout << A[i]; if (i = N - 1) { cout << endl; } } }
a.cc:2:9: fatal error: algorihm: No such file or directory 2 | #include<algorihm> | ^~~~~~~~~~ compilation terminated.
s387599167
p04044
C++
#include<iostream> using namespace std; int main() { int N, L; cin >> N >> L; string A[N]; for (int i = 0; i < N; i++) { cin >> A[N]; } sort(A, A + N); for (int i = 0; i < N; i++) { cout << A[i]; if (i = N - 1) { cout << endl; } } }
a.cc: In function 'int main()': a.cc:10:9: error: 'sort' was not declared in this scope; did you mean 'short'? 10 | sort(A, A + N); | ^~~~ | short
s928997193
p04044
C++
#include<iostream> #include<sort> using namespace std; int main() { int N, L; cin >> N >> L; string A[N]; for (int i = 0; i < N; i++) { cin >> A[N]; } sort(A, A + N); for (int i = 0; i < N; i++) { cout << A[i]; if (i = N - 1) { cout << endl; } } }
a.cc:2:9: fatal error: sort: No such file or directory 2 | #include<sort> | ^~~~~~ compilation terminated.
s758194160
p04044
C++
#include<iostream> using namespace std; int main() { int a,b,h; cin>>a>>b>>h; cout<<''s=''<<(a+b)*h/2.0<<endl; return 0; }
a.cc:7:7: error: empty character constant 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~~ a.cc:7:11: error: empty character constant 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~ a.cc: In function 'int main()': a.cc:6:6: error: 'a' was not declared in this scope 6 | cin>>a>>b>>h; | ^ a.cc:6:9: error: 'b' was not declared in this scope 6 | cin>>a>>b>>h; | ^ a.cc:6:12: error: 'h' was not declared in this scope 6 | cin>>a>>b>>h; | ^ a.cc:7:7: error: unable to find character literal operator 'operator""s' with 'char' argument 7 | cout<<''s=''<<(a+b)*h/2.0<<endl; | ^~~
s909147421
p04044
Java
import java.io.BufferedReader; import java.io.Closeable; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Comparator; public class Main { public static void main(String[] args) throws IOException { try (PrintWriter writer = new PrintWriter(System.out); InputReader reader = new InputReader(System.in)) { solve(writer, reader); } } private static void solve(PrintWriter writer, InputReader reader) throws IOException { int[] ints = raeder.readIntsSplitByDelimiter(" "); List<String> stringList = new ArrayList(ints[0]); for (int i = 0; i < ints[0]; i++) { String tmp = rader.readLine(); stringList.add(tmp); } stringList.sort(Comparator.naturalOrder()); for (int i = 0; i < ints[0]; i++) { writer.print(stringList.get(i)); } writer.println(); writer.flush(); } } class Util { static int gcd(int m, int n) { int min = Math.min(m, n); int max = Math.max(m, n); while (min != 0) { int tmp = min; min = max % tmp; max = tmp; } return max; } } class InputReader implements Closeable, AutoCloseable { private final BufferedReader br; InputReader(InputStream inputStream) { this.br = new BufferedReader(new InputStreamReader(inputStream)); } String readLine() throws IOException { return this.br.readLine(); } int readInt() throws IOException { return Integer.parseInt(this.readLine()); } long readLong() throws IOException { return Long.parseLong(this.readLine()); } double readDouble() throws IOException { return Double.parseDouble(this.readLine()); } String[] readStringsSplitByDelimiter(String delimiter) throws IOException { return this.readLine().split(delimiter); } int[] readIntsSplitByDelimiter(String delimiter) throws IOException { String[] strings = this.readStringsSplitByDelimiter(delimiter); int stringsLength = strings.length; int[] ints = new int[stringsLength]; for (int i = 0; i < stringsLength; i++) { ints[i] = Integer.parseInt(strings[i]); } return ints; } long[] readLongsSplitByDelimiter(String delimiter) throws IOException { String[] strings = this.readStringsSplitByDelimiter(delimiter); int stringsLength = strings.length; long[] longs = new long[stringsLength]; for (int i = 0; i < stringsLength; i++) { longs[i] = Long.parseLong(strings[i]); } return longs; } double[] readDoublesSplitByDelimiter(String delimiter) throws IOException { String[] strings = this.readStringsSplitByDelimiter(delimiter); int stringsLength = strings.length; double[] doubles = new double[stringsLength]; for (int i = 0; i < stringsLength; i++) { doubles[i] = Double.parseDouble(strings[i]); } return doubles; } @Override public void close() throws IOException { this.br.close(); } }
Main.java:17: error: cannot find symbol int[] ints = raeder.readIntsSplitByDelimiter(" "); ^ symbol: variable raeder location: class Main Main.java:18: error: cannot find symbol List<String> stringList = new ArrayList(ints[0]); ^ symbol: class List location: class Main Main.java:18: error: cannot find symbol List<String> stringList = new ArrayList(ints[0]); ^ symbol: class ArrayList location: class Main Main.java:20: error: cannot find symbol String tmp = rader.readLine(); ^ symbol: variable rader location: class Main 4 errors
s895619489
p04044
C++
#include <iostream> using namespace std; int main() { int N, L; string S[101]; 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; return 0; }
a.cc: In function 'int main()': a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'short'? 15 | sort(S, S+N); | ^~~~ | short
s519964396
p04044
C
#include <stdio.h> #include <string.h> int main(void) { int n, l, i, j, k, m; char s[100][100], tmp[100]; scanf("%d %d", &n, &l); for (i = 0; i < n; i++) { scanf("%s", s[i]); } for (k = n - 1; k > 0; k--) { for (j = 0; j < k; j++) { for (i = 0; i < l; i++) { if (s[j][i] > s[j + 1][i]) { for (m = 0; m < l; m++) { tmp[m] = s[j + 1][m]; s[j + 1][m] = s[j][m]; s[j][m] = tmp[m] } break; } } } } for (i = 0; i < n; i++) { printf("%s\n", s[i]); } return 0; }
main.c: In function 'main': main.c:25:41: error: expected ';' before '}' token 25 | s[j][m] = tmp[m] | ^ | ; 26 | } | ~
s552307262
p04044
C++
#include <bits/stdc++.h> #define ll long long #define pb push_back #define f first #define s second #define mp make_pair #define gg return 0; #define pii pair < int, int> using namespace std; const int maxn = (int)1e5 + 7; const int INF = (int)1e9; ll a,b[4],c,d,cnt,e[(int)2e3 + 1][(int)2e3 + 1],cost[maxn],tout[maxn],mn = INF,mx = -INF,l,r; string s[101]; int main() { cin >> a >> c; for(int i = 1; i <= a; ++i){ cin >> s[i]; } sort(s + 1, s + 1 + a); for(int i = 1; i <= a; ++i){ cout >> s[i]; } gg; }
a.cc: In function 'int main()': a.cc:28:22: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 28 | cout >> s[i]; | ~~~~ ^~ | | | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41, from a.cc:1: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:28:17: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 28 | cout >> s[i]; | ^~~~ In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:28:28: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | cout >> s[i]; | ^ /usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)' 1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) | ^~~~~~~~ /usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed: a.cc:28:28: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | cout >> s[i]; | ^ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:28:28: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | cout >> s[i]; | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:28:28: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 28 | cout >> s[i]; | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:28:28: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 28 | cout >> s[i]; | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:28:28: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | cout >> s[i]; | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:28:28: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 28 | cout >> s[i]; | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:28:28: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 28 | cout >> s[i]; | ^ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = std::__cxx11::basic_string<char>&]': a.cc:28:14: required from here 28 | cout >> s[i]; | ^ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)' 509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed: a.cc:28:28: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | cout >> s[i]; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143: /usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)' 76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed: a.cc:28:28: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | cout >> s[i]; | ^ /usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)' 106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed: a.cc:28:28: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | cout >> s[i]; | ^ /usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)' 137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed: a.cc:28:28: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | cout >> s[i]; | ^ /usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)' 177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:177:5: note: template argument deduction/substitution failed: a.cc:28:28: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | cout >> s[i]; | ^ /usr/include/c++/14/iomanip:207:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setprecision)' 207 | operator>>(basic_istream<_CharT, _Traits>& _
s119702616
p04044
C++
#include<stdio.h> #include<string.h> int main(void){ int n, l; scanf("%d%d", &n, &l); char s[n][l]; for(int i=0;i<n;i++){ scanf("%c", &s[i]); } for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(strcmp(s[j],s[j+1])>0){ char a[]; a[l]=s[j+1]; s[j+1]=s[j]; s[j]=a[l]; } } } for(int i=0;i<n;i++){ printf("%c", s[i]); } printf("\n"); }
a.cc: In function 'int main()': a.cc:14:22: error: storage size of 'a' isn't known 14 | char a[]; | ^ a.cc:16:23: error: invalid array assignment 16 | s[j+1]=s[j]; | ~~~~~~^~~~~
s631682960
p04044
C++
#include<stdio.h> #include<string.h> int main(void){ int n, l; scanf("%d%d", &n, &l); char s[n][l]; for(int i=0;i<n;i++){ scanf("%d", &s[i]); } for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(strcmp(s[j],s[j+1])>0){ char a[l]; a[l]=s[j+1]; s[j+1]=s[j]; s[j]=a[l]; } } } for(int i=0;i<n;i++){ printf("%d", s[i]); } printf("\n"); }
a.cc: In function 'int main()': a.cc:15:27: error: invalid conversion from 'char*' to 'char' [-fpermissive] 15 | a[l]=s[j+1]; | ~~~~~^ | | | char* a.cc:16:23: error: invalid array assignment 16 | s[j+1]=s[j]; | ~~~~~~^~~~~ a.cc:17:21: error: incompatible types in assignment of 'char' to 'char [l]' 17 | s[j]=a[l]; | ~~~~^~~~~
s805813690
p04044
C++
#include<bits/stdc++.h> using namespace std; int a,n,i; string b[105]; int main() { cin>>a>>n; for(i=0;i<a;i++) { cin>>b[s]; } sort(b,b+a); for(i=0;i<a;i++) cout<<b[i]; cout<<endl; }
a.cc: In function 'int main()': a.cc:10:16: error: 's' was not declared in this scope 10 | cin>>b[s]; | ^
s792942072
p04044
C++
#include <iostream> #include <string> #include <vector> using namespace std; int main(int argc, char const *argv[]) { int n, l; cin >> n >> l; vector<string> s(n); for (size_t i = 0; i < n; i++) cin >> s[i]; sort(s.begin(), s.end()); string ans; for (size_t i = 0; i < n; i++) ans += s[i]; cout << ans << endl; return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:13:3: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort(s.begin(), s.end()); | ^~~~ | short
s771129688
p04044
C++
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; int a,n; char b[2333]; int main() { cin>>a>>n; for(int s=0;s<a;s++) cin>>b[s]; sort(b,b+a); for(int s=0;s<a;s++) cout<<b[s]; cout<<endl }
a.cc: In function 'int main()': a.cc:15:15: error: expected ';' before '}' token 15 | cout<<endl | ^ | ; 16 | } | ~
s370700388
p04044
C++
#include<iostream> #include<cstdio> using namespace std; int a,n; string b[105]; int main() { cin>>a>>n; for(int s=0;s<a;s++) { cin>>b[s]; } sort(b,b+a); for(int s=0;s<a;s++) cout<<b[s]; cout<<endl; }
a.cc: In function 'int main()': a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort(b,b+a); | ^~~~ | short
s541412693
p04044
C++
#include <iostream> #include <cstring> #include <cstdio> #include <algorithm> #include <cmath> using namespace std; struct a{string s;}b[1000000]; bool cmp(a a, a b) { return a.s < b.s; } int main() { int n,l; cin >> n >> l; for(int i = 1;i <= n;++i) cin >> b[i].s; sort(b + 1,b + 1 + n,cmp); for(int i = 1;i <= n;++i) cout << b[i].s; return 0; }
a.cc:8:15: error: 'a' is not a type 8 | bool cmp(a a, a b) | ^ a.cc: In function 'bool cmp(a, int)': a.cc:10:24: error: request for member 's' in 'b', which is of non-class type 'int' 10 | return a.s < b.s; | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:71, from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = a*; _Iterator2 = a*; _Compare = bool (*)(a, int)]': /usr/include/c++/14/bits/stl_algo.h:1777:14: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = a*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(a, int)>]' 1777 | if (__comp(__i, __first)) | ~~~~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = a*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(a, int)>]' 1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = a*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(a, int)>]' 1908 | std::__final_insertion_sort(__first, __last, __comp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4805:18: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = a*; _Compare = bool (*)(a, int)]' 4805 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:20:6: required from here 20 | sort(b + 1,b + 1 + n,cmp); | ~~~~^~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/predefined_ops.h:158:30: error: cannot convert 'a' to 'int' in argument passing 158 | { return bool(_M_comp(*__it1, *__it2)); } | ~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Val_comp_iter<_Compare>::operator()(_Value&, _Iterator) [with _Value = a; _Iterator = a*; _Compare = bool (*)(a, int)]': /usr/include/c++/14/bits/stl_algo.h:1757:20: required from 'void std::__unguarded_linear_insert(_RandomAccessIterator, _Compare) [with _RandomAccessIterator = a*; _Compare = __gnu_cxx::__ops::_Val_comp_iter<bool (*)(a, int)>]' 1757 | while (__comp(__val, __next)) | ~~~~~~^~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1785:36: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = a*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(a, int)>]' 1785 | std::__unguarded_linear_insert(__i, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ 1786 | __gnu_cxx::__ops::__val_comp_iter(__comp)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = a*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(a, int)>]' 1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = a*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(a, int)>]' 1908 | std::__final_insertion_sort(__first, __last, __comp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4805:18: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = a*; _Compare = bool (*)(a, int)]' 4805 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:20:6: required from here 20 | sort(b + 1,b + 1 + n,cmp); | ~~~~^~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/predefined_ops.h:240:30: error: cannot convert 'a' to 'int' in argument passing 240 | { return bool(_M_comp(__val, *__it)); } | ~~~~~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_comp_val<_Compare>::operator()(_Iterator, _Value&) [with _Iterator = a*; _Value = a; _Compare = bool (*)(a, int)]': /usr/include/c++/14/bits/stl_heap.h:140:48: required from 'void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare&) [with _RandomAccessIterator = a*; _Distance = long int; _Tp = a; _Compare = __gnu_cxx::__ops::_Iter_comp_val<bool (*)(a, int)>]' 140 | while (__holeIndex > __topIndex && __comp(__first + __parent, __value)) | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:247:23: required from 'void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = a*; _Distance = long int; _Tp = a; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(a, int)>]' 247 | std::__push_heap(__first, __holeIndex, __topIndex, | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 248 | _GLIBCXX_MOVE(__value), __cmp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:356:22: required from 'void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = a*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(a, int)>]' 356 | std::__adjust_heap(__first, __parent, __len, _GLIBCXX_MOVE(__value), | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 357 | __comp); | ~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1593:23: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = a*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(a, int)>]' 1593 | std::__make_heap(__first, __middle, __comp); | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1868:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = a*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(a, int)>]' 1868 | std::__heap_select(__first, __middle, __last, __comp); | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1884:27: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = a*; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(a, int)>]' 1884 | std::__partial_sort(__first, __last, __last, __comp); | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1905:25: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = a*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(a, int)>]' 1905 | std::__introsort_loop(__first, __last, | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1907 | __comp); | ~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4805:18: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = a*; _Compare = bool (*)(a, int)]' 4805 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:20:6: required from here 20 | sort(b + 1,b + 1 + n,cmp); | ~~~~^~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/predefined_ops.h:196:30: error: cannot convert 'a' to 'int' in argument passing 196 | { return bool(_M_comp(*__it, __val)); } | ~~~~~~~^~~~~~~~~~~~~~
s772057462
p04044
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,m string s[100]; cin>>n>>m; 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:6:3: error: expected initializer before 'string' 6 | string s[100]; | ^~~~~~ a.cc:7:11: error: 'm' was not declared in this scope 7 | cin>>n>>m; | ^ a.cc:9:10: error: 's' was not declared in this scope 9 | cin>>s[i]; | ^ a.cc:11:8: error: 's' was not declared in this scope 11 | sort(s,s+n); | ^
s020494587
p04044
C++
#incldeu <bits/stdc++.h> using namespace std; int main(){ int n,m string s[100]; cin>>n>>m; 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:1:2: error: invalid preprocessing directive #incldeu; did you mean #include? 1 | #incldeu <bits/stdc++.h> | ^~~~~~~ | include a.cc: In function 'int main()': a.cc:6:3: error: expected initializer before 'string' 6 | string s[100]; | ^~~~~~ a.cc:7:3: error: 'cin' was not declared in this scope 7 | cin>>n>>m; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | #incldeu <bits/stdc++.h> a.cc:7:11: error: 'm' was not declared in this scope 7 | cin>>n>>m; | ^ a.cc:9:10: error: 's' was not declared in this scope 9 | cin>>s[i]; | ^ a.cc:11:8: error: 's' was not declared in this scope 11 | sort(s,s+n); | ^ a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(s,s+n); | ^~~~ | short a.cc:13:5: error: 'cout' was not declared in this scope 13 | cout<<s[i]; | ^~~~ a.cc:13:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:15:3: error: 'cout' was not declared in this scope 15 | cout<<endl; | ^~~~ a.cc:15:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:15:9: error: 'endl' was not declared in this scope 15 | cout<<endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | #incldeu <bits/stdc++.h>
s497173728
p04044
Java
import java.util.*; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a=sc.nextInt() int b=sc.nextInt(); String c[] =new String[a]; for(int i=0;i<b;i++){ c[i]=sc.next(); } Arrays.sort(c); for(int i=0;i<b;i++){ System.out.print(c[i]); } } }
Main.java:5: error: ';' expected int a=sc.nextInt() ^ 1 error
s993447524
p04044
Java
import java.util.*; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a=sc.nextInt(),b=nextInt(); String c[] =new String[a]; for(int i=0;i<b;i++){ c[i]=sc.next(); } Arrays.sort(c); for(int j=0;j<b;j++){ System.out.print(c[i]); } } }
Main.java:5: error: cannot find symbol int a=sc.nextInt(),b=nextInt(); ^ symbol: method nextInt() location: class Main Main.java:12: error: cannot find symbol System.out.print(c[i]); ^ symbol: variable i location: class Main 2 errors
s009834676
p04044
C++
#include <bits/stdc++.h> using namespace std; string s[111]; int main () { 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:13: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 12 | cout>>s[i]; | ~~~~^~~~~~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41, from a.cc:1: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:12:9: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 12 | cout>>s[i]; | ^~~~ In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout>>s[i]; | ^ /usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)' 1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) | ^~~~~~~~ /usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout>>s[i]; | ^ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout>>s[i]; | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 12 | cout>>s[i]; | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 12 | cout>>s[i]; | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout>>s[i]; | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 12 | cout>>s[i]; | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 12 | cout>>s[i]; | ^ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = std::__cxx11::basic_string<char>&]': a.cc:12:18: required from here 12 | cout>>s[i]; | ^ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)' 509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout>>s[i]; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143: /usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)' 76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout>>s[i]; | ^ /usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)' 106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout>>s[i]; | ^ /usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)' 137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout>>s[i]; | ^ /usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)' 177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:177:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout>>s[i]; | ^ /usr/include/c++/14/iomanip:207:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setprecision)' 207 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setprecision __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:207:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<
s480608862
p04044
C++
#include <bits/stdc++.h> using namespace std; string s[111]; int main () { 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 < ; ++i) cout>>s[i]; cout<<endl; }
a.cc: In function 'int main()': a.cc:11:25: error: expected primary-expression before ';' token 11 | for (int i = 0; i < ; ++i) | ^ a.cc:12:13: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 12 | cout>>s[i]; | ~~~~^~~~~~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41, from a.cc:1: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:12:9: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 12 | cout>>s[i]; | ^~~~ In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout>>s[i]; | ^ /usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)' 1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) | ^~~~~~~~ /usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout>>s[i]; | ^ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout>>s[i]; | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 12 | cout>>s[i]; | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 12 | cout>>s[i]; | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout>>s[i]; | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 12 | cout>>s[i]; | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 12 | cout>>s[i]; | ^ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = std::__cxx11::basic_string<char>&]': a.cc:12:18: required from here 12 | cout>>s[i]; | ^ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)' 509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout>>s[i]; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143: /usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)' 76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout>>s[i]; | ^ /usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)' 106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout>>s[i]; | ^ /usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)' 137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout>>s[i]; | ^ /usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)' 177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:177:5: note: template argument deduction/substitution failed: a.cc:12:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | cout>>s[i]; | ^ /usr/include/c++/14/iomanip:207:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setprecision)' 207 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setprecision __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:207:5: note: template argument de
s198012155
p04044
C++
#include<iostream> #include<algorithm> #include<cstring> using namespace std; struct ap{ int num; char ch[110]; }; bool cmp(ap a,ap b){ return a.num<b.num; } ap a[110]; int main(){ int n,l; // while(1){ cin>>n>>l;getchar(); for(int i=0;i<n;++i){ gets(a[i].ch); a[i].num=0; int m=strlen(a[i].ch); for(int j=0;j<m;++j){ a[i].num=a[i].num+a[i].ch[j]-'a'; } } sort(a,a+n,cmp); for(int i=0;i<n;++i){ cout<<(a[i].ch); } // } }
a.cc: In function 'int main()': a.cc:19:25: error: 'gets' was not declared in this scope; did you mean 'getw'? 19 | gets(a[i].ch); | ^~~~ | getw
s027428321
p04044
C++
##includeinclude <iostream><iostream> ##includeinclude <algorithm><algorithm> #include <stdio.h> #include <string.h> using namespace std; int main() { int n,l,i,j; char a[105][105]; scanf("%d %d",&n,&l); for(i = 0; i<n; i++) scanf("%s",&a[i]); for(i =0; i<n-1; i++) { for(j = i+1;j<n;j++) { if(a[i][0]>a[j][0]) { char t[105]; strcpy(t,a[i]); strcpy(a[i],a[j]); strcpy(a[j],t); } } } for(i = 0;i<n;i++) { printf("%s",a[i]); } printf("\n"); return 0; }
a.cc:2:1: error: stray '##' in program 2 | ##includeinclude <iostream><iostream> | ^~ a.cc:3:2: error: stray '##' in program 3 | ##includeinclude <algorithm><algorithm> | ^~ a.cc:2:3: error: 'includeinclude' does not name a type 2 | ##includeinclude <iostream><iostream> | ^~~~~~~~~~~~~~ In file included from a.cc:5: /usr/include/string.h:44:22: error: 'size_t' has not been declared 44 | size_t __n) __THROW __nonnull ((1, 2)); | ^~~~~~ /usr/include/string.h:47:56: error: 'size_t' has not been declared 47 | extern void *memmove (void *__dest, const void *__src, size_t __n) | ^~~~~~ /usr/include/string.h:55:32: error: 'size_t' has not been declared 55 | int __c, size_t __n) | ^~~~~~ /usr/include/string.h:61:42: error: 'size_t' has not been declared 61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/string.h:64:56: error: 'size_t' has not been declared 64 | extern int memcmp (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:80:60: error: 'size_t' has not been declared 80 | extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:87:42: error: 'size_t' has not been declared 87 | extern void *memchr (void *__s, int __c, size_t __n) | ^~~~~~ /usr/include/string.h:89:54: error: 'size_t' has not been declared 89 | extern const void *memchr (const void *__s, int __c, size_t __n) | ^~~~~~ /usr/include/string.h:126:49: error: 'size_t' has not been declared 126 | extern "C++" void *memrchr (void *__s, int __c, size_t __n) | ^~~~~~ /usr/include/string.h:129:61: error: 'size_t' has not been declared 129 | extern "C++" const void *memrchr (const void *__s, int __c, size_t __n) | ^~~~~~ /usr/include/string.h:145:53: error: 'size_t' has not been declared 145 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:153:23: error: 'size_t' has not been declared 153 | size_t __n) __THROW __nonnull ((1, 2)); | ^~~~~~ /usr/include/string.h:159:57: error: 'size_t' has not been declared 159 | extern int strncmp (const char *__s1, const char *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:166:8: error: 'size_t' does not name a type 166 | extern size_t strxfrm (char *__restrict __dest, | ^~~~~~ /usr/include/string.h:34:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 33 | #include <stddef.h> +++ |+#include <cstddef> 34 | /usr/include/string.h:179:8: error: 'size_t' does not name a type 179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, | ^~~~~~ /usr/include/string.h:179:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/string.h:195:45: error: 'size_t' has not been declared 195 | extern char *strndup (const char *__string, size_t __n) | ^~~~~~ /usr/include/string.h:293:8: error: 'size_t' does not name a type 293 | extern size_t strcspn (const char *__s, const char *__reject) | ^~~~~~ /usr/include/string.h:293:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/string.h:297:8: error: 'size_t' does not name a type 297 | extern size_t strspn (const char *__s, const char *__accept) | ^~~~~~ /usr/include/string.h:297:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/string.h:389:46: error: 'size_t' has not been declared 389 | extern void *memmem (const void *__haystack, size_t __haystacklen, | ^~~~~~ /usr/include/string.h:390:44: error: 'size_t' has not been declared 390 | const void *__needle, size_t __needlelen) | ^~~~~~ /usr/include/string.h:398:55: error: 'size_t' has not been declared 398 | const void *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:401:53: error: 'size_t' has not been declared 401 | const void *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:407:8: error: 'size_t' does not name a type 407 | extern size_t strlen (const char *__s) | ^~~~~~ /usr/include/string.h:407:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/string.h:413:8: error: 'size_t' does not name a type 413 | extern size_t strnlen (const char *__string, size_t __maxlen) | ^~~~~~ /usr/include/string.h:413:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/string.h:444:53: error: 'size_t' has not been declared 444 | extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) | ^~~~~~ In file included from /usr/include/string.h:462: /usr/include/strings.h:34:54: error: 'size_t' has not been declared 34 | extern int bcmp (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/strings.h:38:53: error: 'size_t' has not been declared 38 | extern void bcopy (const void *__src, void *__dest, size_t __n) | ^~~~~~ /usr/include/strings.h:42:31: error: 'size_t' has not been declared 42 | extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/strings.h:120:61: error: 'size_t' has not been declared 120 | extern int strncasecmp (const char *__s1, const char *__s2, size_t __n) | ^~~~~~ /usr/include/strings.h:134:27: error: 'size_t' has not been declared 134 | size_t __n, locale_t __loc) | ^~~~~~ /usr/include/string.h:466:40: error: 'size_t' has not been declared 466 | extern void explicit_bzero (void *__s, size_t __n) __THROW __nonnull ((1)) | ^~~~~~ /usr/include/string.h:497:55: error: 'size_t' has not been declared 497 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:500:53: error: 'size_t' has not been declared 500 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:506:8: error: 'size_t' does not name a type 506 | extern size_t strlcpy (char *__restrict __dest, | ^~~~~~ /usr/include/string.h:506:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/string.h:512:8: error: 'size_t' does not name a type 512 | extern size_t strlcat (char *__restrict __dest, | ^~~~~~ /usr/include/string.h:512:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/string.h:526:34: error: 'size_t' has not been declared 526 | extern void *memfrob (void *__s, size_t __n) __THROW __nonnull ((1)) | ^~~~~~ a.cc: In function 'int main()': a.cc:11:5: error: 'scanf' was not declared in this scope 11 | scanf("%d %d",&n,&l); | ^~~~~ a.cc:29:9: error: 'printf' was not declared in this scope 29 | printf("%s",a[i]); | ^~~~~~ a.cc:6:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' 5 | #include <string.h> +++ |+#include <cstdio> 6 | using namespace std; a.cc:31:5: error: 'printf' was not declared in this scope 31 | printf("\n"); | ^~~~~~ a.cc:31:5: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
s995055476
p04044
C++
##includeinclude <iostream><iostream> ##includeinclude <algorithm><algorithm> #include <stdio.h> #include <string.h> using namespace std; int main() { int n,l,i,j; char a[105][105]; scanf("%d %d",&n,&l); for(i = 0; i<n; i++) scanf("%s",&a[i]); for(i =0; i<n-1; i++) { for(j = i+1;j<n;j++) { if(a[i][0]>a[j][0]) { char t[105]; strcpy(t,a[i]); strcpy(a[i],a[j]); strcpy(a[j],t); } } } for(i = 0;i<n;i++) { printf("%s",a[i]); } printf("\n"); return 0; }
a.cc:1:1: error: stray '##' in program 1 | ##includeinclude <iostream><iostream> | ^~ a.cc:2:2: error: stray '##' in program 2 | ##includeinclude <algorithm><algorithm> | ^~ a.cc:1:3: error: 'includeinclude' does not name a type 1 | ##includeinclude <iostream><iostream> | ^~~~~~~~~~~~~~ In file included from a.cc:4: /usr/include/string.h:44:22: error: 'size_t' has not been declared 44 | size_t __n) __THROW __nonnull ((1, 2)); | ^~~~~~ /usr/include/string.h:47:56: error: 'size_t' has not been declared 47 | extern void *memmove (void *__dest, const void *__src, size_t __n) | ^~~~~~ /usr/include/string.h:55:32: error: 'size_t' has not been declared 55 | int __c, size_t __n) | ^~~~~~ /usr/include/string.h:61:42: error: 'size_t' has not been declared 61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/string.h:64:56: error: 'size_t' has not been declared 64 | extern int memcmp (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:80:60: error: 'size_t' has not been declared 80 | extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:87:42: error: 'size_t' has not been declared 87 | extern void *memchr (void *__s, int __c, size_t __n) | ^~~~~~ /usr/include/string.h:89:54: error: 'size_t' has not been declared 89 | extern const void *memchr (const void *__s, int __c, size_t __n) | ^~~~~~ /usr/include/string.h:126:49: error: 'size_t' has not been declared 126 | extern "C++" void *memrchr (void *__s, int __c, size_t __n) | ^~~~~~ /usr/include/string.h:129:61: error: 'size_t' has not been declared 129 | extern "C++" const void *memrchr (const void *__s, int __c, size_t __n) | ^~~~~~ /usr/include/string.h:145:53: error: 'size_t' has not been declared 145 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:153:23: error: 'size_t' has not been declared 153 | size_t __n) __THROW __nonnull ((1, 2)); | ^~~~~~ /usr/include/string.h:159:57: error: 'size_t' has not been declared 159 | extern int strncmp (const char *__s1, const char *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:166:8: error: 'size_t' does not name a type 166 | extern size_t strxfrm (char *__restrict __dest, | ^~~~~~ /usr/include/string.h:34:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 33 | #include <stddef.h> +++ |+#include <cstddef> 34 | /usr/include/string.h:179:8: error: 'size_t' does not name a type 179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, | ^~~~~~ /usr/include/string.h:179:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/string.h:195:45: error: 'size_t' has not been declared 195 | extern char *strndup (const char *__string, size_t __n) | ^~~~~~ /usr/include/string.h:293:8: error: 'size_t' does not name a type 293 | extern size_t strcspn (const char *__s, const char *__reject) | ^~~~~~ /usr/include/string.h:293:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/string.h:297:8: error: 'size_t' does not name a type 297 | extern size_t strspn (const char *__s, const char *__accept) | ^~~~~~ /usr/include/string.h:297:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/string.h:389:46: error: 'size_t' has not been declared 389 | extern void *memmem (const void *__haystack, size_t __haystacklen, | ^~~~~~ /usr/include/string.h:390:44: error: 'size_t' has not been declared 390 | const void *__needle, size_t __needlelen) | ^~~~~~ /usr/include/string.h:398:55: error: 'size_t' has not been declared 398 | const void *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:401:53: error: 'size_t' has not been declared 401 | const void *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:407:8: error: 'size_t' does not name a type 407 | extern size_t strlen (const char *__s) | ^~~~~~ /usr/include/string.h:407:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/string.h:413:8: error: 'size_t' does not name a type 413 | extern size_t strnlen (const char *__string, size_t __maxlen) | ^~~~~~ /usr/include/string.h:413:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/string.h:444:53: error: 'size_t' has not been declared 444 | extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) | ^~~~~~ In file included from /usr/include/string.h:462: /usr/include/strings.h:34:54: error: 'size_t' has not been declared 34 | extern int bcmp (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/strings.h:38:53: error: 'size_t' has not been declared 38 | extern void bcopy (const void *__src, void *__dest, size_t __n) | ^~~~~~ /usr/include/strings.h:42:31: error: 'size_t' has not been declared 42 | extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/strings.h:120:61: error: 'size_t' has not been declared 120 | extern int strncasecmp (const char *__s1, const char *__s2, size_t __n) | ^~~~~~ /usr/include/strings.h:134:27: error: 'size_t' has not been declared 134 | size_t __n, locale_t __loc) | ^~~~~~ /usr/include/string.h:466:40: error: 'size_t' has not been declared 466 | extern void explicit_bzero (void *__s, size_t __n) __THROW __nonnull ((1)) | ^~~~~~ /usr/include/string.h:497:55: error: 'size_t' has not been declared 497 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:500:53: error: 'size_t' has not been declared 500 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:506:8: error: 'size_t' does not name a type 506 | extern size_t strlcpy (char *__restrict __dest, | ^~~~~~ /usr/include/string.h:506:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/string.h:512:8: error: 'size_t' does not name a type 512 | extern size_t strlcat (char *__restrict __dest, | ^~~~~~ /usr/include/string.h:512:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/string.h:526:34: error: 'size_t' has not been declared 526 | extern void *memfrob (void *__s, size_t __n) __THROW __nonnull ((1)) | ^~~~~~ a.cc: In function 'int main()': a.cc:10:5: error: 'scanf' was not declared in this scope 10 | scanf("%d %d",&n,&l); | ^~~~~ a.cc:28:9: error: 'printf' was not declared in this scope 28 | printf("%s",a[i]); | ^~~~~~ a.cc:5:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' 4 | #include <string.h> +++ |+#include <cstdio> 5 | using namespace std; a.cc:30:5: error: 'printf' was not declared in this scope 30 | printf("\n"); | ^~~~~~ a.cc:30:5: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
s102986252
p04044
C++
#include<iostream> #include<algorithm> #include<cstring> using namespace std; struct ap{ int num; char ch[110]; }; bool cmp(ap a,ap b){ return a.num<b.num; } ap a[110]; int main(){ int n,l; // while(1){ cin>>n>>l;getchar(); for(int i=0;i<n;++i){ gets(a[i].ch); a[i].num=0; int m=strlen(a[i].ch); for(int j=0;j<m;++j){ a[i].num=a[i].num+a[i].ch[j]-'a'; } } sort(a,a+n,cmp); for(int i=0;i<n;++i){ cout<<(a[i].ch); } // } }
a.cc: In function 'int main()': a.cc:19:25: error: 'gets' was not declared in this scope; did you mean 'getw'? 19 | gets(a[i].ch); | ^~~~ | getw
s257942012
p04044
C++
#include<cstdio> #include<cstring> #include<iostream> using namespace std; int main () { char s[110][110],t[50]; int n,i,j,k,l; while(scanf("%d%d\n",&n,&l)!=EOF) { for(i=0;i<n;i++) gets(s[i]); for(i=0;i<n-1;i++) { k=i; for(j=i+1;j<n;j++) if(strcmp(s[j],s[k])<0)k=j; strcpy(t,s[i]); strcpy(s[i],s[k]); strcpy(s[k],t); } for(i=0;i<n;i++) cout<<s[i]; printf("\n"); } return 0; }
a.cc: In function 'int main()': a.cc:14:4: error: 'gets' was not declared in this scope; did you mean 'getw'? 14 | gets(s[i]); | ^~~~ | getw
s224677109
p04044
C++
#include<cstdio> #include<cstring> #include<iostream> using namespace std; int main () { char s[110][110],t[50]; int n,i,j,k,l; while(scanf("%d%d\n",&n,&l)!=EOF) { for(i=0;i<n;i++) gets(s[i]); for(i=0;i<n-1;i++) { k=i; for(j=i+1;j<n;j++) if(strcmp(s[j],s[k])<0)k=j; strcpy(t,s[i]); strcpy(s[i],s[k]); strcpy(s[k],t); } for(i=0;i<n;i++) cout<<s[i]; printf("\n"); } return 0; }
a.cc: In function 'int main()': a.cc:14:4: error: 'gets' was not declared in this scope; did you mean 'getw'? 14 | gets(s[i]); | ^~~~ | getw
s781642403
p04044
C++
#include <bits/stdc++.h> #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i = m;i < n;i++) #define FORR(i, m, n) for(int i = m;i >= n;i--) #define SORT(v, n) sort(v, v+n); #define VSORT(v) sort(v.begin(), v.end()); #define llong long long #define pb(a) push_back(a) #define INF 1000000000 using namespace std; typedef pair<int, int> P; typedef pair<llong, llong> LP; typedef pair<int, P> PP; typedef pair<llong, LP> LPP; int dy[]={0, 0, 1, -1, 0}; int dx[]={1, -1, 0, 0, 0}; int main(){ cin.tie(0); ios::sync_with_stdio(false); int N,L; cin >> N >> L; vector <string> v(N); for(int i = 0;i < N;i++) cin >> v[i]; sort(vec.begin(),vec.end()); for(int i = 0;i < N;i++) cout << v[i]; }
a.cc: In function 'int main()': a.cc:28:8: error: 'vec' was not declared in this scope 28 | sort(vec.begin(),vec.end()); | ^~~
s973576977
p04044
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int N,L; cin>>NL; char s[110]; 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:8:7: error: 'NL' was not declared in this scope; did you mean 'L'? 8 | cin>>NL; | ^~ | L
s525503166
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int l, n; cin >> n >> l; vactor<string> s(n); for (int i = 0; i < n; i++) cin >> s[i]; sort(s.begin(), s.end()); for (int i = 0; i < n; i++) cout << s[i]; cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: 'vactor' was not declared in this scope 8 | vactor<string> s(n); | ^~~~~~ a.cc:8:22: error: expected primary-expression before '>' token 8 | vactor<string> s(n); | ^ a.cc:8:24: error: 's' was not declared in this scope 8 | vactor<string> s(n); | ^
s018561616
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int l, n; cin >> n >> l; string s[n]; for (int i = 0; i < n; i++) cin >> s[i]; sort(s[0], s[n]); for (int i = 0; i < n; i++) cout << s[i]; cout << endl; return 0; }
In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __cxx11::basic_string<char>; _Compare = __gnu_cxx::__ops::_Iter_less_iter]': /usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = __cxx11::basic_string<char>]' 4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:11:6: required from here 11 | sort(s[0], s[n]); | ~~~~^~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1906:50: error: no match for 'operator-' (operand types are 'std::__cxx11::basic_string<char>' and 'std::__cxx11::basic_string<char>') 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67, from /usr/include/c++/14/algorithm:60: /usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 618 | operator-(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:618:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1790 | operator-(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1790:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::move_iterator<_IteratorL>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1197 | _DEFINE_BINARY_OPERATOR(-, __minus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::valarray<_Tp>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1197 | _DEFINE_BINARY_OPERATOR(-, __minus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::valarray<_Tp>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const valarray<_Tp>&)' 1197 | _DEFINE_BINARY_OPERATOR(-, __minus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::valarray<_Tp>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ In file included from /usr/include/c++/14/valarray:605: /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ 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:465:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&)' 465 | operator-(const complex<_Tp>& __x) | ^~~~~~~~ /usr/include/c++/14/complex:465:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/complex:388:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const _Tp&, const complex<_Tp>&)' 388 | operator-(const _Tp& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:388:5: note: template argument deduction/substitution failed: /usr/include/c++/14/
s323763152
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, l; cin >> n >> l; string s[n], ans; for (int i = 0; i < n; i++) cin >> s[i]; sort(s[0], s[n]); for (int i = 0; i < n; i++) ans += s[i]; cout << ans << endl; return 0; }
In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __cxx11::basic_string<char>; _Compare = __gnu_cxx::__ops::_Iter_less_iter]': /usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = __cxx11::basic_string<char>]' 4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:11:7: required from here 11 | sort(s[0], s[n]); | ~~~~^~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1906:50: error: no match for 'operator-' (operand types are 'std::__cxx11::basic_string<char>' and 'std::__cxx11::basic_string<char>') 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67, from /usr/include/c++/14/algorithm:60: /usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 618 | operator-(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:618:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1790 | operator-(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1790:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::move_iterator<_IteratorL>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1197 | _DEFINE_BINARY_OPERATOR(-, __minus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::valarray<_Tp>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1197 | _DEFINE_BINARY_OPERATOR(-, __minus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::valarray<_Tp>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const valarray<_Tp>&)' 1197 | _DEFINE_BINARY_OPERATOR(-, __minus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::valarray<_Tp>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ In file included from /usr/include/c++/14/valarray:605: /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ 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:465:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&)' 465 | operator-(const complex<_Tp>& __x) | ^~~~~~~~ /usr/include/c++/14/complex:465:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/complex:388:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const _Tp&, const complex<_Tp>&)' 388 | operator-(const _Tp& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:388:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_alg
s661406135
p04044
C++
n = list(map(int, input().split())) a = [] for i in range(n[0]): a.append(input()) a.sort() for i in range(n[0]): print(a[i], end="") print()
a.cc:1:1: error: 'n' does not name a type 1 | n = list(map(int, input().split())) | ^
s972757286
p04044
C++
n = list(map(int, input().split())) a = [] for i in range(n[0]): a.append(input()) a.sort() for i in range(n[0]): print(a[i], end="") print()
a.cc:1:1: error: 'n' does not name a type 1 | n = list(map(int, input().split())) | ^
s292371050
p04044
C++
#include <bits/stdc++.h> #define FOR(i,x,y) for(int i=x;i<y;i++) using namespace std; int main(){ int N,L; cin >> N; vector<string> S(N); FOR(i,0,N)cin >> S[i]; sort(S.begin(),S.end()); for(auto x:S)cout << x; cout << endll }
a.cc: In function 'int main()': a.cc:11:11: error: 'endll' was not declared in this scope 11 | cout << endll | ^~~~~
s584292242
p04044
C++
3 3 dxx axx cxx
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 3 3 | ^
s604650759
p04044
Java
public class Main { public static void main(String[] args) { Scanner sd = new Scanner(System.in); String s = sd.next(); String t = sd.next(); //行数 int a = Integer.parseInt(s); //文字列の長さ int b = Integer.parseInt(t); //配列に入力 String[] mozi = new String[a]; for(int i=0; i<a; i++) { mozi[i] = sd.next(); } for(int i=0; i<a-1; i++) { for(int j=0; j<a-1; j++) { String temp; if(mozi[i].compareTo(mozi[i+1])<0) { temp=mozi[i]; mozi[i]=mozi[i+1]; mozi[i+1]=temp; }else { } } } for(int i=0;i<a;i++) { System.out.print(mozi[i]); } } }
Main.java:3: error: cannot find symbol Scanner sd = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner sd = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s577053815
p04044
C++
#include<iostream> #include<algorithm> #include<math.h> #include<cstdio> #include<ctype.h> #include<stdio.h> #include<set> #include<vector> #include<map> #include<functional> #include<iomanip> #include<queue> #include<ciso646> #include<random> #include<numeric> #include<string> typedef long long ll; using namespace std; ll gcd(ll a, ll b){ if(a<b){return gcd(b,a);} else if(a%b){return gcd(b,a%b);} else{return b;} } int main(){ int N,L; cin>>N>>L; string S[150]; string ans =""; for(int i=0; i<N; ++i) cin>>S[i]; sort(S,S+N); ans+=S[i]; cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:35:14: error: 'i' was not declared in this scope 35 | ans+=S[i]; | ^
s447226846
p04044
C++
l = input().split(' ') N = int(l[0]) L = int(l[1]) S=[] for i in range(N): S.append(input()) S.sort() for str in S: print(str,end="") print()
a.cc:1:1: error: 'l' does not name a type 1 | l = input().split(' ') | ^
s108459371
p04044
C++
#include<cstdio> #include<cstring> #include<cstdlib> #include<cmath> #include<iostream> #include<string> #include<vector> #include<queue> #include<map> using namespace std; typedef long long LL; #define M(a,b) memset(a,b,sizeof(a)) #define pb push_back const int maxn = 200000+5; string s[105]; int main() { int n,l; // scanf("%d%d",&n,&l); cin>>n>>l; for (int i=1;i<=n;++i) { cin>>s[i]; } sort(s+1,s+1+n); for (int i=1;i<=n;++i) cout<<s[i]; cout<<'\n'; return 0; }
a.cc: In function 'int main()': a.cc:24:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 24 | sort(s+1,s+1+n); | ^~~~ | sqrt
s851234409
p04044
C++
#include <iostream> #include <algorithm> #include <string> using namespace std; int main() { int n, l; cin >> n >> l; string s[110]; for (int i = 0; i < n; i++) { cin >> s[i]; } sort(s, s+n); string stot; for (int i = 0; i < n; i++) { stot += s[i]; } cout << stot << endl return 0; }
a.cc: In function 'int main()': a.cc:20:23: error: expected ';' before 'return' 20 | cout << stot << endl | ^ | ; 21 | return 0; | ~~~~~~
s832474728
p04044
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,l; cin>>n>>l; string t; vector<string>s(n); for(int i=0;i<n;i++){ cin>>s.at(i); } sort(s.begin(),s.end()); for(int i=0;i<n;i++){ t+=s.at(i) } cout<<t<<endl; return 0; }
a.cc: In function 'int main()': a.cc:14:13: error: expected ';' before '}' token 14 | t+=s.at(i) | ^ | ; 15 | } | ~
s537095150
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.at(i); } sort(s.begin(),s.end()); for(int i=0;i<n;i++){ cout<< s.at(i)<<end; } cout>>endl; return 0; }
a.cc: In function 'int main()': a.cc:13:17: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 13 | cout<< s.at(i)<<end; | ~~~~~~~~~~~~~~^~~~~ 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, 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]' 306 |
s071659270
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()) for (int i=0;i<n;i++){ cin >> s[i]; } }
a.cc: In function 'int main()': a.cc:11:32: error: expected ';' before 'for' 11 | sort(s.begin(),s.end()) | ^ | ; 12 | for (int i=0;i<n;i++){ | ~~~ a.cc:12:22: error: 'i' was not declared in this scope 12 | for (int i=0;i<n;i++){ | ^
s980673432
p04044
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; int main() { int N, L; vector<string> sv; for(int i = 0; i < N; i++) { string tmp; cin >> tmp; sv.push_back(tmp); } sort(sv.begin(), sv.end()); for(int i = 0, svsize = sv.size(); i < svsize; i++) { cout << sv[i] << flush; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:3: error: 'vector' was not declared in this scope 9 | vector<string> sv; | ^~~~~~ 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 | a.cc:9:16: error: expected primary-expression before '>' token 9 | vector<string> sv; | ^ a.cc:9:18: error: 'sv' was not declared in this scope 9 | vector<string> sv; | ^~
s161235835
p04044
C++
#include<iostream> #include<vector> using namespace std; int main(){ int N,L; cin >> N >> L; vector<string> v; string ret; string s; for(int i = 0;i < N;i++){ cin >> s; v.push_back(s); } sort(v.begin(),v.end()); for(vector<string>::iterator it = v.begin() ;it != v.end();it++){ ret += *it; } cout << ret << endl; return 0; }
a.cc: In function 'int main()': a.cc:23:5: error: 'sort' was not declared in this scope; did you mean 'short'? 23 | sort(v.begin(),v.end()); | ^~~~ | short
s399928161
p04044
C++
#include<iostream> #include<cmath> #include<vector> #include<map> using namespace std; int main(){ int N; int L; cin >> N >> L; vector<string> vec(N); for(int i = 0;i < N;i++){ cin >> vec.at(i); } sort(vec.begin(),vec.end()); for(int i = 0;i < N;i++){ cout << vec.at(i); } return 0; }
a.cc: In function 'int main()': a.cc:21:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 21 | sort(vec.begin(),vec.end()); | ^~~~ | sqrt
s370902505
p04044
C++
#include<vector> #include<iostream> #include<cmath> #include<map> using namespace std; int main(){ int N; int L; cin >> N >> L; vector<string> vec(N); for(int i = 0;i < N;i++){ cin >> vec.at(i); } sort(vec.begin(),vec.end()); for(int i = 0;i < N;i++){ cout << vec.at(i); } return 0; }
a.cc: In function 'int main()': a.cc:21:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 21 | sort(vec.begin(),vec.end()); | ^~~~ | sqrt